bcsphere / bluetooth

Please support! Kindly "Star" this standard Bluetooth Smart API / SDK :) The "bcsphere/bluetooth" is a phonegap/cordova plugin. It's a Bluetooth JavaScript API from JUMA, a Bluetooth expert team. It supports both Bluetooth 4.0 GATT/Bluetooth Low Energy (BLE) interface in iOS/Android and Bluetooth 2.1 Classic Rfcomm / L2cap socket interface as Bluetooth Serial Port/SPP, as well as iBeacon!
Apache License 2.0
299 stars 12 forks source link

ios 下设备异常断开连接,app端没有接收到回调 #24

Closed mrichie closed 10 years ago

mrichie commented 10 years ago

调查发现上一个版本是正常的 https://github.com/bcsphere/bluetooth/blob/3e1b4c03377bc7234100c529bb6f18dad582a87c/src/ios/BCBluetooth.m#L1089

在 didDisconnectPeripheral 这个函数里面有 isConnectedByManager 来进行判断,是app主动断开连接还是设备异常断开连接的

而在最新的代码里面无法 用 [self.urlAndCallback valueForKey:deviceAddress] 来进行区分这一情况,导致设备异常断开连接时,无法将EVENT_DISCONNECT 消息回调给app

superMushRoom commented 10 years ago

ok 更新一下吧 感谢反馈

mrichie commented 10 years ago

fixed, thanks