This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Can you specifically set the amount of packets per interval?

Hi!

I have an implementation running with a peripheral sending notifications to a central at 27.5 ms. They are both configured with HIGH BW. Sending of notifications is activated by pressing a button. I now see that when the button is pressed, the peripheral is able to put 7 packets into the buffer (and an 8th one overflowing it) in the first interval, but then it changes to 6 packets (+ a 7th that overflows the buffer) for the following intervals.

I actually want be able to achieve 6 packets per interval, for each interval, so also for the first one. So my question is, how is this possible?

The figure below illustrates once more the beginning of notification sending and thus the transitions from 7 to 6. Channel 2 is the radio. Channel 0 indicates putting a packet in the TX buffer and is thus first 8 times and then always 7 times. Channel 1 is I2C measurements of an accelerometer in between. image description

Kind regards

Mathias

EDIT 1

image description

Parents
  • I believe it actually transports 6 packets over the radio, note that Tx buffers inside SD aren't necessarily linked to number of packets transported over radio link. Do you have some confidence by looking into radio analyzer/sniffer trace that different numbers are going through the link in each interval? otherwise if you push 7 packets to the stack and then 6 of them are "cleaned" so you can push 6 more it indicates that 6 are going over the radio... can you make some GPIO counter on TX_COMPLETED event if their count corresponds to the numbers?

  • This comment in the answer to the question states what I mean: "As you already mentioned, the nature of BLE doesn't support realtime requirement. All packet will be transmitted I assume that you want to only update the latest sample on each connection interval, my suggestion for you is to try to keep track of the number of packet in the buffer by using the number of packet you queue, minus the number of packet sent reported in BLE_EVT_TX_COMPLETE. If in one BLE_EVT_TX_COMPLETE you have the number of packet in the buffer is full, you would need to queue at least 7 packets (if the max number of packet per connection interval is 6). This is to make sure you will have at least 1 packet to be sent in the connection after the next one. So that we will not get into the situation with one connection event with packet sent and one without.

    But anyway, it will have a 7.5ms latency because you can't have a packet sent immediately but will have to wait for the next connection interval."

    So what I'm saying is that to have 6 PDU's every interval, I need to put a 7th as well, that overflows the buffer and makes sure that the next interval is also used to empty the then again refilled TX buffers. And the issue that I'm having is that in the first interval, 7 packets can apparently be tried to send with an 8th overflowing the buffer. If I would just count to 6, the buffer wouldn't overflow and thus I would get interval sending, next not sending, next sending ... If I would count to 7 you might say, then I do overflow the buffer but not in the first interval, that requires 8 packets to overflow... So that's my issue :/

Reply
  • This comment in the answer to the question states what I mean: "As you already mentioned, the nature of BLE doesn't support realtime requirement. All packet will be transmitted I assume that you want to only update the latest sample on each connection interval, my suggestion for you is to try to keep track of the number of packet in the buffer by using the number of packet you queue, minus the number of packet sent reported in BLE_EVT_TX_COMPLETE. If in one BLE_EVT_TX_COMPLETE you have the number of packet in the buffer is full, you would need to queue at least 7 packets (if the max number of packet per connection interval is 6). This is to make sure you will have at least 1 packet to be sent in the connection after the next one. So that we will not get into the situation with one connection event with packet sent and one without.

    But anyway, it will have a 7.5ms latency because you can't have a packet sent immediately but will have to wait for the next connection interval."

    So what I'm saying is that to have 6 PDU's every interval, I need to put a 7th as well, that overflows the buffer and makes sure that the next interval is also used to empty the then again refilled TX buffers. And the issue that I'm having is that in the first interval, 7 packets can apparently be tried to send with an 8th overflowing the buffer. If I would just count to 6, the buffer wouldn't overflow and thus I would get interval sending, next not sending, next sending ... If I would count to 7 you might say, then I do overflow the buffer but not in the first interval, that requires 8 packets to overflow... So that's my issue :/

Children
No Data
Related