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.
Terms and Conditions functional check during CompleteCommissioning
This update improves the robustness of the commissioning process by enforcing the acceptance of required terms and conditions before commissioning can be completed, addressing potential legal and compliance issues. - Refactored the GeneralCommissioningServer to use a more robust method for checking terms and conditions acceptance before commissioning is considered complete. - Added methods for retrieving and setting terms and conditions versions and acknowledgments. - Updated the handling logic to check both the acknowledged versions against the minimum required versions and whether all required acknowledgments have been met before proceeding. - Introduced a TermsAndConditionsManager class that centralizes the management of terms and conditions related data. - Simplified related methods in DeviceControlServer to use the new manager class, ensuring all terms and conditions related operations are consistent and centralized.
- Loading branch information
1 parent
ecb5109
commit c01394d
Showing
7 changed files
with
124 additions
and
66 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 |
---|---|---|
@@ -1,20 +1,78 @@ | ||
#include "TermsAndConditionsManager.h" | ||
|
||
CHIP_ERROR chip::app::TermsAndConditionsManager::SetTCAcknowledgements(uint16_t tcVersion, uint16_t tcUserResponse) | ||
#include <platform/ConfigurationManager.h> | ||
|
||
CHIP_ERROR chip::app::TermsAndConditionsManager::GetTCAcceptedVersion(uint16_t & value) | ||
{ | ||
CHIP_ERROR err = CHIP_NO_ERROR; | ||
|
||
err = ConfigurationMgr().StoreTCAcknowledgements(tcVersion, tcUserResponse); | ||
err = DeviceLayer::ConfigurationMgr().GetTCAcceptedVersion(value); | ||
SuccessOrExit(err); | ||
|
||
exit: | ||
if (err != CHIP_NO_ERROR) | ||
{ | ||
ChipLogError(DeviceLayer, "SetTCAcknowledgements failed with error: %s", ErrorStr(err)); | ||
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; | ||
} | ||
|
||
bool chip::app::TermsAndConditionsManager::HasRequiredTermsAndConditionsBeenAcknowledged() { | ||
return false; | ||
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
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