mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-16 08:42:28 +00:00
Allways call bnep_run() in bnep_hci_event_handler(). Even if the incomming event
if unknown. Otherwise package handling could stop
This commit is contained in:
parent
fe4751381e
commit
98f09fd9b8
@ -959,7 +959,7 @@ static int bnep_hci_event_handler(uint8_t *packet, uint16_t size)
|
|||||||
if (READ_BT_16(packet, 11) != PSM_BNEP) {
|
if (READ_BT_16(packet, 11) != PSM_BNEP) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
status = packet[2];
|
status = packet[2];
|
||||||
log_info("L2CAP_EVENT_CHANNEL_OPENED for PSM_BNEP, status %u", status);
|
log_info("L2CAP_EVENT_CHANNEL_OPENED for PSM_BNEP, status %u", status);
|
||||||
|
|
||||||
@ -972,7 +972,7 @@ static int bnep_hci_event_handler(uint8_t *packet, uint16_t size)
|
|||||||
log_error("L2CAP_EVENT_CHANNEL_OPENED but no BNEP channel prepared");
|
log_error("L2CAP_EVENT_CHANNEL_OPENED but no BNEP channel prepared");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* On L2CAP open error discard everything */
|
/* On L2CAP open error discard everything */
|
||||||
if (status) {
|
if (status) {
|
||||||
/* Emit bnep_open_channel_complete with status and free channel */
|
/* Emit bnep_open_channel_complete with status and free channel */
|
||||||
@ -982,7 +982,7 @@ static int bnep_hci_event_handler(uint8_t *packet, uint16_t size)
|
|||||||
bnep_channel_free(channel);
|
bnep_channel_free(channel);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (channel->state == BNEP_CHANNEL_STATE_CLOSED) {
|
if (channel->state == BNEP_CHANNEL_STATE_CLOSED) {
|
||||||
log_info("L2CAP_EVENT_CHANNEL_OPENED: outgoing connection");
|
log_info("L2CAP_EVENT_CHANNEL_OPENED: outgoing connection");
|
||||||
|
|
||||||
@ -996,7 +996,7 @@ static int bnep_hci_event_handler(uint8_t *packet, uint16_t size)
|
|||||||
channel->max_frame_size = bnep_max_frame_size_for_l2cap_mtu(READ_BT_16(packet, 17));
|
channel->max_frame_size = bnep_max_frame_size_for_l2cap_mtu(READ_BT_16(packet, 17));
|
||||||
bnep_run();
|
bnep_run();
|
||||||
} else {
|
} else {
|
||||||
log_info("L2CAP_EVENT_CHANNEL_OPENED: Instalid state: %d", channel->state);
|
log_info("L2CAP_EVENT_CHANNEL_OPENED: Invalid state: %d", channel->state);
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
break;
|
break;
|
||||||
@ -1027,6 +1027,7 @@ static int bnep_hci_event_handler(uint8_t *packet, uint16_t size)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
bnep_run();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user