switch order of checks to avoid irritating log output '... handle 0x0 not in connection list'

This commit is contained in:
Matthias Ringwald 2015-08-26 12:42:37 +02:00
parent 264e3be687
commit 77aee70f56

View File

@ -227,8 +227,8 @@ 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_for_handle(channel->handle)) return;
if (channel->state != L2CAP_STATE_OPEN) continue;
if (!hci_number_free_acl_slots_for_handle(channel->handle)) return;
if (hci_number_outgoing_packets(channel->handle) < NR_BUFFERED_ACL_PACKETS && channel->packets_granted == 0) {
l2cap_emit_credits(channel, 1);
}