mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-06 10:20:42 +00:00
rfcomm: handle l2cap_register_service status
This commit is contained in:
parent
7dfe4b1c91
commit
c3b97dcd33
@ -2533,7 +2533,11 @@ static uint8_t rfcomm_register_service_internal(btstack_packet_handler_t packet_
|
|||||||
|
|
||||||
// register with l2cap if not registered before, max MTU
|
// register with l2cap if not registered before, max MTU
|
||||||
if (btstack_linked_list_empty(&rfcomm_services)){
|
if (btstack_linked_list_empty(&rfcomm_services)){
|
||||||
l2cap_register_service(rfcomm_packet_handler, BLUETOOTH_PROTOCOL_RFCOMM, 0xffff, rfcomm_security_level);
|
uint8_t status = l2cap_register_service(rfcomm_packet_handler, BLUETOOTH_PROTOCOL_RFCOMM, 0xffff, rfcomm_security_level);
|
||||||
|
if (status != ERROR_CODE_SUCCESS){
|
||||||
|
btstack_memory_rfcomm_service_free(service);
|
||||||
|
return status;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// fill in
|
// fill in
|
||||||
@ -2546,7 +2550,7 @@ static uint8_t rfcomm_register_service_internal(btstack_packet_handler_t packet_
|
|||||||
// add to services list
|
// add to services list
|
||||||
btstack_linked_list_add(&rfcomm_services, (btstack_linked_item_t *) service);
|
btstack_linked_list_add(&rfcomm_services, (btstack_linked_item_t *) service);
|
||||||
|
|
||||||
return 0;
|
return ERROR_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t rfcomm_register_service_with_initial_credits(btstack_packet_handler_t packet_handler,
|
uint8_t rfcomm_register_service_with_initial_credits(btstack_packet_handler_t packet_handler,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user