Skip to content

Commit e80c0fa

Browse files
swan-amazoncecille
authored andcommitted
Remove [commissioner] redundant TC acknowledgement flag (project-chip#36966)
* Remove [commissioner] redundant TC acknowledgement flag The flag controlling whether to require TC acknowledgement is no longer needed since TC acceptance is now a mandatory pre-condition for commissioning. This flag was originally added to support delayed TC acceptance during the commissioning process, but since that flow has been removed, the flag serves no purpose. The TC acknowledgement state itself is still required and maintained, but the additional boolean flag controlling the requirement is redundant and can be safely removed.
1 parent 44201b4 commit e80c0fa

File tree

7 files changed

+1
-47
lines changed

7 files changed

+1
-47
lines changed

examples/chip-tool/commands/pairing/PairingCommand.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,6 @@ CommissioningParameters PairingCommand::GetCommissioningParameters()
129129
params.SetCountryCode(CharSpan::fromCharString(mCountryCode.Value()));
130130
}
131131

132-
// Default requiring TCs to false, to preserve release 1.3 chip-tool behavior
133-
params.SetRequireTermsAndConditionsAcknowledgement(mRequireTCAcknowledgements.ValueOr(false));
134-
135132
// mTCAcknowledgements and mTCAcknowledgementVersion are optional, but related. When one is missing, default the value to 0, to
136133
// increase the test tools ability to test the applications.
137134
if (mTCAcknowledgements.HasValue() || mTCAcknowledgementVersion.HasValue())

examples/chip-tool/commands/pairing/PairingCommand.h

-6
Original file line numberDiff line numberDiff line change
@@ -203,11 +203,6 @@ class PairingCommand : public CHIPCommand,
203203
"DSTOffset list to use when setting Time Synchronization cluster's DSTOffset attribute",
204204
Argument::kOptional);
205205

206-
AddArgument("require-tc-acknowledgements", 0, 1, &mRequireTCAcknowledgements,
207-
"Indicates whether Terms and Conditions acknowledgements are required during commissioning. If set to "
208-
"true, the tc-acknowledgements and tc-acknowledgements-version arguments must be provided for the "
209-
"commissioning to succeed. If false, the T&C acknowledgement step will be skipped.");
210-
211206
AddArgument("tc-acknowledgements", 0, UINT16_MAX, &mTCAcknowledgements,
212207
"Bit-field value indicating which Terms and Conditions have been accepted by the user. This value is sent "
213208
"to the device during commissioning via the General Commissioning cluster");
@@ -272,7 +267,6 @@ class PairingCommand : public CHIPCommand,
272267
chip::Optional<uint64_t> mICDMonitoredSubject;
273268
chip::Optional<chip::app::Clusters::IcdManagement::ClientTypeEnum> mICDClientType;
274269
chip::Optional<uint32_t> mICDStayActiveDurationMsec;
275-
chip::Optional<bool> mRequireTCAcknowledgements;
276270
chip::Optional<uint16_t> mTCAcknowledgements;
277271
chip::Optional<uint16_t> mTCAcknowledgementVersion;
278272
chip::app::DataModel::List<chip::app::Clusters::TimeSynchronization::Structs::TimeZoneStruct::Type> mTimeZoneList;

src/controller/CHIPDeviceController.cpp

