diff --git a/src/ble/att_db.h b/src/ble/att_db.h index e969b2947..13fc3c20f 100644 --- a/src/ble/att_db.h +++ b/src/ble/att_db.h @@ -166,11 +166,12 @@ typedef int (*att_write_callback_t)(hci_con_handle_t con_handle, uint16_t attrib // Read & Write Callbacks for handle range typedef struct att_service_handler { btstack_linked_item_t * item; - uint16_t start_handle; - uint16_t end_handle; att_read_callback_t read_callback; att_write_callback_t write_callback; btstack_packet_handler_t packet_handler; + uint16_t start_handle; + uint16_t end_handle; + uint8_t flags; } att_service_handler_t; // MARK: ATT Operations diff --git a/src/ble/att_server.c b/src/ble/att_server.c index 911828192..b8585716e 100644 --- a/src/ble/att_server.c +++ b/src/ble/att_server.c @@ -1263,6 +1263,8 @@ void att_server_register_service_handler(att_service_handler_t * handler){ log_error("handler for range 0x%04x-0x%04x already registered", handler->start_handle, handler->end_handle); return; } + + handler->flags = 0; btstack_linked_list_add(&service_handlers, (btstack_linked_item_t*) handler); }