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
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.
F | pointer to function to handle a write request |
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. |