BlueToe
an alternative GATT/BLE implementation
Loading...
Searching...
No Matches
bluetoe::free_write_handler< T, F > Struct Template Reference

binds a free function as a write handler for the given characteristic More...

#include <bluetoe/characteristic_value.hpp>

Inheritance diagram for bluetoe::free_write_handler< T, F >:

Detailed Description

template<typename T, std::uint8_t(*)(T) F>
struct bluetoe::free_write_handler< T, F >

binds a free function as a write handler for the given characteristic

This handler handle write to characteristics with a specific size. The size if derived from the first template paramter. A std::uint32_t for example would result in a characteristic with a size of 4 octets. If only a write handler is passed to the bluetoe::characteristic, the characteristic will be write only.

Template Parameters
Ttype of characteristic. Possible values are bool, std::uint8_t, std::uint16_t, std::uint32_t, std::uint64_t and there signed counterpart.
Fpointer to function to handle a write request.
Return values
Ifthe characteristic value could be written successfully the function should return luetoe::error_codes::success. For usefull error codes, have a look at bluetoe::error_codes::error_codes.
See also
characteristic
free_read_blob_handler
free_read_handler
free_write_blob_handler
bluetoe::error_codes::error_codes
Examples
change_advertising_example.cpp.

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