@@ -609,6 +609,8 @@ class MatterTestConfig:
609
609
# path to device attestation revocation set json file
610
610
dac_revocation_set_path : Optional [pathlib .Path ] = None
611
611
612
+ legacy : Optional [bool ] = None
613
+
612
614
613
615
class ClusterMapper :
614
616
"""Describe clusters/attributes using schema names."""
@@ -1222,13 +1224,37 @@ async def send_test_event_triggers(self, eventTrigger: int, enableKey: bytes = N
1222
1224
else :
1223
1225
enableKey = self .matter_test_config .global_test_params ['enableKey' ]
1224
1226
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
+
1225
1247
try :
1226
1248
# 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 ("" )
1232
1258
1233
1259
except InteractionModelError as e :
1234
1260
asserts .fail (
@@ -1862,6 +1888,8 @@ def convert_args_to_matter_config(args: argparse.Namespace) -> MatterTestConfig:
1862
1888
config .app_pid = 0 if args .app_pid is None else args .app_pid
1863
1889
config .fail_on_skipped_tests = args .fail_on_skipped
1864
1890
1891
+ config .legacy = True if args .use_legacy_test_event_triggers else args .use_legacy_test_event_triggers
1892
+
1865
1893
config .controller_node_id = args .controller_node_id
1866
1894
config .trace_to = args .trace_to
1867
1895
@@ -1920,6 +1948,9 @@ def parse_matter_test_args(argv: Optional[List[str]] = None) -> MatterTestConfig
1920
1948
basic_group .add_argument ('--timeout' , type = int , help = "Test timeout in seconds" )
1921
1949
basic_group .add_argument ("--PICS" , help = "PICS file path" , type = str )
1922
1950
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
+
1923
1954
commission_group = parser .add_argument_group (title = "Commissioning" , description = "Arguments to commission a node" )
1924
1955
1925
1956
commission_group .add_argument ('-m' , '--commissioning-method' , type = str ,
0 commit comments