Skip to content

Commit

Permalink
Remove EMBER_ZCL_STATUS_INVALID_FIELD
Browse files Browse the repository at this point in the history
  • Loading branch information
vivien-apple committed Dec 7, 2022
1 parent f51c3ac commit 39a7700
Show file tree
Hide file tree
Showing 8 changed files with 135 additions and 136 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static void stepHandler(CommandId commandId, uint8_t stepMode, uint8_t stepSize,
}
break;
default:
status = EMBER_ZCL_STATUS_INVALID_FIELD;
status = EMBER_ZCL_STATUS_INVALID_COMMAND;
goto send_default_response;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2207,7 +2207,7 @@ bool ColorControlServer::moveColorTempCommand(const app::ConcreteCommandPath & c

if (rate == 0)
{
emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_INVALID_FIELD);
emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_INVALID_COMMAND);
return true;
}

Expand Down
4 changes: 2 additions & 2 deletions src/app/clusters/level-control/level-control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ static void moveHandler(EndpointId endpoint, CommandId commandId, uint8_t moveMo
difference = static_cast<uint8_t>(currentLevel.Value() - state->minLevel);
break;
default:
status = EMBER_ZCL_STATUS_INVALID_FIELD;
status = EMBER_ZCL_STATUS_INVALID_COMMAND;
goto send_default_response;
}

Expand Down Expand Up @@ -972,7 +972,7 @@ static void stepHandler(EndpointId endpoint, CommandId commandId, uint8_t stepMo
}
break;
default:
status = EMBER_ZCL_STATUS_INVALID_FIELD;
status = EMBER_ZCL_STATUS_INVALID_COMMAND;
goto send_default_response;
}

