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

feat: extend GattClient interface with enable/disable indication/notification #447

Merged
merged 3 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if (HALST_STANDALONE)
FetchContent_Declare(
emil
GIT_REPOSITORY https://github.com/philips-software/amp-embedded-infra-lib.git
GIT_TAG 28ef5f86cf50a4b0d00207d7484f2332d1f7c024 # unreleased
GIT_TAG e110c4d31115e2ae14e91bbc40f9cf0f4fa3cb7c # unreleased
)
FetchContent_MakeAvailable(emil)

Expand Down
14 changes: 6 additions & 8 deletions hal_st/middlewares/ble_middleware/GattClientSt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,14 +304,12 @@ namespace hal

really_assert(gattIndicationEvent.Connection_Handle == connectionHandle);

infra::Subject<services::GattClientStackUpdateObserver>::NotifyObservers([&gattIndicationEvent, &data](auto& observer)
infra::Subject<services::GattClientStackUpdateObserver>::NotifyObservers([this, &gattIndicationEvent, &data](auto& observer)
{
observer.UpdateReceived(gattIndicationEvent.Attribute_Handle, data);
});

infra::EventDispatcherWithWeakPtr::Instance().Schedule([this, &gattIndicationEvent]()
{
this->HandleGattConfirmIndication(gattIndicationEvent.Attribute_Handle);
observer.IndicationReceived(gattIndicationEvent.Attribute_Handle, data, [this, &gattIndicationEvent]()
{
this->HandleGattConfirmIndication(gattIndicationEvent.Attribute_Handle);
});
});
}

Expand All @@ -325,7 +323,7 @@ namespace hal

infra::Subject<services::GattClientStackUpdateObserver>::NotifyObservers([&gattNotificationEvent, &data](auto& observer)
{
observer.UpdateReceived(gattNotificationEvent.Attribute_Handle, data);
observer.NotificationReceived(gattNotificationEvent.Attribute_Handle, data);
});
}

Expand Down
Loading