mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-28 08:37:22 +00:00
l2cap-ertm: free tx packets that receive an RR s-frame
This commit is contained in:
parent
675e6881a7
commit
bdbe2e4960
21
src/l2cap.c
21
src/l2cap.c
@ -2463,9 +2463,26 @@ static void l2cap_acl_handler(uint8_t packet_type, uint16_t channel, uint8_t *pa
|
||||
uint16_t control = little_endian_read_16(packet, COMPLETE_L2CAP_HEADER);
|
||||
uint8_t req_seq = (control >> 8) & 0x3f;
|
||||
if (control & 1){
|
||||
// int poll = (control >> 7) & 0x01;
|
||||
log_info("S-Frame not not implemented yet");
|
||||
// S-Frame
|
||||
// int poll = (control >> 7) & 0x01;
|
||||
l2cap_supervisory_function_t s = (l2cap_supervisory_function_t) ((control >> 2) & 0x03);
|
||||
l2cap_ertm_tx_packet_state_t * tx_state;
|
||||
switch (s){
|
||||
case L2CAP_SUPERVISORY_FUNCTION_RR_RECEIVER_READY:
|
||||
tx_state = &l2cap_channel->tx_packets_state[l2cap_channel->tx_read_index];
|
||||
if ( ((req_seq - 1) & 0x3f) == tx_state->tx_seq){
|
||||
log_info("RR seq %u == seq of oldest tx packet -> packet done", req_seq);
|
||||
l2cap_channel->tx_read_index++;
|
||||
if (l2cap_channel->tx_read_index >= l2cap_channel->num_rx_buffers){
|
||||
l2cap_channel->tx_read_index = 0;
|
||||
}
|
||||
} else {
|
||||
log_info("RR seq %u != seq of oldest tx packet %u ???", req_seq, tx_state->tx_seq);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
// I-Frame
|
||||
|
Loading…
x
Reference in New Issue
Block a user