serviceData = jsvSkipName(jsvFindChildFromVar(servicesData, serviceUUID, false));
if (serviceData) {
However one problem you have is UUIDs can be defined in different ways, eg 0xABCD, "ABCD", "AbCd" - so maybe what you're doing is better - but use bleVarToUUID and then compare the raw UUIDs, rather than using jsvIsEqual.
you do say the ESP32 uses handles though? IMO it would probably be faster/easier to have a separate list of handle vs. value in execInfo.hiddenRoot instead? It might come in handy in other places - for instance I think notifications so something like that already?
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.
So you intend to call
jswrap_ESP32_get_Char_Value
when the ESP32 asks Espruino for the data inside a characteristic?Rather than:
You could just use:
However one problem you have is UUIDs can be defined in different ways, eg
0xABCD, "ABCD", "AbCd"
- so maybe what you're doing is better - but usebleVarToUUID
and then compare the raw UUIDs, rather than usingjsvIsEqual
.you do say the ESP32 uses handles though? IMO it would probably be faster/easier to have a separate list of handle vs. value in
execInfo.hiddenRoot
instead? It might come in handy in other places - for instance I think notifications so something like that already?