Using hid for setServices does something special, and does actually advertise a service.
In the API docs for setServices it also mentions you can do stuff like this:
NRF.setServices(undefined, {
hid : new Uint8Array(...), // optional, default is undefined. Enable BLE HID support
uart : true, // optional, default is true. Enable BLE UART support
advertise: [ '180D' ] // optional, list of service UUIDs to advertise
});
So you can specify services to advertise.
It's all a bit confusing but with BLE you can advertise data (exposed by setAdvertising) as well as advertising services, which you can do with setServices.
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.
Using
hid
forsetServices
does something special, and does actually advertise a service.In the API docs for setServices it also mentions you can do stuff like this:
So you can specify services to advertise.
It's all a bit confusing but with BLE you can advertise data (exposed by
setAdvertising
) as well as advertising services, which you can do withsetServices
.