This repository has been archived by the owner on Mar 23, 2023. It is now read-only.
/
errors.h
683 lines (639 loc) · 33.6 KB
/
errors.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
/*******************************************************************************
* Ledger Nano S - Secure firmware
* (c) 2022 Ledger
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
********************************************************************************/
#if !defined(ERRORS_H)
#define ERRORS_H
/**
* The OS error codes are encoded on two bytes (0xabcd), with the following
* structure:
* 'a': The error code category,
* 'b': The error code subcategory,
* 'cd': The error code identifier (depends on the two previous fields).
* The 'B000' - 'EFFF' range is reserved for applications, if they want to
* have the same uniqueness mechanism in their error codes.
*/
/**
* OS-reserved error codes ranges.
* Applications should avoid using them for their own implementations,
* except for the SWO_SUCCESS value.
*/
#define ERR_IOL_RANGE 0x1000
#define ERR_TSK_RANGE 0x2000
#define ERR_CRY_RANGE 0x3000
#define ERR_PAR_RANGE 0x4000
#define ERR_SEC_RANGE 0x5000
#define ERR_APD_RANGE 0x6000
#define ERR_MUI_RANGE 0xA000
/**
* Applications-reserved error codes ranges.
* The Operating System do not use any error code within these ranges.
*/
#define ERR_APP_RANGE_01 0xB000
#define ERR_APP_RANGE_02 0xC000
#define ERR_APP_RANGE_03 0xD000
#define ERR_APP_RANGE_04 0xE000
// Generic subcategories.
#define ERR_GEN_SUB_01 0x0100
#define ERR_GEN_SUB_02 0x0200
#define ERR_GEN_SUB_03 0x0300
#define ERR_GEN_SUB_04 0x0400
#define ERR_GEN_SUB_05 0x0500
#define ERR_GEN_SUB_06 0x0600
#define ERR_GEN_SUB_07 0x0700
#define ERR_GEN_SUB_08 0x0800
#define ERR_GEN_SUB_09 0x0900
#define ERR_GEN_SUB_0D 0x0D00
#define ERR_GEN_SUB_0E 0x0E00
// Generic identifiers.
enum generic_identifiers {
ERR_GEN_ID_01 = 0x01,
ERR_GEN_ID_02,
ERR_GEN_ID_03,
ERR_GEN_ID_04,
ERR_GEN_ID_05,
ERR_GEN_ID_06,
ERR_GEN_ID_07,
ERR_GEN_ID_08,
ERR_GEN_ID_09,
ERR_GEN_ID_0A,
ERR_GEN_ID_0B,
ERR_GEN_ID_0C,
ERR_GEN_ID_0D,
ERR_GEN_ID_0E,
ERR_GEN_ID_0F,
ERR_GEN_ID_10,
ERR_GEN_ID_11,
ERR_GEN_ID_12,
ERR_GEN_ID_13,
ERR_GEN_ID_14,
ERR_GEN_ID_15,
ERR_GEN_ID_16,
ERR_GEN_ID_17,
ERR_GEN_ID_18,
ERR_GEN_ID_19,
ERR_GEN_ID_1A,
ERR_GEN_ID_1B,
ERR_GEN_ID_1C,
ERR_GEN_ID_1D,
ERR_GEN_ID_1E,
ERR_GEN_ID_1F,
ERR_GEN_ID_20,
ERR_GEN_ID_21,
ERR_GEN_ID_22,
ERR_GEN_ID_23,
ERR_GEN_ID_24,
ERR_GEN_ID_25,
ERR_GEN_ID_26,
ERR_GEN_ID_27,
ERR_GEN_ID_28,
ERR_GEN_ID_29,
ERR_GEN_ID_2A,
ERR_GEN_ID_2B,
ERR_GEN_ID_2C
};
/**
* I/O-related issues are categorized into:
* Overflow issues (OFW),
* Header issues (HDR),
* State issues (STA),
* Reset issues (RST),
* BLE issues (BLE).
*/
#define ERR_IOL_OFW (ERR_IOL_RANGE + ERR_GEN_SUB_01)
#define ERR_IOL_HDR (ERR_IOL_RANGE + ERR_GEN_SUB_02)
#define ERR_IOL_STA (ERR_IOL_RANGE + ERR_GEN_SUB_03)
#define ERR_IOL_RST (ERR_IOL_RANGE + ERR_GEN_SUB_04)
#if defined(HAVE_BLE)
#define ERR_IOL_BLE (ERR_IOL_RANGE + ERR_GEN_SUB_05)
#endif // HAVE_BLE
#define SWO_IOL_OFW_01 (ERR_IOL_OFW + ERR_GEN_ID_01) // 0x1101
#define SWO_IOL_OFW_02 (ERR_IOL_OFW + ERR_GEN_ID_02) // 0x1102
#define SWO_IOL_OFW_03 (ERR_IOL_OFW + ERR_GEN_ID_03) // 0x1103
#define SWO_IOL_OFW_04 (ERR_IOL_OFW + ERR_GEN_ID_04) // 0x1104
#define SWO_IOL_OFW_05 (ERR_IOL_OFW + ERR_GEN_ID_05) // 0x1105
#define SWO_IOL_HDR_01 (ERR_IOL_HDR + ERR_GEN_ID_01) // 0x1201
#define SWO_IOL_HDR_02 (ERR_IOL_HDR + ERR_GEN_ID_02) // 0x1202
#define SWO_IOL_HDR_03 (ERR_IOL_HDR + ERR_GEN_ID_03) // 0x1203
#define SWO_IOL_HDR_04 (ERR_IOL_HDR + ERR_GEN_ID_04) // 0x1204
#define SWO_IOL_HDR_05 (ERR_IOL_HDR + ERR_GEN_ID_05) // 0x1205
#define SWO_IOL_HDR_06 (ERR_IOL_HDR + ERR_GEN_ID_06) // 0x1206
#define SWO_IOL_HDR_07 (ERR_IOL_HDR + ERR_GEN_ID_07) // 0x1207
#define SWO_IOL_HDR_08 (ERR_IOL_HDR + ERR_GEN_ID_08) // 0x1208
#define SWO_IOL_STA_01 (ERR_IOL_STA + ERR_GEN_ID_01) // 0x1301
#define SWO_IOL_STA_02 (ERR_IOL_STA + ERR_GEN_ID_02) // 0x1302
#define SWO_IOL_STA_03 (ERR_IOL_STA + ERR_GEN_ID_03) // 0x1303
#define SWO_IOL_STA_04 (ERR_IOL_STA + ERR_GEN_ID_04) // 0x1304
#define SWO_IOL_RST_01 (ERR_IOL_RST + ERR_GEN_ID_01) // 0x1401
#define SWO_IOL_RST_02 (ERR_IOL_RST + ERR_GEN_ID_02) // 0x1402
#define SWO_IOL_RST_03 (ERR_IOL_RST + ERR_GEN_ID_03) // 0x1403
#define SWO_IOL_RST_05 \
(ERR_IOL_RST + ERR_GEN_ID_05) // 0x1405 - Do not move this value.
#if defined(HAVE_BLE)
#define SWO_IOL_BLE_01 (ERR_IOL_BLE + ERR_GEN_ID_01) // 0x1501
#define SWO_IOL_BLE_02 (ERR_IOL_BLE + ERR_GEN_ID_02) // 0x1502
#define SWO_IOL_BLE_03 (ERR_IOL_BLE + ERR_GEN_ID_03) // 0x1503
#define SWO_IOL_BLE_04 (ERR_IOL_BLE + ERR_GEN_ID_04) // 0x1504
#define SWO_IOL_BLE_05 (ERR_IOL_BLE + ERR_GEN_ID_05) // 0x1505
#define SWO_IOL_BLE_06 (ERR_IOL_BLE + ERR_GEN_ID_06) // 0x1506
#define SWO_IOL_BLE_07 (ERR_IOL_BLE + ERR_GEN_ID_07) // 0x1507
#define SWO_IOL_BLE_08 (ERR_IOL_BLE + ERR_GEN_ID_08) // 0x1508
#define SWO_IOL_BLE_09 (ERR_IOL_BLE + ERR_GEN_ID_09) // 0x1509
#define SWO_IOL_BLE_0A (ERR_IOL_BLE + ERR_GEN_ID_0A) // 0x150A
#define SWO_IOL_BLE_0B (ERR_IOL_BLE + ERR_GEN_ID_0B) // 0x150B
#define SWO_IOL_BLE_0C (ERR_IOL_BLE + ERR_GEN_ID_0C) // 0x150C
#endif // HAVE_BLE
/**
* Tasks-related issues are categorized into:
* Stack issues (STC),
* Task Owner issues (OWN),
* Overflow issues (OFW).
*/
#define ERR_TSK_STC (ERR_TSK_RANGE + ERR_GEN_SUB_01)
#define ERR_TSK_OWN (ERR_TSK_RANGE + ERR_GEN_SUB_02)
#define ERR_TSK_OFW (ERR_TSK_RANGE + ERR_GEN_SUB_03)
#define SWO_TSK_STC_01 (ERR_TSK_STC + ERR_GEN_ID_01) // 0x2101
#define SWO_TSK_STC_02 (ERR_TSK_STC + ERR_GEN_ID_02) // 0x2102
#define SWO_TSK_STC_03 (ERR_TSK_STC + ERR_GEN_ID_03) // 0x2103
#define SWO_TSK_STC_04 (ERR_TSK_STC + ERR_GEN_ID_04) // 0x2104
#define SWO_TSK_STC_05 (ERR_TSK_STC + ERR_GEN_ID_05) // 0x2105
#define SWO_TSK_STC_06 (ERR_TSK_STC + ERR_GEN_ID_06) // 0x2106
#define SWO_TSK_STC_07 (ERR_TSK_STC + ERR_GEN_ID_07) // 0x2107
#define SWO_TSK_STC_08 (ERR_TSK_STC + ERR_GEN_ID_08) // 0x2108
#define SWO_TSK_OWN_01 (ERR_TSK_OWN + ERR_GEN_ID_01) // 0x2201
#define SWO_TSK_OWN_02 (ERR_TSK_OWN + ERR_GEN_ID_02) // 0x2202
#define SWO_TSK_OWN_03 (ERR_TSK_OWN + ERR_GEN_ID_03) // 0x2203
#define SWO_TSK_OWN_04 (ERR_TSK_OWN + ERR_GEN_ID_04) // 0x2204
#define SWO_TSK_OFW_01 (ERR_TSK_OFW + ERR_GEN_ID_01) // 0x2301
#define SWO_TSK_OFW_02 (ERR_TSK_OFW + ERR_GEN_ID_02) // 0x2302
/**
* Cryptography parameter-related issues are categorized into:
* Lengths mismatch in functions (LEN),
* Values mismatch in functions (VAL).
*/
#define ERR_CRY_LEN (ERR_CRY_RANGE + ERR_GEN_SUB_01)
#define ERR_CRY_VAL (ERR_CRY_RANGE + ERR_GEN_SUB_02)
// Not used yet.
#define SWO_CRY_LEN_01 (ERR_CRY_LEN + ERR_GEN_ID_01) // 0x3101
#define SWO_CRY_VAL_01 (ERR_CRY_VAL + ERR_GEN_ID_01) // 0x3201
/**
* OS (except cryptography) parameter-related issues are categorized into:
* Lengths mismatch in functions (LEN),
* Values mismatch in functions (VAL).
*/
#define ERR_PAR_LEN (ERR_PAR_RANGE + ERR_GEN_SUB_01)
#define ERR_PAR_VAL (ERR_PAR_RANGE + ERR_GEN_SUB_02)
#define SWO_PAR_LEN_01 (ERR_PAR_LEN + ERR_GEN_ID_01) // 0x4101
#define SWO_PAR_LEN_02 (ERR_PAR_LEN + ERR_GEN_ID_02) // 0x4102
#define SWO_PAR_LEN_03 (ERR_PAR_LEN + ERR_GEN_ID_03) // 0x4103
#define SWO_PAR_LEN_04 (ERR_PAR_LEN + ERR_GEN_ID_04) // 0x4104
#define SWO_PAR_LEN_05 (ERR_PAR_LEN + ERR_GEN_ID_05) // 0x4105
#define SWO_PAR_LEN_06 (ERR_PAR_LEN + ERR_GEN_ID_06) // 0x4106
#define SWO_PAR_LEN_07 (ERR_PAR_LEN + ERR_GEN_ID_07) // 0x4107
#define SWO_PAR_LEN_08 (ERR_PAR_LEN + ERR_GEN_ID_08) // 0x4108
#define SWO_PAR_LEN_09 (ERR_PAR_LEN + ERR_GEN_ID_09) // 0x4109
#define SWO_PAR_LEN_0A (ERR_PAR_LEN + ERR_GEN_ID_0A) // 0x410A
#define SWO_PAR_LEN_0B (ERR_PAR_LEN + ERR_GEN_ID_0B) // 0x410B
#define SWO_PAR_LEN_0C (ERR_PAR_LEN + ERR_GEN_ID_0C) // 0x410C
#define SWO_PAR_LEN_0D (ERR_PAR_LEN + ERR_GEN_ID_0D) // 0x410D
#define SWO_PAR_LEN_0E (ERR_PAR_LEN + ERR_GEN_ID_0E) // 0x410E
#define SWO_PAR_LEN_0F (ERR_PAR_LEN + ERR_GEN_ID_0F) // 0x410F
#define SWO_PAR_LEN_10 (ERR_PAR_LEN + ERR_GEN_ID_10) // 0x4110
#define SWO_PAR_LEN_11 (ERR_PAR_LEN + ERR_GEN_ID_11) // 0x4111
#define SWO_PAR_LEN_12 (ERR_PAR_LEN + ERR_GEN_ID_12) // 0x4112
#define SWO_PAR_LEN_13 (ERR_PAR_LEN + ERR_GEN_ID_13) // 0x4113
#define SWO_PAR_LEN_14 (ERR_PAR_LEN + ERR_GEN_ID_14) // 0x4114
#define SWO_PAR_LEN_15 (ERR_PAR_LEN + ERR_GEN_ID_15) // 0x4115
#define SWO_PAR_LEN_16 (ERR_PAR_LEN + ERR_GEN_ID_16) // 0x4116
#define SWO_PAR_VAL_01 (ERR_PAR_VAL + ERR_GEN_ID_01) // 0x4201
#define SWO_PAR_VAL_02 (ERR_PAR_VAL + ERR_GEN_ID_02) // 0x4202
#define SWO_PAR_VAL_03 (ERR_PAR_VAL + ERR_GEN_ID_03) // 0x4203
#define SWO_PAR_VAL_04 (ERR_PAR_VAL + ERR_GEN_ID_04) // 0x4204
#define SWO_PAR_VAL_05 (ERR_PAR_VAL + ERR_GEN_ID_05) // 0x4205
#define SWO_PAR_VAL_06 (ERR_PAR_VAL + ERR_GEN_ID_06) // 0x4206
#define SWO_PAR_VAL_07 (ERR_PAR_VAL + ERR_GEN_ID_07) // 0x4207
#define SWO_PAR_VAL_08 (ERR_PAR_VAL + ERR_GEN_ID_08) // 0x4208
#define SWO_PAR_VAL_09 (ERR_PAR_VAL + ERR_GEN_ID_09) // 0x4209
#define SWO_PAR_VAL_0A (ERR_PAR_VAL + ERR_GEN_ID_0A) // 0x420A
#define SWO_PAR_VAL_0B (ERR_PAR_VAL + ERR_GEN_ID_0B) // 0x420B
#define SWO_PAR_VAL_0C (ERR_PAR_VAL + ERR_GEN_ID_0C) // 0x420C
#define SWO_PAR_VAL_0D (ERR_PAR_VAL + ERR_GEN_ID_0D) // 0x420D
#define SWO_PAR_VAL_0E (ERR_PAR_VAL + ERR_GEN_ID_0E) // 0x420E
#define SWO_PAR_VAL_0F (ERR_PAR_VAL + ERR_GEN_ID_0F) // 0x420F
#define SWO_PAR_VAL_10 (ERR_PAR_VAL + ERR_GEN_ID_10) // 0x4210
#define SWO_PAR_VAL_11 (ERR_PAR_VAL + ERR_GEN_ID_11) // 0x4211
#define SWO_PAR_VAL_12 (ERR_PAR_VAL + ERR_GEN_ID_12) // 0x4212
#define SWO_PAR_VAL_13 (ERR_PAR_VAL + ERR_GEN_ID_13) // 0x4213
#define SWO_PAR_VAL_14 (ERR_PAR_VAL + ERR_GEN_ID_14) // 0x4214
#define SWO_PAR_VAL_15 (ERR_PAR_VAL + ERR_GEN_ID_15) // 0x4215
#define SWO_PAR_VAL_16 (ERR_PAR_VAL + ERR_GEN_ID_16) // 0x4216
#define SWO_PAR_VAL_17 (ERR_PAR_VAL + ERR_GEN_ID_17) // 0x4217
#define SWO_PAR_VAL_18 (ERR_PAR_VAL + ERR_GEN_ID_18) // 0x4218
#define SWO_PAR_VAL_19 (ERR_PAR_VAL + ERR_GEN_ID_19) // 0x4219
#define SWO_PAR_VAL_1A (ERR_PAR_VAL + ERR_GEN_ID_1A) // 0x421A
#define SWO_PAR_VAL_1B (ERR_PAR_VAL + ERR_GEN_ID_1B) // 0x421B
#define SWO_PAR_VAL_1C (ERR_PAR_VAL + ERR_GEN_ID_1C) // 0x421C
#define SWO_PAR_VAL_1D (ERR_PAR_VAL + ERR_GEN_ID_1D) // 0x421D
#define SWO_PAR_VAL_1E (ERR_PAR_VAL + ERR_GEN_ID_1E) // 0x421E
#define SWO_PAR_VAL_1F (ERR_PAR_VAL + ERR_GEN_ID_1F) // 0x421F
#define SWO_PAR_VAL_20 (ERR_PAR_VAL + ERR_GEN_ID_20) // 0x4220
#define SWO_PAR_VAL_21 (ERR_PAR_VAL + ERR_GEN_ID_21) // 0x4221
#define SWO_PAR_VAL_22 (ERR_PAR_VAL + ERR_GEN_ID_22) // 0x4222
#define SWO_PAR_VAL_23 (ERR_PAR_VAL + ERR_GEN_ID_23) // 0x4223
#define SWO_PAR_VAL_24 (ERR_PAR_VAL + ERR_GEN_ID_24) // 0x4224
#define SWO_PAR_VAL_25 (ERR_PAR_VAL + ERR_GEN_ID_25) // 0x4225
#define SWO_PAR_VAL_26 (ERR_PAR_VAL + ERR_GEN_ID_26) // 0x4226
#define SWO_PAR_VAL_27 (ERR_PAR_VAL + ERR_GEN_ID_27) // 0x4227
/**
* Security-related issues are categorized into:
* Application registry-related issues (APP),
* CRC checks issues (CRC),
* Miscellaneous security checks (CHK),
* Key-related operations (KEY),
* User consent-related operations (PIN),
* SCP-related operations (SCP),
* Signature-related operations (SIG),
* Memory Management operation (MEM),
* Device state issues (STA).
*/
#define ERR_SEC_APP (ERR_SEC_RANGE + ERR_GEN_SUB_01)
#define ERR_SEC_CRC (ERR_SEC_RANGE + ERR_GEN_SUB_02)
#define ERR_SEC_CHK (ERR_SEC_RANGE + ERR_GEN_SUB_03)
#define ERR_SEC_KEY (ERR_SEC_RANGE + ERR_GEN_SUB_04)
#define ERR_SEC_PIN (ERR_SEC_RANGE + ERR_GEN_SUB_05)
#define ERR_SEC_SCP (ERR_SEC_RANGE + ERR_GEN_SUB_06)
#define ERR_SEC_SIG (ERR_SEC_RANGE + ERR_GEN_SUB_07)
#define ERR_SEC_MEM (ERR_SEC_RANGE + ERR_GEN_SUB_08)
#define ERR_SEC_STA (ERR_SEC_RANGE + ERR_GEN_SUB_09)
#define SWO_SEC_APP_01 (ERR_SEC_APP + ERR_GEN_ID_01) // 0x5101
#define SWO_SEC_APP_02 (ERR_SEC_APP + ERR_GEN_ID_02) // 0x5102
#define SWO_SEC_APP_03 (ERR_SEC_APP + ERR_GEN_ID_03) // 0x5103
#define SWO_SEC_APP_04 (ERR_SEC_APP + ERR_GEN_ID_04) // 0x5104
#define SWO_SEC_APP_05 (ERR_SEC_APP + ERR_GEN_ID_05) // 0x5105
#define SWO_SEC_APP_06 (ERR_SEC_APP + ERR_GEN_ID_06) // 0x5106
#define SWO_SEC_APP_07 (ERR_SEC_APP + ERR_GEN_ID_07) // 0x5107
#define SWO_SEC_APP_08 (ERR_SEC_APP + ERR_GEN_ID_08) // 0x5108
#define SWO_SEC_APP_09 (ERR_SEC_APP + ERR_GEN_ID_09) // 0x5109
#define SWO_SEC_APP_0A (ERR_SEC_APP + ERR_GEN_ID_0A) // 0x510A
#define SWO_SEC_APP_0B (ERR_SEC_APP + ERR_GEN_ID_0B) // 0x510B
#define SWO_SEC_APP_0C (ERR_SEC_APP + ERR_GEN_ID_0C) // 0x510C
#define SWO_SEC_APP_0D (ERR_SEC_APP + ERR_GEN_ID_0D) // 0x510D
#define SWO_SEC_APP_0E (ERR_SEC_APP + ERR_GEN_ID_0E) // 0x510E
#define SWO_SEC_APP_0F (ERR_SEC_APP + ERR_GEN_ID_0F) // 0x510F
#define SWO_SEC_APP_10 (ERR_SEC_APP + ERR_GEN_ID_10) // 0x5110
#define SWO_SEC_APP_11 (ERR_SEC_APP + ERR_GEN_ID_11) // 0x5111
#define SWO_SEC_APP_12 (ERR_SEC_APP + ERR_GEN_ID_12) // 0x5112
#define SWO_SEC_APP_13 (ERR_SEC_APP + ERR_GEN_ID_13) // 0x5113
#define SWO_SEC_APP_14 (ERR_SEC_APP + ERR_GEN_ID_14) // 0x5114
#define SWO_SEC_APP_15 (ERR_SEC_APP + ERR_GEN_ID_15) // 0x5115
#define SWO_SEC_APP_16 (ERR_SEC_APP + ERR_GEN_ID_16) // 0x5116
#define SWO_SEC_APP_17 (ERR_SEC_APP + ERR_GEN_ID_17) // 0x5117
#define SWO_SEC_APP_18 (ERR_SEC_APP + ERR_GEN_ID_18) // 0x5118
#define SWO_SEC_APP_19 (ERR_SEC_APP + ERR_GEN_ID_19) // 0x5119
#define SWO_SEC_APP_1A (ERR_SEC_APP + ERR_GEN_ID_1A) // 0x511A
#define SWO_SEC_APP_1B (ERR_SEC_APP + ERR_GEN_ID_1B) // 0x511B
#define SWO_SEC_CRC_01 (ERR_SEC_CRC + ERR_GEN_ID_01) // 0x5201
#define SWO_SEC_CRC_02 (ERR_SEC_CRC + ERR_GEN_ID_02) // 0x5202
#define SWO_SEC_CRC_03 (ERR_SEC_CRC + ERR_GEN_ID_03) // 0x5203
#define SWO_SEC_CRC_04 (ERR_SEC_CRC + ERR_GEN_ID_04) // 0x5204
#define SWO_SEC_CRC_05 (ERR_SEC_CRC + ERR_GEN_ID_05) // 0x5205
#define SWO_SEC_CRC_06 (ERR_SEC_CRC + ERR_GEN_ID_06) // 0x5206
#define SWO_SEC_CRC_07 (ERR_SEC_CRC + ERR_GEN_ID_07) // 0x5207
#define SWO_SEC_CRC_08 (ERR_SEC_CRC + ERR_GEN_ID_08) // 0x5208
#define SWO_SEC_CRC_09 (ERR_SEC_CRC + ERR_GEN_ID_09) // 0x5209
#define SWO_SEC_CRC_0A (ERR_SEC_CRC + ERR_GEN_ID_0A) // 0x520A
#define SWO_SEC_CRC_0B (ERR_SEC_CRC + ERR_GEN_ID_0B) // 0x520B
#define SWO_SEC_CRC_0C (ERR_SEC_CRC + ERR_GEN_ID_0C) // 0x520C
#define SWO_SEC_CRC_0D (ERR_SEC_CRC + ERR_GEN_ID_0D) // 0x520D
#define SWO_SEC_CRC_0E (ERR_SEC_CRC + ERR_GEN_ID_0E) // 0x520E
#define SWO_SEC_CRC_0F (ERR_SEC_CRC + ERR_GEN_ID_0F) // 0x520F
#define SWO_SEC_CRC_10 (ERR_SEC_CRC + ERR_GEN_ID_10) // 0x5210
#define SWO_SEC_CRC_11 (ERR_SEC_CRC + ERR_GEN_ID_11) // 0x5211
#define SWO_SEC_CRC_12 (ERR_SEC_CRC + ERR_GEN_ID_12) // 0x5212
#define SWO_SEC_CRC_13 (ERR_SEC_CRC + ERR_GEN_ID_13) // 0x5213
#define SWO_SEC_CRC_14 (ERR_SEC_CRC + ERR_GEN_ID_14) // 0x5214
#define SWO_SEC_CRC_15 (ERR_SEC_CRC + ERR_GEN_ID_15) // 0x5215
#define SWO_SEC_CRC_16 (ERR_SEC_CRC + ERR_GEN_ID_16) // 0x5216
#define SWO_SEC_CRC_17 (ERR_SEC_CRC + ERR_GEN_ID_17) // 0x5217
#define SWO_SEC_CRC_18 (ERR_SEC_CRC + ERR_GEN_ID_18) // 0x5218
#define SWO_SEC_CRC_19 (ERR_SEC_CRC + ERR_GEN_ID_19) // 0x5219
#define SWO_SEC_CRC_1A (ERR_SEC_CRC + ERR_GEN_ID_1A) // 0x521A
#define SWO_SEC_CRC_1B (ERR_SEC_CRC + ERR_GEN_ID_1B) // 0x521B
#define SWO_SEC_CRC_1C (ERR_SEC_CRC + ERR_GEN_ID_1C) // 0x521C
#define SWO_SEC_CRC_1D (ERR_SEC_CRC + ERR_GEN_ID_1D) // 0x521D
#define SWO_SEC_CRC_1E (ERR_SEC_CRC + ERR_GEN_ID_1E) // 0x521E
#define SWO_SEC_CRC_1F (ERR_SEC_CRC + ERR_GEN_ID_1F) // 0x521F
#define SWO_SEC_CRC_20 (ERR_SEC_CRC + ERR_GEN_ID_20) // 0x5220
#define SWO_SEC_CRC_21 (ERR_SEC_CRC + ERR_GEN_ID_21) // 0x5221
#define SWO_SEC_CRC_22 (ERR_SEC_CRC + ERR_GEN_ID_22) // 0x5222
#define SWO_SEC_CRC_23 (ERR_SEC_CRC + ERR_GEN_ID_23) // 0x5223
#define SWO_SEC_CRC_24 (ERR_SEC_CRC + ERR_GEN_ID_24) // 0x5224
#define SWO_SEC_CHK_01 (ERR_SEC_CHK + ERR_GEN_ID_01) // 0x5301
#define SWO_SEC_CHK_02 (ERR_SEC_CHK + ERR_GEN_ID_02) // 0x5302
#define SWO_SEC_CHK_03 (ERR_SEC_CHK + ERR_GEN_ID_03) // 0x5303
#define SWO_SEC_CHK_04 (ERR_SEC_CHK + ERR_GEN_ID_04) // 0x5304
#define SWO_SEC_CHK_05 (ERR_SEC_CHK + ERR_GEN_ID_05) // 0x5305
#define SWO_SEC_CHK_06 (ERR_SEC_CHK + ERR_GEN_ID_06) // 0x5306
#define SWO_SEC_CHK_07 (ERR_SEC_CHK + ERR_GEN_ID_07) // 0x5307
#define SWO_SEC_CHK_08 (ERR_SEC_CHK + ERR_GEN_ID_08) // 0x5308
#define SWO_SEC_CHK_09 (ERR_SEC_CHK + ERR_GEN_ID_09) // 0x5309
#define SWO_SEC_CHK_0A (ERR_SEC_CHK + ERR_GEN_ID_0A) // 0x530A
#define SWO_SEC_CHK_0B (ERR_SEC_CHK + ERR_GEN_ID_0B) // 0x530B
#define SWO_SEC_CHK_0C (ERR_SEC_CHK + ERR_GEN_ID_0C) // 0x530C
#define SWO_SEC_CHK_0D (ERR_SEC_CHK + ERR_GEN_ID_0D) // 0x530D
#define SWO_SEC_CHK_0E (ERR_SEC_CHK + ERR_GEN_ID_0E) // 0x530E
#define SWO_SEC_CHK_0F (ERR_SEC_CHK + ERR_GEN_ID_0F) // 0x530F
#define SWO_SEC_CHK_10 (ERR_SEC_CHK + ERR_GEN_ID_10) // 0x5310
#define SWO_SEC_CHK_11 (ERR_SEC_CHK + ERR_GEN_ID_11) // 0x5311
#define SWO_SEC_CHK_12 (ERR_SEC_CHK + ERR_GEN_ID_12) // 0x5312
#define SWO_SEC_CHK_13 (ERR_SEC_CHK + ERR_GEN_ID_13) // 0x5313
#define SWO_SEC_CHK_14 (ERR_SEC_CHK + ERR_GEN_ID_14) // 0x5314
#define SWO_SEC_CHK_15 (ERR_SEC_CHK + ERR_GEN_ID_15) // 0x5315
#define SWO_SEC_CHK_16 (ERR_SEC_CHK + ERR_GEN_ID_16) // 0x5316
#define SWO_SEC_CHK_17 (ERR_SEC_CHK + ERR_GEN_ID_17) // 0x5317
#define SWO_SEC_CHK_18 (ERR_SEC_CHK + ERR_GEN_ID_18) // 0x5318
#define SWO_SEC_CHK_19 (ERR_SEC_CHK + ERR_GEN_ID_19) // 0x5319
#define SWO_SEC_CHK_1A (ERR_SEC_CHK + ERR_GEN_ID_1A) // 0x531A
#define SWO_SEC_CHK_1B (ERR_SEC_CHK + ERR_GEN_ID_1B) // 0x531B
#define SWO_SEC_KEY_01 (ERR_SEC_KEY + ERR_GEN_ID_01) // 0x5401
#define SWO_SEC_PIN_01 (ERR_SEC_PIN + ERR_GEN_ID_01) // 0x5501
#define SWO_SEC_PIN_02 (ERR_SEC_PIN + ERR_GEN_ID_02) // 0x5502
#define SWO_SEC_PIN_03 (ERR_SEC_PIN + ERR_GEN_ID_03) // 0x5503
#define SWO_SEC_PIN_04 (ERR_SEC_PIN + ERR_GEN_ID_04) // 0x5504
#define SWO_SEC_PIN_05 (ERR_SEC_PIN + ERR_GEN_ID_05) // 0x5505
#define SWO_SEC_PIN_06 (ERR_SEC_PIN + ERR_GEN_ID_06) // 0x5506
#define SWO_SEC_PIN_07 (ERR_SEC_PIN + ERR_GEN_ID_07) // 0x5507
#define SWO_SEC_PIN_08 (ERR_SEC_PIN + ERR_GEN_ID_08) // 0x5508
#define SWO_SEC_PIN_09 (ERR_SEC_PIN + ERR_GEN_ID_09) // 0x5509
#define SWO_SEC_PIN_0A (ERR_SEC_PIN + ERR_GEN_ID_0A) // 0x550A
#define SWO_SEC_PIN_0B (ERR_SEC_PIN + ERR_GEN_ID_0B) // 0x550B
#define SWO_SEC_PIN_0C (ERR_SEC_PIN + ERR_GEN_ID_0C) // 0x550C
#define SWO_SEC_PIN_0D (ERR_SEC_PIN + ERR_GEN_ID_0D) // 0x550D
#define SWO_SEC_PIN_0E (ERR_SEC_PIN + ERR_GEN_ID_0E) // 0x550E
#define SWO_SEC_PIN_0F (ERR_SEC_PIN + ERR_GEN_ID_0F) // 0x550F
#define SWO_SEC_PIN_10 (ERR_SEC_PIN + ERR_GEN_ID_10) // 0x5510
#define SWO_SEC_PIN_11 (ERR_SEC_PIN + ERR_GEN_ID_11) // 0x5511
#define SWO_SEC_PIN_12 (ERR_SEC_PIN + ERR_GEN_ID_12) // 0x5512
#define SWO_SEC_PIN_13 (ERR_SEC_PIN + ERR_GEN_ID_13) // 0x5513
#define SWO_SEC_PIN_14 (ERR_SEC_PIN + ERR_GEN_ID_14) // 0x5514
#define SWO_SEC_PIN_15 (ERR_SEC_PIN + ERR_GEN_ID_15) // 0x5515
#define SWO_SEC_SCP_01 (ERR_SEC_SCP + ERR_GEN_ID_01) // 0x5601
#define SWO_SEC_SCP_02 (ERR_SEC_SCP + ERR_GEN_ID_02) // 0x5602
#define SWO_SEC_SIG_01 (ERR_SEC_SIG + ERR_GEN_ID_01) // 0x5701
#define SWO_SEC_SIG_02 (ERR_SEC_SIG + ERR_GEN_ID_02) // 0x5702
#define SWO_SEC_SIG_03 (ERR_SEC_SIG + ERR_GEN_ID_03) // 0x5703
#define SWO_SEC_SIG_04 (ERR_SEC_SIG + ERR_GEN_ID_04) // 0x5704
#define SWO_SEC_SIG_05 (ERR_SEC_SIG + ERR_GEN_ID_05) // 0x5705
#define SWO_SEC_SIG_06 (ERR_SEC_SIG + ERR_GEN_ID_06) // 0x5706
#define SWO_SEC_SIG_07 (ERR_SEC_SIG + ERR_GEN_ID_07) // 0x5707
#define SWO_SEC_SIG_08 (ERR_SEC_SIG + ERR_GEN_ID_08) // 0x5708
#define SWO_SEC_SIG_09 (ERR_SEC_SIG + ERR_GEN_ID_09) // 0x5709
#define SWO_SEC_SIG_0A (ERR_SEC_SIG + ERR_GEN_ID_0A) // 0x570A
#define SWO_SEC_SIG_0B (ERR_SEC_SIG + ERR_GEN_ID_0B) // 0x570B
#define SWO_SEC_SIG_0C (ERR_SEC_SIG + ERR_GEN_ID_0C) // 0x570C
#define SWO_SEC_SIG_0D (ERR_SEC_SIG + ERR_GEN_ID_0D) // 0x570D
#define SWO_SEC_SIG_0E (ERR_SEC_SIG + ERR_GEN_ID_0E) // 0x570E
#define SWO_SEC_SIG_0F (ERR_SEC_SIG + ERR_GEN_ID_0F) // 0x570F
#define SWO_SEC_MEM_01 (ERR_SEC_MEM + ERR_GEN_ID_01) // 0x5801
#define SWO_SEC_MEM_02 (ERR_SEC_MEM + ERR_GEN_ID_02) // 0x5802
#define SWO_SEC_MEM_03 (ERR_SEC_MEM + ERR_GEN_ID_03) // 0x5803
#define SWO_SEC_MEM_04 (ERR_SEC_MEM + ERR_GEN_ID_04) // 0x5804
#define SWO_SEC_MEM_05 (ERR_SEC_MEM + ERR_GEN_ID_05) // 0x5805
#define SWO_SEC_MEM_06 (ERR_SEC_MEM + ERR_GEN_ID_06) // 0x5806
#define SWO_SEC_MEM_07 (ERR_SEC_MEM + ERR_GEN_ID_07) // 0x5807
#define SWO_SEC_MEM_08 (ERR_SEC_MEM + ERR_GEN_ID_08) // 0x5808
#define SWO_SEC_MEM_09 (ERR_SEC_MEM + ERR_GEN_ID_09) // 0x5809
#define SWO_SEC_MEM_0A (ERR_SEC_MEM + ERR_GEN_ID_0A) // 0x580A
#define SWO_SEC_MEM_0B (ERR_SEC_MEM + ERR_GEN_ID_0B) // 0x580B
#define SWO_SEC_MEM_0C (ERR_SEC_MEM + ERR_GEN_ID_0C) // 0x580C
#define SWO_SEC_MEM_0D (ERR_SEC_MEM + ERR_GEN_ID_0D) // 0x580D
#define SWO_SEC_MEM_0E (ERR_SEC_MEM + ERR_GEN_ID_0E) // 0x580E
#define SWO_SEC_MEM_0F (ERR_SEC_MEM + ERR_GEN_ID_0F) // 0x580F
#define SWO_SEC_MEM_10 (ERR_SEC_MEM + ERR_GEN_ID_10) // 0x5810
#define SWO_SEC_STA_01 (ERR_SEC_STA + ERR_GEN_ID_01) // 0x5901
#define SWO_SEC_STA_02 (ERR_SEC_STA + ERR_GEN_ID_02) // 0x5902
#define SWO_SEC_STA_03 (ERR_SEC_STA + ERR_GEN_ID_03) // 0x5903
#define SWO_SEC_STA_04 (ERR_SEC_STA + ERR_GEN_ID_04) // 0x5904
#define SWO_SEC_STA_05 (ERR_SEC_STA + ERR_GEN_ID_05) // 0x5905
#define SWO_SEC_STA_06 (ERR_SEC_STA + ERR_GEN_ID_06) // 0x5906
#define SWO_SEC_STA_07 (ERR_SEC_STA + ERR_GEN_ID_07) // 0x5907
#define SWO_SEC_STA_08 (ERR_SEC_STA + ERR_GEN_ID_08) // 0x5908
#define SWO_SEC_STA_09 (ERR_SEC_STA + ERR_GEN_ID_09) // 0x5909
#define SWO_SEC_STA_0A (ERR_SEC_STA + ERR_GEN_ID_0A) // 0x590A
#define SWO_SEC_STA_0B (ERR_SEC_STA + ERR_GEN_ID_0B) // 0x590B
/**
* APDU-related issues are categorized into:
* Class issues (CLA),
* Instruction issues (INS),
* Other APDU header checks (HDR),
* Operating System state (STA),
* Length issues (LEN),
* Transmitted data issues (DAT).
*/
#define ERR_APD_CLA (ERR_APD_RANGE + ERR_GEN_SUB_0E)
#define ERR_APD_INS (ERR_APD_RANGE + ERR_GEN_SUB_0D)
#define ERR_APD_HDR (ERR_APD_RANGE + ERR_GEN_SUB_05)
#define ERR_APD_STA (ERR_APD_RANGE + ERR_GEN_SUB_06)
#define ERR_APD_LEN (ERR_APD_RANGE + ERR_GEN_SUB_07)
#define ERR_APD_DAT (ERR_APD_RANGE + ERR_GEN_SUB_08)
#define SWO_APD_CLA_01 (ERR_APD_CLA + ERR_GEN_ID_01) // 0x6E01
#define SWO_APD_CLA_02 (ERR_APD_CLA + ERR_GEN_ID_02) // 0x6E02
#define SWO_APD_INS_01 (ERR_APD_INS + ERR_GEN_ID_01) // 0x6D01
#define SWO_APD_INS_02 (ERR_APD_INS + ERR_GEN_ID_02) // 0x6D02
#define SWO_APD_INS_03 (ERR_APD_INS + ERR_GEN_ID_03) // 0x6D03
#define SWO_APD_INS_04 (ERR_APD_INS + ERR_GEN_ID_04) // 0x6D04
#define SWO_APD_INS_05 (ERR_APD_INS + ERR_GEN_ID_05) // 0x6D05
#define SWO_APD_INS_06 (ERR_APD_INS + ERR_GEN_ID_06) // 0x6D06
#define SWO_APD_HDR_01 (ERR_APD_HDR + ERR_GEN_ID_01) // 0x6501
#define SWO_APD_HDR_02 (ERR_APD_HDR + ERR_GEN_ID_02) // 0x6502
#define SWO_APD_HDR_03 (ERR_APD_HDR + ERR_GEN_ID_03) // 0x6503
#define SWO_APD_HDR_04 (ERR_APD_HDR + ERR_GEN_ID_04) // 0x6504
#define SWO_APD_HDR_05 (ERR_APD_HDR + ERR_GEN_ID_05) // 0x6505
#define SWO_APD_HDR_06 (ERR_APD_HDR + ERR_GEN_ID_06) // 0x6506
#define SWO_APD_HDR_07 (ERR_APD_HDR + ERR_GEN_ID_07) // 0x6507
#define SWO_APD_HDR_08 (ERR_APD_HDR + ERR_GEN_ID_08) // 0x6508
#define SWO_APD_HDR_09 (ERR_APD_HDR + ERR_GEN_ID_09) // 0x6509
#define SWO_APD_HDR_0A (ERR_APD_HDR + ERR_GEN_ID_0A) // 0x650A
#define SWO_APD_HDR_0B (ERR_APD_HDR + ERR_GEN_ID_0B) // 0x650B
#define SWO_APD_HDR_0C (ERR_APD_HDR + ERR_GEN_ID_0C) // 0x650C
#define SWO_APD_HDR_0D (ERR_APD_HDR + ERR_GEN_ID_0D) // 0x650D
#define SWO_APD_HDR_0E (ERR_APD_HDR + ERR_GEN_ID_0E) // 0x650E
#define SWO_APD_HDR_0F (ERR_APD_HDR + ERR_GEN_ID_0F) // 0x650F
#define SWO_APD_HDR_10 (ERR_APD_HDR + ERR_GEN_ID_10) // 0x6510
#define SWO_APD_HDR_11 (ERR_APD_HDR + ERR_GEN_ID_11) // 0x6511
#define SWO_APD_HDR_12 (ERR_APD_HDR + ERR_GEN_ID_12) // 0x6512
#define SWO_APD_LEN_01 (ERR_APD_LEN + ERR_GEN_ID_01) // 0x6701
#define SWO_APD_LEN_02 (ERR_APD_LEN + ERR_GEN_ID_02) // 0x6702
#define SWO_APD_LEN_03 (ERR_APD_LEN + ERR_GEN_ID_03) // 0x6703
#define SWO_APD_LEN_04 (ERR_APD_LEN + ERR_GEN_ID_04) // 0x6704
#define SWO_APD_LEN_05 (ERR_APD_LEN + ERR_GEN_ID_05) // 0x6705
#define SWO_APD_LEN_06 (ERR_APD_LEN + ERR_GEN_ID_06) // 0x6706
#define SWO_APD_LEN_07 (ERR_APD_LEN + ERR_GEN_ID_07) // 0x6707
#define SWO_APD_LEN_08 (ERR_APD_LEN + ERR_GEN_ID_08) // 0x6708
#define SWO_APD_LEN_09 (ERR_APD_LEN + ERR_GEN_ID_09) // 0x6709
#define SWO_APD_LEN_0A (ERR_APD_LEN + ERR_GEN_ID_0A) // 0x670A
#define SWO_APD_LEN_0B (ERR_APD_LEN + ERR_GEN_ID_0B) // 0x670B
#define SWO_APD_LEN_0C (ERR_APD_LEN + ERR_GEN_ID_0C) // 0x670C
#define SWO_APD_LEN_0D (ERR_APD_LEN + ERR_GEN_ID_0D) // 0x670D
#define SWO_APD_LEN_0E (ERR_APD_LEN + ERR_GEN_ID_0E) // 0x670E
#define SWO_APD_LEN_0F (ERR_APD_LEN + ERR_GEN_ID_0F) // 0x670F
#define SWO_APD_LEN_10 (ERR_APD_LEN + ERR_GEN_ID_10) // 0x6710
#define SWO_APD_LEN_11 (ERR_APD_LEN + ERR_GEN_ID_11) // 0x6711
#define SWO_APD_LEN_12 (ERR_APD_LEN + ERR_GEN_ID_12) // 0x6712
#define SWO_APD_LEN_13 (ERR_APD_LEN + ERR_GEN_ID_13) // 0x6713
#define SWO_APD_LEN_14 (ERR_APD_LEN + ERR_GEN_ID_14) // 0x6714
#define SWO_APD_LEN_15 (ERR_APD_LEN + ERR_GEN_ID_15) // 0x6715
#define SWO_APD_LEN_16 (ERR_APD_LEN + ERR_GEN_ID_16) // 0x6716
#define SWO_APD_LEN_17 (ERR_APD_LEN + ERR_GEN_ID_17) // 0x6717
#define SWO_APD_LEN_18 (ERR_APD_LEN + ERR_GEN_ID_18) // 0x6718
#define SWO_APD_LEN_19 (ERR_APD_LEN + ERR_GEN_ID_19) // 0x6719
#define SWO_APD_LEN_1A (ERR_APD_LEN + ERR_GEN_ID_1A) // 0x671A
#define SWO_APD_LEN_1B (ERR_APD_LEN + ERR_GEN_ID_1B) // 0x671B
#define SWO_APD_LEN_1C (ERR_APD_LEN + ERR_GEN_ID_1C) // 0x671C
#define SWO_APD_LEN_1D (ERR_APD_LEN + ERR_GEN_ID_1D) // 0x671D
#define SWO_APD_LEN_1E (ERR_APD_LEN + ERR_GEN_ID_1E) // 0x671E
#define SWO_APD_LEN_1F (ERR_APD_LEN + ERR_GEN_ID_1F) // 0x671F
#define SWO_APD_LEN_20 (ERR_APD_LEN + ERR_GEN_ID_20) // 0x6720
#define SWO_APD_LEN_21 (ERR_APD_LEN + ERR_GEN_ID_21) // 0x6721
#define SWO_APD_LEN_22 (ERR_APD_LEN + ERR_GEN_ID_22) // 0x6722
#define SWO_APD_LEN_23 (ERR_APD_LEN + ERR_GEN_ID_23) // 0x6723
#define SWO_APD_LEN_24 (ERR_APD_LEN + ERR_GEN_ID_24) // 0x6724
#define SWO_APD_LEN_25 (ERR_APD_LEN + ERR_GEN_ID_25) // 0x6725
#define SWO_APD_LEN_26 (ERR_APD_LEN + ERR_GEN_ID_26) // 0x6726
#define SWO_APD_LEN_27 (ERR_APD_LEN + ERR_GEN_ID_27) // 0x6727
#define SWO_APD_LEN_28 (ERR_APD_LEN + ERR_GEN_ID_28) // 0x6728
#define SWO_APD_LEN_29 (ERR_APD_LEN + ERR_GEN_ID_29) // 0x6729
#define SWO_APD_LEN_2A (ERR_APD_LEN + ERR_GEN_ID_2A) // 0x672A
#define SWO_APD_LEN_2B (ERR_APD_LEN + ERR_GEN_ID_2B) // 0x672B
#define SWO_APD_DAT_01 (ERR_APD_DAT + ERR_GEN_ID_01) // 0x6801
#define SWO_APD_DAT_02 (ERR_APD_DAT + ERR_GEN_ID_02) // 0x6802
#define SWO_APD_DAT_03 (ERR_APD_DAT + ERR_GEN_ID_03) // 0x6803
#define SWO_APD_DAT_04 (ERR_APD_DAT + ERR_GEN_ID_04) // 0x6804
#define SWO_APD_DAT_05 (ERR_APD_DAT + ERR_GEN_ID_05) // 0x6805
#define SWO_APD_DAT_06 (ERR_APD_DAT + ERR_GEN_ID_06) // 0x6806
#define SWO_APD_DAT_07 (ERR_APD_DAT + ERR_GEN_ID_07) // 0x6807
#define SWO_APD_DAT_08 (ERR_APD_DAT + ERR_GEN_ID_08) // 0x6808
#define SWO_APD_DAT_09 (ERR_APD_DAT + ERR_GEN_ID_09) // 0x6809
#define SWO_APD_DAT_0A (ERR_APD_DAT + ERR_GEN_ID_0A) // 0x680A
#define SWO_APD_DAT_0B (ERR_APD_DAT + ERR_GEN_ID_0B) // 0x680B
#define SWO_APD_DAT_0C (ERR_APD_DAT + ERR_GEN_ID_0C) // 0x680C
#define SWO_APD_DAT_0D (ERR_APD_DAT + ERR_GEN_ID_0D) // 0x680D
#define SWO_APD_DAT_0E (ERR_APD_DAT + ERR_GEN_ID_0E) // 0x680E
#define SWO_APD_DAT_0F (ERR_APD_DAT + ERR_GEN_ID_0F) // 0x680F
#define SWO_APD_DAT_10 (ERR_APD_DAT + ERR_GEN_ID_10) // 0x6810
#define SWO_APD_DAT_11 (ERR_APD_DAT + ERR_GEN_ID_11) // 0x6811
#define SWO_APD_DAT_12 (ERR_APD_DAT + ERR_GEN_ID_12) // 0x6812
#define SWO_APD_DAT_13 (ERR_APD_DAT + ERR_GEN_ID_13) // 0x6813
#define SWO_APD_DAT_14 (ERR_APD_DAT + ERR_GEN_ID_14) // 0x6814
#define SWO_APD_DAT_15 (ERR_APD_DAT + ERR_GEN_ID_15) // 0x6815
#define SWO_APD_DAT_16 (ERR_APD_DAT + ERR_GEN_ID_16) // 0x6816
#define SWO_APD_DAT_17 (ERR_APD_DAT + ERR_GEN_ID_17) // 0x6817
#define SWO_APD_DAT_18 (ERR_APD_DAT + ERR_GEN_ID_18) // 0x6818
#define SWO_APD_STA_01 (ERR_APD_STA + ERR_GEN_ID_01) // 0x6601
#define SWO_APD_STA_02 (ERR_APD_STA + ERR_GEN_ID_02) // 0x6602
#define SWO_APD_STA_03 (ERR_APD_STA + ERR_GEN_ID_03) // 0x6603
#define SWO_APD_STA_04 (ERR_APD_STA + ERR_GEN_ID_04) // 0x6604
#define SWO_APD_STA_05 (ERR_APD_STA + ERR_GEN_ID_05) // 0x6605
#define SWO_APD_STA_06 (ERR_APD_STA + ERR_GEN_ID_06) // 0x6606
#define SWO_APD_STA_07 (ERR_APD_STA + ERR_GEN_ID_07) // 0x6607
#define SWO_APD_STA_08 (ERR_APD_STA + ERR_GEN_ID_08) // 0x6608
#define SWO_APD_STA_09 (ERR_APD_STA + ERR_GEN_ID_09) // 0x6609
#define SWO_APD_STA_0A (ERR_APD_STA + ERR_GEN_ID_0A) // 0x660A
#define SWO_APD_STA_0B (ERR_APD_STA + ERR_GEN_ID_0B) // 0x660B
#define SWO_APD_STA_0C (ERR_APD_STA + ERR_GEN_ID_0C) // 0x660C
#define SWO_APD_STA_0D (ERR_APD_STA + ERR_GEN_ID_0D) // 0x660D
#define SWO_APD_STA_0E (ERR_APD_STA + ERR_GEN_ID_0E) // 0x660E
#define SWO_APD_STA_0F (ERR_APD_STA + ERR_GEN_ID_0F) // 0x660F
#define SWO_APD_STA_10 (ERR_APD_STA + ERR_GEN_ID_10) // 0x6610
#define SWO_APD_STA_11 (ERR_APD_STA + ERR_GEN_ID_11) // 0x6611
#define SWO_APD_STA_12 (ERR_APD_STA + ERR_GEN_ID_12) // 0x6612
#define SWO_APD_STA_13 (ERR_APD_STA + ERR_GEN_ID_13) // 0x6613
#define SWO_APD_STA_14 (ERR_APD_STA + ERR_GEN_ID_14) // 0x6614
#define SWO_APD_STA_15 (ERR_APD_STA + ERR_GEN_ID_15) // 0x6615
#define SWO_APD_STA_16 (ERR_APD_STA + ERR_GEN_ID_16) // 0x6616
#define SWO_APD_STA_17 (ERR_APD_STA + ERR_GEN_ID_17) // 0x6617
#define SWO_APD_STA_18 (ERR_APD_STA + ERR_GEN_ID_18) // 0x6618
#define SWO_APD_STA_19 (ERR_APD_STA + ERR_GEN_ID_19) // 0x6619
#define SWO_APD_STA_1A (ERR_APD_STA + ERR_GEN_ID_1A) // 0x661A
#define SWO_APD_STA_1B (ERR_APD_STA + ERR_GEN_ID_1B) // 0x661B
#define SWO_APD_STA_1C (ERR_APD_STA + ERR_GEN_ID_1C) // 0x661C
#define SWO_APD_STA_1D (ERR_APD_STA + ERR_GEN_ID_1D) // 0x661D
#define SWO_APD_STA_1E (ERR_APD_STA + ERR_GEN_ID_1E) // 0x661E
#define SWO_APD_STA_1F (ERR_APD_STA + ERR_GEN_ID_1F) // 0x661F
#define SWO_APD_STA_20 (ERR_APD_STA + ERR_GEN_ID_20) // 0x6620
#define SWO_APD_STA_21 (ERR_APD_STA + ERR_GEN_ID_21) // 0x6621
#define SWO_APD_STA_22 (ERR_APD_STA + ERR_GEN_ID_22) // 0x6622
#define SWO_APD_STA_23 (ERR_APD_STA + ERR_GEN_ID_23) // 0x6623
#define SWO_APD_STA_24 (ERR_APD_STA + ERR_GEN_ID_24) // 0x6624
#define SWO_APD_STA_25 (ERR_APD_STA + ERR_GEN_ID_25) // 0x6625
#define SWO_APD_STA_26 (ERR_APD_STA + ERR_GEN_ID_26) // 0x6626
#define SWO_APD_STA_27 (ERR_APD_STA + ERR_GEN_ID_27) // 0x6627
#define SWO_APD_STA_28 (ERR_APD_STA + ERR_GEN_ID_28) // 0x6628
#define SWO_APD_STA_29 (ERR_APD_STA + ERR_GEN_ID_29) // 0x6629
#define SWO_APD_STA_2A (ERR_APD_STA + ERR_GEN_ID_2A) // 0x662A
#define SWO_APD_STA_2B (ERR_APD_STA + ERR_GEN_ID_2B) // 0x662B
#define SWO_APD_STA_2C (ERR_APD_STA + ERR_GEN_ID_2C) // 0x662C
/**
* The process is successful.
*/
#define SWO_SUCCESS 0x9000
/**
* Miscellaneous Unexplained issues (no categorization, Unknown).
*/
#define SWO_MUI_UNK_01 (ERR_MUI_RANGE + ERR_GEN_ID_01) // 0xA001
#define SWO_MUI_UNK_02 (ERR_MUI_RANGE + ERR_GEN_ID_02) // 0xA002
#define SWO_MUI_UNK_03 (ERR_MUI_RANGE + ERR_GEN_ID_03) // 0xA003
#define SWO_MUI_UNK_04 (ERR_MUI_RANGE + ERR_GEN_ID_04) // 0xA004
#define SWO_MUI_UNK_05 (ERR_MUI_RANGE + ERR_GEN_ID_05) // 0xA005
#define SWO_MUI_UNK_06 (ERR_MUI_RANGE + ERR_GEN_ID_06) // 0xA006
#define SWO_MUI_UNK_07 (ERR_MUI_RANGE + ERR_GEN_ID_07) // 0xA007
#define SWO_MUI_UNK_08 (ERR_MUI_RANGE + ERR_GEN_ID_08) // 0xA008
#define SWO_MUI_UNK_09 (ERR_MUI_RANGE + ERR_GEN_ID_09) // 0xA009
#define SWO_MUI_UNK_0A (ERR_MUI_RANGE + ERR_GEN_ID_0A) // 0xA00A
#define SWO_MUI_UNK_0B (ERR_MUI_RANGE + ERR_GEN_ID_0B) // 0xA00B
#define SWO_MUI_UNK_0C (ERR_MUI_RANGE + ERR_GEN_ID_0C) // 0xA00C
#define SWO_MUI_UNK_0D (ERR_MUI_RANGE + ERR_GEN_ID_0D) // 0xA00D
#define SWO_MUI_UNK_0E (ERR_MUI_RANGE + ERR_GEN_ID_0E) // 0xA00E
#define SWO_MUI_UNK_0F (ERR_MUI_RANGE + ERR_GEN_ID_0F) // 0xA00F
#define SWO_MUI_UNK_10 (ERR_MUI_RANGE + ERR_GEN_ID_10) // 0xA010
#define SWO_MUI_UNK_11 (ERR_MUI_RANGE + ERR_GEN_ID_11) // 0xA011
#define SWO_MUI_UNK_12 (ERR_MUI_RANGE + ERR_GEN_ID_12) // 0xA012
#define SWO_MUI_UNK_13 (ERR_MUI_RANGE + ERR_GEN_ID_13) // 0xA013
#define SWO_MUI_UNK_14 (ERR_MUI_RANGE + ERR_GEN_ID_14) // 0xA014
#define SWO_MUI_UNK_15 (ERR_MUI_RANGE + ERR_GEN_ID_15) // 0xA015
#define SWO_MUI_UNK_16 (ERR_MUI_RANGE + ERR_GEN_ID_16) // 0xA016
#define SWO_MUI_UNK_17 (ERR_MUI_RANGE + ERR_GEN_ID_17) // 0xA017
#define SWO_MUI_UNK_18 (ERR_MUI_RANGE + ERR_GEN_ID_18) // 0xA018
// Legacy
#define EXCEPTION 0x1 // keep original value // SWO_MUI_UNK_01
#define INVALID_PARAMETER 0x2 // keep original value // SWO_CRY_LEN_01
#define EXCEPTION_SECURITY 0x3 // keep original value // SWO_MUI_UNK_02
#define INVALID_STATE 0x4 // keep original value // SWO_CRY_VAL_01
#define EXCEPTION_IO_RESET 0x5 // keep original value // SWO_IOL_RST_01
#define NOT_ENOUGH_SPACE 0x6 // keep original value // SWO_CRY_VAL_01
#define EXCEPTION_OVERFLOW 0x7 // keep original value // SWO_MUI_UNK_03
#define INVALID_CRC 0x8 // keep original value // SWO_MUI_UNK_0C
#define INVALID_CHECKSUM 0x9 // keep original value // SWO_MUI_UNK_0D
#define INVALID_COUNTER 0xA // keep original value // SWO_MUI_UNK_0E
#define NOT_SUPPORTED 0xB // keep original value // SWO_MUI_UNK_0F
#define TIMEOUT 0xC // keep original value // SWO_MUI_UNK_10
#define EXCEPTION_PIC 0xD // keep original value // SWO_MUI_UNK_11
#define EXCEPTION_APPEXIT 0xE // keep original value // SWO_MUI_UNK_12
#define EXCEPTION_IO_OVERFLOW 0xF // keep original value // SWO_MUI_UNK_13
#define EXCEPTION_IO_HEADER 0x10 // keep original value // SWO_MUI_UNK_14
#define EXCEPTION_IO_STATE 0x11 // keep original value // SWO_MUI_UNK_15
#define EXCEPTION_CXPORT 0x12 // keep original value // SWO_MUI_UNK_16
#define EXCEPTION_SYSTEM 0x13 // keep original value // SWO_MUI_UNK_17
#endif // ERRORS_H