+1-8
Original file line numberDiff line numberDiff line change
@@ -3179,20 +3179,13 @@ void DeviceCommissioner::PerformCommissioningStep(DeviceProxy * proxy, Commissio
31793179
case CommissioningStage::kConfigureTCAcknowledgments: {
31803180
ChipLogProgress(Controller, "Setting Terms and Conditions");
31813181

3182-
if (!params.GetRequireTermsAndConditionsAcknowledgement())
3182+
if (!params.GetTermsAndConditionsAcknowledgement().HasValue())
31833183
{
31843184
ChipLogProgress(Controller, "Setting Terms and Conditions: Skipped");
31853185
CommissioningStageComplete(CHIP_NO_ERROR);
31863186
return;
31873187
}
31883188

3189-
if (!params.GetTermsAndConditionsAcknowledgement().HasValue())
3190-
{
3191-
ChipLogError(Controller, "No acknowledgements provided");
3192-
CommissioningStageComplete(CHIP_ERROR_INCORRECT_STATE);
3193-
return;
3194-
}
3195-
31963189
GeneralCommissioning::Commands::SetTCAcknowledgements::Type request;
31973190
TermsAndConditionsAcknowledgement termsAndConditionsAcknowledgement = params.GetTermsAndConditionsAcknowledgement().Value();
31983191
request.TCUserResponse = termsAndConditionsAcknowledgement.acceptedTermsAndConditions;

src/controller/CommissioningDelegate.h

-9
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,6 @@ class CommissioningParameters
175175
// The country code to be used for the node, if set.
176176
Optional<CharSpan> GetCountryCode() const { return mCountryCode; }
177177

178-
bool GetRequireTermsAndConditionsAcknowledgement() const { return mRequireTermsAndConditionsAcknowledgement; }
179-
180178
Optional<TermsAndConditionsAcknowledgement> GetTermsAndConditionsAcknowledgement() const
181179
{
182180
return mTermsAndConditionsAcknowledgement;
@@ -354,12 +352,6 @@ class CommissioningParameters
354352
return *this;
355353
}
356354

357-
CommissioningParameters & SetRequireTermsAndConditionsAcknowledgement(bool requireTermsAndConditionsAcknowledgement)
358-
{
359-
mRequireTermsAndConditionsAcknowledgement = requireTermsAndConditionsAcknowledgement;
360-
return *this;
361-
}
362-
363355
CommissioningParameters &
364356
SetTermsAndConditionsAcknowledgement(TermsAndConditionsAcknowledgement termsAndConditionsAcknowledgement)
365357
{
@@ -671,7 +663,6 @@ class CommissioningParameters
671663
Optional<uint32_t> mICDStayActiveDurationMsec;
672664
ICDRegistrationStrategy mICDRegistrationStrategy = ICDRegistrationStrategy::kIgnore;
673665
bool mCheckForMatchingFabric = false;
674-
bool mRequireTermsAndConditionsAcknowledgement = false;
675666
};
676667

677668
struct RequestedCertificate

src/controller/python/ChipDeviceController-ScriptBinding.cpp

-8
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,6 @@ PyChipError pychip_DeviceController_OpenCommissioningWindow(chip::Controller::De
182182
bool pychip_DeviceController_GetIPForDiscoveredDevice(chip::Controller::DeviceCommissioner * devCtrl, int idx, char * addrStr,
183183
uint32_t len);
184184

185-
PyChipError pychip_DeviceController_SetRequireTermsAndConditionsAcknowledgement(bool tcRequired);
186-
187185
PyChipError pychip_DeviceController_SetTermsAcknowledgements(uint16_t tcVersion, uint16_t tcUserResponse);
188186

189187
PyChipError pychip_DeviceController_SetSkipCommissioningComplete(bool skipCommissioningComplete);
@@ -576,12 +574,6 @@ PyChipError pychip_DeviceController_SetDefaultNtp(const char * defaultNTP)
576574
return ToPyChipError(CHIP_NO_ERROR);
577575
}
578576

579-
PyChipError pychip_DeviceController_SetRequireTermsAndConditionsAcknowledgement(bool tcRequired)
580-
{
581-
sCommissioningParameters.SetRequireTermsAndConditionsAcknowledgement(tcRequired);
582-
return ToPyChipError(CHIP_NO_ERROR);
583-
}
584-
585577
PyChipError pychip_DeviceController_SetTermsAcknowledgements(uint16_t tcVersion, uint16_t tcUserResponse)
586578
{
587579
sCommissioningParameters.SetTermsAndConditionsAcknowledgement(

src/controller/python/chip/ChipDeviceCtrl.py

-10
Original file line numberDiff line numberDiff line change
@@ -1977,9 +1977,6 @@ def _InitLib(self):
19771977
self._dmLib.pychip_DeviceController_SetSkipCommissioningComplete.restype = PyChipError
19781978
self._dmLib.pychip_DeviceController_SetSkipCommissioningComplete.argtypes = [c_bool]
19791979

1980-
self._dmLib.pychip_DeviceController_SetRequireTermsAndConditionsAcknowledgement.restype = PyChipError
1981-
self._dmLib.pychip_DeviceController_SetRequireTermsAndConditionsAcknowledgement.argtypes = [c_bool]
1982-
19831980
self._dmLib.pychip_DeviceController_SetTermsAcknowledgements.restype = PyChipError
19841981
self._dmLib.pychip_DeviceController_SetTermsAcknowledgements.argtypes = [c_uint16, c_uint16]
19851982

@@ -2111,13 +2108,6 @@ def SetDSTOffset(self, offset: int, validStarting: int, validUntil: int):
21112108
lambda: self._dmLib.pychip_DeviceController_SetDSTOffset(offset, validStarting, validUntil)
21122109
).raise_on_error()
21132110

2114-
def SetTCRequired(self, tcRequired: bool):
2115-
''' Set whether TC Acknowledgements should be set during commissioning'''
2116-
self.CheckIsActive()
2117-
self._ChipStack.Call(
2118-
lambda: self._dmLib.pychip_DeviceController_SetRequireTermsAndConditionsAcknowledgement(tcRequired)
2119-
).raise_on_error()
2120-
21212111
def SetTCAcknowledgements(self, tcAcceptedVersion: int, tcUserResponse: int):
21222112
''' Set the TC acknowledgements to set during commissioning'''
21232113
self.CheckIsActive()

src/python_testing/matter_testing_support.py

-3
Original file line numberDiff line numberDiff line change
@@ -2243,9 +2243,6 @@ async def commission_device(instance: MatterBaseTest, i) -> bool:
22432243
logging.debug(
22442244
f"Setting TC Acknowledgements to version {conf.tc_version_to_simulate} with user response {conf.tc_user_response_to_simulate}.")
22452245
dev_ctrl.SetTCAcknowledgements(conf.tc_version_to_simulate, conf.tc_user_response_to_simulate)
2246-
dev_ctrl.SetTCRequired(True)
2247-
else:
2248-
dev_ctrl.SetTCRequired(False)
22492246

22502247
if conf.commissioning_method == "on-network":
22512248
try:

0 commit comments

Comments
 (0)