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

Defines priorities of notified or indicated characteristics. More...

#include <bluetoe/outgoing_priority.hpp>

Detailed Description

template<typename ... UUIDs>
struct bluetoe::higher_outgoing_priority< UUIDs >

Defines priorities of notified or indicated characteristics.

In Bluetoe, when a characteristic notification or indication have to be send, the server::notify or server::indicate function can be used to queue this characteristic for beeing send out. Once the link layer finds a free spot for a notification or indication, it will determin one of the queued characteristics, reserve a buffer, fill that buffer with the value of the characteristic and send it out.

higher_outgoing_priority and lower_outgoing_priority can be used define in which order queued notifications and indications are send.

The higher_outgoing_priority option can be used as option to a service, to define the priority of outgoing notifications and indications based on the characteristics UUID. UUIDs are given in decreasing order of priority. Characteristics of the service that are not named in the list have a priority that is lower than the last element in the list.

The higher_outgoing_priority option can also be used as option to a server, to raise the priority of all characteristics within a service. Then, all characteristics within a service, that is not named as a parameter to higher_outgoing_priority have a priority that is less than all characteristics within the last element of the list.

Example: Given that we have 3 services A, B, and C which all contain 3 characteristics a, b, and c. Given this pseudo GATT server:

A,
>,
B,
>,
C,
>,
>;
A characteristic is a typed value that is accessable by a GATT client hosted by a GATT server.
Definition: characteristic.hpp:160
Root of the declaration of a GATT server.
Definition: server.hpp:85
a service with zero or more characteristics
Definition: service.hpp:150
Defines priorities of notified or indicated characteristics.
Definition: outgoing_priority.hpp:160
Defines priorities of notified or indicated characteristics.
Definition: outgoing_priority.hpp:284

Now, the priority of each characteristic is as follows. Characteristics comming first have higher priorities. Characteristics on the same line have equal priority.

Service: | A | B | C
---------------------------------------
highest | b | |
| a,c | |
| | | a
| | | b
| | b, c | c
lowest | | a |

Note, that the characteristics b and c of service B and the characteristic c of service C have the very same priority, because B and C have the same priority and the characteristics have default (unchanged) priorities.

See also
lower_outgoing_priority
Examples
priorities_example.cpp.

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