Multiple services/characteristics with the same UUID #2625
Replies: 4 comments
-
Posted at 2018-07-09 by @gfwilliams As I understood it, you weren't really meant to do:
But instead might have different services that contained the same characteristic:
However I could well be wrong - is your example something that people are actually doing? As you noted, in Espruino it's not easy to do. One solution is to alternate between using Strings and Integers:
However it is a bit of a hack! It'll also be virtually impossible to then change the value with |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-07-09 by the1laz It's in the spec and I've seen it done, it doesn't seem to be a common thing though. Most devices only have a single temperature reading, magnetometer or whatever. I was looking at how to have a bunch of generic I/O using the standard characteristics. No big deal for me to use 128 bit UUIDs or do it some other way, I was just trying not to reinvent the wheel. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-07-10 by @gfwilliams Well, I'm afraid it's not in there yet. It'd be a good thing to fix though. To be honest the whole services/advertising API could do with a bit of love. It doesn't make that much sense as-is. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-07-14 by the1laz All good, thanks for looking. 👍 |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-07-09 by the1laz
BLE seems to support multiple of the same UUID for services and characteristics, for example you could use the automation IO service with 4 digital characteristics. With Espruino, specifying the services as an object seems to prevent that as the keys won't be unique, ie:
Is there any way around this?
Beta Was this translation helpful? Give feedback.
All reactions