This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Send custom data when advertising and don't allow connections

I want to make a small sensor that will wake up every once in a while, turn on advertising for a second or two and then go back to sleep again.

I'm trying to figure out which example should I take a look at if I want my device to be discoverable but does not accept connections and also
how can I put a custom data (sensor ID and value it's reading) into advertising packet so it can be picked up by nRF connect mobile app.

Can someone please point me to examples I can take a peek at or maybe point me to a manual/doc that explains how to do this?

Right now I have Nordic UART example up and running and I'm trying to modify it to work like described above.

  • I have made a system like the one you're talking about, unfortunately it's under NDA so I can't share it with you. To get you started I would suggest looking at the ble_beacon example, and also the HRS and HRS Collector examples. You would want to modify the data from the advertising bit of the beacon example to fit your needs. You also need to reinitiate the advertiser with your changed data. Use manufacturer specific data and you should be well on your way ;) For timing i suggest using the Application timer running on the RTC clock. (Look at DevZone or the Infocenter). Hope this helps you.

    Good luck!

Related