BlueToe
an alternative GATT/BLE implementation
|
defines a write queue size that is shared among all connected clients More...
#include <bluetoe/write_queue.hpp>
defines a write queue size that is shared among all connected clients
Defines the size of a per server write queue in bytes. The queue is allocated within the server object. All connected clients share the same write queue. The write queue is needed to implement the "Write Long Characteristic" procedure defined by GATT.
To write objects of the size N, the queue size must be ( ( N + 17 ) / 18 * 7 ) + N bytes (integer math). For example, if the size of the largest object to be writen is 100 bytes, than the queue size must be ( ( 100 + 17 ) / 18 * 7 ) + 100 = 142
As all connections share one write queue, the whole queue is allocated to the first connection that starts writing a long characteristic value until that client is done with writing or gets disconnected. All othere connections will get an "Prepare Queue Full" error meanwhile.
If no write queue size if given, the server will respond with "Request Not Supported" to a ATT "Prepare Write Request" or "Execute Write Request".
example: