Adjusting the number packets per connection event

Learn MoreFAQsTutorials

3 posts / 0 new
Last post
JamesHiebert
Offline
Last seen:4 months 3 days ago
加入:2014-10-24 14:17
Adjusting the number packets per connection event

Hello,

We have the need to limit the maximum number of packets received and sent per BLE connection event. A Dialog FAE informed us of the following call to control this behavior:

ble_maxevtime_set(0, N); // where N is the max number of packets per CE

I added this call immediately after a BLE connection. However, it appears as if the stack overwrites this value subsequently. Consider the following scenario:
1. Add the following code in the connection request indication handler: ble_maxevtime_set(0, 4);
2. Start a BLE connection and Indicate several hundred bytes. With a packet sniffer, I observe that MORE than 4 packets are emitted by the DA14581 in a CE.
3. Read the location 0x8007e (address where ble_maxevtime_set(0, N) writes, verified with debugger) and find that the value is not 4, but 16.
4. Write the location 0x8007e back to 4. Indicate several hundred bytes again. With the sniffer, I now verify that the number of packets emitted per CE is now 4.

When and why does the BLE stack overwrite the location altered by ble_maxevtime_set()?

Device:
MT_dialog
Offline
Last seen:4 days 13 min ago
工作人员
加入:2015-06-08 11:34
Hi JamesHiebert,

Hi JamesHiebert,

The stack doesn't change the value without an event, most probably a connection parameter update from the central side is what forces the stack and changes that value, if there is no parameter update after the connection occurs then the value will stay as set, the stack will reconfigure the value upon the update parameter reception in order to be adapted to the new connection interval indicated. If you set the value after the connection parameter has been completed then the value should stay solid.

Thanks MT_dialog

JamesHiebert
Offline
Last seen:4 months 3 days ago
加入:2014-10-24 14:17
Perfect, I'll try that.

Perfect, I'll try that. Thanks!