So it just adds an array that's [len, BLE_GAP_AD_TYPE_SERVICE_DATA, uuid_16, uuid_16, data....] to the stuff that's advertised.
So yes, you'd need to rebuild jswrap_nrf_bluetooth_getAdvertisingData so it didn't use ble_advdata_t, but it should be pretty straightforward. I can look into it at some point in the next few weeks if you want?
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.
esp_ble_gap_config_adv_data_raw
looks perfect - and yes, I'd imagine the standard function has stuff built into the library.adv_data_encode
is here: https://github.com/espruino/Espruino/blob/059eb0a3e6031e065dea5bc1101561d4b95b8e9c/targetlibs/nrf5x/components/ble/common/ble_advdata.c#L474It calls into other functions to include the relevant advertising bits and bobs. They're all pretty simple once you strip away all the checks though - for example services is this: https://github.com/espruino/Espruino/blob/059eb0a3e6031e065dea5bc1101561d4b95b8e9c/targetlibs/nrf5x/components/ble/common/ble_advdata.c#L451
So it just adds an array that's
[len, BLE_GAP_AD_TYPE_SERVICE_DATA, uuid_16, uuid_16, data....]
to the stuff that's advertised.So yes, you'd need to rebuild
jswrap_nrf_bluetooth_getAdvertisingData
so it didn't useble_advdata_t
, but it should be pretty straightforward. I can look into it at some point in the next few weeks if you want?