Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 1 month ago.
How to update advertising payload before transmission?
Hi,
It seems pretty easy to change the advertising payload, and to set the advertising interval. But is it possible to know when the advertisment is about to be sent and run some code to update the payload before hand?
For example consider a hygrometer that sends the humidity every 5 seconds in the advertising payload. You want to measure it just before you actually send the payload, but I can't see a way to work out when that is.
Cheers,
Tim
Question relating to:
1 Answer
10 years, 1 month ago.
Hi Tim,
You can do that but only using the Nordic APIs directly.
You will have to use the Radio Notification APIs described in section 7 of the SDS and here:
This will allow you to get notified (via a software interrupt) before the packet goes over the air.
Unfortunately there is no mbed API for this as of now yet.
Carles
Does the measurement need to be in-sync with the advertising or could you just take a reading every X secs and update the payload accordingly. You can update the payload without stopping the advertising.
posted by Andrew Fox 06 May 2016