diff --git a/examples/lock-app/lock-common/src/LockEndpoint.cpp b/examples/lock-app/lock-common/src/LockEndpoint.cpp index 35764f9b81ad6a..430537a523059b 100644 --- a/examples/lock-app/lock-common/src/LockEndpoint.cpp +++ b/examples/lock-app/lock-common/src/LockEndpoint.cpp @@ -37,7 +37,7 @@ struct LockActionData bool moving = false; }; -LockActionData currentAction; +static LockActionData gCurrentAction; bool LockEndpoint::Lock(const Nullable & fabricIdx, const Nullable & nodeId, const Optional & pin, OperationErrorEnum & err, OperationSourceEnum opSource) @@ -427,21 +427,21 @@ bool LockEndpoint::setLockState(const Nullable & fabricIdx, c ChipLogProgress(Zcl, "Door Lock App: setting door lock state to \"%s\" [endpointId=%d]", lockStateToString(lockState), mEndpointId); - if (currentAction.moving == true) + if (gCurrentAction.moving == true) { return false; } - currentAction.moving = true; - currentAction.endpointId = mEndpointId; - currentAction.lockState = lockState; - currentAction.opSource = opSource; - currentAction.userIndex = NullNullable; - currentAction.fabricIdx = fabricIdx; - currentAction.nodeId = nodeId; + gCurrentAction.moving = true; + gCurrentAction.endpointId = mEndpointId; + gCurrentAction.lockState = lockState; + gCurrentAction.opSource = opSource; + gCurrentAction.userIndex = NullNullable; + gCurrentAction.fabricIdx = fabricIdx; + gCurrentAction.nodeId = nodeId; // simulate 3s lock movement duration - chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Seconds16(3), OnLockActionCompleteCallback, nullptr); + chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Seconds16(0), OnLockActionCompleteCallback, nullptr); return true; } @@ -506,54 +506,54 @@ bool LockEndpoint::setLockState(const Nullable & fabricIdx, c "Lock App: specified PIN code was found in the database, setting door lock state to \"%s\" [endpointId=%d,userIndex=%u]", lockStateToString(lockState), mEndpointId, userIndex); - if (currentAction.moving == true) + if (gCurrentAction.moving == true) { return false; } - currentAction.moving = true; - currentAction.endpointId = mEndpointId; - currentAction.lockState = lockState; - currentAction.opSource = opSource; - currentAction.userIndex = MakeNullable(static_cast(userIndex + 1)); - currentAction.credentialIndex = static_cast(credentialIndex); - currentAction.fabricIdx = fabricIdx; - currentAction.nodeId = nodeId; + gCurrentAction.moving = true; + gCurrentAction.endpointId = mEndpointId; + gCurrentAction.lockState = lockState; + gCurrentAction.opSource = opSource; + gCurrentAction.userIndex = MakeNullable(static_cast(userIndex + 1)); + gCurrentAction.credentialIndex = static_cast(credentialIndex); + gCurrentAction.fabricIdx = fabricIdx; + gCurrentAction.nodeId = nodeId; // simulate 3s lock movement duration - chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Seconds16(3), OnLockActionCompleteCallback, nullptr); + chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Seconds16(0), OnLockActionCompleteCallback, nullptr); return true; } void LockEndpoint::OnLockActionCompleteCallback(chip::System::Layer *, void * callbackContext) { - if (currentAction.userIndex == NullNullable) + if (gCurrentAction.userIndex == NullNullable) { - DoorLockServer::Instance().SetLockState(currentAction.endpointId, currentAction.lockState, currentAction.opSource, - NullNullable, NullNullable, currentAction.fabricIdx, currentAction.nodeId); + DoorLockServer::Instance().SetLockState(gCurrentAction.endpointId, gCurrentAction.lockState, gCurrentAction.opSource, + NullNullable, NullNullable, gCurrentAction.fabricIdx, gCurrentAction.nodeId); } else { - LockOpCredentials userCredential[] = { { CredentialTypeEnum::kPin, currentAction.credentialIndex } }; + LockOpCredentials userCredential[] = { { CredentialTypeEnum::kPin, gCurrentAction.credentialIndex } }; auto userCredentials = MakeNullable>(userCredential); - DoorLockServer::Instance().SetLockState(currentAction.endpointId, currentAction.lockState, currentAction.opSource, - currentAction.userIndex, userCredentials, currentAction.fabricIdx, - currentAction.nodeId); + DoorLockServer::Instance().SetLockState(gCurrentAction.endpointId, gCurrentAction.lockState, gCurrentAction.opSource, + gCurrentAction.userIndex, userCredentials, gCurrentAction.fabricIdx, + gCurrentAction.nodeId); } // move back to Unlocked after Unlatch - if (currentAction.lockState == DlLockState::kUnlatched) + if (gCurrentAction.lockState == DlLockState::kUnlatched) { - currentAction.lockState = DlLockState::kUnlocked; + gCurrentAction.lockState = DlLockState::kUnlocked; // simulate 1s lock movement duration - chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Seconds16(1), OnLockActionCompleteCallback, nullptr); + chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Seconds16(0), OnLockActionCompleteCallback, nullptr); } else { - currentAction.moving = false; + gCurrentAction.moving = false; } } diff --git a/src/app/tests/suites/DL_LockUnlock.yaml b/src/app/tests/suites/DL_LockUnlock.yaml index 8dc84f3f466294..97c76a559f7296 100644 --- a/src/app/tests/suites/DL_LockUnlock.yaml +++ b/src/app/tests/suites/DL_LockUnlock.yaml @@ -18,7 +18,7 @@ config: nodeId: 0x12344321 cluster: "Door Lock" endpoint: 1 - timeout: 100 + timeout: 25 tests: - label: "Wait for the commissioned device to be retrieved" @@ -33,14 +33,6 @@ tests: command: "UnlockDoor" timedInteractionTimeoutMs: 10000 - - label: "Wait for lock action to complete" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 5000 - - label: "Verify that lock state attribute value is set to Unlocked" command: "readAttribute" attribute: "LockState" @@ -51,14 +43,6 @@ tests: command: "LockDoor" timedInteractionTimeoutMs: 10000 - - label: "Wait for lock action to complete" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 5000 - - label: "Verify that lock state attribute value is set to Locked" command: "readAttribute" attribute: "LockState" @@ -69,14 +53,6 @@ tests: command: "UnboltDoor" timedInteractionTimeoutMs: 10000 - - label: "Wait for lock action to complete" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 5000 - - label: "Verify that lock state attribute value is set to Unlocked" command: "readAttribute" attribute: "LockState" @@ -87,14 +63,6 @@ tests: command: "LockDoor" timedInteractionTimeoutMs: 10000 - - label: "Wait for lock action to complete" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 5000 - - label: "Verify that lock state attribute value is set to Locked" command: "readAttribute" attribute: "LockState" @@ -181,14 +149,6 @@ tests: - name: "PINCode" value: "123456" - - label: "Wait for lock action to complete" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 5000 - - label: "Read the LockOperation event list" command: "readEvent" event: "LockOperation" @@ -307,14 +267,6 @@ tests: - name: "PINCode" value: "123456" - - label: "Wait for lock action to complete" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 5000 - - label: "Verify that lock state attribute value is set to Locked" command: "readAttribute" attribute: "LockState" @@ -379,14 +331,6 @@ tests: - name: "PINCode" value: "123456" - - label: "Wait for lock action to complete" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 5000 - - label: "Verify that lock state attribute value is set to Unlocked" command: "readAttribute" attribute: "LockState" @@ -401,14 +345,6 @@ tests: - name: "PINCode" value: "123456" - - label: "Wait for lock action to complete" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 5000 - - label: "Verify that lock state attribute value is set to Locked" command: "readAttribute" attribute: "LockState" @@ -443,14 +379,6 @@ tests: - name: "PINCode" value: "123456" - - label: "Wait for lock action to complete" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 5000 - - label: "Verify that lock state attribute value is set to Unlocked" command: "readAttribute" attribute: "LockState" @@ -465,14 +393,6 @@ tests: - name: "PINCode" value: "123456" - - label: "Wait for lock action to complete" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 5000 - - label: "Verify that lock state attribute value is set to Locked" command: "readAttribute" attribute: "LockState" @@ -553,14 +473,6 @@ tests: - name: "PINCode" value: "123456" - - label: "Wait for lock action to complete" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 5000 - - label: "Verify that lock state attribute value is set to Unlocked" command: "readAttribute" attribute: "LockState" @@ -575,14 +487,6 @@ tests: - name: "PINCode" value: "123456" - - label: "Wait for lock action to complete" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 5000 - - label: "Create a disabled user and credential" command: "SetCredential" timedInteractionTimeoutMs: 10000 @@ -633,14 +537,6 @@ tests: - name: "PINCode" value: "123456" - - label: "Wait for lock action to complete" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 5000 - - label: "Verify that lock state attribute value is set to Unlocked" command: "readAttribute" attribute: "LockState" @@ -671,14 +567,6 @@ tests: - name: "PINCode" value: "123456" - - label: "Wait for lock action to complete" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 5000 - - label: "Verify that lock state attribute value is set to Locked" command: "readAttribute" attribute: "LockState" diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_1.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_1.yaml index d49ceeda79f11c..2e9008d4eca7b4 100644 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_1.yaml @@ -63,14 +63,6 @@ tests: command: "LockDoor" timedInteractionTimeoutMs: 1000 - - label: "Wait for lock action to complete" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 5000 - - label: "Step 1d: TH reads LockState attribute from DUT" PICS: DRLK.S.A0000 command: "readAttribute" @@ -83,14 +75,6 @@ tests: command: "UnlockDoor" timedInteractionTimeoutMs: 1000 - - label: "Wait for lock action to complete" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 5000 - - label: "Step 1e: TH reads LockState attribute from DUT" PICS: DRLK.S.A0000 command: "readAttribute" diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_12.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_12.yaml index 4ae19ec74a9ce9..964e6a763c2435 100644 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_12.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_12.yaml @@ -15,7 +15,7 @@ name: 121.3.2. [TC-DRLK-2.12] Verification for Ubolt Door command [DUT-Server] PICS: - - DRLK.S.F0c + - DRLK.S config: nodeId: 0x12344321 @@ -128,7 +128,7 @@ tests: - label: "Step 1: TH writes the RequirePINforRemoteOperation attribute value as False on the DUT" - PICS: DRLK.S.F07 && DRLK.S.F00 && DRLK.S.A0033.Write + PICS: DRLK.S.F0c && DRLK.S.F07 && DRLK.S.F00 && DRLK.S.A0033.Write command: "writeAttribute" attribute: "RequirePINforRemoteOperation" arguments: @@ -137,7 +137,7 @@ tests: - label: "Step 1: TH writes the RequirePINforRemoteOperation attribute value as False on the DUT" - PICS: DRLK.S.F07 && DRLK.S.F00 && !DRLK.S.A0033.Write + PICS: DRLK.S.F0c && DRLK.S.F07 && DRLK.S.F00 && !DRLK.S.A0033.Write command: "writeAttribute" attribute: "RequirePINforRemoteOperation" arguments: @@ -148,27 +148,19 @@ tests: - label: "Step 2: TH reads the RequirePINforRemoteOperation attribute from the DUT" - PICS: DRLK.S.F07 && DRLK.S.F00 && DRLK.S.A0033 + PICS: DRLK.S.F0c && DRLK.S.F07 && DRLK.S.F00 && DRLK.S.A0033 command: "readAttribute" attribute: "RequirePINforRemoteOperation" response: value: false - label: "Step 3: TH sends Ubolt Door Command to the DUT without PINCode" - PICS: DRLK.S.C27.Rsp + PICS: DRLK.S.C27.Rsp && DRLK.S.F0c command: "UnboltDoor" timedInteractionTimeoutMs: 1000 - - label: "Wait for lock action to complete" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 5000 - - label: "Step 4: TH sends Ubolt Door Command to the DUT with PINCode" - PICS: DRLK.S.C27.Rsp + PICS: DRLK.S.C27.Rsp && DRLK.S.F0c command: "UnboltDoor" timedInteractionTimeoutMs: 1000 arguments: @@ -176,18 +168,10 @@ tests: - name: "PINCode" value: "123456" - - label: "Wait for lock action to complete" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 5000 - - label: "Step 5: TH writes the RequirePINforRemoteOperation attribute value as true on the DUT" - PICS: DRLK.S.F07 && DRLK.S.F00 && DRLK.S.A0033.Write + PICS: DRLK.S.F0c && DRLK.S.F07 && DRLK.S.F00 && DRLK.S.A0033.Write command: "writeAttribute" attribute: "RequirePINforRemoteOperation" arguments: @@ -196,7 +180,7 @@ tests: - label: "Step 5: TH writes the RequirePINforRemoteOperation attribute value as true on the DUT" - PICS: DRLK.S.F07 && DRLK.S.F00 && !DRLK.S.A0033.Write + PICS: DRLK.S.F0c && DRLK.S.F07 && DRLK.S.F00 && !DRLK.S.A0033.Write command: "writeAttribute" attribute: "RequirePINforRemoteOperation" arguments: @@ -207,14 +191,14 @@ tests: - label: "Step 6: TH reads the RequirePINforRemoteOperation attribute from the DUT" - PICS: DRLK.S.F07 && DRLK.S.F00 && DRLK.S.A0033 + PICS: DRLK.S.F0c && DRLK.S.F07 && DRLK.S.F00 && DRLK.S.A0033 command: "readAttribute" attribute: "RequirePINforRemoteOperation" response: value: true - label: "Step 7: TH sends Ubolt Door Command to the DUT with valid PINCode" - PICS: DRLK.S.C27.Rsp + PICS: DRLK.S.C27.Rsp && DRLK.S.F0c command: "UnboltDoor" timedInteractionTimeoutMs: 1000 arguments: @@ -222,17 +206,9 @@ tests: - name: "PINCode" value: "123456" - - label: "Wait for lock action to complete" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 5000 - - label: "Step 8: TH sends Unbolt Door Command to the DUT with Invalid PINCode" - PICS: DRLK.S.C27.Rsp + PICS: DRLK.S.C27.Rsp && DRLK.S.F0c command: "UnboltDoor" timedInteractionTimeoutMs: 1000 arguments: @@ -243,7 +219,7 @@ tests: error: FAILURE - label: "Step 9: TH sends Unbolt Door Command to the DUT without PINCode" - PICS: DRLK.S.C27.Rsp + PICS: DRLK.S.C27.Rsp && DRLK.S.F0c command: "UnboltDoor" timedInteractionTimeoutMs: 1000 response: @@ -252,7 +228,7 @@ tests: - label: "Step 10: TH writes WrongCodeEntryLimit attribute value as 3 on the DUT" - PICS: ( DRLK.S.F00 || DRLK.S.F01 ) && DRLK.S.A0030.Write + PICS: DRLK.S.F0c && ( DRLK.S.F00 || DRLK.S.F01 ) && DRLK.S.A0030.Write command: "writeAttribute" attribute: "WrongCodeEntryLimit" arguments: @@ -261,7 +237,7 @@ tests: - label: "Step 10: TH writes WrongCodeEntryLimit attribute value as 3 on the DUT" - PICS: ( DRLK.S.F00 || DRLK.S.F01 ) && !DRLK.S.A0030.Write + PICS: DRLK.S.F0c && ( DRLK.S.F00 || DRLK.S.F01 ) && !DRLK.S.A0030.Write command: "writeAttribute" attribute: "WrongCodeEntryLimit" arguments: @@ -272,7 +248,7 @@ tests: - label: "Step 11: TH writes UserCodeTemporaryDisableTime attribute value as 15 Seconds on the DUT and Verify that the DUT sends Success response" - PICS: ( DRLK.S.F00 || DRLK.S.F01 ) && DRLK.S.A0031.Write + PICS: DRLK.S.F0c && ( DRLK.S.F00 || DRLK.S.F01 ) && DRLK.S.A0031.Write command: "writeAttribute" attribute: "UserCodeTemporaryDisableTime" arguments: @@ -281,7 +257,7 @@ tests: - label: "Step 11: TH writes UserCodeTemporaryDisableTime attribute value as 15 Seconds on the DUT and Verify that the DUT sends Success response" - PICS: ( DRLK.S.F00 || DRLK.S.F01 ) && !DRLK.S.A0031.Write + PICS: DRLK.S.F0c && ( DRLK.S.F00 || DRLK.S.F01 ) && !DRLK.S.A0031.Write command: "writeAttribute" attribute: "UserCodeTemporaryDisableTime" arguments: @@ -343,7 +319,7 @@ tests: - label: "Step 13: TH reads UserCodedTemporaryDisableTime attribute from DUT" - PICS: ( DRLK.S.F00 || DRLK.S.F01 ) && DRLK.S.A0031 + PICS: DRLK.S.F0c && ( DRLK.S.F00 || DRLK.S.F01 ) && DRLK.S.A0031 command: "readAttribute" attribute: "UserCodeTemporaryDisableTime" response: @@ -365,7 +341,7 @@ tests: - label: "Wait for UserCodeTemporaryDisableTime expires" cluster: "DelayCommands" command: "WaitForMs" - PICS: ( DRLK.S.F00 || DRLK.S.F01 ) && DRLK.S.A0031 + PICS: DRLK.S.F0c && ( DRLK.S.F00 || DRLK.S.F01 ) && DRLK.S.A0031 arguments: values: - name: "ms" @@ -436,14 +412,6 @@ tests: - name: "PINCode" value: "123456" - - label: "Wait for lock action to complete" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 5000 - - label: "Wait for AutoRelockTime Expires" cluster: "DelayCommands" command: "WaitForMs" diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_2.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_2.yaml index 351b8a9f464162..38290883e3b699 100644 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_2.yaml @@ -159,14 +159,6 @@ tests: command: "LockDoor" timedInteractionTimeoutMs: 1000 - - label: "Wait for lock action to complete" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 5000 - - label: "Step 4: TH sends Lock Door Command to the DUT with valid PINCode" PICS: DRLK.S.C00.Rsp command: "LockDoor" @@ -176,14 +168,6 @@ tests: - name: "PINCode" value: "123456" - - label: "Wait for lock action to complete" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 5000 - - label: "Step 5a: TH writes the RequirePINforRemoteOperation attribute value as False on the DUT" @@ -222,14 +206,6 @@ tests: - name: "PINCode" value: "123456" - - label: "Wait for lock action to complete" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 5000 - - label: "Step 8: TH sends Lock Door Command to the DUT without valid PINCode" PICS: DRLK.S.C00.Rsp && DRLK.S.A0033 diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_3.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_3.yaml index ebd47808a69ed4..644d59a39d146f 100644 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_3.yaml @@ -161,14 +161,6 @@ tests: command: "UnlockDoor" timedInteractionTimeoutMs: 1000 - - label: "Wait for lock action to complete" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 5000 - - label: "Step 4: TH sends the unlock Door command to the DUT with valid PINCode" @@ -180,14 +172,6 @@ tests: - name: "PINCode" value: "123456" - - label: "Wait for lock action to complete" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 5000 - - label: "Step 5a: TH writes the RequirePINforRemoteOperation attribute value as False on the DUT" @@ -228,14 +212,6 @@ tests: - name: "PINCode" value: "123456" - - label: "Wait for lock action to complete" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 5000 - - label: "Step 8: TH sends the unlock Door command to the DUT with invalid PINCode" @@ -445,14 +421,6 @@ tests: - name: "PINCode" value: "123456" - - label: "Wait for lock action to complete" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 5000 - - label: "Wait for AutoRelockTime Expires" cluster: "DelayCommands" command: "WaitForMs" diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_4.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_4.yaml index 2f0822daadf56f..7ae95330c7b37e 100644 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_4.yaml @@ -193,14 +193,6 @@ tests: - name: "PINCode" value: "123456" - - label: "Wait for lock action to complete" - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 5000 - - label: "Wait for AutoRelockTime Expires" cluster: "DelayCommands" command: "WaitForMs"