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.
Created Terms and Conditions Provider opposed to ConfigurationManager
- Loading branch information
1 parent
d9aa750
commit 210c14f
Showing
15 changed files
with
211 additions
and
129 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* | ||
* Copyright (c) 2024 Project CHIP Authors | ||
* All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#include "EnhancedSetupFlowProvider.h" |
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,39 @@ | ||
/* | ||
* | ||
* Copyright (c) 2024 Project CHIP Authors | ||
* All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <stdint.h> | ||
|
||
#include <lib/core/CHIPError.h> | ||
|
||
namespace chip { | ||
namespace app { | ||
|
||
class EnhancedSetupFlowProvider | ||
{ | ||
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 StoreTCAcknowledgements(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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* | ||
* Copyright (c) 2024 Project CHIP Authors | ||
* All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#include "TermsAndConditionsProvider.h" | ||
|
||
#include "core/CHIPBuildConfig.h" | ||
|
||
chip::app::TermsAndConditionsProvider::TermsAndConditionsProvider() : | ||
mTermsAndConditionsAcceptedVersion(0), mTermsAndConditionsAcknowledgements(0) | ||
{} | ||
|
||
CHIP_ERROR chip::app::TermsAndConditionsProvider::GetTCAcceptedVersion(uint16_t & value) | ||
{ | ||
value = mTermsAndConditionsAcceptedVersion; | ||
return CHIP_NO_ERROR; | ||
} | ||
|
||
CHIP_ERROR chip::app::TermsAndConditionsProvider::GetTCMinRequiredVersion(uint16_t & value) | ||
{ | ||
value = CHIP_CONFIG_TC_REQUIRED_VERSION; | ||
return CHIP_NO_ERROR; | ||
} | ||
|
||
CHIP_ERROR chip::app::TermsAndConditionsProvider::GetTCAcknowledgements(uint16_t & value) | ||
{ | ||
value = mTermsAndConditionsAcknowledgements; | ||
return CHIP_NO_ERROR; | ||
} | ||
|
||
CHIP_ERROR chip::app::TermsAndConditionsProvider::GetTCAcknowledgementsRequired(uint16_t & value) | ||
{ | ||
value = CHIP_CONFIG_TC_REQUIRED_ACKNOWLEDGEMENTS; | ||
return CHIP_NO_ERROR; | ||
} | ||
|
||
CHIP_ERROR chip::app::TermsAndConditionsProvider::SetTCAcknowledgements(uint16_t tcVersion, uint16_t tcUserResponse) | ||
{ | ||
mTermsAndConditionsAcceptedVersion = tcVersion; | ||
mTermsAndConditionsAcknowledgements = tcUserResponse; | ||
return CHIP_NO_ERROR; | ||
} |
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,44 @@ | ||
/* | ||
* | ||
* Copyright (c) 2024 Project CHIP Authors | ||
* All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <stdint.h> | ||
|
||
#include <lib/core/CHIPError.h> | ||
|
||
namespace chip { | ||
namespace app { | ||
|
||
class TermsAndConditionsProvider | ||
{ | ||
public: | ||
TermsAndConditionsProvider(); | ||
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); | ||
|
||
private: | ||
uint16_t mTermsAndConditionsAcceptedVersion; | ||
uint16_t mTermsAndConditionsAcknowledgements; | ||
}; | ||
|
||
}; // 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
Oops, something went wrong.