我正在使用 cordova-plugin-ble-central 为 Android 构建一个 cordova 应用程序,用于从由 YINMIK 提供支持的设备 BLE-9909 Meter 读取数据。 除了读取数据外,扫描和连接插件都很好。我收到以下错误。你能提供一个方向吗?谢谢。
注意: 读取电池服务 0x180F/特性 0x2A19 适用于 Android,但服务 FF01/特性 FF02 除外。 BLE 浏览器不会出现此问题。
D/BLEPlugin: action = isConnected
D/BLEPlugin: action = read
D/Peripheral: Queuing Command com.megster.cordova.ble.central.BLECommand@ca43bed
D/Peripheral: Processing Commands
D/Peripheral: Read 0000ff02-0000-1000-8000-00805f9b34fb
D/Peripheral: onCharacteristicRead android.bluetooth.BluetoothGattCharacteristic@cb961e5
D/Peripheral: Processing Complete
D/Peripheral: Processing Commands
D/Peripheral: Command Queue is empty.
I/chromium: [INFO:CONSOLE(478)] "Error reading 0000ff02-0000-1000-8000-00805f9b34fb status=133"
这里是代码片段:
ble.startNotification(
deviceId,
'FF01',
'FF02',
(buffer) => {
this.decodeDataFromBLE9909Sensor(buffer, callback);
},
(err) => {
console.error(err);
}
);
和设备文档:
Bluetooth communication protocol
Basic Information
1 Bluetooth name: BLE-9100 i.e. product name(BLE-9100,BLE-Ph01,BLE-9909,…)
2 Service UUID FF01
3 Feature UUID FF02 read and write
read data
1 After the Bluetooth connection is successful, subscribe to the characteristic UUID FF02,
2 Read the characteristic UUID FF02 to return the data