Skip to content

Commit

Permalink
chore: gap central connection flow (#483)
Browse files Browse the repository at this point in the history
fix gap central connection flow to be compatible between wb5x, wba5x and wba6x
  • Loading branch information
gabrielsantosphilips authored Jan 15, 2025
1 parent b4a534b commit 4a2b778
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions hal_st/middlewares/ble_middleware/GapCentralSt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,11 @@ namespace hal

auto gattCompleteEvent = *reinterpret_cast<aci_gatt_proc_complete_event_rp0*>(vendorEvent->data);

if (onMtuExchangeDone && gattCompleteEvent.Error_Code == BLE_STATUS_SUCCESS)
{
if (gattCompleteEvent.Error_Code == BLE_STATUS_SUCCESS)
really_assert(gattCompleteEvent.Connection_Handle == connectionContext.connectionHandle);

if (onMtuExchangeDone)
onMtuExchangeDone();
}
}

void GapCentralSt::HandleL2capConnectionUpdateRequestEvent(evt_blecore_aci* vendorEvent)
Expand All @@ -187,10 +187,13 @@ namespace hal
assert(status == BLE_STATUS_SUCCESS);
});

infra::EventDispatcherWithWeakPtr::Instance().Schedule([this]()
{
MtuExchange();
});
if (onMtuExchangeDone)
infra::EventDispatcherWithWeakPtr::Instance().Schedule([this]()
{
MtuExchange();
});
else
SetDataLength();
}

void GapCentralSt::HandleHciLeDataLengthChangeEvent(evt_le_meta_event* metaEvent)
Expand Down

0 comments on commit 4a2b778

Please sign in to comment.