private void writeDescriptorValue(CordovaArgs args, final CallbackContext callbackContext)
throws JSONException {
final String descriptorId = args.getString(0);
String deviceAddress = getDeviceAddressFromInstanceId(descriptorId);
final byte[] value = args.getArrayBuffer(1);
final ChromeBluetoothLowEnergyPeripheral peripheral = getPeripheralByDeviceAddress(deviceAddress);
if (peripheral == null) {
callbackContext.error("Invalid Argument");
return;
}
cordova.getThreadPool().execute(new Runnable() {
public void run() {
peripheral.writeDescriptorValue(descriptorId, value, callbackContext);
}
});
}
ChromeBluetoothLowEnergy.java 文件源码
java
阅读 19
收藏 0
点赞 0
评论 0
项目:cordova-plugin-chrome-apps-bluetoothLowEnergy
作者:
评论列表
文章目录