att_dispatch: avoid infinite recursion if no packet handler defined and can send now gets requested (which is not correct)

This commit is contained in:
Matthias Ringwald 2018-03-12 15:39:25 +01:00
parent 85847a9dce
commit 98cc33c4b3

View File

@ -90,7 +90,7 @@ static void att_packet_handler(uint8_t packet_type, uint16_t handle, uint8_t *pa
// check if more can send now events are needed
if (!can_send_now_pending){
for (i = 0; i < ATT_MAX; i++){
if (subscriptions[i].waiting_for_can_send){
if (subscriptions[index].packet_handler && subscriptions[index].waiting_for_can_send){
can_send_now_pending = 1;
// note: con_handle is not used, so we can pass in anything
l2cap_request_can_send_fix_channel_now_event(0, L2CAP_CID_ATTRIBUTE_PROTOCOL);