There seems to be a bug in the notification flow control algorithm used in the CSR1010 Glucose sensor sample application. I am copying this app for a different application and found that some notifications were getting lost: if you have more than about 15 notifications to send then two get lost.
The Glucose app algorithm sends the first notification with a call to GattCharValueNotification() and then further notifications each time the corresponding GATT_CHAR_VAL_NOT_CFM event arrives, until GATT_CHAR_VAL_NOT_CFM shows an error (because the CSR1010 buffer is full). From that point on, it turns on LS_RADIO_EVENT_IND events and sends further notifications on each LS_RADIO_EVENT_IND event, until all have been sent. The GATT_CHAR_VAL_NOT_CFM events still occur but are ignored. The idea is presumably that one LS_RADIO_EVENT_IND event will happen each time a notification is transmitted, so there will be room for another in the buffer.
However this is a mistake, as (for me) two further GATT_CHAR_VAL_NOT_CFM events with error status arrive (and are ignored). The result is that two notifications are not transmitted.
The fix is simple: on the first error turn on LS_RADIO_EVENT_IND events but use each one only as a prompt to attempt a further GattCharValueNotification() call. Monitor every GATT_CHAR_VAL_NOT_CFM event and if it shows an error, note that the notification has to be retried. Retry the next time you get a LS_RADIO_EVENT_IND event.
I would be interested to know if there are other examples of notification flow control?
Regards - Charles