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

Add APIs to access default SessionKeystore & PersistentStorageDelegate #36566

Merged
merged 2 commits into from
Nov 20, 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
10 changes: 10 additions & 0 deletions examples/platform/linux/CommissionerMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,4 +457,14 @@ CommissionerDiscoveryController * GetCommissionerDiscoveryController()
return &gCommissionerDiscoveryController;
}

SessionKeystore * GetSessionKeystore()
{
return &gSessionKeystore;
}

PersistentStorageDelegate * GetPersistentStorageDelegate()
{
return &gServerStorage;
}

#endif // CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE
4 changes: 4 additions & 0 deletions examples/platform/linux/CommissionerMain.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@

#if CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE

using chip::PersistentStorageDelegate;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please refrain from using using declarations like this in header files.

using chip::Controller::DeviceCommissioner;
using chip::Crypto::SessionKeystore;
using chip::Transport::PeerAddress;

CHIP_ERROR CommissionerPairOnNetwork(uint32_t pincode, uint16_t disc, PeerAddress address);
Expand All @@ -39,5 +41,7 @@ void ShutdownCommissioner();

DeviceCommissioner * GetDeviceCommissioner();
CommissionerDiscoveryController * GetCommissionerDiscoveryController();
SessionKeystore * GetSessionKeystore();
PersistentStorageDelegate * GetPersistentStorageDelegate();

#endif // CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE
Loading