Skip to content

Commit

Permalink
feat: extend GattClient interface with enable/disable indication/noti…
Browse files Browse the repository at this point in the history
…fication (#447)

* feat: extend GattClient interface with enable/disable indication/notification

* Update amp-embedded-infra-lib
  • Loading branch information
richardapeters authored Nov 4, 2024
1 parent 1d0b6a2 commit 62be185
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
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

0 comments on commit 62be185

Please sign in to comment.