我正在使用BLE的Android应用程序中工作。我想写入我连接到的设备服务的特征。使用蓝牙低功耗写入
我的功能是这样的:
public void writeCharacteristic(BluetoothGattCharacteristic characteristic,
boolean enabled, String text) {
if (mBluetoothAdapter == null || mBluetoothGatt == null) {
Log.w(TAG, "BluetoothAdapter not initialized");
return;
}
characteristic.setValue("7");
boolean status = mBluetoothGatt.writeCharacteristic(characteristic);
}
我不为什么值未特性里面写。 我按照此链接中的步骤操作: write with BLE
有人知道我的代码为什么不起作用吗?
非常感谢。 Regards
P.D.为我的英语道歉。
究竟发生了什么? – njzk2