custom advertising packet - iot sensor

6 posts / 0 new
Last post
djim
Offline
Last seen:3 years 1 month ago
加入:2014-10-02 12:07
custom advertising packet - iot sensor

Hello.

is there a way to set up a custom advertising packet?
and regarding the iot sensor, transmit the the sensor fusion data through the advertising packet even in a reduced refresh rate?

Thank you

Device:
MT_dialog
Offline
Last seen:3 months 5 days ago
Staff
加入:2015-06-08 11:34
Hi djim,

Hi djim,

You can change the advertising packet in the IoT sensor, the application as is it takes the values from the user_config.h file from the USER_ADVERTISE_DATA and the USER_DEVICE_NAME, you can either change the definitions or make a custom advertising function.

I am not sure i get the question, as far as i can understand you would like to take the data from the sensor fusion engine and place them to the advertising string, i suppose its possible but it requires quite some modifications to the code, also please have in mind that the data that you can fit on a string is limited to 31 bytes and with 3 bytes allready reserved by mandatory flags which limits tha amount of data that you can transmit (just mentioning). Also how would you know if the data that are transmitted by the peripheral as an advertising string would get to your central without lossing any data ? And offcourse there is a limit to the minimum interval of the BLE advertising specification about 20 ms and also it depends on the type of advertising.

Thanks MT_dialog

JBaczuk
Offline
Last seen:1 year 9 months ago
加入:2014-12-31 23:41
@MT_dialog: Could you expand

@MT_dialog: Could you expand on the best way to update the advertisement data periodically? It seems that the kernel message that is sent includes the advertising data (gapm_start_advertise_cmd), and the SDK (5.0.4) will just beacon that data periodically. But, I can't find the function that actually beacons the data (I'm assuming it's not exposed in the code). So it would seem wrong to periodically send the kernel message and stop and start advertising. Is there a better way?

MT_dialog
Offline
Last seen:3 months 5 days ago
Staff
加入:2015-06-08 11:34
Hi JBaczuk,

Hi JBaczuk,

I dont quite understand why starting and stopping the advertising in order to change the advertising data doesn't suit you, this is the way that dialog recommends in order to change the advertising string. The function that actually starts the advertising (not the message but the actual function) is part of the BLE stack, what it is exposed in the SDK is the function that sends the message.

Thanks MT_dialog

JBaczuk
Offline
Last seen:1 year 9 months ago
加入:2014-12-31 23:41
I'm wondering because I don't

I'm wondering because I don't know what the advertising will actually happen.

1 - How do I know how long after I send the message to the kernel it will be until the advertising packet is sent?
2 - Can I adjust this?
3 - Is it a good idea to create a timer that will update the advertising data periodically
4 - And which function should I use to do this? Thanks!

MT_dialog
Offline
Last seen:3 months 5 days ago
Staff
加入:2015-06-08 11:34
Hi JBaczuk,

Hi JBaczuk,

1. How long the advertising will occur, after the message is send, depends on the load of the kernel at that specific instance, an average value could be around 4ms until the first packet goes out in the air.

2.你不能调整多久助教ke for the kernel to take and process the message.

3. This is how it is done in all Dialog examples, please have a look at the ble_app_barebone project in the SDK.

4. Please have a look at the Tutorial 1 - Modifying Advertising Parameters in the Tutorials tab in the Documents section.

Thanks MT_dialog