So I wonder whether you're hitting an issue with how 128 bit UUIDs are handled. Basically I think they're transmitted as 16 bit UUIDs plus a '128 bit ID index'. Espruino doesn't explicitly request the full 128 bit UUIDs (I'm not even sure how you do this) and expects you to supply them.
You may find that just poking Espruino with the ID you're interested in is enough:
So you request the characteristic, but don't use it. You might now see UUIDs reported properly.
But as you say, Espruino doesn't support filtering by UUID with getCharacteristics() though.
Honestly, I'd have thought that since the order of characteristics won't change, you could probably just use a simple getCharacteristics() and then reference the characteristics by their position in the returned array
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Wow, having identical UUIDs on the same service is something I haven't come across at all! The use of differing 128 bit UUIDs is a bit dodgy too.
I just tried some simple code here and the UUID gets reported properly in my case:
So I wonder whether you're hitting an issue with how 128 bit UUIDs are handled. Basically I think they're transmitted as 16 bit UUIDs plus a '128 bit ID index'. Espruino doesn't explicitly request the full 128 bit UUIDs (I'm not even sure how you do this) and expects you to supply them.
You may find that just poking Espruino with the ID you're interested in is enough:
So you request the characteristic, but don't use it. You might now see UUIDs reported properly.
But as you say, Espruino doesn't support filtering by UUID with
getCharacteristics()
though.Honestly, I'd have thought that since the order of characteristics won't change, you could probably just use a simple
getCharacteristics()
and then reference the characteristics by their position in the returned array