android代码如下,请问如何翻译成小程序
public void enableBLE(int p) {
try {
BluetoothGattService e = this.mBluetoothGatt.getService(UUID.fromString(Service_uuid));
BluetoothGattCharacteristic ale;
switch(p) {
case 0:
ale = e.getCharacteristic(UUID.fromString(Characteristic_uuid_TX));
break;
case 1:
ale = e.getCharacteristic(UUID.fromString(Characteristic_uuid_FUNCTION));
break;
default:
ale = e.getCharacteristic(UUID.fromString(Characteristic_uuid_TX));
}
this.mBluetoothGatt.setCharacteristicNotification(ale, true);
BluetoothGattDescriptor dsc = ale.getDescriptor(UUID.fromString("00002902-0000-1000-8000-00805f9b34fb"));
byte[] bytes = new byte[]{(byte)1, (byte)0};
dsc.setValue(bytes);
this.mBluetoothGatt.writeDescriptor(dsc);
} catch (NumberFormatException var8) {
var8.printStackTrace();
}
}
也遇到相同的问题, 有解决吗?
writeDescriptor这个好像没有对接的微信接口
有什么解决方案码?