Hi,
I am using a 52832 part as a peripheral communicating with a central running on an ESP32. It operates in the following manner:
1. When it is active, the peripheral sends a notification to the central.
2. When the central receives the notification, it performs a write-with-response to write a state update to the peripheral.
(Note that the UUID that is notified is always the same, and the UUID that is written is always the same).
So what I'd expect to see in a sniffer log is something like this:
P -> C: Notify
C -> P: Write
P -> C: Response
P -> C: Notify
C -> P: Write
P -> C: Response
etc.
Most of the time, everything works fine. When the peripheral receives a write, our application sees the BLE_GATTS_EVT_WRITE event.
The trouble is that sometimes, our application does not see the BLE_GATTS_EVT_WRITE event, and the response to the write is never sent by the peripheral. This causes the central to close the connection due to the write-with-response timing out.
I have attached a Wireshark capture showing the failure. The notification/write/response sequence begins around 124 seconds. You can see things proceed normally, with matched write requests and write responses.
An example of a failure case is between 130.172 and 130.471. There, you see two write requests, but the only response is sent at 130.474, and our application only receives BLE_GATTS_EVT_WRITE for one of the two writes. I don't believe there could be a lost packet because there is no error in the sequence numbers. It looks like the peripheral processed, but otherwise completely ignored, one of the write requests.
Any idea what's going on?
My connection parameters are as follows: min_int = 60, max_int = 120,conn_int = 120,latency = 90, timeout = 3000