I'm building a node.js app that uses Noble to talk to BLE devices.
I’m trying to read data off the device using the readHandle method, with variations of:
await peripheral.readHandleAsync("6acc554d-e631-4069-944d-b8ca7598ad50")
// or...
await peripheral.readHandleAsync(Buffer.from("6acc554de6314069944db8ca7598ad50"))
The long string is the uuid of a characteristic I know exists from checking the list of the peripheral’s characteristics I’ve already captured. it’s a big long array of things like:
[
{
"uuid": "6acc5592e6314069944db8ca7598ad50",
"name": null,
"type": null,
"properties": ["read", "write", "notify", "authenticatedSignedWrites"]
},
// etc...
]
This is what the docs and the types for the library seem to suggest, but when I run it, it’s giving me errors like:
TypeError: There should be 2 arguments: (String, Number)
at Noble.readHandle (/Users/me/Desktop/edward-spokehands/node_modules/@abandonware/noble/lib/noble.js:552:18)
at Peripheral.readHandle (/Users/me/Desktop/edward-spokehands/node_modules/@abandonware/noble/lib/peripheral.js:188:15)
The error seems to be coming from the native bindings of the library rather than the JS source, where I'm no longer confident enough to track it down to its origin.
What am I missing?