Hi All,
I have an application that wants to send 1 array every 2ms.
There are 10Bytes of data in the array.
I will be based on 1Mbps, MTU size = 23byte, Payload = 27byte, Event Length = 7.5ms.
Is this possible?
Best regards,
Kai
Hi All,
I have an application that wants to send 1 array every 2ms.
There are 10Bytes of data in the array.
I will be based on 1Mbps, MTU size = 23byte, Payload = 27byte, Event Length = 7.5ms.
Is this possible?
Best regards,
Kai
Hi Kai,
One may send several packets in one connection event. So, inside the 7.5 ms event there can be multiple packets sent and it can be close to 2 ms. However, this depends on the peer as well, requiring that you can control both sides of the connection.
Most Bluetooth devices nowadays(phones) support multiple packets per connection event. What is the other side of your connection?
You need to queue as much as possible. The buffer needs to be filled with data before the connection event to have most data out. What is it you are trying to achieve with your setup? Why is it not possible to combine your data into one big packet and send as a single packet?
Best regards,
Håkon
Hi Helsing,
Most Bluetooth devices nowadays(phones) support multiple packets per connection event. What is the other side of your connection?
My phone currently only receives 6 packets at most.
You need to queue as much as possible. The buffer needs to be filled with data before the connection event to have most data out. What is it you are trying to achieve with your setup? Why is it not possible to combine your data into one big packet and send as a single packet?
My SDK will generate 1 10byte data every 2ms, and I need to send these data through bluetooth. At present, I am trying to integrate these 10byte data into a buffer and send it directly through bluetooth
Have you faced any challenges so far? One packet per 2ms will not be a big deal if the central supports multiple packets per connection interval.
You could try to send something as fast as possible and capture a sniffer trace. We could then look at the sniffer trace to see if there is any issue.
Here is my sniffer.
My connection interval is set at 30ms,and the 6th byte of my data packet will display the current data packet volume (range 00~FF).
You can see that the packet at the marker is wrong and multiple packets cannot be generated within 1 interval

Thank you for providing the sniffer trace.
As you see from the image below, more data is 'False'. This means there is no more data to transmit.

The marked package contained '0a', which means some values are missing and were not transmitted. What probably happened is that a buffer in the SoftDevice was full.
The question now is how you are queuing your data? You will need to have a good way to queue your data that suits your application.
The GATTS Handle Value Notification documentation includes two different variants demonstrating how to queue your data.
One option is to implement your own way to keep track of how many elements you have queued(Variant #2). Another option is to monitor whether NRF_SUCCESS or NRF_ERROR_RESOURCES is returned each time you queue an element(as in Variant #1).
At present, the MCU will generate 10Byte data at a speed of 2ms.
For the bluetooth part, I built a Buffer to load the data generated by the MCU and accumulated 100 bytes for Notify.
One option is to implement your own way to keep track of how many elements you have queued(Variant #2). Another option is to monitor whether NRF_SUCCESS or NRF_ERROR_RESOURCES is returned each time you queue an element(as in Variant #1).
I donot know how to use it,do you have any example code?
Would you be able to share some of your work?
How to handle this highly depends on your application.
Here is the throughput example: \examples\ble_central_and_peripheral\experimental\ble_app_att_mtu_throughput
Check out char_notification_send() in amts.c
The function checks if the buffer is full. If it is full, it will wait and retry.
Here is a discussion on the topic: https://devzone.nordicsemi.com/f/nordic-q-a/69440/s140---gatts-handle-value-notification/285667#285667
Would you be able to share some of your work?
How to handle this highly depends on your application.
Here is the throughput example: \examples\ble_central_and_peripheral\experimental\ble_app_att_mtu_throughput
Check out char_notification_send() in amts.c
The function checks if the buffer is full. If it is full, it will wait and retry.
Here is a discussion on the topic: https://devzone.nordicsemi.com/f/nordic-q-a/69440/s140---gatts-handle-value-notification/285667#285667