mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-17 20:42:47 +00:00
att_server: refactor towards round robin
This commit is contained in:
parent
236467535a
commit
374a288a9d
@ -481,6 +481,8 @@ static void att_server_handle_can_send_now(void){
|
|||||||
|
|
||||||
// process all server requests
|
// process all server requests
|
||||||
btstack_linked_list_iterator_t it;
|
btstack_linked_list_iterator_t it;
|
||||||
|
hci_con_handle_t request_con_handle = HCI_CON_HANDLE_INVALID;
|
||||||
|
while (1){
|
||||||
hci_connections_get_iterator(&it);
|
hci_connections_get_iterator(&it);
|
||||||
while(btstack_linked_list_iterator_has_next(&it)){
|
while(btstack_linked_list_iterator_has_next(&it)){
|
||||||
hci_connection_t * connection = (hci_connection_t *) btstack_linked_list_iterator_next(&it);
|
hci_connection_t * connection = (hci_connection_t *) btstack_linked_list_iterator_next(&it);
|
||||||
@ -496,8 +498,16 @@ static void att_server_handle_can_send_now(void){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Exit loop, if we cannot send
|
||||||
|
if (!can_send_now) break;
|
||||||
|
|
||||||
|
// Exit loop, if we can send but there are also no further request
|
||||||
|
if (request_con_handle == HCI_CON_HANDLE_INVALID) break;
|
||||||
|
|
||||||
|
// Finally, if we still can send and there are requests, just try again
|
||||||
|
request_con_handle = HCI_CON_HANDLE_INVALID;
|
||||||
|
}
|
||||||
|
|
||||||
hci_con_handle_t request_con_handle = HCI_CON_HANDLE_INVALID;
|
|
||||||
while (1){
|
while (1){
|
||||||
hci_connections_get_iterator(&it);
|
hci_connections_get_iterator(&it);
|
||||||
while(btstack_linked_list_iterator_has_next(&it)){
|
while(btstack_linked_list_iterator_has_next(&it)){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user