BlueToe
an alternative GATT/BLE implementation
Classes | Public Member Functions | List of all members
bluetoe::server< Options > Class Template Reference

Root of the declaration of a GATT server. More...

#include <bluetoe/server.hpp>

Inheritance diagram for bluetoe::server< Options >:

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 More...
 
template<class CharacteristicUUID >
bool notify ()
 
template<class T >
bool indicate (const T &value)
 sends indications to all connceted clients. More...
 
template<class CharacteristicUUID >
bool indicate ()
 sends indications to all connceted clients. More...
 

Detailed Description

template<typename ... Options>
class bluetoe::server< Options >

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:

See also
service
shared_write_queue
extend_server
server_name
appearance
Examples:
change_advertising_example.cpp, include_example.cpp, priorities_example.cpp, read_write_handler_example.cpp, and server_example.cpp.

Member Function Documentation

◆ indicate() [1/2]

template<typename ... Options>
template<class T >
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.

Returns
The function will return false, if the given indication was ignored, because the characteristic is already queued for indication, but not yet send out or the confirmation to a previous send out indication of this characteristic was not received yet.

◆ indicate() [2/2]

template<typename ... Options>
template<class CharacteristicUUID >
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.

Returns
The function will return false, if the given indication was ignored, because the characteristic is already queued for indication, but not yet send out or the confirmation to a previous send out indication of this characteristic was not received yet.

◆ notify() [1/2]

template<typename ... Options>
template<class T >
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.

See also
notify
characteristic

Example:

Returns
The function will return false, if the given notification was ignored, because the characteristic is already queued for notification, but not yet send out.

◆ notify() [2/2]

template<typename ... Options>
template<class CharacteristicUUID >
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.

See also
notify
characteristic

Example:

Returns
The function will return false, if the given notification was ignored, because the characteristic is already queued for notification, but not yet send out.

The documentation for this class was generated from the following files: