@@ -54,57 +54,57 @@ LinuxDeviceOptions gDeviceOptions;
54
54
// Follow the code style of command line arguments in case we need to add more options in the future.
55
55
enum
56
56
{
57
- kDeviceOption_BleDevice = 0x1000 ,
58
- kDeviceOption_WiFi = 0x1001 ,
59
- kDeviceOption_Thread = 0x1002 ,
60
- kDeviceOption_Version = 0x1003 ,
61
- kDeviceOption_VendorID = 0x1004 ,
62
- kDeviceOption_ProductID = 0x1005 ,
63
- kDeviceOption_CustomFlow = 0x1006 ,
64
- kDeviceOption_Capabilities = 0x1007 ,
65
- kDeviceOption_Discriminator = 0x1008 ,
66
- kDeviceOption_Passcode = 0x1009 ,
57
+ kDeviceOption_BleDevice = 0x1000 ,
58
+ kDeviceOption_WiFi ,
59
+ kDeviceOption_Thread ,
60
+ kDeviceOption_Version ,
61
+ kDeviceOption_VendorID ,
62
+ kDeviceOption_ProductID ,
63
+ kDeviceOption_CustomFlow ,
64
+ kDeviceOption_Capabilities ,
65
+ kDeviceOption_Discriminator ,
66
+ kDeviceOption_Passcode ,
67
67
#if CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE || CHIP_DEVICE_ENABLE_PORT_PARAMS
68
- kDeviceOption_SecuredDevicePort = 0x100a ,
69
- kDeviceOption_UnsecuredCommissionerPort = 0x100b ,
68
+ kDeviceOption_SecuredDevicePort ,
69
+ kDeviceOption_UnsecuredCommissionerPort ,
70
70
#endif
71
71
#if CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE
72
- kDeviceOption_SecuredCommissionerPort = 0x100c ,
72
+ kDeviceOption_SecuredCommissionerPort ,
73
+ kCommissionerOption_FabricID ,
73
74
#endif
74
- kDeviceOption_Command = 0x100d ,
75
- kDeviceOption_PICS = 0x100e ,
76
- kDeviceOption_KVS = 0x100f ,
77
- kDeviceOption_InterfaceId = 0x1010 ,
78
- kDeviceOption_Spake2pVerifierBase64 = 0x1011 ,
79
- kDeviceOption_Spake2pSaltBase64 = 0x1012 ,
80
- kDeviceOption_Spake2pIterations = 0x1013 ,
81
- kDeviceOption_TraceFile = 0x1014 ,
82
- kDeviceOption_TraceLog = 0x1015 ,
83
- kDeviceOption_TraceDecode = 0x1016 ,
84
- kOptionCSRResponseCSRIncorrectType = 0x1017 ,
85
- kOptionCSRResponseCSRNonceIncorrectType = 0x1018 ,
86
- kOptionCSRResponseCSRNonceTooLong = 0x1019 ,
87
- kOptionCSRResponseCSRNonceInvalid = 0x101a ,
88
- kOptionCSRResponseNOCSRElementsTooLong = 0x101b ,
89
- kOptionCSRResponseAttestationSignatureIncorrectType = 0x101c ,
90
- kOptionCSRResponseAttestationSignatureInvalid = 0x101d ,
91
- kOptionCSRResponseCSRExistingKeyPair = 0x101e ,
92
- kDeviceOption_TestEventTriggerEnableKey = 0x101f ,
93
- kCommissionerOption_FabricID = 0x1020 ,
94
- kTraceTo = 0x1021 ,
95
- kOptionSimulateNoInternalTime = 0x1022 ,
75
+ kDeviceOption_Command ,
76
+ kDeviceOption_PICS ,
77
+ kDeviceOption_KVS ,
78
+ kDeviceOption_InterfaceId ,
79
+ kDeviceOption_Spake2pVerifierBase64 ,
80
+ kDeviceOption_Spake2pSaltBase64 ,
81
+ kDeviceOption_Spake2pIterations ,
82
+ kDeviceOption_TraceFile ,
83
+ kDeviceOption_TraceLog ,
84
+ kDeviceOption_TraceDecode ,
85
+ kOptionCSRResponseCSRIncorrectType ,
86
+ kOptionCSRResponseCSRNonceIncorrectType ,
87
+ kOptionCSRResponseCSRNonceTooLong ,
88
+ kOptionCSRResponseCSRNonceInvalid ,
89
+ kOptionCSRResponseNOCSRElementsTooLong ,
90
+ kOptionCSRResponseAttestationSignatureIncorrectType ,
91
+ kOptionCSRResponseAttestationSignatureInvalid ,
92
+ kOptionCSRResponseCSRExistingKeyPair ,
93
+ kDeviceOption_TestEventTriggerEnableKey ,
94
+ kTraceTo ,
95
+ kOptionSimulateNoInternalTime ,
96
96
#if defined(PW_RPC_ENABLED)
97
- kOptionRpcServerPort = 0x1023 ,
97
+ kOptionRpcServerPort ,
98
98
#endif
99
99
#if CONFIG_BUILD_FOR_HOST_UNIT_TEST
100
- kDeviceOption_SubscriptionCapacity = 0x1024 ,
100
+ kDeviceOption_SubscriptionCapacity ,
101
101
#endif
102
- kDeviceOption_WiFiSupports5g = 0x1025 ,
102
+ kDeviceOption_WiFiSupports5g ,
103
103
#if CONFIG_BUILD_FOR_HOST_UNIT_TEST
104
- kDeviceOption_SubscriptionResumptionRetryIntervalSec = 0x1026 ,
104
+ kDeviceOption_SubscriptionResumptionRetryIntervalSec ,
105
105
#endif
106
106
#if CHIP_WITH_NLFAULTINJECTION
107
- kDeviceOption_FaultInjection = 0x1027 ,
107
+ kDeviceOption_FaultInjection ,
108
108
#endif
109
109
};
110
110
@@ -137,6 +137,7 @@ OptionDef sDeviceOptionDefs[] = {
137
137
#endif
138
138
#if CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE
139
139
{ " secured-commissioner-port" , kArgumentRequired , kDeviceOption_SecuredCommissionerPort },
140
+ { " commissioner-fabric-id" , kArgumentRequired , kCommissionerOption_FabricID },
140
141
#endif
141
142
{ " command" , kArgumentRequired , kDeviceOption_Command },
142
143
{ " PICS" , kArgumentRequired , kDeviceOption_PICS },
@@ -156,7 +157,6 @@ OptionDef sDeviceOptionDefs[] = {
156
157
{ " cert_error_attestation_signature_incorrect_type" , kNoArgument , kOptionCSRResponseAttestationSignatureIncorrectType },
157
158
{ " cert_error_attestation_signature_invalid" , kNoArgument , kOptionCSRResponseAttestationSignatureInvalid },
158
159
{ " enable-key" , kArgumentRequired , kDeviceOption_TestEventTriggerEnableKey },
159
- { " commissioner-fabric-id" , kArgumentRequired , kCommissionerOption_FabricID },
160
160
#if ENABLE_TRACING
161
161
{ " trace-to" , kArgumentRequired , kTraceTo },
162
162
#endif
@@ -239,15 +239,15 @@ const char * sDeviceOptionHelp =
239
239
" A 16-bit unsigned integer specifying the port to use for unsecured commissioner messages (default is 5550).\n "
240
240
" \n "
241
241
#endif
242
- #if CHIP_DEVICE_ENABLE_PORT_PARAMS
242
+ #if CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE
243
243
" --secured-commissioner-port <port>\n "
244
244
" A 16-bit unsigned integer specifying the listen port to use for secure commissioner messages (default is 5552). Only "
245
245
" valid when app is both device and commissioner\n "
246
246
" \n "
247
- #endif
248
247
" --commissioner-fabric-id <fabricid>\n "
249
248
" The fabric ID to be used when this device is a commissioner (default in code is 1).\n "
250
249
" \n "
250
+ #endif
251
251
" --command <command-name>\n "
252
252
" A name for a command to execute during startup.\n "
253
253
" \n "
@@ -476,6 +476,11 @@ bool HandleOption(const char * aProgram, OptionSet * aOptions, int aIdentifier,
476
476
case kDeviceOption_SecuredCommissionerPort :
477
477
LinuxDeviceOptions::GetInstance ().securedCommissionerPort = static_cast <uint16_t >(atoi (aValue));
478
478
break ;
479
+ case kCommissionerOption_FabricID : {
480
+ char * eptr;
481
+ LinuxDeviceOptions::GetInstance ().commissionerFabricId = (chip::FabricId) strtoull (aValue, &eptr, 0 );
482
+ break ;
483
+ }
479
484
#endif
480
485
481
486
case kDeviceOption_Command :
@@ -550,11 +555,6 @@ bool HandleOption(const char * aProgram, OptionSet * aOptions, int aIdentifier,
550
555
551
556
break ;
552
557
}
553
- case kCommissionerOption_FabricID : {
554
- char * eptr;
555
- LinuxDeviceOptions::GetInstance ().commissionerFabricId = (chip::FabricId) strtoull (aValue, &eptr, 0 );
556
- break ;
557
- }
558
558
#if ENABLE_TRACING
559
559
case kTraceTo :
560
560
LinuxDeviceOptions::GetInstance ().traceTo .push_back (aValue);
0 commit comments