BlueToe
an alternative GATT/BLE implementation
|
Defines priorities of notified or indicated characteristics. More...
#include <bluetoe/outgoing_priority.hpp>
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:
Now, the priority of each characteristic is as follows. Characteristics comming first have higher priorities. Characteristics on the same line have equal priority.
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.