1
0
mirror of https://github.com/bluekitchen/btstack.git synced 2025-04-03 01:20:35 +00:00

att_server: simplify coverage

This commit is contained in:
Milanka Ringwald 2022-12-27 19:17:11 +01:00
parent 35d7f2df0b
commit ec8f5414ef

@ -1145,8 +1145,16 @@ static int att_server_write_callback(hci_con_handle_t con_handle, uint16_t attri
* @param att_service_handler_t * @param att_service_handler_t
*/ */
void att_server_register_service_handler(att_service_handler_t * handler){ void att_server_register_service_handler(att_service_handler_t * handler){
if (att_service_handler_for_handle(handler->start_handle) || bool att_server_registered = false;
att_service_handler_for_handle(handler->end_handle)){ if (att_service_handler_for_handle(handler->start_handle)){
att_server_registered = true;
}
if (att_service_handler_for_handle(handler->end_handle)){
att_server_registered = true;
}
if (att_server_registered){
log_error("handler for range 0x%04x-0x%04x already registered", handler->start_handle, handler->end_handle); log_error("handler for range 0x%04x-0x%04x already registered", handler->start_handle, handler->end_handle);
return; return;
} }