@@ -19,9 +19,9 @@ ocpp::v201::GetCertificateIdUseEnum to_ocpp_v201(ocpp::CertificateType other) {
19
19
return ocpp::v201::GetCertificateIdUseEnum::V2GCertificateChain;
20
20
case ocpp::CertificateType::MFRootCertificate:
21
21
return ocpp::v201::GetCertificateIdUseEnum::ManufacturerRootCertificate;
22
- default :
23
- throw std::runtime_error (" Could not convert CertificateType to GetCertificateIdUseEnum" );
24
22
}
23
+
24
+ throw std::runtime_error (" Could not convert CertificateType to GetCertificateIdUseEnum" );
25
25
}
26
26
27
27
ocpp::v201::InstallCertificateUseEnum to_ocpp_v201 (ocpp::CaCertificateType other) {
@@ -34,9 +34,9 @@ ocpp::v201::InstallCertificateUseEnum to_ocpp_v201(ocpp::CaCertificateType other
34
34
return ocpp::v201::InstallCertificateUseEnum::CSMSRootCertificate;
35
35
case ocpp::CaCertificateType::MF:
36
36
return ocpp::v201::InstallCertificateUseEnum::ManufacturerRootCertificate;
37
- default :
38
- throw std::runtime_error (" Could not convert CaCertificateType to InstallCertificateUseEnum" );
39
37
}
38
+
39
+ throw std::runtime_error (" Could not convert CaCertificateType to InstallCertificateUseEnum" );
40
40
}
41
41
42
42
ocpp::v201::CertificateSigningUseEnum to_ocpp_v201 (ocpp::CertificateSigningUseEnum other) {
@@ -45,9 +45,13 @@ ocpp::v201::CertificateSigningUseEnum to_ocpp_v201(ocpp::CertificateSigningUseEn
45
45
return ocpp::v201::CertificateSigningUseEnum::ChargingStationCertificate;
46
46
case ocpp::CertificateSigningUseEnum::V2GCertificate:
47
47
return ocpp::v201::CertificateSigningUseEnum::V2GCertificate;
48
- default :
49
- throw std::runtime_error (" Could not convert CertificateSigningUseEnum to CertificateSigningUseEnum" );
48
+ case ocpp::CertificateSigningUseEnum::ManufacturerCertificate:
49
+ // TODO: we don't have this value in ocpp
50
+ throw std::runtime_error (
51
+ " Could not convert ocpp::CertificateSigningUseEnum::ManufacturerCertificate missing type" );
50
52
}
53
+
54
+ throw std::runtime_error (" Could not convert CertificateSigningUseEnum to CertificateSigningUseEnum" );
51
55
}
52
56
53
57
ocpp::v201::HashAlgorithmEnum to_ocpp_v201 (ocpp::HashAlgorithmEnumType other) {
@@ -58,9 +62,9 @@ ocpp::v201::HashAlgorithmEnum to_ocpp_v201(ocpp::HashAlgorithmEnumType other) {
58
62
return ocpp::v201::HashAlgorithmEnum::SHA384;
59
63
case ocpp::HashAlgorithmEnumType::SHA512:
60
64
return ocpp::v201::HashAlgorithmEnum::SHA512;
61
- default :
62
- throw std::runtime_error (" Could not convert HashAlgorithmEnumType to HashAlgorithmEnum" );
63
65
}
66
+
67
+ throw std::runtime_error (" Could not convert HashAlgorithmEnumType to HashAlgorithmEnum" );
64
68
}
65
69
66
70
ocpp::v201::InstallCertificateStatusEnum to_ocpp_v201 (ocpp::InstallCertificateResult other) {
@@ -83,9 +87,9 @@ ocpp::v201::InstallCertificateStatusEnum to_ocpp_v201(ocpp::InstallCertificateRe
83
87
return ocpp::v201::InstallCertificateStatusEnum::Failed;
84
88
case ocpp::InstallCertificateResult::Accepted:
85
89
return ocpp::v201::InstallCertificateStatusEnum::Accepted;
86
- default :
87
- throw std::runtime_error (" Could not convert InstallCertificateResult to InstallCertificateStatusEnum" );
88
90
}
91
+
92
+ throw std::runtime_error (" Could not convert InstallCertificateResult to InstallCertificateStatusEnum" );
89
93
}
90
94
91
95
ocpp::v201::DeleteCertificateStatusEnum to_ocpp_v201 (ocpp::DeleteCertificateResult other) {
@@ -96,9 +100,9 @@ ocpp::v201::DeleteCertificateStatusEnum to_ocpp_v201(ocpp::DeleteCertificateResu
96
100
return ocpp::v201::DeleteCertificateStatusEnum ::Failed;
97
101
case ocpp::DeleteCertificateResult::NotFound:
98
102
return ocpp::v201::DeleteCertificateStatusEnum ::NotFound;
99
- default :
100
- throw std::runtime_error (" Could not convert DeleteCertificateResult to DeleteCertificateResult" );
101
103
}
104
+
105
+ throw std::runtime_error (" Could not convert DeleteCertificateResult to DeleteCertificateResult" );
102
106
}
103
107
104
108
ocpp::v201::CertificateHashDataType to_ocpp_v201 (ocpp::CertificateHashDataType other) {
@@ -155,9 +159,9 @@ ocpp::CertificateType from_ocpp_v201(ocpp::v201::GetCertificateIdUseEnum other)
155
159
return ocpp::CertificateType::CSMSRootCertificate;
156
160
case ocpp::v201::GetCertificateIdUseEnum::ManufacturerRootCertificate:
157
161
return ocpp::CertificateType::MFRootCertificate;
158
- default :
159
- throw std::runtime_error (" Could not convert GetCertificateIdUseEnum to CertificateType" );
160
162
}
163
+
164
+ throw std::runtime_error (" Could not convert GetCertificateIdUseEnum to CertificateType" );
161
165
}
162
166
163
167
std::vector<ocpp::CertificateType> from_ocpp_v201 (const std::vector<ocpp::v201::GetCertificateIdUseEnum>& other) {
@@ -178,9 +182,9 @@ ocpp::CaCertificateType from_ocpp_v201(ocpp::v201::InstallCertificateUseEnum oth
178
182
return ocpp::CaCertificateType::CSMS;
179
183
case ocpp::v201::InstallCertificateUseEnum::ManufacturerRootCertificate:
180
184
return ocpp::CaCertificateType::MF;
181
- default :
182
- throw std::runtime_error (" Could not convert CaCertificateType to InstallCertificateUseEnum" );
183
185
}
186
+
187
+ throw std::runtime_error (" Could not convert CaCertificateType to InstallCertificateUseEnum" );
184
188
}
185
189
186
190
ocpp::CertificateSigningUseEnum from_ocpp_v201 (ocpp::v201::CertificateSigningUseEnum other) {
@@ -189,9 +193,9 @@ ocpp::CertificateSigningUseEnum from_ocpp_v201(ocpp::v201::CertificateSigningUse
189
193
return ocpp::CertificateSigningUseEnum::ChargingStationCertificate;
190
194
case ocpp::v201::CertificateSigningUseEnum::V2GCertificate:
191
195
return ocpp::CertificateSigningUseEnum::V2GCertificate;
192
- default :
193
- throw std::runtime_error (" Could not convert CertificateSigningUseEnum to CertificateSigningUseEnum" );
194
196
}
197
+
198
+ throw std::runtime_error (" Could not convert CertificateSigningUseEnum to CertificateSigningUseEnum" );
195
199
}
196
200
197
201
ocpp::HashAlgorithmEnumType from_ocpp_v201 (ocpp::v201::HashAlgorithmEnum other) {
@@ -202,9 +206,9 @@ ocpp::HashAlgorithmEnumType from_ocpp_v201(ocpp::v201::HashAlgorithmEnum other)
202
206
return ocpp::HashAlgorithmEnumType::SHA384;
203
207
case ocpp::v201::HashAlgorithmEnum::SHA512:
204
208
return ocpp::HashAlgorithmEnumType::SHA512;
205
- default :
206
- throw std::runtime_error (" Could not convert HashAlgorithmEnum to HashAlgorithmEnumType" );
207
209
}
210
+
211
+ throw std::runtime_error (" Could not convert HashAlgorithmEnum to HashAlgorithmEnumType" );
208
212
}
209
213
210
214
ocpp::InstallCertificateResult from_ocpp_v201 (ocpp::v201::InstallCertificateStatusEnum other) {
@@ -215,10 +219,9 @@ ocpp::InstallCertificateResult from_ocpp_v201(ocpp::v201::InstallCertificateStat
215
219
return ocpp::InstallCertificateResult::WriteError;
216
220
case ocpp::v201::InstallCertificateStatusEnum::Accepted:
217
221
return ocpp::InstallCertificateResult::Accepted;
218
- default :
219
- throw std::runtime_error (
220
- " Could not convert InstallCertificateResult to evse_security::InstallCertificateResult" );
221
222
}
223
+
224
+ throw std::runtime_error (" Could not convert InstallCertificateResult to evse_security::InstallCertificateResult" );
222
225
}
223
226
224
227
ocpp::DeleteCertificateResult from_ocpp_v201 (ocpp::v201::DeleteCertificateStatusEnum other) {
@@ -229,9 +232,9 @@ ocpp::DeleteCertificateResult from_ocpp_v201(ocpp::v201::DeleteCertificateStatus
229
232
return ocpp::DeleteCertificateResult::Failed;
230
233
case ocpp::v201::DeleteCertificateStatusEnum::NotFound:
231
234
return ocpp::DeleteCertificateResult::NotFound;
232
- default :
233
- throw std::runtime_error (" Could not convert DeleteCertificateResult to evse_security::DeleteCertificateResult" );
234
235
}
236
+
237
+ throw std::runtime_error (" Could not convert DeleteCertificateResult to evse_security::DeleteCertificateResult" );
235
238
}
236
239
237
240
ocpp::CertificateHashDataType from_ocpp_v201 (ocpp::v201::CertificateHashDataType other) {
0 commit comments