bcsphere/bluetooth — pull request #18 by mrichie (2014-06-17 07:33:36+00:00)
Title: Android BLE 4.3 reconnect error

android 4.3 下重新连接设备会发生异常
参考链接：lianhttp://stackoverflow.com/questions/17870189/android-4-3-bluetooth-low-energy-unstable

修改之后，在发起链接请求中加上错误处理，经测试即可解决该问题

device.connect(function(){
prepareDevice();
}, connectError);

connectError: function(msg){
console.log('connect error ' + msg);
if(device.platform == 'Android'){
BC.Bluetooth.CloseBluetooth(function(){
BC.Bluetooth.OpenBluetooth(function(){ console.log('reopened ble')});
}, function(){ console.log('cannot close ble')});
};
},