mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-31 10:20:58 +00:00
l2cap-ertm: use send_supervisor_frame_receiver_ready to request RR frame
This commit is contained in:
parent
25cd60d37c
commit
d84e866fb8
11
src/l2cap.c
11
src/l2cap.c
@ -911,10 +911,10 @@ static void l2cap_run(void){
|
|||||||
#ifdef ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE
|
#ifdef ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE
|
||||||
// send s-frame to acknowledge received packets
|
// send s-frame to acknowledge received packets
|
||||||
if (!hci_can_send_acl_packet_now(channel->con_handle)) continue;
|
if (!hci_can_send_acl_packet_now(channel->con_handle)) continue;
|
||||||
if (channel->req_seq != 0xff){
|
if (channel->send_supervisor_frame_receiver_ready){
|
||||||
log_info("try to send s-frame");
|
channel->send_supervisor_frame_receiver_ready = 0;;
|
||||||
|
log_info("Send S-Frame: RR %u", channel->req_seq);
|
||||||
uint16_t control = l2cap_encanced_control_field_for_supevisor_frame( L2CAP_SUPERVISORY_FUNCTION_RR_RECEIVER_READY, 0, 0, channel->req_seq);
|
uint16_t control = l2cap_encanced_control_field_for_supevisor_frame( L2CAP_SUPERVISORY_FUNCTION_RR_RECEIVER_READY, 0, 0, channel->req_seq);
|
||||||
channel->req_seq = 0xff;
|
|
||||||
l2cap_ertm_send_supervisor_frame(channel, control);
|
l2cap_ertm_send_supervisor_frame(channel, control);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -1130,10 +1130,6 @@ static l2cap_channel_t * l2cap_create_channel_entry(btstack_packet_handler_t pac
|
|||||||
channel->remote_sig_id = L2CAP_SIG_ID_INVALID;
|
channel->remote_sig_id = L2CAP_SIG_ID_INVALID;
|
||||||
channel->local_sig_id = L2CAP_SIG_ID_INVALID;
|
channel->local_sig_id = L2CAP_SIG_ID_INVALID;
|
||||||
|
|
||||||
#ifdef ENABLE_L2CAP_ENHANCED_RETRANSMISSION_MODE
|
|
||||||
channel->req_seq = 0xff;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return channel;
|
return channel;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -2442,6 +2438,7 @@ static void l2cap_acl_handler(uint8_t packet_type, uint16_t channel, uint8_t *pa
|
|||||||
if (l2cap_channel->expected_tx_seq == tx_seq){
|
if (l2cap_channel->expected_tx_seq == tx_seq){
|
||||||
log_info("Received expected frame with TxSeq == ExpectedTxSeq == %02u", tx_seq);
|
log_info("Received expected frame with TxSeq == ExpectedTxSeq == %02u", tx_seq);
|
||||||
l2cap_channel->req_seq = tx_seq;
|
l2cap_channel->req_seq = tx_seq;
|
||||||
|
l2cap_channel->send_supervisor_frame_receiver_ready = 1;
|
||||||
l2cap_channel->expected_tx_seq = l2cap_next_ertm_seq_nr(l2cap_channel->expected_tx_seq);
|
l2cap_channel->expected_tx_seq = l2cap_next_ertm_seq_nr(l2cap_channel->expected_tx_seq);
|
||||||
uint16_t sdu_length;
|
uint16_t sdu_length;
|
||||||
uint16_t segment_length;
|
uint16_t segment_length;
|
||||||
|
@ -207,16 +207,19 @@ typedef struct {
|
|||||||
uint8_t local_max_transmit;
|
uint8_t local_max_transmit;
|
||||||
uint8_t remote_max_transmit;
|
uint8_t remote_max_transmit;
|
||||||
|
|
||||||
// if ertm is not mandatory, allow fallback to L2CAP Basic Mode
|
// if ertm is not mandatory, allow fallback to L2CAP Basic Mode - flag
|
||||||
uint8_t ertm_mandatory;
|
uint8_t ertm_mandatory;
|
||||||
|
|
||||||
|
// receiver: send RR frame - flag
|
||||||
|
uint8_t send_supervisor_frame_receiver_ready;
|
||||||
|
|
||||||
// sender: next seq nr used for sending
|
// sender: next seq nr used for sending
|
||||||
uint8_t next_tx_seq;
|
uint8_t next_tx_seq;
|
||||||
|
|
||||||
// receiver: value of tx_seq in next expected i-frame
|
// receiver: value of tx_seq in next expected i-frame
|
||||||
uint8_t expected_tx_seq;
|
uint8_t expected_tx_seq;
|
||||||
|
|
||||||
// receiver: request transmiissoin with tx_seq = req_seq and ack up to and including req_seq - 1, 0xff if no ack to send
|
// receiver: request transmiissoin with tx_seq = req_seq and ack up to and including req_seq
|
||||||
uint8_t req_seq;
|
uint8_t req_seq;
|
||||||
|
|
||||||
// max um out-of-order packets // tx_window
|
// max um out-of-order packets // tx_window
|
||||||
|
Loading…
x
Reference in New Issue
Block a user