Skip to content

Commit

Permalink
Use didReadRSSI
Browse files Browse the repository at this point in the history
  • Loading branch information
randdusing committed Nov 9, 2017
1 parent 6fca112 commit 1363dcc
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 4.4.3 - 2017-11-08
- Use didReadRSSI

## 4.4.2 - 2017-07-04
- Allow Windows scanning to be restarted [\#438](https://github.com/randdusing/cordova-plugin-bluetoothle/pull/438)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cordova-plugin-bluetoothle",
"version": "4.4.2",
"version": "4.4.3",
"description": "Use the Bluetooth Low Energy plugin to connect your Cordova app to new Bluetooth devices like heart rate monitors, thermometers, etc...",
"types": "./types/index.d.ts",
"cordova": {
Expand Down
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest" id="cordova-plugin-bluetoothle" version="4.4.2">
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest" id="cordova-plugin-bluetoothle" version="4.4.3">
<engines>
<engine name="cordova-plugman" version=">=5.0.0" />
<engine name="cordova-android" version=">=5.0.0" />
Expand Down
4 changes: 2 additions & 2 deletions src/ios/BluetoothLePlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -2822,7 +2822,7 @@ - (void)peripheral:(CBPeripheral *)peripheral didUpdateNotificationStateForChara
}
}

- (void)peripheralDidUpdateRSSI:(CBPeripheral *)peripheral error:(NSError *)error {
- (void) peripheral:(CBPeripheral *)peripheral didReadRSSI:(NSNumber *)RSSI error:(NSError *)error {
//Get connection
NSMutableDictionary* connection = [connections objectForKey:peripheral.identifier];
if (connection == nil) {
Expand Down Expand Up @@ -2855,7 +2855,7 @@ - (void)peripheralDidUpdateRSSI:(CBPeripheral *)peripheral error:(NSError *)erro
}

//Return RSSI value
[returnObj setValue:peripheral.RSSI forKey:keyRssi];
[returnObj setValue:RSSI forKey:keyRssi];
[returnObj setValue:statusRssi forKey:keyStatus];

CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:returnObj];
Expand Down
4 changes: 2 additions & 2 deletions src/osx/BluetoothLePlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -2822,7 +2822,7 @@ - (void)peripheral:(CBPeripheral *)peripheral didUpdateNotificationStateForChara
}
}

- (void)peripheralDidUpdateRSSI:(CBPeripheral *)peripheral error:(NSError *)error {
- (void) peripheral:(CBPeripheral *)peripheral didReadRSSI:(NSNumber *)RSSI error:(NSError *)error {
//Get connection
NSMutableDictionary* connection = [connections objectForKey:peripheral.identifier];
if (connection == nil) {
Expand Down Expand Up @@ -2855,7 +2855,7 @@ - (void)peripheralDidUpdateRSSI:(CBPeripheral *)peripheral error:(NSError *)erro
}

//Return RSSI value
[returnObj setValue:peripheral.RSSI forKey:keyRssi];
[returnObj setValue:RSSI forKey:keyRssi];
[returnObj setValue:statusRssi forKey:keyStatus];

CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:returnObj];
Expand Down

0 comments on commit 1363dcc

Please sign in to comment.