Expand Down
14 changes: 7 additions & 7 deletions src/app/clusters/scenes/scenes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ bool emberAfScenesClusterRemoveSceneCallback(app::CommandHandler * commandObj, c

if (!isEndpointInGroup(fabricIndex, emberAfCurrentEndpoint(), groupId))
{
status = EMBER_ZCL_STATUS_INVALID_FIELD;
status = EMBER_ZCL_STATUS_INVALID_COMMAND;
}
else
{
Expand Down Expand Up @@ -284,7 +284,7 @@ bool emberAfScenesClusterRemoveAllScenesCallback(app::CommandHandler * commandOb
auto fabricIndex = commandObj->GetAccessingFabricIndex();
auto & groupId = commandData.groupId;

EmberAfStatus status = EMBER_ZCL_STATUS_INVALID_FIELD;
EmberAfStatus status = EMBER_ZCL_STATUS_INVALID_COMMAND;
CHIP_ERROR err = CHIP_NO_ERROR;

emberAfScenesClusterPrintln("RX: RemoveAllScenes 0x%2x", groupId);
Expand Down Expand Up @@ -417,7 +417,7 @@ bool emberAfScenesClusterGetSceneMembershipCallback(app::CommandHandler * comman

if (!isEndpointInGroup(fabricIndex, emberAfCurrentEndpoint(), groupId))
{
status = EMBER_ZCL_STATUS_INVALID_FIELD;
status = EMBER_ZCL_STATUS_INVALID_COMMAND;
}

if (status == EMBER_ZCL_STATUS_SUCCESS)
Expand Down Expand Up @@ -471,7 +471,7 @@ EmberAfStatus emberAfScenesClusterStoreCurrentSceneCallback(chip::FabricIndex fa

if (!isEndpointInGroup(fabricIndex, endpoint, groupId))
{
return EMBER_ZCL_STATUS_INVALID_FIELD;
return EMBER_ZCL_STATUS_INVALID_COMMAND;
}

for (i = 0; i < MATTER_SCENES_TABLE_SIZE; i++)
Expand Down Expand Up @@ -589,7 +589,7 @@ EmberAfStatus emberAfScenesClusterRecallSavedSceneCallback(chip::FabricIndex fab
{
if (!isEndpointInGroup(fabricIndex, endpoint, groupId))
{
return EMBER_ZCL_STATUS_INVALID_FIELD;
return EMBER_ZCL_STATUS_INVALID_COMMAND;
}

uint8_t i;
Expand Down Expand Up @@ -737,7 +737,7 @@ bool emberAfPluginScenesServerParseAddScene(
// Add Scene commands can only reference groups to which we belong.
if (!isEndpointInGroup(fabricIndex, endpoint, groupId))
{
status = EMBER_ZCL_STATUS_INVALID_FIELD;
status = EMBER_ZCL_STATUS_INVALID_COMMAND;
goto kickout;
}

Expand Down Expand Up @@ -1070,7 +1070,7 @@ bool emberAfPluginScenesServerParseViewScene(app::CommandHandler * commandObj, c
// View Scene commands can only reference groups which we belong to.
if (!isEndpointInGroup(fabricIndex, endpoint, groupId))
{
status = EMBER_ZCL_STATUS_INVALID_FIELD;
status = EMBER_ZCL_STATUS_INVALID_COMMAND;
}
else
{
Expand Down
62 changes: 31 additions & 31 deletions src/app/tests/suites/DL_Schedules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ tests:
- name: "endMinute"
value: 00
response:
error: INVALID_FIELD
error: INVALID_COMMAND

- label: "Create Week Day schedule with out-of-bounds index"
command: "SetWeekDaySchedule"
Expand All @@ -129,7 +129,7 @@ tests:
- name: "endMinute"
value: 00
response:
error: INVALID_FIELD
error: INVALID_COMMAND

- label: "Create Week Day schedule with 0 user index"
command: "SetWeekDaySchedule"
Expand All @@ -150,7 +150,7 @@ tests:
- name: "endMinute"
value: 00
response:
error: INVALID_FIELD
error: INVALID_COMMAND

- label: "Create Week Day schedule with out-of-bounds user index"
command: "SetWeekDaySchedule"
Expand All @@ -171,7 +171,7 @@ tests:
- name: "endMinute"
value: 00
response:
error: INVALID_FIELD
error: INVALID_COMMAND

- label: "Create Week Day schedule for non-existing user"
command: "SetWeekDaySchedule"
Expand Down Expand Up @@ -213,7 +213,7 @@ tests:
- name: "endMinute"
value: 00
response:
error: INVALID_FIELD
error: INVALID_COMMAND

- label: "Create Week Day schedule for Sunday and Monday"
command: "SetWeekDaySchedule"
Expand All @@ -234,7 +234,7 @@ tests:
- name: "endMinute"
value: 00
response:
error: INVALID_FIELD
error: INVALID_COMMAND

- label: "Create Week Day schedule for Sunday Wednesday and Saturday"
command: "SetWeekDaySchedule"
Expand All @@ -255,7 +255,7 @@ tests:
- name: "endMinute"
value: 00
response:
error: INVALID_FIELD
error: INVALID_COMMAND

- label: "Create Week Day schedule with invalid start hour"
command: "SetWeekDaySchedule"
Expand All @@ -276,7 +276,7 @@ tests:
- name: "endMinute"
value: 00
response:
error: INVALID_FIELD
error: INVALID_COMMAND

- label: "Create Week Day schedule with invalid start minute"
command: "SetWeekDaySchedule"
Expand All @@ -297,7 +297,7 @@ tests:
- name: "endMinute"
value: 00
response:
error: INVALID_FIELD
error: INVALID_COMMAND

- label: "Create Week Day schedule with invalid end hour"
command: "SetWeekDaySchedule"
Expand All @@ -318,7 +318,7 @@ tests:
- name: "endMinute"
value: 00
response:
error: INVALID_FIELD
error: INVALID_COMMAND

- label: "Create Week Day schedule with invalid end minute"
command: "SetWeekDaySchedule"
Expand All @@ -339,7 +339,7 @@ tests:
- name: "endMinute"
value: 60
response:
error: INVALID_FIELD
error: INVALID_COMMAND

- label: "Create Week Day schedule with start hour later that end hour"
command: "SetWeekDaySchedule"
Expand All @@ -360,7 +360,7 @@ tests:
- name: "endMinute"
value: 00
response:
error: INVALID_FIELD
error: INVALID_COMMAND

- label:
"Create Week Day schedule with start minute later that end minute when
Expand All @@ -383,7 +383,7 @@ tests:
- name: "endMinute"
value: 49
response:
error: INVALID_FIELD
error: INVALID_COMMAND

- label: "Make sure that previous operations did not create a schedule"
command: "GetWeekDaySchedule"
Expand Down Expand Up @@ -506,7 +506,7 @@ tests:
- name: "localEndTime"
value: 12345689
response:
error: INVALID_FIELD
error: INVALID_COMMAND

- label: "Create Year Day schedule with out-of-bounds index"
command: "SetYearDaySchedule"
Expand All @@ -521,7 +521,7 @@ tests:
- name: "localEndTime"
value: 12345689
response:
error: INVALID_FIELD
error: INVALID_COMMAND

- label: "Create Year Day schedule with 0 user index"
command: "SetYearDaySchedule"
Expand All @@ -536,7 +536,7 @@ tests:
- name: "localEndTime"
value: 12345689
response:
error: INVALID_FIELD
error: INVALID_COMMAND

- label: "Create Year Day schedule with out-of-bounds user index"
command: "SetYearDaySchedule"
Expand All @@ -551,7 +551,7 @@ tests:
- name: "localEndTime"
value: 12345689
response:
error: INVALID_FIELD
error: INVALID_COMMAND

- label: "Create Year Day schedule for non-existing user"
command: "SetYearDaySchedule"
Expand Down Expand Up @@ -704,7 +704,7 @@ tests:
- name: "operatingMode"
value: 0
response:
error: INVALID_FIELD
error: INVALID_COMMAND

- label: "Create Holiday schedule with out-of-bounds index"
command: "SetHolidaySchedule"
Expand All @@ -719,7 +719,7 @@ tests:
- name: "operatingMode"
value: 0
response:
error: INVALID_FIELD
error: INVALID_COMMAND

- label: "Create Holiday schedule with start hour later that end hour"
command: "SetHolidaySchedule"
Expand All @@ -734,7 +734,7 @@ tests:
- name: "operatingMode"
value: 0
response:
error: INVALID_FIELD
error: INVALID_COMMAND

- label: "Create Holiday schedule with invalid operating mode"
command: "SetHolidaySchedule"
Expand All @@ -749,7 +749,7 @@ tests:
- name: "operatingMode"
value: 5
response:
error: INVALID_FIELD
error: INVALID_COMMAND

- label: "Make sure that previous operations did not create a schedule"
command: "GetHolidaySchedule"
Expand Down Expand Up @@ -918,7 +918,7 @@ tests:
- name: "userIndex"
value: 1
response:
error: INVALID_FIELD
error: INVALID_COMMAND

- label: "Clear Week Day schedule with out-of-bounds index"
command: "ClearWeekDaySchedule"
Expand All @@ -929,7 +929,7 @@ tests:
- name: "userIndex"
value: 1
response:
error: INVALID_FIELD
error: INVALID_COMMAND

- label: "Clear Week Day schedule with 0 user index"
command: "ClearWeekDaySchedule"
Expand All @@ -940,7 +940,7 @@ tests:
- name: "userIndex"
value: 0
response:
error: INVALID_FIELD
error: INVALID_COMMAND

- label: "Clear Week Day schedule with out-of-bounds user index"
command: "ClearWeekDaySchedule"
Expand All @@ -951,7 +951,7 @@ tests:
- name: "userIndex"
value: NumberOfTotalUsersSupported + 1
response:
error: INVALID_FIELD
error: INVALID_COMMAND

- label: "Clear Week Day schedule with non-existing user"
command: "ClearWeekDaySchedule"
Expand Down Expand Up @@ -1043,7 +1043,7 @@ tests:
- name: "userIndex"
value: 1
response:
error: INVALID_FIELD
error: INVALID_COMMAND

- label: "Clear Year Day schedule with out-of-bounds index"
command: "ClearYearDaySchedule"
Expand All @@ -1054,7 +1054,7 @@ tests:
- name: "userIndex"
value: 1
response:
error: INVALID_FIELD
error: INVALID_COMMAND

- label: "Clear Year Day schedule with 0 user index"
command: "ClearYearDaySchedule"
Expand All @@ -1065,7 +1065,7 @@ tests:
- name: "userIndex"
value: 0
response:
error: INVALID_FIELD
error: INVALID_COMMAND

- label: "Clear Year Day schedule with out-of-bounds user index"
command: "ClearYearDaySchedule"
Expand All @@ -1076,7 +1076,7 @@ tests:
- name: "userIndex"
value: NumberOfTotalUsersSupported + 1
response:
error: INVALID_FIELD
error: INVALID_COMMAND

- label: "Clear Year Day schedule with non-existing user"
command: "ClearYearDaySchedule"
Expand Down Expand Up @@ -1164,7 +1164,7 @@ tests:
- name: "holidayIndex"
value: 0
response:
error: INVALID_FIELD
error: INVALID_COMMAND

- label: "Clear Holiday schedule with out-of-bounds index"
command: "ClearHolidaySchedule"
Expand All @@ -1173,7 +1173,7 @@ tests:
- name: "holidayIndex"
value: NumberOfYearDaySchedulesSupportedPerUser + 1
response:
error: INVALID_FIELD
error: INVALID_COMMAND

- label: "Make sure that week day schedule was not deleted"
command: "GetWeekDaySchedule"
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 @@ -35,7 +35,6 @@ enum EmberAfStatus : uint8_t
EMBER_ZCL_STATUS_DEPRECATED83 = 0x83,
EMBER_ZCL_STATUS_DEPRECATED84 = 0x84,
EMBER_ZCL_STATUS_INVALID_COMMAND = 0x85,
EMBER_ZCL_STATUS_INVALID_FIELD = 0x85, // Deprecated; same as INVALID_COMMAND
EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE = 0x86,
EMBER_ZCL_STATUS_CONSTRAINT_ERROR = 0x87,
EMBER_ZCL_STATUS_INVALID_VALUE = 0x87, // Deprecated; same as CONSTRAINT_ERROR
Expand Down
Loading

0 comments on commit 39a7700

Please sign in to comment.