replace hci_number_free_acl_slots with hci_number_free_acl_slots_for_handle

This commit is contained in:
matthias.ringwald@gmail.com 2014-08-14 13:06:29 +00:00
parent d713a683b2
commit e79abdd605
3 changed files with 4 additions and 4 deletions

View File

@ -241,7 +241,7 @@ uint8_t hci_number_outgoing_packets(hci_con_handle_t handle){
return connection->num_acl_packets_sent;
}
uint8_t hci_number_free_acl_slots(){
uint8_t hci_number_free_acl_slots_for_handle(hci_con_handle_t con_handle){
uint8_t free_slots = hci_stack->total_num_acl_packets;
linked_item_t *it;
for (it = (linked_item_t *) hci_stack->connections; it ; it = it->next){
@ -306,7 +306,7 @@ int hci_can_send_prepared_acl_packet_now(hci_con_handle_t con_handle) {
return 0;
}
}
return hci_number_free_acl_slots() > 0;
return hci_number_free_acl_slots_for_handle(con_handle) > 0;
}
int hci_can_send_acl_packet_now(hci_con_handle_t con_handle){

View File

@ -477,7 +477,7 @@ hci_connection_t * hci_connection_for_handle(hci_con_handle_t con_handle);
hci_connection_t * hci_connection_for_bd_addr_and_type(bd_addr_t *addr, bd_addr_type_t addr_type);
int hci_is_le_connection(hci_connection_t * connection);
uint8_t hci_number_outgoing_packets(hci_con_handle_t handle);
uint8_t hci_number_free_acl_slots(void);
uint8_t hci_number_free_acl_slots_for_handle(hci_con_handle_t con_handle);
int hci_authentication_active_for_handle(hci_con_handle_t handle);
uint16_t hci_max_acl_data_packet_length(void);
uint16_t hci_usable_acl_packet_types(void);

View File

@ -220,7 +220,7 @@ void l2cap_hand_out_credits(void){
linked_list_iterator_init(&it, &l2cap_channels);
while (linked_list_iterator_has_next(&it)){
l2cap_channel_t * channel = (l2cap_channel_t *) linked_list_iterator_next(&it);
if (!hci_number_free_acl_slots()) return;
if (!hci_number_free_acl_slots_for_handle(channel->handle)) return;
if (channel->state != L2CAP_STATE_OPEN) continue;
if (hci_number_outgoing_packets(channel->handle) < NR_BUFFERED_ACL_PACKETS && channel->packets_granted == 0) {
l2cap_emit_credits(channel, 1);