diff --git a/src/app/tests/suites/certification/Test_TC_WNCV_3_3.yaml b/src/app/tests/suites/certification/Test_TC_WNCV_3_3.yaml index 6b54f1b78fc367..651420e8e5126e 100644 --- a/src/app/tests/suites/certification/Test_TC_WNCV_3_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_WNCV_3_3.yaml @@ -111,13 +111,10 @@ tests: ### Step 3x -> Verify StopMotion longer period effects on Lift ### Mandatory/Optionality Depends on (PA & LF) for all 4x Steps - # TODO Remove disabled once issue 14502 is fixed - ### Read Current Position -> Store this value for step 4c - label: "3a: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT" - disabled: true command: "readAttribute" attribute: "CurrentPositionLiftPercent100ths" PICS: WNCV_LF && WNCV_PA_LF @@ -132,7 +129,6 @@ tests: - label: "3b: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute 3c: it Must be equal with CurrentPositionLiftPercent100ths from DUT" - disabled: true command: "readAttribute" attribute: "TargetPositionLiftPercent100ths" PICS: WNCV_LF && WNCV_PA_LF @@ -147,7 +143,6 @@ tests: - label: "4a: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT" - disabled: true command: "readAttribute" attribute: "CurrentPositionTiltPercent100ths" PICS: WNCV_TL && WNCV_PA_TL @@ -162,7 +157,6 @@ tests: - label: "4b: If (PA & TL) TH reads TargetPositionTiltPercent100ths attribute 4c: it Must be equal with CurrentPositionTiltPercent100ths from DUT" - disabled: true command: "readAttribute" attribute: "TargetPositionTiltPercent100ths" PICS: WNCV_TL && WNCV_PA_TL diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index e7228539d9d62d..37e9336746a08f 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -27317,6 +27317,152 @@ - (void)testSendClusterTest_TC_WNCV_3_3_000011_ReadAttribute [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +NSNumber * _Nullable attrCurrentPositionLift; +- (void)testSendClusterTest_TC_WNCV_3_3_000012_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"3a: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster + readAttributeCurrentPositionLiftPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3a: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 10000U); + } + } + { + id actualValue = value; + attrCurrentPositionLift = actualValue; + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_WNCV_3_3_000013_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"3b: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute 3c: it Must be " + @"equal with CurrentPositionLiftPercent100ths from DUT"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster + readAttributeTargetPositionLiftPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"3b: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute 3c: it Must be equal with " + @"CurrentPositionLiftPercent100ths from DUT Error: %@", + err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + if (attrCurrentPositionLift == nil) { + XCTAssertTrue(actualValue == nil); + } else { + XCTAssertFalse(actualValue == nil); + XCTAssertEqualObjects(actualValue, attrCurrentPositionLift); + } + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +NSNumber * _Nullable attrCurrentPositionTilt; +- (void)testSendClusterTest_TC_WNCV_3_3_000014_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"4a: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster + readAttributeCurrentPositionTiltPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"4a: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT Error: %@", err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertGreaterThanOrEqual([actualValue unsignedShortValue], 0U); + } + } + { + id actualValue = value; + if (actualValue != nil) { + XCTAssertLessThanOrEqual([actualValue unsignedShortValue], 10000U); + } + } + { + id actualValue = value; + attrCurrentPositionTilt = actualValue; + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTest_TC_WNCV_3_3_000015_ReadAttribute +{ + XCTestExpectation * expectation = + [self expectationWithDescription:@"4b: If (PA & TL) TH reads TargetPositionTiltPercent100ths attribute 4c: it Must be " + @"equal with CurrentPositionTiltPercent100ths from DUT"]; + + CHIPDevice * device = GetConnectedDevice(); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestWindowCovering * cluster = [[CHIPTestWindowCovering alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster + readAttributeTargetPositionTiltPercent100thsWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"4b: If (PA & TL) TH reads TargetPositionTiltPercent100ths attribute 4c: it Must be equal with " + @"CurrentPositionTiltPercent100ths from DUT Error: %@", + err); + + XCTAssertEqual([CHIPErrorTestUtils errorToZCLErrorCode:err], 0); + + { + id actualValue = value; + if (attrCurrentPositionTilt == nil) { + XCTAssertTrue(actualValue == nil); + } else { + XCTAssertFalse(actualValue == nil); + XCTAssertEqualObjects(actualValue, attrCurrentPositionTilt); + } + } + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} - (void)testSendClusterTestCluster_000000_WaitForCommissionee { diff --git a/zzz_generated/window-app/zap-generated/endpoint_config.h b/zzz_generated/window-app/zap-generated/endpoint_config.h index 6191c2e4027516..2d2840193f8f7a 100644 --- a/zzz_generated/window-app/zap-generated/endpoint_config.h +++ b/zzz_generated/window-app/zap-generated/endpoint_config.h @@ -275,12 +275,12 @@ /* Endpoint: 1, Cluster: Window Covering (server), big-endian */ \ \ /* 383 - FeatureMap, */ \ - 0x00, 0x00, 0x00, 0x01, \ + 0x00, 0x00, 0x00, 0x17, \ \ /* Endpoint: 2, Cluster: Window Covering (server), big-endian */ \ \ /* 387 - FeatureMap, */ \ - 0x00, 0x00, 0x00, 0x01, \ + 0x00, 0x00, 0x00, 0x17, \ } #else // !BIGENDIAN_CPU @@ -533,12 +533,12 @@ /* Endpoint: 1, Cluster: Window Covering (server), little-endian */ \ \ /* 383 - FeatureMap, */ \ - 0x01, 0x00, 0x00, 0x00, \ + 0x17, 0x00, 0x00, 0x00, \ \ /* Endpoint: 2, Cluster: Window Covering (server), little-endian */ \ \ /* 387 - FeatureMap, */ \ - 0x01, 0x00, 0x00, 0x00, \ + 0x17, 0x00, 0x00, 0x00, \ } #endif // BIGENDIAN_CPU