Skip to content

Commit 2d1f43f

Browse files
committed
legacy flag added
1 parent 1114858 commit 2d1f43f

File tree

1 file changed

+36
-5
lines changed

1 file changed

+36
-5
lines changed

src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py

+36-5
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,8 @@ class MatterTestConfig:
609609
# path to device attestation revocation set json file
610610
dac_revocation_set_path: Optional[pathlib.Path] = None
611611

612+
legacy: Optional[bool] = None
613+
612614

613615
class ClusterMapper:
614616
"""Describe clusters/attributes using schema names."""
@@ -1222,13 +1224,37 @@ async def send_test_event_triggers(self, eventTrigger: int, enableKey: bytes = N
12221224
else:
12231225
enableKey = self.matter_test_config.global_test_params['enableKey']
12241226

1227+
# What about --endpoing != 0 and legacy = True? Right now target endpoint is set to 0
1228+
1229+
target_endpoint = 0
1230+
if not self.matter_test_config.legacy and self.matter_test_config.endpoint is not None:
1231+
target_endpoint = self.matter_test_config.endpoint
1232+
1233+
print("")
1234+
print("Target endpoint: ", target_endpoint)
1235+
print("")
1236+
1237+
print("")
1238+
print("Event trigger: ", hex(eventTrigger))
1239+
print("")
1240+
1241+
eventTrigger = eventTrigger | (target_endpoint << 32)
1242+
1243+
print("")
1244+
print("Event trigger: ", hex(eventTrigger))
1245+
print("")
1246+
12251247
try:
12261248
# GeneralDiagnostics cluster is meant to be on Endpoint 0 (Root)
1227-
await self.send_single_cmd(endpoint=0,
1228-
cmd=Clusters.GeneralDiagnostics.Commands.TestEventTrigger(
1229-
enableKey,
1230-
eventTrigger)
1231-
)
1249+
general_diagnostics_result = await self.send_single_cmd(endpoint=0,
1250+
cmd=Clusters.GeneralDiagnostics.Commands.TestEventTrigger(
1251+
enableKey,
1252+
eventTrigger)
1253+
)
1254+
1255+
print("")
1256+
logger.info(general_diagnostics_result)
1257+
print("")
12321258

12331259
except InteractionModelError as e:
12341260
asserts.fail(
@@ -1862,6 +1888,8 @@ def convert_args_to_matter_config(args: argparse.Namespace) -> MatterTestConfig:
18621888
config.app_pid = 0 if args.app_pid is None else args.app_pid
18631889
config.fail_on_skipped_tests = args.fail_on_skipped
18641890

1891+
config.legacy = True if args.use_legacy_test_event_triggers else args.use_legacy_test_event_triggers
1892+
18651893
config.controller_node_id = args.controller_node_id
18661894
config.trace_to = args.trace_to
18671895

@@ -1920,6 +1948,9 @@ def parse_matter_test_args(argv: Optional[List[str]] = None) -> MatterTestConfig
19201948
basic_group.add_argument('--timeout', type=int, help="Test timeout in seconds")
19211949
basic_group.add_argument("--PICS", help="PICS file path", type=str)
19221950

1951+
basic_group.add_argument("--use-legacy-test-event-triggers", action="store_true", default=False,
1952+
help="Send test event triggers with endpoint 0 for older devices")
1953+
19231954
commission_group = parser.add_argument_group(title="Commissioning", description="Arguments to commission a node")
19241955

19251956
commission_group.add_argument('-m', '--commissioning-method', type=str,

0 commit comments

Comments
 (0)