Replies: 2 comments
-
this is only one Uint8Array, and it has a total of 1407 rows, need push by BLE |
Beta Was this translation helpful? Give feedback.
0 replies
-
Try something like const dataVal = new Uint8Array([
0xab, 0x05, 0x02, 0x00, 0x80, 0x00, 0x20, 0xd1, 0xdb, 0x00, 0x08, 0x4f, 0x06,
0x01, 0x08, 0x19, 0xdc, 0x00, 0x08, 0x51, 0x06, 0x01, 0x08, 0x53, 0x06, 0x01,
0x08, 0x55, 0x06, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0xdc, 0x00, 0x08, 0x57, 0x06,
0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x19, 0xdc, 0x00, 0x08, 0xc9, 0xc3, 0x00,
0x08, 0xed,
]);
const packetLength = 20;
const numPackets = Math.ceil(dataVal.length / packetLength);
for (let i = 0; i < numPackets; i++) {
const dataView = new DataView(
dataVal.slice(i * packetLength, (i + 1) * packetLength).buffer
);
await BleClient.writeWithoutResponse(
idModem.value,
numberToUUID(0xffe0),
numberToUUID(0xffe1),
dataView
);
} By using In your code, when you're calling |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the bug
How to send data in 20 bits?
I can't implement it.
Bluetooth version 4.0 on connected device
max 23 mtu on connected device
To Reproduce
code Vue js
Expected behavior
I would like to see a record of 20 bits of information
ab 05 02 00 80 00 20 d1 db 00 08 4f 06 01 08 19 dc 00 08 51 - the first packet
06 01 08 53 06 01 08 55 06 01 08 00 00 00 00 00 00 00 00 00 - the second package
00 00 00 00 00 00 00 19 dc 00 08 57 06 01 08 00 00 00 00 19 - third package
dc 00 08 c9 c3 00 08 ed - fourth package
but got DataView with same data
Screenshots
Plugin version:
"@capacitor-community/bluetooth-le": "^3.0.0"
"@capacitor/app": "^5.0.0",
"@capacitor/core": "^5.0.0",
Beta Was this translation helpful? Give feedback.
All reactions