BlueToe
an alternative GATT/BLE implementation
|
binds a free function as a write handler for the given characteristic More...
#include <bluetoe/characteristic_value.hpp>
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.
F | pointer to function to handle a write request |
offset | offset 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_size | The 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. |
value | Input buffer containing the desired characteristic value. |
If | the 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. |