How to change the advertising payload on the fly

This blog is to show how to modify the advertising payload from time to time instead of stop / restart the advertising module.

This demo is based on the SDK 14.2 / S132v5.1 with nRF52832 DK. The idea is to use pointer of the global buffer for the advertising data and scan response data. And then it sets to the softdevice API. Also, this example is to use the softdevice API instead of using the ble_advertising module in order to save the code and ram usage.

Advertising Payload

  • Manufacturer Specific Data (including battery value, MAC Address, RSSI value, other)

Scan Response Payload

  • 128 UUID + Device Name (Max length = 11 bytes)
Advertising Payload
Scan Response Payload
Start the Advertising

By a regular app_timer for update the advertising payload, here is the example how to change the MAC address inside the manufacturer specific data payload.

Welcome to give any comment and suggestion!!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.