evothings / cordova-ble

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

How to tell which device disconnected? #140

Closed ccravens closed 7 years ago

ccravens commented 7 years ago

Hello:

when I'm connected to a BLE device and it unexpectedly disconnects (loss of power, out of range, etc), the connect function triggers the "error" callback as expected. However there is no information about what device disconnected! All I receive is the following:

{
  "available": true,
  "platform": "Android",
  "version": "6.0.1",
  "uuid": "58f4234e73d283f",
  "cordova": "6.0.0",
  "model": "SM-J320V",
  "manufacturer": "samsung",
  "isVirtual": false,
  "serial": "74fc393f"
}

How can I tell which device (MAC address, name or id) disconnected?