4 posts / 0 new
Last post
DrNick1
Offline
Last seen: 4 years 1 month ago
Joined: 2014-07-01 11:55
Changing advertising packet length

In the Beacon 3.40.6 example, can you tell me the easy way to change the advertising packet length? Or more generally, how is the packet length controlled within the software

For example, I see a data structure in nvds.c which I could vary, but its not a simple as just changing the first byte of .NVDS_TAG_APP_BLE_ADV_DATA to say how many bytes follow and then adding those bytes in the following lines, as this breaks the code.
Are there other settings I need to modify?

Device: 
MT_dialog
Offline
Last seen: 2 weeks 3 days ago
Staff
Joined: 2015-06-08 11:34
Hi DrNick1,

Hi DrNick1,

I am not sure what are you trying to do, the advertising packet length is standard (31 bytes with 3 bytes occupied by mandatory flags). The data aren't controlled dynamically, they are static. You just change the data in the NVDS.c. What can be controlled dynamically is the major and minor values.

Thanks MT_dialog

DrNick1
Offline
Last seen: 4 years 1 month ago
Joined: 2014-07-01 11:55
I want to transmit less than

I want to transmit less than the 31 bytes. In fact I want to transmit the bare minimum which I guess would be 4 bytes (the three you mention plus one to say that the rest of the advertising is zero bytes long)

MHv_Dialog
Offline
Last seen: 1 month 4 weeks ago
Staff
Joined: 2013-12-06 15:10
Hi ,

Hi ,

Just set the advertisment data length to 0. The stack will fill out the mandatory 3 bytes. Advertisment data is not terminated, so you don't have to worry about indicating the last segment.