BlueToe
an alternative GATT/BLE implementation
Loading...
Searching...
No Matches
bluetoe::free_raw_write_handler< 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_raw_write_handler< F >:

Detailed Description

template<std::uint8_t(*)(std::size_t write_size, const std::uint8_t *value) F>
struct bluetoe::free_raw_write_handler< F >

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

If only a write handler is passed to the bluetoe::characteristic, the characteristic will be write only. To handle characteristic value sizes larger than 20 octets, a free_write_blob_handler should be used.

Template Parameters
Fpointer to function to handle a write request
Parameters
write_sizeThe size of the data that should be written to the characteristic value. If the size given is to large, the handler should return bluetoe::error_codes::invalid_attribute_value_length.
valueInput buffer containing the desired characteristic value.
Return values
Ifthe characteristic value could be read successfully (even when the out_buffer was to small, to read the whole value), the function should return luetoe::error_codes::success. In all other cases, Bluetoe will generate an error response to a read request and directly use the return value as error code. 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
read_write_handler_example.cpp.

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