@@ -287,21 +287,10 @@ bool emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback(app::CommandH
287
287
DeviceControlServer * server = &DeviceLayer::DeviceControlServer::DeviceControlSvr ();
288
288
Commands::SetRegulatoryConfigResponse::Type response;
289
289
290
- auto & countryCode = commandData.countryCode ;
291
- bool isValidLength = countryCode.size () == DeviceLayer::ConfigurationManager::kMaxLocationLength ;
292
- if (!isValidLength)
293
- {
294
- ChipLogError (Zcl, " Invalid country code: '%.*s'" , static_cast <int >(countryCode.size ()), countryCode.data ());
295
- commandObj->AddStatus (commandPath, Protocols::InteractionModel::Status::ConstraintError);
296
- return true ;
297
- }
298
-
299
290
if (commandData.newRegulatoryConfig > RegulatoryLocationTypeEnum::kIndoorOutdoor )
300
291
{
301
292
response.errorCode = CommissioningErrorEnum::kValueOutsideRange ;
302
- // TODO: How does using the country code in debug text make sense, if
303
- // the real issue is the newRegulatoryConfig value?
304
- response.debugText = countryCode;
293
+ response.debugText = commandData.countryCode ;
305
294
}
306
295
else
307
296
{
@@ -315,13 +304,11 @@ bool emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback(app::CommandH
315
304
if ((locationCapability != to_underlying (RegulatoryLocationTypeEnum::kIndoorOutdoor )) && (location != locationCapability))
316
305
{
317
306
response.errorCode = CommissioningErrorEnum::kValueOutsideRange ;
318
- // TODO: How does using the country code in debug text make sense, if
319
- // the real issue is the newRegulatoryConfig value?
320
- response.debugText = countryCode;
307
+ response.debugText = commandData.countryCode ;
321
308
}
322
309
else
323
310
{
324
- CheckSuccess (server->SetRegulatoryConfig (location, countryCode), Failure);
311
+ CheckSuccess (server->SetRegulatoryConfig (location, commandData. countryCode ), Failure);
325
312
Breadcrumb::Set (commandPath.mEndpointId , commandData.breadcrumb );
326
313
response.errorCode = CommissioningErrorEnum::kOk ;
327
314
}
0 commit comments