evothings / cordova-ble

Bluetooth Low Energy plugin for Cordova
http://www.evothings.com/
Apache License 2.0
242 stars 103 forks source link

Read RSSI fails on iOS 10 #135

Open mdailor opened 7 years ago

mdailor commented 7 years ago

On iOS 10, when I try to read the RSSI of a scanned+connected device:

evothings.ble.rssi( device, function (rssi) { console.log("RSSI=" + rssi }, function (err) { console.log("ERROR=" + err });

I get the following error:

[NSTaggedPointerString count]: unrecognized selector sent to instance 0xa000000697373724 *** WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: [NSTaggedPointerString count]: unrecognized selector sent to instance 0xa000000697373724

How can I read the RSSI value? Thanks!

mdailor commented 7 years ago

SOLVED! On further investigation: in ble.js, change:

exports.rssi = function(deviceOrHandle, success, fail) { exec(deviceOrHandle, success, fail, 'BLE', 'rssi', [objectHandle(deviceOrHandle)]); };

to this:

exports.rssi = function(deviceOrHandle, success, fail) { exec(success, fail, 'BLE', 'rssi', [objectHandle(deviceOrHandle)]); };