I'm getting 100% as the result every time...why (iOS/ SocketScan API v.10.2.227)? Here's my code:
-(void) onGetBatteryInfo:(ISktScanObject*)scanObj {
SKTRESULT result=[[scanObj Msg]Result];
if(SKTSUCCESS(result)){
long batteryLevel = SKTBATTERY_GETCURLEVEL([[scanObj Property] getUlong]);
NSLog(@"BatteryInfo %ld", batteryLevel);
[self setBatteryLevel:batteryLevel];
[self.tableView reloadData];
} else {
NSLog(@"ES-GetBatteryInfo set status returned the error %ld",result);
}
}
Thanks, Mark
Can you double check the following...
In
viewDidLoad
you create ScanApiHelper and a timerYour timer calls
doScanApiReceive
Finally, you don't query the battery level until after you've received an
onDeviceArrival
notification