Hi,
your code has two problems. The first problem is
var result = so.ISysInfo.GetInfo(criteria); it's not correct, because get CellID you need get a notification. Therefor, you need use var result = so.ISysInfo.GetNotification, ok?
The other problem is the var result = so.ISysInfo.GetNotification is a asynchronous method. The code below will work in your device. If you try to use in emulator, It doesn't work.
Code:
function getCELLID(){
try {
var so = device.getServiceObject("Service.SysInfo", "ISysInfo");
var criteria = new Object();
criteria.Entity = 'Network';
criteria.Key = 'CellID';
alert("GetCellID")
var result = so.ISysInfo.GetNotification(criteria, function(transId, eventCode, result){
if (eventCode == 4) {
alert("Error " + result.ErrorCode + ": " + result.ErrorMessage);
return;
}
alert("ok");
alert(result);
alert(result.ReturnValue);
alert(result.ReturnValue.Status);
});
}
catch (e) {
return null;
}
}