Skip to content

Commit

Permalink
Remove EMBER_ZCL_STATUS_INVALID_VALUE
Browse files Browse the repository at this point in the history
  • Loading branch information
vivien-apple committed Dec 7, 2022
1 parent 39a7700 commit 2ceb2cc
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ bool emberAfBarrierControlClusterBarrierControlGoToPercentCallback(
percentOpen != EMBER_ZCL_BARRIER_CONTROL_BARRIER_POSITION_CLOSED &&
percentOpen != EMBER_ZCL_BARRIER_CONTROL_BARRIER_POSITION_OPEN))
{
status = EMBER_ZCL_STATUS_INVALID_VALUE;
status = EMBER_ZCL_STATUS_CONSTRAINT_ERROR;
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/app/clusters/groups-server/groups-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ bool emberAfGroupsClusterViewGroupCallback(app::CommandHandler * commandObj, con
CHIP_ERROR err = CHIP_NO_ERROR;
EmberAfStatus status = EMBER_ZCL_STATUS_NOT_FOUND;

VerifyOrExit(IsFabricGroupId(groupId), status = EMBER_ZCL_STATUS_INVALID_VALUE);
VerifyOrExit(IsFabricGroupId(groupId), status = EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
VerifyOrExit(nullptr != provider, status = EMBER_ZCL_STATUS_FAILURE);
VerifyOrExit(provider->HasEndpoint(fabricIndex, groupId, commandPath.mEndpointId), status = EMBER_ZCL_STATUS_NOT_FOUND);

Expand Down
2 changes: 1 addition & 1 deletion src/app/clusters/ias-zone-server/ias-zone-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ EmberAfStatus emberAfPluginIasZoneClusterSetEnrollmentMethod(EndpointId endpoint
else if (!isValidEnrollmentMode(method))
{
emberAfIasZoneClusterPrintln("Invalid IAS Zone Server Enrollment Mode: %d", method);
status = EMBER_ZCL_STATUS_INVALID_VALUE;
status = EMBER_ZCL_STATUS_CONSTRAINT_ERROR;
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ bool emberAfWindowCoveringClusterGoToLiftPercentageCallback(app::CommandHandler
}
else
{
emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_INVALID_VALUE);
emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
}
}
else
Expand Down Expand Up @@ -933,7 +933,7 @@ bool emberAfWindowCoveringClusterGoToTiltPercentageCallback(app::CommandHandler
}
else
{
emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_INVALID_VALUE);
emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_CONSTRAINT_ERROR);
}
}
else
Expand Down
2 changes: 1 addition & 1 deletion src/app/tests/suites/TestCluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2965,7 +2965,7 @@ tests:
"Send a command that takes an optional parameter but do not set it."
command: "TestSimpleOptionalArgumentRequest"
response:
error: INVALID_VALUE
error: CONSTRAINT_ERROR

- label:
"Send a command that takes an optional parameter but do not set it."
Expand Down
1 change: 0 additions & 1 deletion src/app/util/af-enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ enum EmberAfStatus : uint8_t
EMBER_ZCL_STATUS_INVALID_COMMAND = 0x85,
EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE = 0x86,
EMBER_ZCL_STATUS_CONSTRAINT_ERROR = 0x87,
EMBER_ZCL_STATUS_INVALID_VALUE = 0x87, // Deprecated; same as CONSTRAINT_ERROR
EMBER_ZCL_STATUS_UNSUPPORTED_WRITE = 0x88,
EMBER_ZCL_STATUS_READ_ONLY = 0x88, // Deprecated; same as UNSUPPORTED_WRITE
EMBER_ZCL_STATUS_RESOURCE_EXHAUSTED = 0x89,
Expand Down
6 changes: 3 additions & 3 deletions src/app/util/attribute-table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ static bool IsNullValue(const uint8_t * data, uint16_t dataLen, bool isAttribute
// - EMBER_ZCL_STATUS_INVALID_DATA_TYPE: if the data type passed in doesnt match the type
// stored in the attribute table
// - EMBER_ZCL_STATUS_READ_ONLY: if the attribute isnt writable
// - EMBER_ZCL_STATUS_INVALID_VALUE: if the value is set out of the allowable range for
// - EMBER_ZCL_STATUS_CONSTRAINT_ERROR: if the value is set out of the allowable range for
// the attribute
// - EMBER_ZCL_STATUS_SUCCESS: if the attribute was found and successfully written
//
Expand Down Expand Up @@ -272,7 +272,7 @@ EmberAfStatus emAfWriteAttribute(EndpointId endpoint, ClusterId cluster, Attribu
}

// if the value the attribute is being set to is out of range
// return EMBER_ZCL_STATUS_INVALID_VALUE
// return EMBER_ZCL_STATUS_CONSTRAINT_ERROR
if ((metadata->mask & ATTRIBUTE_MASK_MIN_MAX) != 0U)
{
EmberAfDefaultAttributeValue minv = metadata->defaultValue.ptrToMinMaxValue->minValue;
Expand Down Expand Up @@ -309,7 +309,7 @@ EmberAfStatus emAfWriteAttribute(EndpointId endpoint, ClusterId cluster, Attribu
// null value is always in-range for a nullable attribute.
(!metadata->IsNullable() || !IsNullValue(data, dataLen, isAttributeSigned)))
{
return EMBER_ZCL_STATUS_INVALID_VALUE;
return EMBER_ZCL_STATUS_CONSTRAINT_ERROR;
}
}

Expand Down
2 changes: 1 addition & 1 deletion zzz_generated/chip-tool/zap-generated/test/Commands.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2ceb2cc

Please sign in to comment.