示例代码:
// 指定服务UUID和特征值UUID BluetoothGattCharacteristic characteristic = new BluetoothGattCharacteristic( SERVICE_UUID, CHARACTERISTIC_UUID, BluetoothGattCharacteristic.PROPERTY_WRITE);
// 转换数据为byte数组 byte[] data = "Hello, BLE!".getBytes();
// 设置byte数组到characteristic对象中 characteristic.setValue(data);
// 发送数据 bluetoothGatt.writeCharacteristic(characteristic);