I'm developing an app using Corebluetooth framework,
and connect to a BLE device to get RSSI value.
I set a function to read RSSI periodly, the timer code is below
NSTimer *timer;
timer = [NSTimer scheduledTimerWithTimeInterval:1.2f target:self selector:@selector(detectRSSI) userInfo:nil repeats:YES];
and the detectRSSI code is below
- (void)detectRSSI
{
[self.peripheral readRSSI];
}
So the question is,
the function works fine , but when I set time interval less then 1.2 sec,
the peripheralDidUpdateRSSI will randomly report error message like this:
The operation was cancelled.
And it wouldn't happened if the rate is more than 1.2sec.
Does anyone have any idea to read RSSI value more frequently (0.5 sec or less)?
didRangeBeacons:
. The device will only scan so many times per sec. – Alceste