Skip to content

Commit

Permalink
iOS 8 CoreBluetooth deprecated RSSI methods
Browse files Browse the repository at this point in the history
  • Loading branch information
mrichie committed Mar 17, 2015
1 parent a7ad57a commit d3f873c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/ios/BCBluetooth.m
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,20 @@ - (void)centralManager:(CBCentralManager *)central didDisconnectPeripheral:(CBPe
/*--------------------------------------------------------------------------*/
#pragma mark -
#pragma mark CBPeripheralDelegate
-(void) peripheral:(CBPeripheral *)peripheral didReadRSSI:(NSNumber *)RSSI error:(NSError *)error {
BCLOG_FUNC(GAP_MODUAL)
if (!error) {
NSMutableDictionary *callbackInfo = [[NSMutableDictionary alloc] init];
[callbackInfo setValue:[NSString stringWithFormat:@"%4.1f",[RSSI doubleValue]] forKey:PERIPHERAL_RSSI];
[callbackInfo setValue:[self getPeripheralUUID:peripheral] forKey:DEVICE_ADDRESS];
CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:callbackInfo];
[self.commandDelegate sendPluginResult:result callbackId:[self.callbacks objectForKey:
[NSString stringWithFormat:@"getRssi%@",[self getPeripheralUUID:peripheral]]]];
}else{
[self error:[self.callbacks objectForKey:[NSString stringWithFormat:@"getRssi%@",[self getPeripheralUUID:peripheral]]]];
}
}

- (void)peripheralDidUpdateRSSI:(CBPeripheral *)peripheral error:(NSError *)error{
BCLOG_FUNC(GAP_MODUAL)
if (!error) {
Expand Down

0 comments on commit d3f873c

Please sign in to comment.