Please make sure that your connection interval is small enough such that sending notification at these high rates is feasible. Keep your connection interval as low as possible.
Check if the GattsNotification API returns any error code. Also, it is not recommended to use CyDelay in your code. Please use WDT timers if you want to introduce delays.
- Madhu Sudhan
1 of 1 people found this helpful
Thanks for your input it is very valuable. Regarding the connection interval on the device I have 7.5-10(min max connection) and the supervision timeout at 100 ms. Of course as I know this parameters will depend on iOS and Android devices at the end but for the device I keep the smallest possible.
I did this for a characteristic that has only Notification attribute active( no read and write can be performed on it):
/* Process BLE Events */
/* retry until successful */
}while( u8ConnectionFlag &&
/* Notify the phone that the values are update */
(CyBle_GattsNotification(cyBle_connHandle, &tempHandle) != CYBLE_ERROR_OK)
And now I was able to receive hundreds of notifications. I also deleted the delay since I suppose the BLE stack and link should do the job. As I know in one connection interval there is 4-6 packages exchanges depending on the client. It seems ok.
Then again I have another problem with another characteristic that have also read attribute. This characteristic should only send 11 notifications every time. Of course without the above code I only receive 10 notifications. With the above code I only receive 2 notifications and the BLE is dead. I receive timeout on read, and furthermore even if I disconnect from the device it wont react. Without a reset it is dead.
So I think maybe the read attribute cause this. Maybe you have an idea what can be the problem. I need to mention that BLE has 0 interrupt priority(highest) and also I have WTD 0 active, WDT 2 active, SW pin interrupt therefore I except the code should not be frozen in the do while loop and some interrupts should jump in.