bcsphere/bluetooth — pull request #25 by mrichie (2014-07-18 03:37:10+00:00)
Title: fixed readValue error after setNotification

错误发生过程：
1、执行service1 下 char1 的 setNotifcation enable: true操作，这时ISON 为 TRUE
2、执行service2 下 char1 的 readValue 操作，didUpdateValueForCharacteristic 方法会优先走ISON为true的判断逻辑，返回setNotification的callback，此时系统就会报错
解决方法：在执行readValue的时候，强制将ISON关闭，读完数据之后再打开

TO: @lizhijumacc, @wenze0410
很早以前邮件沟通过，ios 不能同时对多个 characteristic 执行subscribe 操作，那时回调里面只会返回一个characteristic的值，现在这个问题由于urlAndCallback的加入已经解决，根本原因是cordova 执行的时候需要记住command.callbackId ，这样在发送回调结果时（commandDelegate sendPluginResult）才能将对应的结果返回给指定的函数
但是最近几次调查出来的bug，问题都出在urlAndCallback的使用上，建议这块再系统测试下，read, write, ison的控制也能够像setNotification 那样根据serviceIndex、characteristicIndex进行区分开
(lldb) po self.urlAndCallback
{
10setNotification = BCBluetooth1632634;
20setNotification = BCBluetooth1632628;
"connectD71A2C8D-C9E0-2517-6F26-81E8121AB2A8" = BCBluetooth1632624;
disconnect = BCBluetooth1632593;
getBluetoothState = BCBluetooth1632602;
"getRssiD71A2C8D-C9E0-2517-6F26-81E8121AB2A8" = BCBluetooth1632911;
newadvpacket = BCBluetooth1632600;
oncharacteristicread = BCBluetooth1632596;
oncharacteristicwrite = BCBluetooth1632597;
ondescriptorread = BCBluetooth1632598;
ondescriptorwrite = BCBluetooth1632599;
onsubscribe = BCBluetooth1632594;
onunsubscribe = BCBluetooth1632595;
"perInfoCommandD71A2C8D-C9E0-2517-6F26-81E8121AB2A8" = BCBluetooth1632626;
readCharacteristor = BCBluetooth1632922;
write = BCBluetooth1632630;