小编ste*_*ven的帖子

Android 4.3 BLE怎么写特色

随后的样本

我知道:

  • 如何阅读特征值.

但我不知道:

  • 如何将数据写入固件.

我试了几次,但没办法.

这是编码:

if ((charaProp | BluetoothGattCharacteristic.PROPERTY_READ) > 0) {
                System.out.println("read!!!!!!");
                // If there is an active notification on a characteristic,
                // clear
                // it first so it doesn't update the data field on the user
                // interface.
                if (mNotifyCharacteristic != null) {
                    mBluetoothLeService.setCharacteristicNotification(
                            mNotifyCharacteristic, false);
                    mNotifyCharacteristic = null;
                }
                mBluetoothLeService.readCharacteristic(characteristic);
            }
            if ((charaProp | BluetoothGattCharacteristic.PROPERTY_NOTIFY) > 0) {
                System.out.println("notify!!!!!!");
                mNotifyCharacteristic = characteristic;
                mBluetoothLeService.setCharacteristicNotification(
                        characteristic, true);
            }
            if ((charaProp | BluetoothGattCharacteristic.PROPERTY_WRITE) > 0) {
                if …
Run Code Online (Sandbox Code Playgroud)

android bluetooth bluetooth-lowenergy

6
推荐指数
1
解决办法
2万
查看次数

标签 统计

android ×1

bluetooth ×1

bluetooth-lowenergy ×1