I'm trying to do BLE advertising with an nRF51 without the softdevice, has anyone already tried this? maybe there is an example of this?
There is also this alternative implementation: github.com/.../ See the radio-broadcaster example specifically.
Hi Hung,
I already looked into an example like this, the thing is I don't want to load the softdevice in the nRF51. I will be using the uESB library, but is a feature to have non-connectable advertising to send data to a smart device.
Best regards,
Hi Ulrich,
I will look in to this example, it appears as it does not use the softdevice at all so that are great news. Maybe, if you have some kind of example using the uESB library or baremetal, that would be great, thank you.
Best regards,
If you copy the RADIO0 configuration options from radio.c in the example I linked, and strip out the callback and state stuff, you will have the simplest advertiser you can get. You probably want a timer implementation to do multiple advertisements, and the blessed stack has support for this. It can also do callbacks when RX/TX happens in case you want to implement scan responses. In the simplest sense, you have to configure the radio fields (MODE, TIFS, PCNF1, CRCCNF, CRCPOLY, etc.), then set PACKETPTR to some uint8_t[39], put your data in there, then enable start TASKS_RXEN. If the READY->START SHORTS is set, the radio will automatically transmit the packet once it is ready. You have to repeat this for all advertising channels (37, 38 and 39).
This might sound complex, but I think "blessed" solves this in an easy-to-understand way.