evothings / cordova-ble

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

Different address for the same device across Android and IOS #73

Closed dested closed 9 years ago

dested commented 9 years ago

When I scan for devices on android I get a shorter address (eg. AB:CD:EF:12:34) vs IOS which gives me a longer uuid looking address. My goal is to store the address in a database and auto connect to it, regardless of the originating operating system. To do this I need to be able to convert from one to the other to determine that the device I scanned for is the original device I connected to. Thoughts?

fredrikeldh commented 9 years ago

You may be able to use "advertisementData", a member of the DeviceInfo object you get in startScan()'s callback.

You'll need to use the easyble library to get this field on Android.

Not all BLE devices advertise unique data, but if you have control of the device firmware, you should be able to make it happen.