Skip to content

Commit

Permalink
CHIPDevice: add access to ExchangeManager, fix SessionHandle getter (#…
Browse files Browse the repository at this point in the history
…9734)

* add access to ExchangeManager

* fix other references of GetSecureSession()
  • Loading branch information
holbrookt authored and pull[bot] committed Sep 17, 2021
1 parent 458fe47 commit c1c90fb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/controller/CHIPDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,8 @@ CHIP_ERROR Device::SendSubscribeAttributeRequest(app::AttributePathParams aPath,

// The application context is used to identify different requests from client application the type of it is intptr_t, here we
// use the seqNum.
app::ReadPrepareParams params(GetSecureSession());
VerifyOrReturnError(GetSecureSession().HasValue(), CHIP_ERROR_INCORRECT_STATE);
app::ReadPrepareParams params(GetSecureSession().Value());
params.mpAttributePathParamsList = path;
params.mAttributePathParamsListSize = 1;
params.mMinIntervalFloorSeconds = mMinIntervalFloorSeconds;
Expand Down
4 changes: 3 additions & 1 deletion src/controller/CHIPDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,9 @@ class DLL_EXPORT Device : public Messaging::ExchangeDelegate, public SessionEsta

bool MatchesSession(SessionHandle session) const { return mSecureSession.HasValue() && mSecureSession.Value() == session; }

SessionHandle GetSecureSession() const { return mSecureSession.Value(); }
chip::Optional<SessionHandle> GetSecureSession() const { return mSecureSession; }

Messaging::ExchangeManager * GetExchangeManager() const { return mExchangeMgr; }

void SetAddress(const Inet::IPAddress & deviceAddr) { mDeviceAddress.SetIPAddress(deviceAddr); }

Expand Down

0 comments on commit c1c90fb

Please sign in to comment.