@@ -27,34 +27,54 @@ public class CommissionerDeclaration {
27
27
* commissioning.
28
28
*/
29
29
public enum CdError {
30
- noError (0 ),
31
- commissionableDiscoveryFailed (1 ),
32
- paseConnectionFailed (2 ),
33
- paseAuthFailed (3 ),
34
- dacValidationFailed (4 ),
35
- alreadyOnFabric (5 ),
36
- operationalDiscoveryFailed (6 ),
37
- caseConnectionFailed (7 ),
38
- caseAuthFailed (8 ),
39
- configurationFailed (9 ),
40
- bindingConfigurationFailed (10 ),
41
- commissionerPasscodeNotSupported (11 ),
42
- invalidIdentificationDeclarationParams (12 ),
43
- appInstallConsentPending (13 ),
44
- appInstalling (14 ),
45
- appInstallFailed (15 ),
46
- appInstalledRetryNeeded (16 ),
47
- commissionerPasscodeDisabled (17 ),
48
- unexpectedCommissionerPasscodeReady (18 );
30
+ noError (0 , "No error" ),
31
+ commissionableDiscoveryFailed (1 , "Commissionable Node discovery failed" ),
32
+ paseConnectionFailed (2 , "PASE connection failed" ),
33
+ paseAuthFailed (3 , "PASE authentication failed (bad Passcode)" ),
34
+ dacValidationFailed (4 , "DAC validation failed" ),
35
+ alreadyOnFabric (5 , "Already on fabric" ),
36
+ operationalDiscoveryFailed (6 , "Operational Node discovery failed" ),
37
+ caseConnectionFailed (7 , "CASE connection failed" ),
38
+ caseAuthFailed (8 , "CASE authentication failed" ),
39
+ configurationFailed (9 , "Configuration failed" ),
40
+ bindingConfigurationFailed (10 , "Binding Configuration failed" ),
41
+ commissionerPasscodeNotSupported (11 , "Commissioner Passcode not supported" ),
42
+ invalidIdentificationDeclarationParams (12 , "Invalid UDC Identification Declaration parameters" ),
43
+ appInstallConsentPending (13 , "App Install Consent Pending" ),
44
+ appInstalling (14 , "App Installing" ),
45
+ appInstallFailed (15 , "App Install Failed" ),
46
+ appInstalledRetryNeeded (16 , "App Installed, Retry Needed" ),
47
+ commissionerPasscodeDisabled (17 , "Commissioner Passcode disabled" ),
48
+ unexpectedCommissionerPasscodeReady (18 , "Unexpected Commissioner Passcode ready" );
49
+
49
50
private final int value ;
51
+ private final String description ;
50
52
51
- CdError (int value ) {
53
+ private CdError (int value , String description ) {
52
54
this .value = value ;
55
+ this .description = description ;
56
+ }
57
+
58
+ private static String getDefaultDescription (int value ) {
59
+ for (CdError error : CdError .values ()) {
60
+ if (error .value == value ) {
61
+ return error .name ();
62
+ }
63
+ }
64
+ return "Unknown Error" ;
65
+ }
66
+
67
+ CdError (int value ) {
68
+ this (value , getDefaultDescription (value ));
53
69
}
54
70
55
71
public int getValue () {
56
72
return value ;
57
73
}
74
+
75
+ public String getDescription () {
76
+ return description ;
77
+ }
58
78
}
59
79
/** Feature: All - Indicates errors incurred during commissioning. */
60
80
private CdError errorCode = CdError .noError ;
0 commit comments