Skip to content

Commit

Permalink
Mark commands that require a timed interaction. (#14421)
Browse files Browse the repository at this point in the history
Our XML was not matching the spec in terms of which commands require
timed interactions.
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Feb 27, 2024
1 parent 9bbea65 commit 9703277
Show file tree
Hide file tree
Showing 42 changed files with 711 additions and 396 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ server cluster AdministratorCommissioning = 60 {
INT16U passcodeID = 5;
}

command OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1;
command OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0;
command RevokeCommissioning(): DefaultSuccess = 2;
timed command OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1;
timed command OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0;
timed command RevokeCommissioning(): DefaultSuccess = 2;
}

server cluster ApplicationBasic = 1293 {
Expand Down Expand Up @@ -1250,14 +1250,14 @@ server cluster DoorLock = 257 {
nullable INT16U nextCredentialIndex = 2;
}

command ClearCredential(ClearCredentialRequest): DefaultSuccess = 38;
command ClearUser(ClearUserRequest): DefaultSuccess = 29;
timed command ClearCredential(ClearCredentialRequest): DefaultSuccess = 38;
timed command ClearUser(ClearUserRequest): DefaultSuccess = 29;
command GetCredentialStatus(GetCredentialStatusRequest): GetCredentialStatusResponse = 36;
command GetUser(GetUserRequest): GetUserResponse = 27;
command LockDoor(LockDoorRequest): DefaultSuccess = 0;
command SetCredential(SetCredentialRequest): SetCredentialResponse = 34;
command SetUser(SetUserRequest): DefaultSuccess = 26;
command UnlockDoor(UnlockDoorRequest): DefaultSuccess = 1;
timed command LockDoor(LockDoorRequest): DefaultSuccess = 0;
timed command SetCredential(SetCredentialRequest): SetCredentialResponse = 34;
timed command SetUser(SetUserRequest): DefaultSuccess = 26;
timed command UnlockDoor(UnlockDoorRequest): DefaultSuccess = 1;
}

server cluster ElectricalMeasurement = 2820 {
Expand Down
6 changes: 3 additions & 3 deletions examples/bridge-app/bridge-common/bridge-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ server cluster AdministratorCommissioning = 60 {
INT16U passcodeID = 5;
}

command OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1;
command OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0;
command RevokeCommissioning(): DefaultSuccess = 2;
timed command OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1;
timed command OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0;
timed command RevokeCommissioning(): DefaultSuccess = 2;
}

server cluster Basic = 40 {
Expand Down
18 changes: 9 additions & 9 deletions examples/door-lock-app/door-lock-common/door-lock-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ server cluster AdministratorCommissioning = 60 {
INT16U passcodeID = 5;
}

command OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1;
command OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0;
command RevokeCommissioning(): DefaultSuccess = 2;
timed command OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1;
timed command OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0;
timed command RevokeCommissioning(): DefaultSuccess = 2;
}

server cluster Basic = 40 {
Expand Down Expand Up @@ -645,20 +645,20 @@ server cluster DoorLock = 257 {
nullable INT16U nextCredentialIndex = 2;
}

command ClearCredential(ClearCredentialRequest): DefaultSuccess = 38;
command ClearUser(ClearUserRequest): DefaultSuccess = 29;
timed command ClearCredential(ClearCredentialRequest): DefaultSuccess = 38;
timed command ClearUser(ClearUserRequest): DefaultSuccess = 29;
command ClearWeekDaySchedule(ClearWeekDayScheduleRequest): DefaultSuccess = 13;
command ClearYearDaySchedule(ClearYearDayScheduleRequest): DefaultSuccess = 16;
command GetCredentialStatus(GetCredentialStatusRequest): GetCredentialStatusResponse = 36;
command GetUser(GetUserRequest): GetUserResponse = 27;
command GetWeekDaySchedule(GetWeekDayScheduleRequest): GetWeekDayScheduleResponse = 12;
command GetYearDaySchedule(GetYearDayScheduleRequest): GetYearDayScheduleResponse = 15;
command LockDoor(LockDoorRequest): DefaultSuccess = 0;
command SetCredential(SetCredentialRequest): SetCredentialResponse = 34;
command SetUser(SetUserRequest): DefaultSuccess = 26;
timed command LockDoor(LockDoorRequest): DefaultSuccess = 0;
timed command SetCredential(SetCredentialRequest): SetCredentialResponse = 34;
timed command SetUser(SetUserRequest): DefaultSuccess = 26;
command SetWeekDaySchedule(SetWeekDayScheduleRequest): DefaultSuccess = 11;
command SetYearDaySchedule(SetYearDayScheduleRequest): DefaultSuccess = 14;
command UnlockDoor(UnlockDoorRequest): DefaultSuccess = 1;
timed command UnlockDoor(UnlockDoorRequest): DefaultSuccess = 1;
}

