Open dakhnod opened 1 year ago
@shmuelzon any comment on this?
@shmuelzon how about this: Instead of focusing on single operations, we run the regular initialization routine as it used to be. When we hit an insufficient-encryption or encryption we try bonding, and then re-run the regular routine from start. That way, all possible types of read/write operations should be covered.
The code tries pairing with a BLE device when an initial characteristic read operation fails, and then tries to read the value again after pairing.
Yet, there might be a failing descriptor write operation first, or no characteristic read at all. Hence, this code adds handling of such a case by buffering every write, issuing pairing if needed and re writing the descriptor.
This code is just a starting point. @shmuelzon How would you buffer the writes?