2014-10-13 01:33 AM
Hello
I have the following issue with BlueNRG: when I try to use ''INDICATION'' to sending data from server to client I have ble crash (the BlueNRG stops to respond to any command) after a few indicate packet (50 - 60). When I use ''NOTIFICATION'' this problem is not appear. I have checked this issue in ''Ble_chat'' project (I have modified characteristic properties for ''charUuidTX'' from ''CHAR_PROP_NOTIFY'' to CHAR_PROP_INDICATE and set delay (1s) between sending packet) and this issue also has appeared. Maybe do you have any idea what could be the problem?
Thanks Regards Software engineer, Andrei Kukenov2014-10-15 12:01 PM
Hi Andrei
The main difference between Notify and Indicate is, of course, that the Peripheral sending the Indicate expects an acknowledgement. Could it be that once in a while this handshake does not occur - either because the Indicate message did not make it to the Central or because the Central's ack did not make it back to the Peripheral? As I recall, the BlueNRG stack will time out after about 30s if it does not see the ack, and fires a timeout event. Are you looking for that event and processing it? Alternatively: if you are sending many Indicates, one per second, then the BlueNRG will have to keep track of the ack for all outstanding Indicates. I guess at some point there will be a limit to the number of unacknowledged Indicate messages and something unpleasant will happen. Are you looking at the status byte in the command complete response that at the BlueNRG sends when you send the Indicate? (ST: what happens?) Request to ST: it would be great if the BlueNRG could fire an ''Indicate ACK Received'' event as soon as the ack arrives, as a positive acknowledgment that the Indicate has reached its destination. Otherwise the application has no way of knowing this, beyond waiting the 30s and checking for the absence of the timeout. Regards - Charles Palmer2014-10-16 05:03 AM
2014-10-17 04:37 AM
2014-10-23 06:30 AM
Hi, Palmer
Thanks a lot for you reply. On my side I see exactly the same behavior that you describe. I get ''disconnection'' just on Peripheral side. I also really want to know how can I determine the BlueNRG is connected to master now or not. For example, after disconect on master side the method ( hci_read_rssi) returns last actual rssi value. Regards Andrei2014-11-19 02:55 AM
Hi,
As Charles has said, ''The main difference between Notify and Indicate is, of course, that the Peripheral sending the Indicate expects an acknowledgement. '' therefore when the central receives the event ''EVT_BLUE_GATT_INDICATION'', it has to respond with the command ''ACI_GATT_CONFIRM_INDICATION''. If this not occurs (about 30 sec), both devices receive the event ''EVT_BLUE_GATT_PROCEDURE_TIMEOUT'' that means that the GATT procedure shall be considered to have failed, and no further GATT procedures shall be performed.
Anyway, the connection between devices is lost, both devices should receive the HCI_DISCONNECTION_COMPLETE.
Regards, GraziellaHi, Palmer
Thanks a lot for you reply. On my side I see exactly the same behavior that you describe. I get ''disconnection'' just on Peripheral side. I also really want to know how can I determine the BlueNRG is connected to master now or not. For example, after disconect on master side the method ( hci_read_rssi) returns last actual rssi value. Regards Andrei2014-11-23 11:25 PM
Hi,
Thank very much for you reply, if I understand correctly, there is no any event on peripheral role to indicate that acknowledgement from Central had been received and I'll find out just in 30 seconds if acknowledgement was not recieved is not it? Regards, Andrei Kukenov2014-11-26 06:45 AM
Hi,
I confirm that there is no event on peripheral role to indicate that acknowledgement from Central had been received. After 30 sec, if central doesn't send the ACI_GATT_CONFIRM_INDICATION, the EVT_BLUE_GATT_PROCEDURE_TIMEOUT event is raised on both devices.
However, the peripheral doesn't have to wait 30 sec between an indication and another, he can send them sequentially and the stack manages all.
Regards,
Graziella Marchese2014-11-27 01:20 AM
Hi,
Thank you for you help Regards, Andrei Kukenov