server cluster EthernetNetworkDiagnostics = 55 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ server cluster AdministratorCommissioning = 60 {
INT16U passcodeID = 5;
}

command OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1;
command OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0;
command RevokeCommissioning(): DefaultSuccess = 2;
timed command OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1;
timed command OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0;
timed command RevokeCommissioning(): DefaultSuccess = 2;
}

server cluster Basic = 40 {
Expand Down
6 changes: 3 additions & 3 deletions examples/lighting-app/lighting-common/lighting-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ server cluster AdministratorCommissioning = 60 {
INT16U passcodeID = 5;
}

command OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1;
command OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0;
command RevokeCommissioning(): DefaultSuccess = 2;
timed command OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1;
timed command OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0;
timed command RevokeCommissioning(): DefaultSuccess = 2;
}

server cluster Basic = 40 {
Expand Down
6 changes: 3 additions & 3 deletions examples/lock-app/lock-common/lock-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ server cluster AdministratorCommissioning = 60 {
INT16U passcodeID = 5;
}

command OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1;
command OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0;
command RevokeCommissioning(): DefaultSuccess = 2;
timed command OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1;
timed command OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0;
timed command RevokeCommissioning(): DefaultSuccess = 2;
}

server cluster Basic = 40 {
Expand Down
6 changes: 3 additions & 3 deletions examples/pump-app/pump-common/pump-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ server cluster AdministratorCommissioning = 60 {
INT16U passcodeID = 5;
}

command OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1;
command OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0;
command RevokeCommissioning(): DefaultSuccess = 2;
timed command OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1;
timed command OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0;
timed command RevokeCommissioning(): DefaultSuccess = 2;
}

server cluster Basic = 40 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ server cluster AdministratorCommissioning = 60 {
INT16U passcodeID = 5;
}

command OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1;
command OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0;
command RevokeCommissioning(): DefaultSuccess = 2;
timed command OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1;
timed command OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0;
timed command RevokeCommissioning(): DefaultSuccess = 2;
}

server cluster Basic = 40 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ server cluster AdministratorCommissioning = 60 {
INT16U passcodeID = 5;
}

command OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1;
command OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0;
command RevokeCommissioning(): DefaultSuccess = 2;
timed command OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1;
timed command OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0;
timed command RevokeCommissioning(): DefaultSuccess = 2;
}

server cluster Basic = 40 {
Expand Down
6 changes: 3 additions & 3 deletions examples/thermostat/thermostat-common/thermostat.matter
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ server cluster AdministratorCommissioning = 60 {
INT16U passcodeID = 5;
}

command OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1;
command OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0;
command RevokeCommissioning(): DefaultSuccess = 2;
timed command OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1;
timed command OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0;
timed command RevokeCommissioning(): DefaultSuccess = 2;
}

server cluster Basic = 40 {
Expand Down
8 changes: 4 additions & 4 deletions examples/tv-app/tv-common/tv-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ server cluster AccountLogin = 1294 {
}

timed command GetSetupPINRequest(GetSetupPINRequestRequest): GetSetupPINResponse = 0;
command LoginRequest(LoginRequestRequest): DefaultSuccess = 2;
timed command LoginRequest(LoginRequestRequest): DefaultSuccess = 2;
timed command LogoutRequest(): DefaultSuccess = 3;
}

Expand Down Expand Up @@ -58,9 +58,9 @@ server cluster AdministratorCommissioning = 60 {
INT16U passcodeID = 5;
}

command OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1;
command OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0;
command RevokeCommissioning(): DefaultSuccess = 2;
timed command OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1;
timed command OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0;
timed command RevokeCommissioning(): DefaultSuccess = 2;
}

server cluster ApplicationBasic = 1293 {
Expand Down
20 changes: 10 additions & 10 deletions examples/tv-casting-app/tv-casting-common/tv-casting-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ client cluster AccountLogin = 1294 {
}

timed command GetSetupPINRequest(GetSetupPINRequestRequest): GetSetupPINResponse = 0;
command LoginRequest(LoginRequestRequest): DefaultSuccess = 2;
timed command LoginRequest(LoginRequestRequest): DefaultSuccess = 2;
timed command LogoutRequest(): DefaultSuccess = 3;
}

Expand Down Expand Up @@ -54,9 +54,9 @@ server cluster AdministratorCommissioning = 60 {
INT16U passcodeID = 5;
}

command OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1;
command OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0;
command RevokeCommissioning(): DefaultSuccess = 2;
timed command OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1;
timed command OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0;
timed command RevokeCommissioning(): DefaultSuccess = 2;
}

