Hello,
My project is based on CC2650 Throughput example. Using the example I can easily get a throughput of about 30KB/s without any problem.
As I understand, once MTU size updated, the program enters an infinite while loop and sends packages of 244B data continuously. Only keypress are processed inside the while loop.
I then start to add a sensor, generating interrupts via GPIO pin at about 80Hz frequency. I want that each time the interrupt is triggered, a BLE package of 244B is sent to the Central.
I tried:
1. using event: I added an event inside SimpleBLEPeripheral main task (just like SBP_PERIODIC_EVT)
2. using appMsgQueue, I added it inside SimpleBLEPeripheral. HWI interrupts are treated in SimpleBLEPeripheral_processAppMsg (just like SBP_CHAR_CHANGE_EVT).
3. creating a new task with priority of 2. The HWI interrupt posts semaphores to this task. The task waits for the semaphore, then sends a package of 244B to the Central.
No matter which method I use, I only get about 2KB/s.
I checked sensor interrupt frequency, everything is OK.
I then checked GATT_Notification return value. It actually returns 0x04 (MSG_BUFFER_NOT_AVAIL) 10 times before finally succeeding to send one 244B package to the Central. As a result, data transmission speed slows down dramatically.
I changed to connection interval to 7.5 ms, no luck.
It seems that GATT_Notification needs time to prepare and send BLE data, and sensor interrupts of 80Hz are just way too fast. But how to explain the results obtained with the Throughput example (using an infinite while loop)?
Once I use an infinite while loop and send 244B data no stop, I get the top speed (about 30KB/s), once I start to implement HWI / semaphore / events to synchronize things between them, everything slows down.
Could someone tell me what I am doing wrong?
Thank you
Kind regards
Xin

