xcp_registry 0.1.0

Measurement and Calibration registry for XCP - pure Rust, no C dependency
Documentation
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
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
#![allow(clippy::all)] // don't care about messages in generated code

use a2lfile::a2ml_specification;

a2ml_specification! {
    <A2mlVector>

    struct Protocol_Layer {
        uint protocol_version;  /// XCP protocol layer version
        uint t1;  /// T1 [ms]
        uint t2;  /// T2 [ms]
        uint t3;  /// T3 [ms]
        uint t4;  /// T4 [ms]
        uint t5;  /// T5 [ms]
        uint t6;  /// T6 [ms]
        uint t7;  /// T7 [ms]
        uchar max_cto;  /// MAX_CTO
        uint max_dto;  /// MAX_DTO
        enum {
            "BYTE_ORDER_MSB_LAST" = 0,
            "BYTE_ORDER_MSB_FIRST" = 1
        };
        enum {
            "ADDRESS_GRANULARITY_BYTE" = 1,
            "ADDRESS_GRANULARITY_WORD" = 2,
            "ADDRESS_GRANULARITY_DWORD" = 4
        };
        taggedstruct {
            ("OPTIONAL_CMD" enum XcpOptions {
                "GET_COMM_MODE_INFO" = 251,
                "GET_ID" = 250,
                "SET_REQUEST" = 249,
                "GET_SEED" = 248,
                "UNLOCK" = 247,
                "SET_MTA" = 246,
                "UPLOAD" = 245,
                "SHORT_UPLOAD" = 244,
                "BUILD_CHECKSUM" = 243,
                "TRANSPORT_LAYER_CMD" = 242,
                "USER_CMD" = 241,
                "DOWNLOAD" = 240,
                "DOWNLOAD_NEXT" = 239,
                "DOWNLOAD_MAX" = 238,
                "SHORT_DOWNLOAD" = 237,
                "MODIFY_BITS" = 236,
                "SET_CAL_PAGE" = 235,
                "GET_CAL_PAGE" = 234,
                "GET_PAG_PROCESSOR_INFO" = 233,
                "GET_SEGMENT_INFO" = 232,
                "GET_PAGE_INFO" = 231,
                "SET_SEGMENT_MODE" = 230,
                "GET_SEGMENT_MODE" = 229,
                "COPY_CAL_PAGE" = 228,
                "CLEAR_DAQ_LIST" = 227,
                "SET_DAQ_PTR" = 226,
                "WRITE_DAQ" = 225,
                "SET_DAQ_LIST_MODE" = 224,
                "GET_DAQ_LIST_MODE" = 223,
                "START_STOP_DAQ_LIST" = 222,
                "START_STOP_SYNCH" = 221,
                "GET_DAQ_CLOCK" = 220,
                "READ_DAQ" = 219,
                "GET_DAQ_PROCESSOR_INFO" = 218,
                "GET_DAQ_RESOLUTION_INFO" = 217,
                "GET_DAQ_LIST_INFO" = 216,
                "GET_DAQ_EVENT_INFO" = 215,
                "FREE_DAQ" = 214,
                "ALLOC_DAQ" = 213,
                "ALLOC_ODT" = 212,
                "ALLOC_ODT_ENTRY" = 211,
                "PROGRAM_START" = 210,
                "PROGRAM_CLEAR" = 209,
                "PROGRAM" = 208,
                "PROGRAM_RESET" = 207,
                "GET_PGM_PROCESSOR_INFO" = 206,
                "GET_SECTOR_INFO" = 205,
                "PROGRAM_PREPARE" = 204,
                "PROGRAM_FORMAT" = 203,
                "PROGRAM_NEXT" = 202,
                "PROGRAM_MAX" = 201,
                "PROGRAM_VERIFY" = 200,
                "WRITE_DAQ_MULTIPLE" = 199,
                "TIME_CORRELATION_PROPERTIES" = 198,
                "DTO_CTR_PROPERTIES" = 197
            })*;
            ("OPTIONAL_LEVEL1_CMD" enum {                         /* XCP-Code of optional level 1 commands, starting with level 0 0xC0 as first byte */
                "GET_VERSION" = 0x00,
                "SET_DAQ_PACKED_MODE" = 0x01,
                "GET_DAQ_PACKED_MODE" = 0x02,
                "SW_DBG_COMMAND_SPACE" = 0xFC,
                "POD_COMMAND_SPACE" = 0xFD
            })*;
            "COMMUNICATION_MODE_SUPPORTED" taggedunion {
                "BLOCK" taggedstruct {
                    "SLAVE" ;
                    "MASTER" struct {
                        uchar max_bs;  /// MAX_BS
                        uchar min_st;  /// MIN_ST
                    };
                };
                "INTERLEAVED" uchar;  /// QUEUE_SIZE
            };
            "SEED_AND_KEY_EXTERNAL_FUNCTION" char funcname[256];  /// Name of the Seed&Key function
            "MAX_DTO_STIM" uint max_dto_stim;  /// overrules MAX_DTO see above for STIM use case

            block "ECU_STATES" taggedstruct{
                (block "STATE" struct{
                    uchar state_number;   /// STATE_NUMBER
                    char state_name[100]; /// STATE_NAME
                    taggedstruct {
                        "ECU_SWITCHED_TO_DEFAULT_PAGE";
                    };
                    enum CalPagResource {
                        "NOT_ACTIVE" = 0,
                        "ACTIVE" = 1,
                        "GETTER_ONLY" = 2
                    };
                    enum DaqResource {
                        "NOT_ACTIVE" = 0,
                        "ACTIVE" = 1
                    };
                    enum StimResource {
                        "NOT_ACTIVE" = 0,
                        "ACTIVE" = 1
                    };
                    enum PgmResource {
                        "NOT_ACTIVE" = 0,
                        "ACTIVE" = 1
                    };

                    taggedstruct {
                        (block "MEMORY_ACCESS" struct{    /* CAL/PAG AVAILABLE */
                            uchar segment_number;         /* SEGMENT_NUMBER */
                            uchar page_number;            /* PAGE_NUMBER */
                            enum ReadAccess {
                                "READ_ACCESS_NOT_ALLOWED" = 0,
                                "READ_ACCESS_ALLOWED" = 1
                            };
                            enum WriteAccess {
                                "WRITE_ACCESS_NOT_ALLOWED" = 0,
                                "WRITE_ACCESS_ALLOWED" = 1
                            };
                        })*;
                    };
                })*;

              };
        };
    };

    struct Daq {
        enum {
            "STATIC" = 0,
            "DYNAMIC" = 1
        };
        uint max_daq;            /// MAX_DAQ
        uint max_event_channel;  /// MAX_EVENT_CHANNEL
        uchar min_daq;           /// MIN_DAQ
        enum OptimisationType {
            "OPTIMISATION_TYPE_DEFAULT" = 0,
            "OPTIMISATION_TYPE_ODT_TYPE_16" = 1,
            "OPTIMISATION_TYPE_ODT_TYPE_32" = 2,
            "OPTIMISATION_TYPE_ODT_TYPE_64" = 3,
            "OPTIMISATION_TYPE_ODT_TYPE_ALIGNMENT" = 4,
            "OPTIMISATION_TYPE_MAX_ENTRY_SIZE" = 5
        };
        enum AddressExtension {
            "ADDRESS_EXTENSION_FREE" = 0,
            "ADDRESS_EXTENSION_ODT" = 1,
            "ADDRESS_EXTENSION_DAQ" = 3
        };
        enum IdentificationFieldType {
            "IDENTIFICATION_FIELD_TYPE_ABSOLUTE" = 0,
            "IDENTIFICATION_FIELD_TYPE_RELATIVE_BYTE" = 1,
            "IDENTIFICATION_FIELD_TYPE_RELATIVE_WORD" = 2,
            "IDENTIFICATION_FIELD_TYPE_RELATIVE_WORD_ALIGNED" = 3
        };
        enum GranularityOdtEntrySizeDaq {
            "GRANULARITY_ODT_ENTRY_SIZE_DAQ_BYTE" = 1,
            "GRANULARITY_ODT_ENTRY_SIZE_DAQ_WORD" = 2,
            "GRANULARITY_ODT_ENTRY_SIZE_DAQ_DWORD" = 4,
            "GRANULARITY_ODT_ENTRY_SIZE_DAQ_DLONG" = 8
        };
        uchar max_odt_entry_size_daq;  /// MAX_ODT_ENTRY_SIZE_DAQ
        enum OverloadIndication {
            "NO_OVERLOAD_INDICATION" = 0,
            "OVERLOAD_INDICATION_PID" = 1,
            "OVERLOAD_INDICATION_EVENT" = 2
        };
        taggedstruct {
            "DAQ_ALTERNATING_SUPPORTED" uint;  ///This flag selects the alternating display mode.
            "PRESCALER_SUPPORTED" ;
            "RESUME_SUPPORTED" ;
            "STORE_DAQ_SUPPORTED" ;  ///This flag indicates that the slave can store DAQ configurations.
            "DTO_CTR_FIELD_SUPPORTED" ;
            "OPTIMISATION_TYPE_ODT_STRICT" ;
            block "STIM" struct {
                enum GranularityOdtEntrySizeStim {
                    "GRANULARITY_ODT_ENTRY_SIZE_STIM_BYTE" = 1,
                    "GRANULARITY_ODT_ENTRY_SIZE_STIM_WORD" = 2,
                    "GRANULARITY_ODT_ENTRY_SIZE_STIM_DWORD" = 4,
                    "GRANULARITY_ODT_ENTRY_SIZE_STIM_DLONG" = 8
                };
                uchar max_odt_entry_size_stim;  /// MAX_ODT_ENTRY_SIZE_STIM
                taggedstruct {
                    "BIT_STIM_SUPPORTED" ;
                    "MIN_ST_STIM" uchar;  ///Separation time between DTOs time in units of 100 microseconds
                };
            };
            block "TIMESTAMP_SUPPORTED" struct {
                uint timestamp_ticks;  /// TIMESTAMP_TICKS
                enum TimestampSize {
                    "NO_TIME_STAMP" = 0,
                    "SIZE_BYTE" = 1,
                    "SIZE_WORD" = 2,
                    "SIZE_DWORD" = 4
                };
                enum TimestampUnit {
                    "UNIT_1NS" = 0,
                    "UNIT_10NS" = 1,
                    "UNIT_100NS" = 2,
                    "UNIT_1US" = 3,
                    "UNIT_10US" = 4,
                    "UNIT_100US" = 5,
                    "UNIT_1MS" = 6,
                    "UNIT_10MS" = 7,
                    "UNIT_100MS" = 8,
                    "UNIT_1S" = 9,
                    "UNIT_1PS" = 10,
                    "UNIT_10PS" = 11,
                    "UNIT_100PS" = 12
                };
                taggedstruct {
                    "TIMESTAMP_FIXED" ;
                };
            };
            "PID_OFF_SUPPORTED" ;
            "MAX_DAQ_TOTAL" uint;
            "MAX_ODT_TOTAL" uint;
            "MAX_ODT_DAQ_TOTAL" uint;
            "MAX_ODT_STIM_TOTAL" uint;
            "MAX_ODT_ENTRIES_TOTAL" uint;
            "MAX_ODT_ENTRIES_DAQ_TOTAL" uint;
            "MAX_ODT_ENTRIES_STIM_TOTAL" uint;
            "CPU_LOAD_MAX_TOTAL" float;
            "CORE_LOAD_MAX_TOTAL" float;   /// max load of all cores
            (block "CORE_LOAD_MAX" struct {
                uint core_nr;          /// CORE_NR: core reference number
                float core_load_max;   /// CORE_LOAD_MAX: max load of core(CORE_NR)
            })*;
            block "DAQ_MEMORY_CONSUMPTION" struct {
                ulong daq_memory_limit;  /// "DAQ_MEMORY_LIMIT"
                uint daq_size;  /// "DAQ_SIZE" : Bytes pro DAQ-Liste
                uint odt_size;  /// "ODT_SIZE" : Bytes pro ODT
                uint odt_entry_size;  /// "ODT_ENTRY_SIZE" : Bytes pro ODT_Entry
                uint odt_daq_buffer_factor;  /// "ODT_DAQ_BUFFER_FACTOR"  : Nutzbytes * Faktor = Bytes für Sendepuffer
                uint odt_stim_buffer_factor;  /// "ODT_STIM_BUFFER_FACTOR" : Nutzbytes * Faktor = Bytes für Empfangspuffer
                taggedstruct {
                    block "BUFFER_RESERVE" struct {     // default for all EVENTs
                        uchar odt_daq_buffer_reserve;   /// ODT_DAQ_BUFFER_ELEMENT_RESERVE in % of ODT_DAQ_BUFFER_ELEMENT_SIZE
                        uchar odt_stim_buffer_reserve;  /// ODT_STIM_BUFFER_ELEMENT_RESERVE in % of ODT_STIM_BUFFER_ELEMENT_SIZE
                    };
                };
            };
            (block "DAQ_LIST" struct {
                uint daq_list_number;  /// DAQ_LIST_NUMBER
                taggedstruct {
                    "DAQ_LIST_TYPE" enum {
                        "DAQ" = 1,
                        "STIM" = 2,
                        "DAQ_STIM" = 3
                    };
                    "MAX_ODT" uchar;
                    "MAX_ODT_ENTRIES" uchar;
                    "FIRST_PID" uchar;
                    "EVENT_FIXED" uint;
                    "DAQ_PACKED_MODE_SUPPORTED";     /// supports DAQ packed mode
                    block "PREDEFINED" taggedstruct {
                        (block "ODT" struct {
                            uchar odt_number;  /// ODT number
                            taggedstruct {
                                ("ODT_ENTRY" struct {
                                    uchar odt_entry_number;  /// ODT_ENTRY number
                                    ulong element_address;  /// address of element
                                    uchar address_extension;  /// address extension of element
                                    uchar element_size;  /// size of element [AG]
                                    uchar bit_offset;  /// BIT_OFFSET
                                })*;
                            };
                        })*;
                    };
                };
            })*;
            (block "EVENT" struct {
                char event_channel_name[101];  /// EVENT_CHANNEL_NAME
                char event_channel_short_name[9];  /// EVENT_CHANNEL_SHORT_NAME
                uint event_channel_number;  /// EVENT_CHANNEL_NUMBER
                enum {
                    "DAQ" = 1,
                    "STIM" = 2,
                    "DAQ_STIM" = 3
                };
                uchar max_daq_list;  /// MAX_DAQ_LIST
                uchar time_cycle;  /// TIME_CYCLE
                uchar time_unit;  /// TIME_UNIT
                uchar priority;  /// PRIORITY
                taggedstruct {
                    "COMPLEMENTARY_BYPASS_EVENT_CHANNEL_NUMBER" uint;  ///This keyword is used to make a combination of two event channels building a bypassing raster.
                    "CONSISTENCY" enum {
                        "DAQ" = 0,
                        "EVENT" = 1,
                        "ODT"   = 2,
                        "NONE"  = 3
                    };  ///With this keyword, the slave can indicate what kind of data consistency exists when data are processed within this Event.
                    "EVENT_COUNTER_PRESENT";
                    "RELATED_EVENT_CHANNEL_NUMBER" uint;
                    "RELATED_EVENT_CHANNEL_NUMBER_FIXED";        /* RELATED_EVENT_CHANNEL_NUMBER can not be modified. */
                    "DTO_CTR_DAQ_MODE" enum {                    /* When inserting the DTO CTR field: */
                        "INSERT_COUNTER" = 0,                    /* - use CTR of the related event channel */
                        "INSERT_STIM_COUNTER_COPY" = 1           /* - use STIM CTR CPY of the related event channel */
                    };
                    "DTO_CTR_DAQ_MODE_FIXED";                    /* DTO_CTR_DAQ_MODE properties can not be modified. */
                    "DTO_CTR_STIM_MODE" enum {                   /* When receiving DTOs with CTR field: */
                        "DO_NOT_CHECK_COUNTER" = 0,              /* - do not check CTR */
                        "CHECK_COUNTER" = 1                      /* - check CTR */
                    };
                    "DTO_CTR_STIM_MODE_FIXED";                   /* DTO_CTR_STIM_MODE properties can not be modified */
                    "STIM_DTO_CTR_COPY_PRESENT";                 /* DTO CTR can be saved for later reference */
                    block "DAQ_PACKED_MODE" struct {             /* DAQ packed mode, applies for all associated DAQ lists */
                        enum Grouping {                          /* El. A,B,C,D, 3 samples */
                            "ELEMENT_GROUPED" = 1,               /* A0A1A2B0B1B2C0C1C2D0D1D2 */
                            "EVENT_GROUPED"   = 2                /* A0B0C0D0A1B1C1D1A2B2C2D2 */
                        };
                        enum TimestampMode {
                            "STS_LAST"      = 0,                 /* single timestamp of last sample */
                            "STS_FIRST"     = 1                  /* single timestamp of first sample */
                        };
                        enum PackedModeUsage {                   /* usage */
                            "OPTIONAL"      = 0,                 /* optional, EVENT allows also non-packed mode */
                            "MANDATORY"     = 1                  /* mandatory, only packed mode allowed */
                        };
                        uint sample_count;                       /* DAQ packed mode sample count */
                        taggedstruct {
                            ("ALT_SAMPLE_COUNT" uint)*;          /* other valid sample count values (optional) */
                        };
                    };
                    block "MIN_CYCLE_TIME" struct {
                        uchar event_channel_time_cycle;  /// EVENT_CHANNEL_TIME_CYCLE
                        uchar event_channel_time_unit;  /// EVENT_CHANNEL_TIME_UNIT
                    };
                    block "BUFFER_RESERVE_EVENT" struct {        /* overrules default BUFFER_RESERVE for this EVENT */
                        uchar odt_daq_buffer_element_reserve;  /// ODT_DAQ_BUFFER_ELEMENT_RESERVE in % of ODT_DAQ_BUFFER_ELEMENT_SIZE
                        uchar odt_stim_buffer_element_reserve;  /// ODT_STIM_BUFFER_ELEMENT_RESERVE in % of ODT_STIM_BUFFER_ELEMENT_SIZE
                    };
                    "CPU_LOAD_MAX" float;
                    block "CPU_LOAD_CONSUMPTION_DAQ" struct {
                        float daq_factor;  /// "DAQ_FACTOR"
                        float odt_factor;  /// "ODT_FACTOR"
                        float odt_entry_factor;  /// "ODT_ENTRY_FACTOR"
                        taggedstruct {
                            (block "ODT_ENTRY_SIZE_FACTOR_TABLE" struct {
                                uint size;  /// "SIZE"
                                float size_factor;  /// "SIZE_FACTOR"
                            })*;
                            block "CORE_LOAD_EP" struct {
                                uint core_nr;  /// CORE_NR: core reference number
                                float core_load_ep_max;  /// CORE_LOAD_EP_MAX: max load of this event part
                            };
                        };
                    };
                    block "CPU_LOAD_CONSUMPTION_STIM" struct {
                        float;  /// "DAQ_FACTOR"
                        float;  /// "ODT_FACTOR"
                        float;  /// "ODT_ENTRY_FACTOR"
                        taggedstruct {
                            (block "ODT_ENTRY_SIZE_FACTOR_TABLE" struct {
                                uint size;  /// "SIZE"
                                float size_factor;  /// "SIZE_FACTOR"
                            })*;
                            block "CORE_LOAD_EP" struct {
                                uint core_nr;  /// CORE_NR: core reference number
                                float core_load_ep_max;  /// CORE_LOAD_EP_MAX: max load of this event part
                            };
                        };
                    };
                    block "CPU_LOAD_CONSUMPTION_QUEUE" struct {  /* default for DAQ and STIM QUEUE */
                        float odt_factor;  /// "ODT_FACTOR"
                        float odt_length_factor;  /// "ODT_LENGTH_FACTOR", length in elements[AG]
                        taggedstruct {
                            block "CORE_LOAD_EP" struct {
                                uint core_nr;  /// CORE_NR: core reference number
                                float core_load_ep_max;  /// CORE_LOAD_EP_MAX: max load of this event part
                            };
                        };
                    };
                    block "CPU_LOAD_CONSUMPTION_QUEUE_STIM" struct {  /* overrules CPU_LOAD_CONSUMPTION_QUEUE for STIM QUEUE */
                        float odt_factor;  /// "ODT_FACTOR"
                        float odt_length_factor;  /// "ODT_ELEMENT_LOAD", length in elements[AG]
                        taggedstruct {
                            block "CORE_LOAD_EP" struct {
                                uint core_nr;  /// CORE_NR: core reference number
                                float core_load_ep_max;  /// CORE_LOAD_EP_MAX: max load of this event part
                            };
                        };
                    };
                };
            })*;
        };
    };

    taggedunion Daq_Event {
        "FIXED_EVENT_LIST" taggedstruct {
            ("EVENT" uint)*;
        };
        "VARIABLE" taggedstruct {
            block "AVAILABLE_EVENT_LIST" taggedstruct {
                ("EVENT" uint)*;
            };
            block "DEFAULT_EVENT_LIST" taggedstruct {
                ("EVENT" uint)*;
            };
            block "CONSISTENCY_EVENT_LIST" taggedstruct {
                ("EVENT" uint)*;
            };
        };
    };

    struct Pag {
        uchar max_segments;  /// MAX_SEGMENTS
        taggedstruct {
            "FREEZE_SUPPORTED" ;
        };
    };

    struct Pgm {
        enum PgmMode {
            "PGM_MODE_ABSOLUTE" = 1,
            "PGM_MODE_FUNCTIONAL" = 2,
            "PGM_MODE_ABSOLUTE_AND_FUNCTIONAL" = 3
        };
        uchar max_sectors;  /// MAX_SECTORS
        uchar max_cto_pgm;  /// MAX_CTO_PGM
        taggedstruct {
            (block "SECTOR" struct {
                char sector_name[101];  /// SECTOR_NAME
                uchar sector_number;  /// SECTOR_NUMBER
                ulong address;  /// Address
                ulong length;  /// Length
                uchar clear_sequence_number;  /// CLEAR_SEQUENCE_NUMBER
                uchar program_sequence_number;  /// PROGRAM_SEQUENCE_NUMBER
                uchar program_method;  /// PROGRAM_METHOD
            })*;
            "COMMUNICATION_MODE_SUPPORTED" taggedunion {
                "BLOCK" taggedstruct {
                    "SLAVE" ;
                    "MASTER" struct {
                        uchar max_bs;  /// MAX_BS_PGM
                        uchar min_st;  /// MIN_ST_PGM
                    };
                };
                "INTERLEAVED" uchar;  /// QUEUE_SIZE_PGM
            };
        };
    };

    struct Segment {
        uchar segment_number;  /// SEGMENT_NUMBER
        uchar num_pages;  /// number of pages
        uchar address_extension;  /// ADDRESS_EXTENSION
        uchar compression_method;  /// COMPRESSION_METHOD
        uchar encryption_method;  /// ENCRYPTION_METHOD
        taggedstruct {
            block "CHECKSUM" struct {
                enum XcpChecksumType {
                    "XCP_ADD_11" = 1,
                    "XCP_ADD_12" = 2,
                    "XCP_ADD_14" = 3,
                    "XCP_ADD_22" = 4,
                    "XCP_ADD_24" = 5,
                    "XCP_ADD_44" = 6,
                    "XCP_CRC_16" = 7,
                    "XCP_CRC_16_CITT" = 8,
                    "XCP_CRC_32" = 9,
                    "XCP_USER_DEFINED" = 255
                };
                taggedstruct {
                    "MAX_BLOCK_SIZE" ulong max_block_size;
                    "EXTERNAL_FUNCTION" char dllname[256];  /// Name of the Checksum.DLL
                    "MTA_BLOCK_SIZE_ALIGN" uint align;
                };
            };
            "DEFAULT_PAGE_NUMBER" uchar def_page;  /// Number of the default page
            (block "PAGE" struct {
                uchar page_number;  /// PAGE_NUMBER
                enum EcuAccessPermission {
                    "ECU_ACCESS_NOT_ALLOWED" = 0,
                    "ECU_ACCESS_WITHOUT_XCP_ONLY" = 1,
                    "ECU_ACCESS_WITH_XCP_ONLY" = 2,
                    "ECU_ACCESS_DONT_CARE" = 3
                };
                enum XcpReadAccessPermission {
                    "XCP_READ_ACCESS_NOT_ALLOWED" = 0,
                    "XCP_READ_ACCESS_WITHOUT_ECU_ONLY" = 1,
                    "XCP_READ_ACCESS_WITH_ECU_ONLY" = 2,
                    "XCP_READ_ACCESS_DONT_CARE" = 3
                };
                enum XcpWriteAccessPermission {
                    "XCP_WRITE_ACCESS_NOT_ALLOWED" = 0,
                    "XCP_WRITE_ACCESS_WITHOUT_ECU_ONLY" = 1,
                    "XCP_WRITE_ACCESS_WITH_ECU_ONLY" = 2,
                    "XCP_WRITE_ACCESS_DONT_CARE" = 3
                };
                taggedstruct {
                    "INIT_SEGMENT" uchar;  /// references segment that initialises this page
                };
            })*;
            (block "ADDRESS_MAPPING" struct {
                ulong source_address;  /// source address
                ulong dest_address;  /// destination address
                ulong length;  /// length
            })*;
            "PGM_VERIFY" ulong;  /// verification value for PGM
        };
    };

    taggedstruct Time_Correlation {
        /***********************************************************/
        /*    XCP_SLAVE_CLOCK and ECU_CLOCK need not               */
        /*    necessarily be the same clock, i.e. in case of       */
        /*    an external XCP Slave, these clocks might differ     */
        /***********************************************************/
        "DAQ_TIMESTAMPS_RELATE_TO" enum {
          "XCP_SLAVE_CLOCK"           = 0,
          "ECU_CLOCK"                 = 1
        };
        (block "CLOCK" struct {
            char uuid_octet_1;  /// globally unique clock identifier (UUID/EUI), 1st octet (most significant byte)
            char uuid_octet_2;  /// globally unique clock identifier (UUID/EUI), 2nd octet
            char uuid_octet_3;  /// globally unique clock identifier (UUID/EUI), 3rd octet
            char uuid_octet_4;  /// globally unique clock identifier (UUID/EUI), 4th octet
            char uuid_octet_5;  /// globally unique clock identifier (UUID/EUI), 5th octet
            char uuid_octet_6;  /// globally unique clock identifier (UUID/EUI), 6th octet
            char uuid_octet_7;  /// globally unique clock identifier (UUID/EUI), 7th octet
            char uuid_octet_8;  /// globally unique clock identifier (UUID/EUI), 8th octet (least significant byte)
            enum ClockType {                       /* clock enumerator */
              "XCP_SLAVE_CLOCK"             = 0,
              "ECU_CLOCK"                   = 1,
              "XCP_SLAVE_GRANDMASTER_CLOCK" = 2,   /* related to XCP_SLAVE_CLOCK */
              "ECU_GRANDMASTER_CLOCK"       = 3    /* related to ECU_CLOCK in case of an external slave */
            };
            enum Readability {                     /* readability */
              "RANDOMLY_READABLE" = 0,
              "LIMITED_READABLE"  = 1,
              "NOT_READABLE"      = 2
            };
            enum SynSupport {                                     /* synchronization features */
              "SYN_UNSUPPORTED"      = 0,                         /* clock neither supports synchronization */
                                                                  /* nor syntonization */
              "SYNCHRONIZATION_ONLY" = 1,                         /* clock only supports synchronization to */
                                                                  /* external grandmaster clock */
              "SYNTONIZATION_ONLY"   = 2,                         /* clock only supports syntonization to */
                                                                  /* external grandmaster clock */
              "SYN_ALL"              = 3                          /* clock supports synchronization as well */
                                                                  /* as syntonization to external grandmaster clock */
            };
            uchar clock_quality;                                  /* clock quality, stratum level */
            taggedstruct {
                block "TIMESTAMP_CHARACTERIZATION" struct {
                    uint timestamp_ticks;                             /* TIMESTAMP_TICKS */
                    enum TimestampUnit {                              /* RESOLUTION OF TIMESTAMP */
                        "UNIT_1NS"   = 0,
                        "UNIT_10NS"  = 1,
                        "UNIT_100NS" = 2,
                        "UNIT_1US"   = 3,
                        "UNIT_10US"  = 4,
                        "UNIT_100US" = 5,
                        "UNIT_1MS"   = 6,
                        "UNIT_10MS"  = 7,
                        "UNIT_100MS" = 8,
                        "UNIT_1S"    = 9,
                        "UNIT_1PS"   = 10,
                        "UNIT_10PS"  = 11,
                        "UNIT_100PS" = 12
                    };
                    enum NativeTimestampSize {                        /* NATIVE TIMESTAMP SIZE */
                        "SIZE_FOUR_BYTE"  = 4,
                        "SIZE_EIGHT_BYTE" = 8
                    };
                };
            };
            uint64 max_clock_value;                               /* MAX_TIMESTAMP_VALUE_BEFORE_WRAP_AROUND */
            enum ClockEpoch {                                     /* epoch */
              "ATOMIC_TIME"                = 0,                   /* TAI */
              "UNIVERSAL_COORDINATED_TIME" = 1,                   /* UTC */
              "ARBITRARY"                  = 2                    /* unknown */
            };
        })*;
    };

    taggedstruct Common_Parameters {
        block "PROTOCOL_LAYER" struct Protocol_Layer;
        block "TIME_CORRELATION" taggedstruct Time_Correlation;
        block "SEGMENT" struct Segment;
        block "DAQ" struct Daq;
        block "PAG" struct Pag;
        block "PGM" struct Pgm;
        block "DAQ_EVENT" taggedunion Daq_Event;
    };

    struct CAN_Parameters {
        uint;  /// XCP on CAN version, currently 0x0100
        taggedstruct {
            "CAN_ID_BROADCAST" ulong value;  /// Auto-detection CAN-ID
            "CAN_ID_MASTER" ulong value;  /// CMD/STIM CAN-ID
            "CAN_ID_MASTER_INCREMENTAL" ;  /// Master uses range of CAN-IDs. Start of range = CAN_ID_MASTER
            "CAN_ID_SLAVE" ulong value;  /// RES/ERR/EV/SERV/DAQ CAN-ID
            "CAN_ID_GET_DAQ_CLOCK_MULTICAST" ulong value;  /// Only for GET_DAQ_CLOCK_MULTICAST
            "BAUDRATE" ulong value;  /// Baudrate in Hz
            "SAMPLE_POINT" uchar value;  /// Sample point in % of bit time
            "SAMPLE_RATE" enum {
                "SINGLE" = 1,
                "TRIPLE" = 3
            };
            "BTL_CYCLES" uchar value;  /// slots per bit time
            "SJW" uchar value; /// sync jump width
            "SYNC_EDGE" enum {
                "SINGLE" = 1,
                "DUAL" = 2
            };
            "MAX_DLC_REQUIRED" ;  /// master to slave frames
            (block "DAQ_LIST_CAN_ID" struct {
                uint daq_list_ref;  /// reference to DAQ_LIST_NUMBER
                taggedstruct {
                    "VARIABLE" ;
                    "FIXED" ulong id;  /// this DAQ_LIST always on this CAN_ID
                };
            })*;
            (block "EVENT_CAN_ID_LIST" struct {
                uint event_ref;  /// reference to EVENT_NUMBER
                taggedstruct {
                    ("FIXED" ulong id)*;  /// this Event always on this IDs
                };
            })*;
            "MAX_BUS_LOAD" ulong;  /// maximum available bus in bit/s
            "MEASUREMENT_SPLIT_ALLOWED";  /// Supports splitting of measurements to increase payload for MAX_DTO <= 8
            block "CAN_FD" struct {
                taggedstruct {
                    "MAX_DLC" uint value;  /// 8, 12, 16, 20, 24, 32, 48 or 64
                    "CAN_FD_DATA_TRANSFER_BAUDRATE" ulong value;  /// BAUDRATE [Hz]
                    "SAMPLE_POINT" uchar value;  /// sample point receiver [% complete bit time]
                    "BTL_CYCLES" uchar value;  /// BTL_CYCLES [slots per bit time]
                    "SJW" uchar value;  /// length synchr. segment [BTL_CYCLES]
                    "SYNC_EDGE" enum {
                        "SINGLE" = 1,
                        "DUAL" = 2
                    };
                    "MAX_DLC_REQUIRED" ;  /// master to slave frames always to have DLC = MAX_DLC_for CAN-FD
                    "SECONDARY_SAMPLE_POINT" uchar value;  /// sender sample point [% complete bit time]
                    "TRANSCEIVER_DELAY_COMPENSATION" enum {
                        "OFF" = 0,
                        "ON" = 1
                    };
                };
            };
        };
        taggedstruct {
            ("OPTIONAL_TL_SUBCMD" enum CanTlSubcmd {  /* XCP code of optional transport layer specific subcommand supported by the slave */
                "GET_SLAVE_ID" = 0xFF,
                "GET_DAQ_ID" = 0xFE,
                "SET_DAQ_ID" = 0xFD,
                "GET_DAQ_CLOCK_MULTICAST" = 0xFA
            })*;
        };
    };

    struct SxI_Parameters {
        uint xcp_on_sxi_version;  /// XCP on SxI version, currently 0x0100
        ulong baudrate;  /// BAUDRATE [Hz]
        taggedstruct {
            "ASYNCH_FULL_DUPLEX_MODE" struct {
                enum Parity {
                    "PARITY_NONE" = 0,
                    "PARITY_ODD" = 1,
                    "PARITY_EVEN" = 2
                };
                enum StopBits {
                    "ONE_STOP_BIT" = 1,
                    "TWO_STOP_BITS" = 2
                };
                taggedstruct {
                    block "FRAMING" struct {
                        uchar;  /// SYNC character
                        uchar;  /// ESC character
                    };
                };  /// Support for framing mechanism
            };
            "SYNCH_FULL_DUPLEX_MODE_BYTE" ;
            "SYNCH_FULL_DUPLEX_MODE_WORD" ;
            "SYNCH_FULL_DUPLEX_MODE_DWORD" ;
            "SYNCH_MASTER_SLAVE_MODE_BYTE" ;
            "SYNCH_MASTER_SLAVE_MODE_WORD" ;
            "SYNCH_MASTER_SLAVE_MODE_DWORD" ;
        };
        enum HeaderLen {
            "HEADER_LEN_BYTE" = 0,
            "HEADER_LEN_CTR_BYTE" = 1,
            "HEADER_LEN_FILL_BYTE" = 2,
            "HEADER_LEN_WORD" = 3,
            "HEADER_LEN_CTR_WORD" = 4,
            "HEADER_LEN_FILL_WORD" = 5
        };
        enum SxiChecksum {
            "NO_CHECKSUM" = 0,
            "CHECKSUM_BYTE" = 1,
            "CHECKSUM_WORD" = 2
        };
    };

    enum EthPacketAlignment {
        "PACKET_ALIGNMENT_8" = 0,  /* default if the keyword is missing */
        "PACKET_ALIGNMENT_16" = 1,
        "PACKET_ALIGNMENT_32" = 2
    };  /// PACKET_ALIGNMENT of XCP on TCP_IP and UDP_IP

    enum EthTlSubcmd {  /* XCP code of optional transport layer specific subcommand supported by the slave */
        "GET_SLAVE_ID" = 0xFF,
        "GET_SLAVE_ID_EXTENDED" = 0xFD,
        "SET_SLAVE_IP_ADDRESS" = 0xFC,
        "GET_DAQ_CLOCK_MULTICAST" = 0xFA
    };  /// OPTIONAL_TL_SUBCMD of XCP on TCP_IP and UDP_IP

    struct TCP_IP_Parameters {
        uint version;  /// XCP on TCP_IP version, currently 0x0100
        uint port;  /// PORT
        taggedunion {
            "HOST_NAME" char hostname[256];
            "ADDRESS" char address_v4[15];
            "IPV6" char address_v6[39];
        };
        taggedstruct {
            "MAX_BUS_LOAD" ulong;  /// maximum available bus load in percent
            "MAX_BIT_RATE" ulong;  /// Network speed which is the base for MAX_BUS_LOAD in Mbit
        };
        taggedstruct {
            "PACKET_ALIGNMENT" enum EthPacketAlignment;
        };
        taggedstruct {
            ("OPTIONAL_TL_SUBCMD" enum EthTlSubcmd)*;
        };
    };

    struct UDP_IP_Parameters {
        uint version;  /// XCP on UDP version, currently 0x0100
        uint port;  /// PORT
        taggedunion {
            "HOST_NAME" char hostname[256];
            "ADDRESS" char address_v4[15];
            "IPV6" char address_v6[39];
        };
        taggedstruct {
            "MAX_BUS_LOAD" ulong;  /// maximum available bus load in percent
            "MAX_BIT_RATE" ulong;  /// Network speed which is the base for MAX_BUS_LOAD in Mbit
        };
        taggedstruct {
            "PACKET_ALIGNMENT" enum EthPacketAlignment;
        };
        taggedstruct {
            ("OPTIONAL_TL_SUBCMD" enum EthTlSubcmd)*;
        };
    };

    struct ep_parameters {
        uchar endpoint_number;  /// ENDPOINT_NUMBER, not endpoint address
        enum {
            "BULK_TRANSFER" = 2,
            "INTERRUPT_TRANSFER" = 3
        };
        uint wMaxPacketSize;  /// wMaxPacketSize: Maximum packet size of endpoint in bytes
        uchar bInterval;  /// bInterval: polling of endpoint
        enum {
            "MESSAGE_PACKING_SINGLE" = 0,
            "MESSAGE_PACKING_MULTIPLE" = 1,
            "MESSAGE_PACKING_STREAMING" = 2
        };
        enum {
            "ALIGNMENT_8_BIT" = 0,
            "ALIGNMENT_16_BIT" = 1,
            "ALIGNMENT_32_BIT" = 2,
            "ALIGNMENT_64_BIT" = 3
        };
        taggedstruct {
            "RECOMMENDED_HOST_BUFSIZE" uint;  /// Recommended size for the host buffer size. The size is defined as multiple of wMaxPacketSize.
        };
    };  /// end of ep_parameters

    struct USB_Parameters {
        uint version;  /// XCP on USB version e.g. "1.0" = 0x0100
        uint vendor_id;  /// Vendor ID
        uint product_id;  /// Product ID
        uchar interface;  /// Number of interface
        enum {
            "HEADER_LEN_BYTE" = 0,
            "HEADER_LEN_CTR_BYTE" = 1,
            "HEADER_LEN_FILL_BYTE" = 2,
            "HEADER_LEN_WORD" = 3,
            "HEADER_LEN_CTR_WORD" = 4,
            "HEADER_LEN_FILL_WORD" = 5
        };
        taggedunion {
            block "OUT_EP_CMD_STIM" struct ep_parameters;
        };
        taggedunion {
            block "IN_EP_RESERR_DAQ_EVSERV" struct ep_parameters;
        };
        taggedstruct {
            "ALTERNATE_SETTING_NO" uchar;  /// Number of alternate setting
            "INTERFACE_STRING_DESCRIPTOR" char[101];
            (block "OUT_EP_ONLY_STIM" struct ep_parameters)*;
            (block "IN_EP_ONLY_DAQ" struct ep_parameters)*;
            block "IN_EP_ONLY_EVSERV" struct ep_parameters;
            (block "DAQ_LIST_USB_ENDPOINT" struct {
                uint;  /// reference to DAQ_LIST_NUMBER
                taggedstruct {
                    "FIXED_IN" uchar;  /// this DAQ list always ENDPOINT_NUMBER, not endpoint address
                    "FIXED_OUT" uchar;  /// this STIM list always ENDPOINT_NUMBER, not endpoint address
                };
            })*;  /// end of DAQ_LIST_USB_ENDPOINT
        };  /// end of optional
        taggedstruct {
            ("OPTIONAL_TL_SUBCMD" enum UsbTlSubcmd {  /* XCP code of optional transport layer specific subcommand supported by the slave */
                "GET_DAQ_EP" = 0xFF,
                "SET_DAQ_EP" = 0xFE
            })*;
        };
    };

    enum PacketAssignmentType {
        "NOT_ALLOWED" = 0,
        "FIXED" = 1,
        "VARIABLE_INITIALISED" = 2,
        "VARIABLE" = 3
    };  /// end of PacketAssignmentType

    struct Buffer {
        uchar flx_buf;  /// FLX_BUF
        taggedstruct {
            "MAX_FLX_LEN_BUF" taggedunion {
                "FIXED" uchar length;  /// constant value
                "VARIABLE" uchar length;  /// initial value
            };  /// end of MAX_FLX_LEN_BUF
            block "LPDU_ID" taggedstruct {
                "FLX_SLOT_ID" taggedunion {
                    "FIXED" uint slot_id;
                    "VARIABLE" taggedstruct {
                        "INITIAL_VALUE" uint slot_id;
                    };
                };  /// end of FLX_SLOT_ID
                "OFFSET" taggedunion {
                    "FIXED" uchar offset;
                    "VARIABLE" taggedstruct {
                        "INITIAL_VALUE" uchar offset;
                    };
                };  /// end of OFFSET
                "CYCLE_REPETITION" taggedunion {
                    "FIXED" uchar cycle;
                    "VARIABLE" taggedstruct {
                        "INITIAL_VALUE" uchar cycle;
                    };
                };  /// end of CYCLE_REPETITION
                "CHANNEL" taggedunion {
                    "FIXED" enum {
                        "A" = 0,
                        "B" = 1
                    } channel;
                    "VARIABLE" taggedstruct {
                        "INITIAL_VALUE" enum {
                            "A" = 0,
                            "B" = 1
                        } channel;
                    };
                };  /// end of CHANNEL
            };  /// end of LPDU_ID
            block "XCP_PACKET" taggedstruct {
                "CMD" enum PacketAssignmentType;  /// end of CMD
                "RES_ERR" enum PacketAssignmentType;  /// end of RES_ERR
                "EV_SERV" enum PacketAssignmentType;  /// end of EV_SERV
                "DAQ" enum PacketAssignmentType;  /// end of DAQ
                "STIM" enum PacketAssignmentType;  /// end of STIM
                "MULTICAST" enum PacketAssignmentType;  /// end of MULTICAST
            };  /// end of XCP_PACKET
        };
    };  /// end of Buffer

    struct FLX_Parameters {
        uint version;  /// XCP on FlexRay version e.g. "1.0" = 0x0100
        uint t1;  /// T1_FLX [ms]
        char fibex_file[256];  /// FIBEX-file including CHI information including extension, without path
        char cluster_id[256];  /// Cluster-ID
        uchar nax;  /// NAX
        enum {
            "HEADER_NAX" = 0,
            "HEADER_NAX_FILL" = 1,
            "HEADER_NAX_CTR" = 2,
            "HEADER_NAX_FILL3" = 3,
            "HEADER_NAX_CTR_FILL2" = 4,
            "HEADER_NAX_LEN" = 5,
            "HEADER_NAX_CTR_LEN" = 6,
            "HEADER_NAX_FILL2_LEN" = 7,
            "HEADER_NAX_CTR_FILL_LEN" = 8
        };
        enum {
            "PACKET_ALIGNMENT_8" = 0,
            "PACKET_ALIGNMENT_16" = 1,
            "PACKET_ALIGNMENT_32" = 2
        };
        taggedunion {
            block "INITIAL_CMD_BUFFER" struct Buffer;
        };
        taggedunion {
            block "INITIAL_RES_ERR_BUFFER" struct Buffer;
        };
        taggedstruct {
            (block "POOL_BUFFER" struct Buffer)*;
        };
        taggedstruct {
            ("OPTIONAL_TL_SUBCMD" enum FlxTlSubcmd {  /* XCP code of optional transport layer specific subcommand supported by the slave */
                "FLX_ASSIGN" = 0xFF,
                "FLX_ACTIVATE" = 0xFE,
                "FLX_DEACTIVATE" = 0xFD,
                "GET_DAQ_FLX_BUF" = 0xFC,
                "SET_DAQ_FLX_BUF" = 0xFB,
                "GET_DAQ_CLOCK_MULTICAST" = 0xFA
            })*;
        };
    };

    block "IF_DATA" taggedunion if_data {

        "CANAPE_EXT" struct {
            int;             /// version number
            taggedstruct {
                "LINK_MAP" struct {
                    char symbol_name[256];   /// symbol name
                    long address;            /// base address of the segment
                    uint address_ext;        /// address extension of the segment
                    uint ds_relative;        /// flag: address is relative to DS
                    long segment_offset;     /// offset of the segment address
                    uint datatype_valid;     /// datatypValid
                    uint datatype;           /// enum datatyp
                    uint bit_offset;         /// bit offset of the data (bitfield)
                };
                "DISPLAY" struct {
                    long color;              /// display color
                    double display_min;      /// minimal display value (phys)
                    double display_max;      /// maximal display value (phys)
                };
                "VIRTUAL_CONVERSION" struct {
                    char conversion_name[256];   /// name of the conversion formula
                };
                "STEPSIZE_W" uint;           /// step size for FNC_VALUES in referenced record layout
                "STEPSIZE_X" uint;           /// step size for AXIS_PTS_X in referenced record layout
                "STEPSIZE_Y" uint;           /// step size for AXIS_PTS_Y in referenced record layout
            };
        };
        "CANAPE_MODULE" struct {
            taggedstruct {
                ("RECORD_LAYOUT_STEPSIZE" struct {
                    char record_layout[256];   /// name of record layout
                    uint fnc_values_step;      /// stepsize for FNC_VALUES
                    uint axis_pts_x_step;      /// stepsize for AXIS_PTS_X
                    uint axis_pts_y_step;      /// stepsize for AXIS_PTS_Y
                    uint axis_pts_z_step;      /// stepsize for AXIS_PTS_Z
                    uint axis_pts_4_step;      /// stepsize for AXIS_PTS_4
                    uint axis_pts_5_step;      /// stepsize for AXIS_PTS_5
                })*;
            };
        };
        "CANAPE_ADDRESS_UPDATE" taggedstruct {
            ("EPK_ADDRESS" struct {
                char epk_sym[1024];         /// name of the corresponding symbol in MAP file
                long offset;               /// optional address offset
            })*;
            "ECU_CALIBRATION_OFFSET" struct {
                char sym[1024];         /// name of the corresponding symbol in MAP file
                long offset;               /// optional address offset
            };
            (block "CALIBRATION_METHOD" taggedunion {
                "AUTOSAR_SINGLE_POINTERED" struct {
                    char pointer_tbl[1024];         /// MAP symbol name for pointer table in RAM
                    long offset;               /// optional address offset
                    taggedstruct {
                        "ORIGINAL_POINTER_TABLE" struct {
                            char[1024];    /// MAP symbol name for pointer table in FLASH
                            long;          /// optional address offset
                        };
                    };
                };
                "InCircuit2" struct {
                    char[1024];         /// MAP symbol name for pointer table in RAM
                    long;               /// optional address offset
                    taggedstruct {
                        "ORIGINAL_POINTER_TABLE" struct {
                            char[1024];    /// MAP symbol name for pointer table in FLASH
                            long;          /// optional address offset
                        };
                        "FLASH_SECTION" struct {
                            ulong;       /// start address of flash section
                            ulong;       /// length of flash section
                        };
                    };
                };
            })*;
            block "MAP_SYMBOL" taggedstruct {
                "FIRST" struct {
                    char[1024];  /// symbol name of the corresponding segment in MAP file
                    long;        /// offset
                };
                "LAST" struct {
                    char[1024];  /// symbol name of the corresponding segment in MAP file
                    long;        /// offset
                };
                ("ADDRESS_MAPPING_XCP" struct {
                    char[1024];  /// symbol name of source range in MAP file
                    char[1024];  /// symbol name of destination range in MAP file
                })*;
            };
            (block "MEMORY_SEGMENT" struct {
                char[1024];         /// name of the memory segment
                taggedstruct {
                    "FIRST" struct {
                        char[1024];  /// symbol name of the corresponding segment in MAP file
                        long;        /// offset
                    };
                    "LAST" struct {
                        char[1024];  /// symbol name of the corresponding segment in MAP file
                        long;        /// offset
                    };
                    ("ADDRESS_MAPPING_XCP" struct {
                        char[1024];  /// symbol name of source range in MAP file
                        char[1024];  /// symbol name of destination range in MAP file
                    })*;
                };
            })*;
        };
        "CANAPE_CAL_METHOD" taggedstruct {
            (block "CAL_PARAM_GROUP" taggedstruct {
                "NAME" char name[1024];
                "ADDRESS" ulong address;
                "SIZE" ulong size;
                "COMMENT" char comment[1024];
                "LINK_MAP" struct {
                    char symbol_name[256];   /// symbol name
                    ulong base_address;      /// base address of the symbol
                    uint address_extension;  /// address extension of the symbol
                    uint rel_address;        /// flag: address is relative to DS
                    long symbol_offset;      /// offset of the symbol address
                };
            })*;
        };
        "CANAPE_GROUP" taggedstruct {
            block "STRUCTURE_LIST" (char name[1024])*;
        };

        "CNP_CREATE_INI" taggedstruct {
            block "TP_BLOB" struct {
                uint version;  /// version
                taggedstruct {
                    ("PARAMETER" struct {
                        char file_name[256];  /// file name
                        char section[50];  /// Section, $CNP_DVC_SCTN$ defines the Device-Section entry
                        char parameter_name[50];  /// parameter name
                        char parameter_value[256];  /// parameter value
                    })*;
                };
            };
        };

        "XCP" struct {
            taggedstruct Common_Parameters;  /// default parameters
            taggedstruct {
                block "XCP_ON_CAN" struct {
                    struct CAN_Parameters;  /// specific for CAN
                    taggedstruct Common_Parameters;  /// overruling of default
                };
                block "XCP_ON_SxI" struct {
                    struct SxI_Parameters;  /// specific for SxI
                    taggedstruct Common_Parameters;  /// overruling of default
                };
                block "XCP_ON_TCP_IP" struct {
                    struct TCP_IP_Parameters;  /// specific for TCP_IP
                    taggedstruct Common_Parameters;  /// overruling of default
                };
                block "XCP_ON_UDP_IP" struct {
                    struct UDP_IP_Parameters;  /// specific for UDP
                    taggedstruct Common_Parameters;  /// overruling of default
                };
                block "XCP_ON_USB" struct {
                    struct USB_Parameters;  /// specific for USB
                    taggedstruct Common_Parameters;  /// overruling of default
                };
                block "XCP_ON_FLX" struct {
                    struct FLX_Parameters;  /// specific for FlexRay
                    taggedstruct Common_Parameters;  /// overruling of default
                };
            };
        };

        "XCPplus" struct {
            uint xcpplus_version;
            taggedstruct Common_Parameters; /* default parameters */
            taggedstruct {
                (block "XCP_ON_CAN" struct {
                    struct CAN_Parameters;  /// specific for CAN
                    taggedstruct Common_Parameters;  /// overruling of default
                    taggedstruct {
                        "TRANSPORT_LAYER_INSTANCE" char name[101];  /// name of the transport layer instance
                    };
                })*;
                (block "XCP_ON_SxI" struct {
                    struct SxI_Parameters;  /// specific for SxI
                    taggedstruct Common_Parameters;  /// overruling of default
                    taggedstruct {
                        "TRANSPORT_LAYER_INSTANCE" char name[101];  /// name of the transport layer instance
                    };
                })*;
                (block "XCP_ON_TCP_IP" struct {
                    struct TCP_IP_Parameters;  /// specific for TCP_IP
                    taggedstruct Common_Parameters;  /// overruling of default
                    taggedstruct {
                        "TRANSPORT_LAYER_INSTANCE" char name[101];  /// name of the transport layer instance
                    };
                })*;
                (block "XCP_ON_UDP_IP" struct {
                    struct UDP_IP_Parameters;  /// specific for UDP
                    taggedstruct Common_Parameters;  /// overruling of default
                    taggedstruct {
                        "TRANSPORT_LAYER_INSTANCE" char name[101];  /// name of the transport layer instance
                    };
                })*;
                (block "XCP_ON_USB" struct {
                    struct USB_Parameters;  /// specific for USB
                    taggedstruct Common_Parameters;  /// overruling of default
                    taggedstruct {
                        "TRANSPORT_LAYER_INSTANCE" char name[101];  /// name of the transport layer instance
                    };
                })*;
                (block "XCP_ON_FLX" struct {
                    struct FLX_Parameters;  /// specific for FlexRay
                    taggedstruct Common_Parameters;  /// overruling of default
                    taggedstruct {
                        "TRANSPORT_LAYER_INSTANCE" char name[101];  /// name of the transport layer instance
                    };
                })*;
            }; /* transport layer specific parameters */
        };

        "ASAP1B_CCP" taggedstruct {
            "DP_BLOB" struct {
                uint address_extension;  /// Address extension of the calibration data
                ulong base_address;  /// Base address of the calibration data
                ulong size;  /// Number of Bytes belonging to the calibration data
            };  /// address information for calibration objects and memory segments
        };
    };
}