client cluster ApplicationBasic = 1293 {
Expand Down Expand Up @@ -1149,14 +1149,14 @@ server cluster DoorLock = 257 {
nullable INT16U nextCredentialIndex = 2;
}

command ClearCredential(ClearCredentialRequest): DefaultSuccess = 38;
command ClearUser(ClearUserRequest): DefaultSuccess = 29;
timed command ClearCredential(ClearCredentialRequest): DefaultSuccess = 38;
timed command ClearUser(ClearUserRequest): DefaultSuccess = 29;
command GetCredentialStatus(GetCredentialStatusRequest): GetCredentialStatusResponse = 36;
command GetUser(GetUserRequest): GetUserResponse = 27;
command LockDoor(LockDoorRequest): DefaultSuccess = 0;
command SetCredential(SetCredentialRequest): SetCredentialResponse = 34;
command SetUser(SetUserRequest): DefaultSuccess = 26;
command UnlockDoor(UnlockDoorRequest): DefaultSuccess = 1;
timed command LockDoor(LockDoorRequest): DefaultSuccess = 0;
timed command SetCredential(SetCredentialRequest): SetCredentialResponse = 34;
timed command SetUser(SetUserRequest): DefaultSuccess = 26;
timed command UnlockDoor(UnlockDoorRequest): DefaultSuccess = 1;
}

server cluster EthernetNetworkDiagnostics = 55 {
Expand Down
6 changes: 3 additions & 3 deletions examples/window-app/common/window-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ server cluster AdministratorCommissioning = 60 {
INT16U passcodeID = 5;
}

command OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1;
command OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0;
command RevokeCommissioning(): DefaultSuccess = 2;
timed command OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1;
timed command OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0;
timed command RevokeCommissioning(): DefaultSuccess = 2;
}

server cluster Basic = 40 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ class MultiAdminClientFragment : Fragment() {
}

private suspend fun sendRevokeCommandClick() {
val timedInvokeTimeout = 10000
getAdministratorCommissioningClusterForDevice().revokeCommissioning(object : ChipClusters.DefaultClusterCallback {
override fun onSuccess() {
showMessage("Revoke Commissioning success")
Expand All @@ -108,7 +109,7 @@ class MultiAdminClientFragment : Fragment() {
showMessage("Revoke Commissioning failure $ex")
Log.e(TAG, "Revoke Commissioning failure", ex)
}
})
}, timedInvokeTimeout)
}

private suspend fun getAdministratorCommissioningClusterForDevice(): ChipClusters.AdministratorCommissioningCluster {
Expand Down
6 changes: 6 additions & 0 deletions src/app/tests/suites/DL_LockUnlock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ tests:

- label: "Create new PIN credential and lock/unlock user"
command: "SetCredential"
timedInteractionTimeoutMs: 10000
arguments:
values:
- name: "operationType"
Expand All @@ -50,6 +51,7 @@ tests:

- label: "Try to unlock the door with invalid PIN"
command: "UnlockDoor"
timedInteractionTimeoutMs: 10000
arguments:
values:
- name: "pinCode"
Expand All @@ -65,6 +67,7 @@ tests:

- label: "Try to unlock the door with valid PIN"
command: "UnlockDoor"
timedInteractionTimeoutMs: 10000
arguments:
values:
- name: "pinCode"
Expand All @@ -78,6 +81,7 @@ tests:

- label: "Try to lock the door with invalid PIN"
command: "LockDoor"
timedInteractionTimeoutMs: 10000
arguments:
values:
- name: "pinCode"
Expand All @@ -93,6 +97,7 @@ tests:

- label: "Try to unlock the door with valid PIN"
command: "LockDoor"
timedInteractionTimeoutMs: 10000
arguments:
values:
- name: "pinCode"
Expand All @@ -107,6 +112,7 @@ tests:
# Clean-up
- label: "Clean the created credential"
command: "ClearCredential"
timedInteractionTimeoutMs: 10000
arguments:
values:
- name: "credential"
Expand Down
3 changes: 3 additions & 0 deletions src/app/tests/suites/DL_Schedules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ tests:

- label: "Create new PIN credential and schedule user"
command: "SetCredential"
timedInteractionTimeoutMs: 10000
arguments:
values:
- name: "operationType"
Expand Down Expand Up @@ -1219,6 +1220,7 @@ tests:
- label:
"Create new user without credential so we can add more schedules to it"
command: "SetUser"
timedInteractionTimeoutMs: 10000
arguments:
values:
- name: "operationType"
Expand Down Expand Up @@ -1398,6 +1400,7 @@ tests:

- label: "Cleanup"
command: "ClearUser"
timedInteractionTimeoutMs: 10000
arguments:
values:
- name: "userIndex"
Expand Down
Loading

0 comments on commit 9703277

Please sign in to comment.