Adjusting the number packets per connection event

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
3 posts / 0 new
Last post
JamesHiebert
Offline
Last seen:6 months 4 weeks 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:2 months 4 weeks 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:6 months 4 weeks ago
加入:2014-10-24 14:17
Perfect, I'll try that.

Perfect, I'll try that. Thanks!