mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-16 08:42:28 +00:00
l2cap: support de-init
This commit is contained in:
parent
4688f21608
commit
a0549bf12c
15
src/l2cap.c
15
src/l2cap.c
@ -200,10 +200,10 @@ static btstack_linked_list_t l2cap_le_services;
|
||||
static btstack_linked_list_t l2cap_channels;
|
||||
#ifdef L2CAP_USES_CHANNELS
|
||||
// next channel id for new connections
|
||||
static uint16_t local_source_cid = 0x40;
|
||||
static uint16_t local_source_cid;
|
||||
#endif
|
||||
// next signaling sequence number
|
||||
static uint8_t sig_seq_nr = 0xff;
|
||||
static uint8_t sig_seq_nr;
|
||||
|
||||
// used to cache l2cap rejects, echo, and informational requests
|
||||
static l2cap_signaling_response_t signaling_responses[NR_PENDING_SIGNALING_RESPONSES];
|
||||
@ -873,7 +873,8 @@ static uint8_t l2cap_next_sig_id(void){
|
||||
|
||||
void l2cap_init(void){
|
||||
signaling_responses_pending = 0;
|
||||
|
||||
local_source_cid = 0x40;
|
||||
sig_seq_nr = 0xff;
|
||||
l2cap_channels = NULL;
|
||||
|
||||
#ifdef ENABLE_CLASSIC
|
||||
@ -920,6 +921,14 @@ void l2cap_init(void){
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief De-Init L2CAP
|
||||
*/
|
||||
void l2cap_deinit(void){
|
||||
memset(l2cap_outgoing_classic_addr, 0, 6);
|
||||
signaling_responses_pending = 0;
|
||||
}
|
||||
|
||||
void l2cap_register_packet_handler(void (*handler)(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size)){
|
||||
#ifdef ENABLE_BLE
|
||||
l2cap_event_packet_handler = handler;
|
||||
|
@ -665,8 +665,6 @@ uint8_t l2cap_le_send_data(uint16_t cid, uint8_t * data, uint16_t size);
|
||||
*/
|
||||
uint8_t l2cap_le_disconnect(uint16_t cid);
|
||||
|
||||
/* API_END */
|
||||
|
||||
/**
|
||||
* @brief ERTM Set channel as busy.
|
||||
* @note Can be cleared by l2cap_ertm_set_ready
|
||||
@ -681,6 +679,13 @@ uint8_t l2cap_ertm_set_busy(uint16_t local_cid);
|
||||
*/
|
||||
uint8_t l2cap_ertm_set_ready(uint16_t local_cid);
|
||||
|
||||
/**
|
||||
* @brief De-Init L2CAP
|
||||
*/
|
||||
void l2cap_deinit(void);
|
||||
|
||||
/* API_END */
|
||||
|
||||
#if defined __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user