Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: gap central connection flow #483

Merged
merged 2 commits into from
Jan 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading