I am playing around with TI CC2540 Keyfob and USB Dongle DK.
I took the simpleBLEPeripheral-Project and made some modifications to it, to test data rate. If I press the left key (which sets an event), I am able to send GATT_Notification. Just for test purpose a tried to add several GATT_Notification commands in SimpleBLEPeripheral_ProcessEvent, what results in multiple packets being sent in one Connection Event. However, the maximum number of notifications within on Connection Event is never more than 4, even if I call GATT_Notification e.g. 5 times, I can only see 4 of them on the sniffer.
I consulted Bluetooth Core Specification V4.0 and couldn't find anything saying that the maximum number of packets in one Connection Event is 4.
Is there any way to increase this? Is this a given limit of TI-Stack? If so, can we expect this to be changed in the near future?
You are right, the BLE stack is limited to processing a maximum of 4 packets per connection event. We are currently looking into whether this can be increased in the next revision of the stack.
Thank you for your reply. Can you make any prediction about when a new revision of the stack will be available?
Slightly off topic, but is this limitation based on the number of HCI buffers available at the controller? Is there anyway to increase the number of HCI buffers?
#define HCI_MAX_NUM_DATA_BUFFERS 0x04#define HCI_MAX_NUM_CMD_BUFFERS 0x01
in hci_controller.h, but changing these constants doesn't seem to have any affect.
In my solution I have to use a FIFO to buffer packets in the case when GATT_Notification() call fails due to "MSG_BUFFER_NOT_AVAIL".
If the BLE stack is limited to processing a maximum of 4 packets per connection event, does this mean that if my application has more than 4 characteristics I cannot write to all of them in the same connection event?
There is a bit of confusion around all the forum.
4 notifications per connection event is the maximum if a 20 bytes size is considered. This was an experiment Karl gently gave to the community to test the maximum throughput in BLE, where the connection event was 6 (7.5ms) and the number of notifs = 4 (20bytes each).
If you use a longer connection interval and/or lower packet size, you will be able to send more.
There are threads in the forum with 6 and 7 notifications per connection event.
Please click the Verify Answer button on a post if it answers your question! :)
Thanks for your answer, but I have another question: looking at the connection event at channel 0x1F in the below figure
what are the yellow packets which don't have PDUs on them? are these the packets to maintain the connection? Do I have to take them into consideration when calculating the number of bytes that can be sent in a connection interval?
Thanks in advance
I do not see the picture because I'm on my mobile phone but they can be ACKs or polls, depending on your app.
I do not think there are keep-alive packets in BLE but if I do not remember wrong, the connection events start with a poll.
I would not take them into account. In fact, for rapid througput calculations what I do is to take all the packets in a connection event during a second, divide the whole number by two (to discard this short packets). and multiply for the number of bytes.
Thanks for your answer
If this answers your questions, verify the thread just to keep the forum cleaner :)
A connection event consists of both initiator and peripheral Rx/Tx periods. I.e. they switch back and forth. You can see from the timestamp that they occur 295 µs after the previous packet. This indicates that they are sent by the reciprocating device within the same connection event. Hence they are not interesting for calculating write speed, as they have no relevance.
LLID of 1 indicates empty packet or continuation packet. In this case empty as pdu len is 0.
See the bluetooth core spec (http://www.bluetooth.org/docman/handlers/downloaddoc.ashx?doc_id=229737) Volume 6, Appendix B, Chapters 2.4 and 4.5.6/9 if you are interested.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.