mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-03 16:14:11 +00:00
mesh: fix mesh_lower_transport_run logic
This commit is contained in:
parent
ed7fbd43a3
commit
6ed0bd5c68
@ -614,18 +614,13 @@ static void mesh_lower_transport_tx_ack_timeout(btstack_timer_source_t * ts){
|
||||
}
|
||||
|
||||
static void mesh_lower_transport_run(void){
|
||||
while(1){
|
||||
int done = 1;
|
||||
|
||||
if (!btstack_linked_list_empty(&lower_transport_incoming)){
|
||||
done = 0;
|
||||
// peek at next message
|
||||
mesh_network_pdu_t * network_pdu = (mesh_network_pdu_t *) btstack_linked_list_get_first_item(&lower_transport_incoming);
|
||||
while(!btstack_linked_list_empty(&lower_transport_incoming)){
|
||||
// get next message
|
||||
mesh_network_pdu_t * network_pdu = (mesh_network_pdu_t *) btstack_linked_list_pop(&lower_transport_incoming);
|
||||
// segmented?
|
||||
if (mesh_network_segmented(network_pdu)){
|
||||
mesh_transport_pdu_t * transport_pdu = mesh_lower_transport_pdu_for_segmented_message(network_pdu);
|
||||
if (!transport_pdu) return;
|
||||
(void) btstack_linked_list_pop(&lower_transport_incoming);
|
||||
// start acknowledgment timer if inactive
|
||||
if (transport_pdu->acknowledgement_timer_active == 0){
|
||||
// - "The acknowledgment timer shall be set to a minimum of 150 + 50 * TTL milliseconds"
|
||||
@ -642,18 +637,13 @@ static void mesh_lower_transport_run(void){
|
||||
// control?
|
||||
if (mesh_network_control(network_pdu)){
|
||||
// unsegmented control message (not encrypted)
|
||||
(void) btstack_linked_list_pop(&lower_transport_incoming);
|
||||
mesh_lower_transport_process_unsegmented_control_message(network_pdu);
|
||||
} else {
|
||||
// unsegmented access message (encrypted)
|
||||
(void) btstack_linked_list_pop(&lower_transport_incoming);
|
||||
mesh_upper_transport_unsegmented_message_received(network_pdu);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (done) return;
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t mesh_lower_transport_next_seq(void){
|
||||
|
Loading…
x
Reference in New Issue
Block a user