setCharacteristicNotification
全部标签 我正在使用以下react库react-native-ble-manager我正在尝试在BLE设备上执行读取和写入操作。我能够成功执行读取操作。但是我在写入BLE设备时收到错误代码128。首先,我启用特征通知-BleManager.startNotification(peripheralId,serviceId,characteristicId)写作是这样的-将'hex'值转换为base64字符串-constbase64String=newBuffer('0x00B00050D0','hex').toString('base64');BleManager.write(peripheral
BluetoothLeGattAndroidBLE示例包含以下代码:publicvoidsetCharacteristicNotification(BluetoothGattCharacteristiccharacteristic,booleanenabled){if(mBluetoothAdapter==null||mBluetoothGatt==null){Log.w(TAG,"BluetoothAdapternotinitialized");return;}mBluetoothGatt.setCharacteristicNotification(characteristic,en
用于测试的设备:Nexus4、Android4.3连接工作正常,但我的回调的onCharacteristicChanged方法从未被调用。但是,我正在使用onServicesDiscovered内的setCharacteristicNotification(char,true)注册通知,该函数甚至返回true。设备日志(当通知应该出现/通过蓝牙设备发送时,实际上根本没有没有消息):07-2818:15:06.93616777-16809/de.ffuf.leica.sketchD/BluetoothGatt:setCharacteristicNotification()-uuid:3a
用于测试的设备:Nexus4、Android4.3连接工作正常,但我的回调的onCharacteristicChanged方法从未被调用。但是,我正在使用onServicesDiscovered内的setCharacteristicNotification(char,true)注册通知,该函数甚至返回true。设备日志(当通知应该出现/通过蓝牙设备发送时,实际上根本没有没有消息):07-2818:15:06.93616777-16809/de.ffuf.leica.sketchD/BluetoothGatt:setCharacteristicNotification()-uuid:3a