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

Detailed Description

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

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

The handler can be used to handle blobs. If only a write handler is passed to the bluetoe::characteristic, the characteristic will be write only. If the characteristic value will always be smaller than 21 octets, using a bluetoe::free_raw_write_handler will save you from coping with an offset.

Template Parameters
Fpointer to function to handle a write request
Parameters
offsetoffset in octets into the characteristic beeing written. If the offset is larger than the characteristic, the handler should return bluetoe::error_codes::invalid_offset
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_raw_write_handler
bluetoe::error_codes::error_codes
Examples
read_write_handler_example.cpp.

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