You are reading a single comment by @user125533 and its replies. Click here to read the full conversation.
  • So I'm trying to interface a puck.js with an existing BLE product, and it has a service with two characteristics with the same UUID, but different properties and uses. One is read/notify and is output from the device, and the other is "write without response", and is input to the device. There are also another two characteristics in this service that I'm not interested in, but also have a read/notify and "write without response" pair.

    Because they have the same UUID, I believe it's not possible(Or at least reliable) for me to use getCharacteristic() to get a handle for both of them, and it becomes necessary to use getCharacteristics() and iterate through them to find the correct ones.

    However, it appears that getCharacteristics() in Espruino does not take a UUID argument as a filter, so I end up also getting the two characteristics I'm not interested in in the array of results.

    In Web Bluetooth, it looks like BluetoothRemoteGATTCharacteristic has a UUID property, but this property does not appear to exist and/or work in Espruino. Attempting to print the UUIDs of the characteristics always results in the value 0x0000.

    So how do I go about getting handles for the correct characteristics?

    Attached is a screenshot of the service/characteristics, lightly anonymized.


    1 Attachment

    • Screenshot_20210220-193236-anonymized.png
About

Avatar for user125533 @user125533 started