I couldn't really understand what advertise does. Is it necessary for my purpose?
No. Literally all it does is add that UUID to the bundle of advertising data it sends out when it's not connected to anything.
The only reason you'd do that is if you wanted a way to 'find' your devices (eg, "scan for all devices with service 6e400001b5a3f393e0a9e50e24dcca9e"). Generally you'd know the address or it or would have some customised name, so that's not an issue though
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.
No. Literally all it does is add that UUID to the bundle of advertising data it sends out when it's not connected to anything.
The only reason you'd do that is if you wanted a way to 'find' your devices (eg, "scan for all devices with service
6e400001b5a3f393e0a9e50e24dcca9e
"). Generally you'd know the address or it or would have some customised name, so that's not an issue though