forked from project-chip/connectedhomeip
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for terms and conditions check and enhanced setup flow
This commit adds support for terms and conditions (TC) check and enhances the setup flow as part of the Connected Home over IP (CHIP) Specification 1.4. Changes include: - Extended support for terms and conditions check and enhanced setup flow feature as part of the connectedhomeip spec 1.4. - Added functionality to retrieve and store Terms and Conditions (TC) information, including accepted version, minimum required version, acknowledgements, and required acknowledgements. - Implemented methods in `TermsAndConditionsManager` to handle TC versioning and acknowledgements. - Updated `GeneralCommissioningAttrAccess` to include support for reading TC-related attributes. - Added callback functions in `emberAfGeneralCommissioningCluster` to handle TC acknowledgements during commissioning. - Integrated `TermsAndConditionsManager` into the server context for managing TC-related information. - Enhanced error handling and logging for TC-related operations. - Adjusted build configuration to include default values for TC versioning and acknowledgements. - Expanded configuration management in `ConfigurationManagerImpl` to handle TC-related configuration keys. - Updated `PosixConfig` to include configuration keys for TC-related information. - Implemented default values for TC versioning and acknowledgements in `ConfigurationManagerImpl`.
- Loading branch information
1 parent
5a7421f
commit 9b47123
Showing
14 changed files
with
326 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
#include "TermsAndConditionsManager.h" | ||
|
||
#include <platform/ConfigurationManager.h> | ||
|
||
CHIP_ERROR chip::app::TermsAndConditionsManager::GetTCAcceptedVersion(uint16_t & value) | ||
{ | ||
CHIP_ERROR err = CHIP_NO_ERROR; | ||
|
||
err = DeviceLayer::ConfigurationMgr().GetTCAcceptedVersion(value); | ||
SuccessOrExit(err); | ||
|
||
exit: | ||
if (err != CHIP_NO_ERROR) | ||
{ | ||
ChipLogError(DeviceLayer, "GetTCAcceptedVersion failed with error: %s", ErrorStr(err)); | ||
} | ||
return err; | ||
} | ||
|
||
CHIP_ERROR chip::app::TermsAndConditionsManager::GetTCMinRequiredVersion(uint16_t & value) | ||
{ | ||
CHIP_ERROR err = CHIP_NO_ERROR; | ||
|
||
err = DeviceLayer::ConfigurationMgr().GetTCMinRequiredVersion(value); | ||
SuccessOrExit(err); | ||
|
||
exit: | ||
if (err != CHIP_NO_ERROR) | ||
{ | ||
ChipLogError(DeviceLayer, "GetTCMinRequiredVersion failed with error: %s", ErrorStr(err)); | ||
} | ||
return err; | ||
} | ||
|
||
CHIP_ERROR chip::app::TermsAndConditionsManager::GetTCAcknowledgements(uint16_t & value) | ||
{ | ||
CHIP_ERROR err = CHIP_NO_ERROR; | ||
|
||
err = DeviceLayer::ConfigurationMgr().GetTCAcknowledgements(value); | ||
SuccessOrExit(err); | ||
|
||
exit: | ||
if (err != CHIP_NO_ERROR) | ||
{ | ||
ChipLogError(DeviceLayer, "GetTCAcknowledgements failed with error: %s", ErrorStr(err)); | ||
} | ||
return err; | ||
} | ||
|
||
CHIP_ERROR chip::app::TermsAndConditionsManager::GetTCAcknowledgementsRequired(uint16_t & value) | ||
{ | ||
CHIP_ERROR err = CHIP_NO_ERROR; | ||
|
||
err = DeviceLayer::ConfigurationMgr().GetTCAcknowledgementsRequired(value); | ||
SuccessOrExit(err); | ||
|
||
exit: | ||
if (err != CHIP_NO_ERROR) | ||
{ | ||
ChipLogError(DeviceLayer, "GetTCAcknowledgementsRequired failed with error: %s", ErrorStr(err)); | ||
} | ||
return err; | ||
} | ||
|
||
CHIP_ERROR chip::app::TermsAndConditionsManager::SetTCAcknowledgements(uint16_t tcVersion, uint16_t tcUserResponse) | ||
{ | ||
CHIP_ERROR err = CHIP_NO_ERROR; | ||
|
||
err = DeviceLayer::ConfigurationMgr().StoreTCAcknowledgements(tcVersion, tcUserResponse); | ||
SuccessOrExit(err); | ||
|
||
exit: | ||
if (err != CHIP_NO_ERROR) | ||
{ | ||
ChipLogError(DeviceLayer, "SetTCAcknowledgements failed with error: %s", ErrorStr(err)); | ||
} | ||
return err; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#pragma once | ||
|
||
#include <stdint.h> | ||
|
||
#include <lib/core/CHIPError.h> | ||
|
||
namespace chip { | ||
namespace app { | ||
|
||
class TermsAndConditionsManager { | ||
public: | ||
CHIP_ERROR GetTCAcceptedVersion(uint16_t &value); | ||
CHIP_ERROR GetTCMinRequiredVersion(uint16_t &value); | ||
CHIP_ERROR GetTCAcknowledgements(uint16_t &value); | ||
CHIP_ERROR GetTCAcknowledgementsRequired(uint16_t &value); | ||
CHIP_ERROR SetTCAcknowledgements(uint16_t tcVersion, uint16_t tcUserResponse); | ||
}; | ||
|
||
}; // namespace app | ||
}; // namespace chip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.