BlueToe
an alternative GATT/BLE implementation
|
Root of the declaration of a GATT server. More...
#include <bluetoe/server.hpp>
Classes | |
class | connection_data |
per connection data More... | |
Public Member Functions | |
server () | |
a server takes no runtime construction parameters | |
template<class T > | |
bool | notify (const T &value) |
notifies all connected clients about this value | |
template<class CharacteristicUUID > | |
bool | notify () |
template<class T > | |
bool | indicate (const T &value) |
sends indications to all connceted clients. | |
template<class CharacteristicUUID > | |
bool | indicate () |
sends indications to all connceted clients. | |
template<class CharacteristicUUID > | |
bool | configured_for_indications (const details::client_characteristic_configuration &) const |
returns true, if the given connection is configured to send indications for the given characteristic | |
template<class CharacteristicUUID > | |
bool | configured_for_notifications (const details::client_characteristic_configuration &) const |
returns true, if the given connection is configured to send notifications for the given characteristic | |
template<class CharacteristicUUID > | |
bool | configured_for_notifications_or_indications (const details::client_characteristic_configuration &) const |
returns true, if the given connection is configured to send indications or notifications for the given characteristic | |
Root of the declaration of a GATT server.
The server serves one or more services configured by the given Options. To configure the server, pass one or more bluetoe::service types as parameters.
example:
bool bluetoe::server< Options >::indicate | ( | ) |
sends indications to all connceted clients.
The function is mostly similar to notify(). Instead of an ATT notification, an ATT indication is send.
bool bluetoe::server< Options >::indicate | ( | const T & | value | ) |
sends indications to all connceted clients.
The function is mostly similar to notify(). Instead of an ATT notification, an ATT indication is send.
bool bluetoe::server< Options >::notify | ( | ) |
Notify a characteristic, by giving the characteristic UUID.
The charactieristic to be notify, must have been configured for notificaton. If multiple characteristics exists with the given UUID, the first characteristic will be notified.
Example:
bool bluetoe::server< Options >::notify | ( | const T & | value | ) |
notifies all connected clients about this value
There is no check whether there was actual a change to the value or not. It's safe to call this function from a different thread or from an interrupt service routine. But there is a check whether or not clients enabled notifications.
The characteristic<> must have been given the notify parameter.
Example: