(G)ATT transactions shall be queued by host
NimBLE host seems to allow to send subsequent ATT requests without waiting for previous one to complete. This behavior is invalid as per Core 5.0, Vol 3, Part F, Section 3.3.2:
Once a client sends a request to a server, that client shall send no other request to the same server until a response PDU has been received.
We could just let application handle this, however:
- it makes apps more complicated
- there are already sample apps which seem to assume that multiple concurrent requests are handled properly (see
blecent_read_write_subscribeinapps/blecent)
Since we already have ble_gattc_procs, we should leverage this to implement proper handling of GATT procedures inside host.
And, I should add, responses should be assigned properly. Right now it is possible to send two GATT reads but responses can get mixed up - when processing a response, the first proc from the queue will be used, which in fact it could be the wrong one (different handle).