Skip to content

Commit

Permalink
Add APIs to access default SessionKeystore & PersistentStorageDelegate (
Browse files Browse the repository at this point in the history
#36566)

* Add APIs to access default SessionKeystore & PersistentStorageDelegate

* Restyled by whitespace

---------

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
yufengwangca and restyled-commits authored Nov 20, 2024
1 parent e19ac85 commit c197bc2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
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;
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

0 comments on commit c197bc2

Please sign in to comment.