Then the ->type field stores an index into this UUID, while ->uuid contains bytes 12 and 13 of the 128 bit UUID.
It seems to be side-effect of the softdevice... So either you could implement something similar in ESP32-land, or I guess we could have something more general than ble_uuid_t - but that would have some pretty huge knock-on effects I believe :(
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.
Yes, it's a bit weird. In the 128 bit case, the majority of the UUID is stored elsewhere with
sd_ble_uuid_vs_add
: https://github.com/espruino/Espruino/blob/master/libs/bluetooth/bluetooth_utils.c#L160Then the
->type
field stores an index into this UUID, while->uuid
contains bytes 12 and 13 of the 128 bit UUID.It seems to be side-effect of the softdevice... So either you could implement something similar in ESP32-land, or I guess we could have something more general than
ble_uuid_t
- but that would have some pretty huge knock-on effects I believe :(