BlueToe
an alternative GATT/BLE implementation
Loading...
Searching...
No Matches
bluetoe::shared_write_queue< S > Struct Template Reference

defines a write queue size that is shared among all connected clients More...

#include <bluetoe/write_queue.hpp>

Detailed Description

template<std::uint16_t S>
struct bluetoe::shared_write_queue< S >

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".

See also
server

example:

...
> large_object_server;
small_temperature_service,
> small_named_temperature_service;
Root of the declaration of a GATT server.
Definition: server.hpp:85
adds additional options to a given server definition
Definition: server.hpp:480
adds a discoverable device name
Definition: server_name.hpp:16
defines a write queue size that is shared among all connected clients
Definition: write_queue.hpp:48

The documentation for this struct was generated from the following file: