-
Notifications
You must be signed in to change notification settings - Fork 31
/
icsnVC40_processed.h
6024 lines (5340 loc) · 164 KB
/
icsnVC40_processed.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
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
/*
Copyright (c) 2016 Intrepid Control Systems, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _ICSNVC40_H
#define _ICSNVC40_H
#if defined(_MSC_VER) && (_MSC_VER <= 1500)
// Visual studio has extremely poor support for C99 pre-2010
typedef signed char int8_t;
typedef short int16_t;
typedef int int32_t;
typedef __int64 int64_t;
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned __int64 uint64_t;
#else
#include <stdint.h>
#endif
#if defined(_MSC_VER)
#pragma warning(disable : 4200)
#endif
// MSVC++ 10.0 _MSC_VER == 1600 64-bit version doesn't allow multi-line #if directives...
#if defined(_WIN64) || defined(__x86_64__) || defined(__aarch64__) || defined(__x86_64__) || defined(__LP64__) || defined(_M_AMD64) || defined(_M_IA64) || defined(__PPC64__)
#define IS_64BIT_SYSTEM
#endif
/* OpenPort "OpenType" Argument Constants -- deprecated, use OpenNeoDevice */
#define NEOVI_COMMTYPE_RS232 0
#define NEOVI_COMMTYPE_USB_BULK 1
#define NEOVI_COMMTYPE_TCPIP 3
#define NEOVI_COMMTYPE_FIRE_USB 5
/* Network IDs -- value of NetworkID member of icsSpyMessage */
#define NETID_DEVICE 0
#define NETID_HSCAN 1
#define NETID_MSCAN 2
#define NETID_SWCAN 3
#define NETID_LSFTCAN 4
#define NETID_FORDSCP 5
#define NETID_J1708 6
#define NETID_AUX 7
#define NETID_JVPW 8
#define NETID_ISO 9
#define NETID_ISOPIC 10
#define NETID_MAIN51 11
#define NETID_RED 12
#define NETID_SCI 13
#define NETID_ISO2 14
#define NETID_ISO14230 15
#define NETID_LIN 16
#define NETID_OP_ETHERNET1 17
#define NETID_OP_ETHERNET2 18
#define NETID_OP_ETHERNET3 19
#define NETID_ISO3 41
#define NETID_HSCAN2 42
#define NETID_HSCAN3 44
#define NETID_OP_ETHERNET4 45
#define NETID_OP_ETHERNET5 46
#define NETID_ISO4 47
#define NETID_LIN2 48
#define NETID_LIN3 49
#define NETID_LIN4 50
#define NETID_MOST 51
#define NETID_RED_APP_ERROR 52
#define NETID_CGI 53
#define NETID_3G_RESET_STATUS 54
#define NETID_3G_FB_STATUS 55
#define NETID_3G_APP_SIGNAL_STATUS 56
#define NETID_3G_READ_DATALINK_CM_TX_MSG 57
#define NETID_3G_READ_DATALINK_CM_RX_MSG 58
#define NETID_3G_LOGGING_OVERFLOW 59
#define NETID_3G_READ_SETTINGS_EX 60
#define NETID_HSCAN4 61
#define NETID_HSCAN5 62
#define NETID_RS232 63
#define NETID_UART 64
#define NETID_UART2 65
#define NETID_UART3 66
#define NETID_UART4 67
#define NETID_SWCAN2 68
#define NETID_ETHERNET_DAQ 69
#define NETID_DATA_TO_HOST 70
#define NETID_TEXTAPI_TO_HOST 71
#define NETID_SPI1 72
#define NETID_OP_ETHERNET6 73
#define NETID_RED_VBAT 74
#define NETID_OP_ETHERNET7 75
#define NETID_OP_ETHERNET8 76
#define NETID_OP_ETHERNET9 77
#define NETID_OP_ETHERNET10 78
#define NETID_OP_ETHERNET11 79
#define NETID_FLEXRAY1A 80
#define NETID_FLEXRAY1B 81
#define NETID_FLEXRAY2A 82
#define NETID_FLEXRAY2B 83
#define NETID_LIN5 84
#define NETID_FLEXRAY 85
#define NETID_FLEXRAY2 86
#define NETID_OP_ETHERNET12 87
#define NETID_I2C1 88
#define NETID_MOST25 90
#define NETID_MOST50 91
#define NETID_MOST150 92
#define NETID_ETHERNET 93
#define NETID_GMFSA 94
#define NETID_TCP 95
#define NETID_HSCAN6 96
#define NETID_HSCAN7 97
#define NETID_LIN6 98
#define NETID_LSFTCAN2 99
/**
* To the next person to add a network, please make it 523!
*/
#define NETID_HW_COM_LATENCY_TEST 512
#define NETID_DEVICE_STATUS 513
#define NETID_UDP 514
#define NETID_AUTOSAR 515
#define NETID_FORWARDED_MESSAGE 516
#define NETID_I2C2 517
#define NETID_I2C3 518
#define NETID_I2C4 519
#define NETID_ETHERNET2 520
#define NETID_ETHERNET_TX_WRAP 521
#define NETID_A2B_01 522
#define NETID_A2B_02 523
#define NETID_ETHERNET3 524
#define NETID_ISM_LOGGER 525
#define NETID_CAN_SWITCH 526
#define NETID_WBMS 532
#define NETID_WBMS2 533
#define NETID_DWCAN_09 534
#define NETID_DWCAN_10 535
#define NETID_DWCAN_11 536
#define NETID_DWCAN_12 537
#define NETID_DWCAN_13 538
#define NETID_DWCAN_14 539
#define NETID_DWCAN_15 540
#define NETID_DWCAN_16 541
#define NETID_LIN_07 542
#define NETID_LIN_08 543
#define NETID_SPI2 544
#define NETID_MDIO_01 545
#define NETID_MDIO_02 546
#define NETID_MDIO_03 547
#define NETID_MDIO_04 548
#define NETID_MDIO_05 549
#define NETID_MDIO_06 550
#define NETID_MDIO_07 551
#define NETID_MDIO_08 552
#define NETID_OP_ETHERNET13 553
#define NETID_OP_ETHERNET14 554
#define NETID_OP_ETHERNET15 555
#define NETID_OP_ETHERNET16 556
#define NETID_SPI3 557
#define NETID_SPI4 558
#define NETID_SPI5 559
#define NETID_SPI6 560
/* Upper boundry of Network IDs */
#define NETID_MAX 100
#define NETID_INVALID 0xffff
/* Device types -- value of DeviceType of NeoDevice */
/* Older devices have a value on a specific bit. Those values have not changed
* to support existing apps using the api. New devices can fill in between the
* existing ones. I know it hurts, but it's just a number!
*/
//clang-format off
#define NEODEVICE_UNKNOWN (0x00000000)
#define NEODEVICE_BLUE (0x00000001)
#define NEODEVICE_ECU_AVB (0x00000002)
#define NEODEVICE_RADSUPERMOON (0x00000003)
#define NEODEVICE_DW_VCAN (0x00000004)
#define NEODEVICE_RADMOON2 (0x00000005)
#define NEODEVICE_RADGIGALOG (0x00000006) /* AKA RADMARS */
#define NEODEVICE_VCAN41 (0x00000007)
#define NEODEVICE_FIRE (0x00000008)
#define NEODEVICE_RADPLUTO (0x00000009)
#define NEODEVICE_VCAN42_EL (0x0000000a)
#define NEODEVICE_RADIO_CANHUB (0x0000000b)
#define NEODEVICE_NEOECU12 (0x0000000c)
#define NEODEVICE_OBD2_LC (0x0000000d)
#define NEODEVICE_RAD_MOON_DUO (0x0000000e)
#define NEODEVICE_FIRE3 (0x0000000f)
#define NEODEVICE_VCAN3 (0x00000010)
#define NEODEVICE_RADJUPITER (0x00000011)
#define NEODEVICE_VCAN4_IND (0x00000012)
#define NEODEVICE_GIGASTAR (0x00000013)
#define NEODEVICE_RED2 (0x00000014)
#define NEODEVICE_FIRE2_REDLINE (0x00000015)
#define NEODEVICE_ETHER_BADGE (0x00000016)
#define NEODEVICE_RAD_A2B (0x00000017)
#define NEODEVICE_RADEPSILON (0x00000018)
#define NEODEVICE_OBD2_SIM_DOIP (0x00000019)
#define NEODEVICE_OBD2_DEV (0x0000001a)
#define NEODEVICE_ECU22 (0x0000001b)
#define NEODEVICE_RADEPSILON_T (0x0000001c)
#define NEODEVICE_RADEPSILON_EXPRESS (0x0000001d)
#define NEODEVICE_RADPROXIMA (0x0000001e)
// I'm not sure what was 0x20 anymore, but we'll skip it to be safe
#define NEODEVICE_RAD_GALAXY_2 (0x00000021)
#define NEODEVICE_RAD_BMS (0x00000022)
#define NEODEVICE_RADMOON3 (0x00000023)
#define NEODEVICE_RADCOMET (0x00000024)
#define NEODEVICE_FIRE3_FLEXRAY (0x00000025)
#define NEODEVICE_RED2_OEM (0x00000026)
#define NEODEVICE_RADCOMET3 (0x00000027)
#define NEODEVICE_RED (0x00000040)
#define NEODEVICE_ECU (0x00000080)
#define NEODEVICE_IEVB (0x00000100)
#define NEODEVICE_PENDANT (0x00000200)
#define NEODEVICE_OBD2_PRO (0x00000400)
#define NEODEVICE_ECUCHIP_UART (0x00000800)
#define NEODEVICE_PLASMA (0x00001000)
#define NEODEVICE_DONT_REUSE0 (0x00002000) // NEODEVICE_FIRE_VNET
#define NEODEVICE_NEOANALOG (0x00004000)
#define NEODEVICE_CT_OBD (0x00008000)
#define NEODEVICE_DONT_REUSE1 (0x00010000) // NEODEVICE_PLASMA_1_12
#define NEODEVICE_DONT_REUSE2 (0x00020000) // NEODEVICE_PLASMA_1_13
#define NEODEVICE_ION (0x00040000)
#define NEODEVICE_RADSTAR (0x00080000)
#define NEODEVICE_DONT_REUSE3 (0x00100000) // NEODEVICE_ION3
#define NEODEVICE_VCAN44 (0x00200000)
#define NEODEVICE_VCAN42 (0x00400000)
#define NEODEVICE_CMPROBE (0x00800000)
#define NEODEVICE_EEVB (0x01000000)
#define NEODEVICE_VCANRF (0x02000000)
#define NEODEVICE_FIRE2 (0x04000000)
#define NEODEVICE_FLEX (0x08000000)
#define NEODEVICE_RADGALAXY (0x10000000)
#define NEODEVICE_RADSTAR2 (0x20000000)
#define NEODEVICE_VIVIDCAN (0x40000000)
#define NEODEVICE_OBD2_SIM (0x80000000)
#define NEODEVICE_ANY_PLASMA (NEODEVICE_PLASMA)
#define NEODEVICE_ANY_ION (NEODEVICE_ION)
#define NEODEVICE_NEOECUCHIP NEODEVICE_IEVB
//clang-format on
#define DEVICECOUNT_FOR_EXPLORER (48) // this value will be checked by the NeoViExplorer after #6453!
#define ISO15765_2_NETWORK_HSCAN 0x01
#define ISO15765_2_NETWORK_MSCAN 0x02
#define ISO15765_2_NETWORK_HSCAN2 0x04
#define ISO15765_2_NETWORK_HSCAN3 0x08
#define ISO15765_2_NETWORK_SWCAN 0x10
#define ISO15765_2_NETWORK_HSCAN4 0x14
#define ISO15765_2_NETWORK_HSCAN5 0x18
#define ISO15765_2_NETWORK_HSCAN6 0x1C
#define ISO15765_2_NETWORK_HSCAN7 0x20
#define ISO15765_2_NETWORK_SWCAN2 0x24
#define PLASMA_SLAVE1_OFFSET 100
#define PLASMA_SLAVE2_OFFSET 200
#define PLASMA_SLAVE_NUM 51
#define PLASMA_SLAVE1_OFFSET_RANGE2 4608
#define PLASMA_SLAVE2_OFFSET_RANGE2 8704
#define PLASMA_SLAVE3_OFFSET_RANGE2 12800
#define SCRIPT_STATUS_STOPPED 0
#define SCRIPT_STATUS_RUNNING 1
#define SCRIPT_LOCATION_FLASH_MEM 0
#define SCRIPT_LOCATION_INTERNAL_FLASH 2
#define SCRIPT_LOCATION_SDCARD 1
#define SCRIPT_LOCATION_VCAN3_MEM 4
#define SCRIPT_LOCATION_EMMC 6
/* Protocols -- value of Protocol member of icsSpyMessage */
#define SPY_PROTOCOL_CUSTOM 0
#define SPY_PROTOCOL_CAN 1
#define SPY_PROTOCOL_GMLAN 2
#define SPY_PROTOCOL_J1850VPW 3
#define SPY_PROTOCOL_J1850PWM 4
#define SPY_PROTOCOL_ISO9141 5
#define SPY_PROTOCOL_Keyword2000 6
#define SPY_PROTOCOL_GM_ALDL_UART 7
#define SPY_PROTOCOL_CHRYSLER_CCD 8
#define SPY_PROTOCOL_CHRYSLER_SCI 9
#define SPY_PROTOCOL_FORD_UBP 10
#define SPY_PROTOCOL_BEAN 11
#define SPY_PROTOCOL_LIN 12
#define SPY_PROTOCOL_J1708 13
#define SPY_PROTOCOL_CHRYSLER_JVPW 14
#define SPY_PROTOCOL_J1939 15
#define SPY_PROTOCOL_FLEXRAY 16
#define SPY_PROTOCOL_MOST 17
#define SPY_PROTOCOL_CGI 18
#define SPY_PROTOCOL_GME_CIM_SCL_KLINE 19
#define SPY_PROTOCOL_SPI 20
#define SPY_PROTOCOL_I2C 21
#define SPY_PROTOCOL_GENERIC_UART 22
#define SPY_PROTOCOL_JTAG 23
#define SPY_PROTOCOL_UNIO 24
#define SPY_PROTOCOL_DALLAS_1WIRE 25
#define SPY_PROTOCOL_GENERIC_MANCHSESTER 26
#define SPY_PROTOCOL_SENT_PROTOCOL 27
#define SPY_PROTOCOL_UART 28
#define SPY_PROTOCOL_ETHERNET 29
#define SPY_PROTOCOL_CANFD 30
#define SPY_PROTOCOL_GMFSA 31
#define SPY_PROTOCOL_TCP 32
#define SPY_PROTOCOL_UDP 33
#define SPY_PROTOCOL_AUTOSAR 34
#define SPY_PROTOCOL_A2B 35
#define SPY_PROTOCOL_WBMS 36
#define SPY_PROTOCOL_MDIO 37
/* Bitmasks for StatusBitField member of icsSpyMessage */
#define SPY_STATUS_GLOBAL_ERR 0x01
#define SPY_STATUS_TX_MSG 0x02
#define SPY_STATUS_XTD_FRAME 0x04
#define SPY_STATUS_REMOTE_FRAME 0x08
#define SPY_STATUS_CRC_ERROR 0x10
#define SPY_STATUS_CAN_ERROR_PASSIVE 0x20
#define SPY_STATUS_HEADERCRC_ERROR 0x20
#define SPY_STATUS_INCOMPLETE_FRAME 0x40
#define SPY_STATUS_LOST_ARBITRATION 0x80
#define SPY_STATUS_UNDEFINED_ERROR 0x100
#define SPY_STATUS_CAN_BUS_OFF 0x200
#define SPY_STATUS_BUS_RECOVERED 0x400
#define SPY_STATUS_BUS_SHORTED_PLUS 0x800
#define SPY_STATUS_BUS_SHORTED_GND 0x1000
#define SPY_STATUS_CHECKSUM_ERROR 0x2000
#define SPY_STATUS_BAD_MESSAGE_BIT_TIME_ERROR 0x4000
#define SPY_STATUS_TX_NOMATCH 0x8000
#define SPY_STATUS_COMM_IN_OVERFLOW 0x10000
#define SPY_STATUS_EXPECTED_LEN_MISMATCH 0x20000
#define SPY_STATUS_MSG_NO_MATCH 0x40000
#define SPY_STATUS_BREAK 0x80000
#define SPY_STATUS_AVSI_REC_OVERFLOW 0x100000
#define SPY_STATUS_TEST_TRIGGER 0x200000
#define SPY_STATUS_AUDIO_COMMENT 0x400000
#define SPY_STATUS_GPS_DATA 0x800000
#define SPY_STATUS_ANALOG_DIGITAL_INPUT 0x1000000
#define SPY_STATUS_TEXT_COMMENT 0x2000000
#define SPY_STATUS_NETWORK_MESSAGE_TYPE 0x4000000
#define SPY_STATUS_VSI_TX_UNDERRUN 0x8000000
#define SPY_STATUS_VSI_IFR_CRC_BIT 0x10000000
#define SPY_STATUS_INIT_MESSAGE 0x20000000
#define SPY_STATUS_LIN_MASTER 0x20000000
#define SPY_STATUS_CANFD 0x20000000
#define SPY_STATUS_A2B_CONTROL 0x10000000
#define SPY_STATUS_A2B_SCF_VALID_WAITING 0x08
#define SPY_STATUS_A2B_MONITOR 0x20000000
#define SPY_STATUS_A2B_UPSTREAM 0x40000000
#define SPY_STATUS_PDU 0x10000000
#define SPY_STATUS_FLEXRAY_PDU SPY_STATUS_PDU
#define SPY_STATUS_HIGH_SPEED 0x40000000
#define SPY_STATUS_EXTENDED 0x80000000 /* if this bit is set than decode StatusBitField3 in AckBytes */
#define SPY_STATUS_FLEXRAY_PDU_UPDATE_BIT_SET 0x40000000
#define SPY_STATUS_FLEXRAY_PDU_NO_UPDATE_BIT 0x08
/* Bitmasks for StatusBitField2 member of icsSpyMessage */
#define SPY_STATUS2_HAS_VALUE 0x1
#define SPY_STATUS2_VALUE_IS_BOOLEAN 0x2
#define SPY_STATUS2_HIGH_VOLTAGE 0x4
#define SPY_STATUS2_LONG_MESSAGE 0x8
#define SPY_STATUS2_GLOBAL_CHANGE 0x10000
#define SPY_STATUS2_ERROR_FRAME 0x20000
#define SPY_STATUS2_END_OF_LONG_MESSAGE 0x100000
/* I2C Specific - check protocol before handling */
#define SPY_STATUS2_I2C_ERR_TIMEOUT 0x200000
#define SPY_STATUS2_I2C_ERR_NACK 0x400000
#define SPY_STATUS2_I2C_DIR_READ 0x800000
/* MDIO Specific - check protocol before handling */
#define SPY_STATUS2_MDIO_ERR_TIMEOUT 0x200000
#define SPY_STATUS2_MDIO_JOB_CANCELLED 0x400000
#define SPY_STATUS2_MDIO_INVALID_BUS 0x800000
#define SPY_STATUS2_MDIO_INVALID_PHYADDR 0x1000000
#define SPY_STATUS2_MDIO_INVALID_REGADDR 0x2000000
#define SPY_STATUS2_MDIO_UNSUPPORTED_CLAUSE 0x4000000
#define SPY_STATUS2_MDIO_UNSUPPORTED_OPCODE 0x8000000
#define SPY_STATUS2_MDIO_OVERFLOW 0x10000000
#define SPY_STATUS2_MDIO_CLAUSE45 0x20000000
#define SPY_STATUS2_MDIO_READ 0x40000000
/* LIN/ISO Specific - check protocol before handling */
#define SPY_STATUS2_LIN_ERR_RX_BREAK_NOT_0 0x200000
#define SPY_STATUS2_LIN_ERR_RX_BREAK_TOO_SHORT 0x400000
#define SPY_STATUS2_LIN_ERR_RX_SYNC_NOT_55 0x800000
#define SPY_STATUS2_LIN_ERR_RX_DATA_GREATER_8 0x1000000
#define SPY_STATUS2_LIN_ERR_TX_RX_MISMATCH 0x2000000
#define SPY_STATUS2_LIN_ERR_MSG_ID_PARITY 0x4000000
#define SPY_STATUS2_ISO_FRAME_ERROR 0x8000000
#define SPY_STATUS2_LIN_SYNC_FRAME_ERROR 0x8000000
#define SPY_STATUS2_ISO_OVERFLOW_ERROR 0x10000000
#define SPY_STATUS2_LIN_ID_FRAME_ERROR 0x10000000
#define SPY_STATUS2_ISO_PARITY_ERROR 0x20000000
#define SPY_STATUS2_LIN_SLAVE_BYTE_ERROR 0x20000000
#define SPY_STATUS2_RX_TIMEOUT_ERROR 0x40000000
#define SPY_STATUS2_LIN_NO_SLAVE_DATA 0x80000000
#define SPY_STATUS3_LIN_JUST_BREAK_SYNC 0x1
#define SPY_STATUS3_LIN_SLAVE_DATA_TOO_SHORT 0x2
#define SPY_STATUS3_LIN_ONLY_UPDATE_SLAVE_TABLE_ONCE 0x4
/* MOST Specific - check protocol before handling */
#define SPY_STATUS2_MOST_PACKET_DATA 0x200000
#define SPY_STATUS2_MOST_STATUS 0x400000 /* reflects changes in light/lock/MPR/SBC/etc... */
#define SPY_STATUS2_MOST_LOW_LEVEL 0x800000 /* MOST low level message, allocs, deallocs, remote requests...*/
#define SPY_STATUS2_MOST_CONTROL_DATA 0x1000000
#define SPY_STATUS2_MOST_MHP_USER_DATA 0x2000000 /* MOST HIGH User Data Frame */
#define SPY_STATUS2_MOST_MHP_CONTROL_DATA 0x4000000 /* MOST HIGH Control Data */
#define SPY_STATUS2_MOST_I2S_DUMP 0x8000000
#define SPY_STATUS2_MOST_TOO_SHORT 0x10000000
#define SPY_STATUS2_MOST_MOST50 0x20000000 /* absence of MOST50 and MOST150 implies it's MOST25 */
#define SPY_STATUS2_MOST_MOST150 0x40000000
#define SPY_STATUS2_MOST_CHANGED_PAR 0x80000000 /* first byte in ack reflects what changed. */
/* Ethernet Specific - check protocol before handling */
#define SPY_STATUS2_ETHERNET_CRC_ERROR 0x200000
#define SPY_STATUS2_ETHERNET_FRAME_TOO_SHORT 0x400000
#define SPY_STATUS2_ETHERNET_FCS_AVAILABLE 0x800000 /* This frame contains FCS (4 bytes) obtained from ICS Ethernet hardware (ex. RAD-STAR) */
#define SPY_STATUS2_ETHERNET_NO_PADDING 0x1000000
#define SPY_STATUS2_ETHERNET_PREEMPTION_ENABLED 0x2000000
#define SPY_STATUS2_ETHERNET_UPDATE_CHECKSUMS 0x4000000
#define SPY_STATUS2_ETHERNET_MANUALFCS_ENABLED 0x8000000
#define SPY_STATUS2_ETHERNET_FCS_VERIFIED 0x10000000
#define SPY_STATUS2_ETHERNET_T1S_SYMBOL 0x20000000
#define SPY_STATUS2_ETHERNET_T1S_BURST 0x40000000
#define SPY_STATUS2_ETHERNET_T1S_ETHERNET 0x80000000
#define SPY_STATUS3_ETHERNET_TX_COLLISION 0x00000001
/* FlexRay Specific - check protocol before handling */
#define SPY_STATUS2_FLEXRAY_TX_AB 0x200000
#define SPY_STATUS2_FLEXRAY_TX_AB_NO_A 0x400000
#define SPY_STATUS2_FLEXRAY_TX_AB_NO_B 0x800000
#define SPY_STATUS2_FLEXRAY_TX_AB_NO_MATCH 0x1000000
#define SPY_STATUS2_FLEXRAY_NO_CRC 0x2000000
#define SPY_STATUS2_FLEXRAY_NO_HEADERCRC 0x4000000
/* CAN/CAN-FD Specific - check protocol before handling */
#define SPY_STATUS2_CAN_ISO15765_LOGICAL_FRAME 0x200000
#define SPY_STATUS2_CAN_HAVE_LINK_DATA 0x400000
/* wBMS Specific - check protocol before handling */
#define SPY_STATUS2_WBMS_API_IS_CALLBACK 0x200000
/* CAN-FD Specific - check protocol before handling */
#define SPY_STATUS3_CANFD_ESI 0x01
#define SPY_STATUS3_CANFD_IDE 0x02
#define SPY_STATUS3_CANFD_RTR 0x04
#define SPY_STATUS3_CANFD_FDF 0x08
#define SPY_STATUS3_CANFD_BRS 0x10
/* Configuration Array constants */
/* HSCAN neoVI or ValueCAN */
#define NEO_CFG_MPIC_HS_CAN_CNF1 (512 + 10)
#define NEO_CFG_MPIC_HS_CAN_CNF2 (512 + 9)
#define NEO_CFG_MPIC_HS_CAN_CNF3 (512 + 8)
#define NEO_CFG_MPIC_HS_CAN_MODE (512 + 54)
/* med speed neoVI CAN */
#define NEO_CFG_MPIC_MS_CAN_CNF1 (512 + 22)
#define NEO_CFG_MPIC_MS_CAN_CNF2 (512 + 21)
#define NEO_CFG_MPIC_MS_CAN_CNF3 (512 + 20)
/* med speed neoVI CAN */
#define NEO_CFG_MPIC_SW_CAN_CNF1 (512 + 34)
#define NEO_CFG_MPIC_SW_CAN_CNF2 (512 + 33)
#define NEO_CFG_MPIC_SW_CAN_CNF3 (512 + 32)
/* med speed neoVI CAN */
#define NEO_CFG_MPIC_LSFT_CAN_CNF1 (512 + 46)
#define NEO_CFG_MPIC_LSFT_CAN_CNF2 (512 + 45)
#define NEO_CFG_MPIC_LSFT_CAN_CNF3 (512 + 44)
/* Constants used to calculate timestamps */
#define NEOVI_TIMESTAMP_2 0.1048576
#define NEOVI_TIMESTAMP_1 0.0000016
#define NEOVIPRO_VCAN_TIMESTAMP_2 0.065536
#define NEOVIPRO_VCAN_TIMESTAMP_1 0.000001
#define NEOVI6_VCAN_TIMESTAMP_2 0.065536
#define NEOVI6_VCAN_TIMESTAMP_1 0.000001
#define NEOVI_RED_TIMESTAMP_2_25NS 107.3741824
#define NEOVI_RED_TIMESTAMP_1_25NS 0.000000025
#define NEOVI_RED_TIMESTAMP_2_10NS 429.4967296
#define NEOVI_RED_TIMESTAMP_1_10NS 0.000000010
#define HARDWARE_TIMESTAMP_ID_NONE (unsigned char)0
#define HARDWARE_TIMESTAMP_ID_VSI (unsigned char)1
#define HARDWARE_TIMESTAMP_ID_AVT_716 (unsigned char)2
#define HARDWARE_TIMESTAMP_ID_NI_CAN (unsigned char)3
#define HARDWARE_TIMESTAMP_ID_NEOVI (unsigned char)4
#define HARDWARE_TIMESTAMP_ID_AVT_717 (unsigned char)5
#define HARDWARE_TIMESTAMP_ID_NEOv6_VCAN (unsigned char)6
#define HARDWARE_TIMESTAMP_ID_DOUBLE_SEC (unsigned char)7
#define HARDWARE_TIMESTAMP_ID_NEORED_10US (unsigned char)8
#define HARDWARE_TIMESTAMP_ID_NEORED_25NS (unsigned char)9
#define HARDWARE_TIMESTAMP_ID_NEORED_10NS (unsigned char)10
// flag to indicate if the timestamp is a fixed value, or if it is a timestamp referenced to a network object
// if this flag is NOT set, then the TimeStampHardwareID is a 1-based index for GetHWAt(index)
// see CMessageTimeDecoder::GetSpyTimeType()
// see cicsSpyCE::GetSpyTimeType()
#define HADRWARE_TIMESTAMP_ID_FIXED 0x80
#define FIRE2_REPORT_PERIODIC (0x0001)
#define FIRE2_REPORT_EMISC1_DIGITAL (0x0002)
#define FIRE2_REPORT_EMISC2_DIGITAL (0x0004)
#define FIRE2_REPORT_MISC5_DIGITAL (0x0008)
#define FIRE2_REPORT_MISC6_DIGITAL (0x0010)
#define FIRE2_REPORT_EMISC1_ANALOG (0x0020)
#define FIRE2_REPORT_EMISC2_ANALOG (0x0040)
#define FIRE2_REPORT_VBATT_ANALOG (0x0080)
#define FIRE2_REPORT_TEMP_ANALOG (0x0100)
#define FIRE2_REPORT_PWM_IN (0x0200)
#define FIRE2_REPORT_GPS (0x0400)
#define FIRE3_REPORT_ORIENTATION (0x0800)
typedef struct SExtendedDataFlashHeader
{
uint16_t version;
uint16_t chksum;
uint32_t len;
} ExtendedDataFlashHeader_t;
typedef struct
{
uint32_t DeviceType;
int32_t Handle;
int32_t NumberOfClients;
int32_t SerialNumber;
int32_t MaxAllowedClients;
} NeoDevice;
typedef struct _NeoDeviceEx
{
NeoDevice neoDevice;
uint32_t FirmwareMajor;
uint32_t FirmwareMinor;
#define CANNODE_STATUS_COREMINI_IS_RUNNING (0x1)
#define CANNODE_STATUS_IN_BOOTLOADER (0x2)
uint32_t Status; // Bitfield, see defs above
// Option bit flags
#define MAIN_VNET (0x01)
#define SLAVE_VNET_A (0x02)
#define SLAVE_VNET_B (0x04)
#define WIFI_CONNECTION (0x08)
#define REGISTER_BY_SERIAL (0x10)
#define TCP_SUPPORTED (0x20)
#define DRIVER_MASK (0xC0)
#define DRIVER_USB1 (0x40)
#define DRIVER_USB2 (0x80)
#define DRIVER_USB3 (0xC0)
uint32_t Options;
void* pAvailWIFINetwork;
void* pWIFIInterfaceInfo;
int isEthernetDevice;
uint8_t MACAddress[6];
uint16_t hardwareRev;
uint16_t revReserved;
uint32_t tcpIpAddress[4];
uint16_t tcpPort;
uint16_t Reserved0;
uint32_t Reserved1;
} NeoDeviceEx;
typedef union tagOptionsOpenNeoEx
{
struct
{
int32_t iNetworkID; /* Network ID indicating which CAN network to communicate over */
} CANOptions;
uint32_t Reserved[16]; /* may be expanded in future revisions */
} OptionsOpenNeoEx, *POptionsOpenNeoEx;
typedef union tagOptionsFindNeoEx
{
struct
{
int32_t iNetworkID; /* Network ID indicating which CAN network to communicate over */
} CANOptions;
uint32_t Reserved[16]; /* may be expanded in future revisions */
} OptionsFindNeoEx, *POptionsFindNeoEx;
typedef struct tagicsneoVICommand
{
uint8_t CommandType;
uint8_t CommandByteLength;
uint8_t Data[14];
} icsneoVICommand;
#pragma pack(push, 1)
typedef struct _stAPIFirmwareInfo
{
int32_t iType; /* 1,2,3 for Generation of HW */
/* Date and Time (only valid for type 1 and 2) */
int32_t iMainFirmDateDay;
int32_t iMainFirmDateMonth;
int32_t iMainFirmDateYear;
int32_t iMainFirmDateHour;
int32_t iMainFirmDateMin;
int32_t iMainFirmDateSecond;
int32_t iMainFirmChkSum;
/* Version data (only valid for type 3) */
uint8_t iAppMajor;
uint8_t iAppMinor;
uint8_t iManufactureDay;
uint8_t iManufactureMonth;
uint16_t iManufactureYear;
uint8_t iBoardRevMajor;
uint8_t iBoardRevMinor;
uint8_t iBootLoaderVersionMajor;
uint8_t iBootLoaderVersionMinor;
uint8_t iMainVnetHWrevMajor;
uint8_t iMainVnetHWrevMinor;
uint8_t iMainVnetSRAMSize;
uint8_t iPhySiliconRev;
} stAPIFirmwareInfo;
#pragma pack(pop)
/* Settings structures come are all packed to 2 bytes */
#pragma pack(push, 2)
/* SetBaudrate in CAN_SETTINGS */
enum
{
AUTO,
USE_TQ
};
/* Baudrate in CAN_SETTINGS/CANFD_SETTINGS */
enum
{
BPS20,
BPS33,
BPS50,
BPS62,
BPS83,
BPS100,
BPS125,
BPS250,
BPS500,
BPS800,
BPS1000,
BPS666,
BPS2000,
BPS4000,
CAN_BPS5000,
CAN_BPS6667,
CAN_BPS8000,
CAN_BPS10000,
};
/* Mode in CAN_SETTINGS */
enum
{
NORMAL = 0,
DISABLE = 1,
LOOPBACK = 2,
LISTEN_ONLY = 3,
LISTEN_ALL = 7
};
typedef struct
{
uint8_t Mode;
uint8_t SetBaudrate;
uint8_t Baudrate;
uint8_t transceiver_mode;
uint8_t TqSeg1;
uint8_t TqSeg2;
uint8_t TqProp;
uint8_t TqSync;
uint16_t BRP;
uint8_t auto_baud;
uint8_t innerFrameDelay25us;
} CAN_SETTINGS;
#define CAN_SETTINGS_SIZE 12
/* FDMode in CANFD_SETTINGS */
enum
{
NO_CANFD,
CANFD_ENABLED,
CANFD_BRS_ENABLED,
CANFD_ENABLED_ISO,
CANFD_BRS_ENABLED_ISO
};
typedef struct _CANFD_SETTINGS
{
uint8_t FDMode; /* mode, secondary baudrate for canfd */
uint8_t FDBaudrate;
uint8_t FDTqSeg1;
uint8_t FDTqSeg2;
uint8_t FDTqProp;
uint8_t FDTqSync;
uint16_t FDBRP;
uint8_t FDTDC;
uint8_t reserved;
} CANFD_SETTINGS;
#define CANFD_SETTINGS_SIZE 10
/* high_speed_auto_switch in SWCAN_SETTINGS */
enum
{
SWCAN_AUTOSWITCH_DISABLED,
SWCAN_AUTOSWITCH_NO_RESISTOR,
SWCAN_AUTOSWITCH_WITH_RESISTOR,
SWCAN_AUTOSWITCH_DISABLED_RESISTOR_ENABLED
};
typedef struct
{
uint8_t Mode;
uint8_t SetBaudrate;
uint8_t Baudrate;
uint8_t transceiver_mode;
uint8_t TqSeg1;
uint8_t TqSeg2;
uint8_t TqProp;
uint8_t TqSync;
uint16_t BRP;
uint16_t high_speed_auto_switch;
uint8_t auto_baud;
uint8_t RESERVED;
} SWCAN_SETTINGS;
#define SWCAN_SETTINGS_SIZE 14
/* Baudrate in LIN_SETTINGS / ISO9141_KEYWORD2000_SETTINGS / UART_SETTINGS */
enum
{
BPS5000,
BPS10400,
BPS33333,
BPS50000,
BPS62500,
BPS71429,
BPS83333,
BPS100000,
BPS117647
};
/* MasterResistor in LIN_SETTINGS */
enum
{
RESISTOR_ON,
RESISTOR_OFF
};
/* Mode in LIN_SETTINGS */
enum
{
SLEEP_MODE,
SLOW_MODE,
NORMAL_MODE,
FAST_MODE
};
typedef struct _LIN_SETTINGS
{
uint32_t Baudrate; /* New products since FIREVNETEP should rely on this only */
uint16_t spbrg; /* Precompiled to be 40Mhz/Baudrate/16 - 1. Only used in neoVI FIRE/FIREVNET(4dw) */
uint8_t brgh; /* Must be zero */
uint8_t numBitsDelay;
uint8_t MasterResistor;
uint8_t Mode;
} LIN_SETTINGS;
#define LIN_SETTINGS_SIZE 10
typedef struct
{
uint16_t time_500us;
uint16_t k;
uint16_t l;
} ISO9141_KEYWORD2000__INIT_STEP;
#define ISO9141_KEYWORD2000__INIT_STEP_SIZE 6
typedef struct
{
uint32_t Baudrate;
uint16_t spbrg;
uint16_t brgh;
ISO9141_KEYWORD2000__INIT_STEP init_steps[16];
uint8_t init_step_count;
uint16_t p2_500us;
uint16_t p3_500us;
uint16_t p4_500us;
uint16_t chksum_enabled;
} ISO9141_KEYWORD2000_SETTINGS;
#define ISO9141_KEYWORD2000_SETTINGS_SIZE 114
typedef struct _UART_SETTINGS
{
uint16_t Baudrate;
uint16_t spbrg;
uint16_t brgh;
uint16_t parity;
uint16_t stop_bits;
uint8_t flow_control; /* 0- off, 1 - Simple CTS RTS */
uint8_t reserved_1;
union
{
uint32_t bOptions;
struct
{
unsigned invert_tx : 1;
unsigned invert_rx : 1;
unsigned half_duplex : 1;
unsigned reserved_bits : 13;
unsigned reserved_bits2 : 16;
};
};
} UART_SETTINGS;
#define UART_SETTINGS_SIZE 16
typedef struct
{
uint16_t enable_convert_mode;
} J1708_SETTINGS;
#define J1708_SETTINGS_SIZE 2
typedef struct _SRedSettings
{
CAN_SETTINGS can1;
CAN_SETTINGS can2;
LIN_SETTINGS lin1;
LIN_SETTINGS lin2;
} SRedSettings;
#define SRedSettings_SIZE 44
typedef struct _STextAPISettings
{
uint32_t can1_tx_id;
uint32_t can1_rx_id;
union
{
struct
{
unsigned bExtended : 1;
unsigned : 31;
};
uint32_t DWord;
} can1_options;
uint32_t can2_tx_id;
uint32_t can2_rx_id;
union
{
struct
{
unsigned bExtended : 1;
unsigned : 31;
};
uint32_t DWord;
} can2_options;
uint32_t network_enables;
uint32_t can3_tx_id;
uint32_t can3_rx_id;
union
{
struct
{
unsigned bExtended : 1;
unsigned : 31;
};
uint32_t DWord;
} can3_options;
uint32_t can4_tx_id;
uint32_t can4_rx_id;
union
{
struct
{
unsigned bExtended : 1;
unsigned : 31;
};
uint32_t DWord;
} can4_options;
uint32_t reserved[5];
} STextAPISettings;
#define STextAPISettings_SIZE 72
typedef union _stChipVersions
{
struct
{
uint8_t mpic_maj;
uint8_t mpic_min;
uint8_t upic_maj;
uint8_t upic_min;
uint8_t lpic_maj;
uint8_t lpic_min;
uint8_t jpic_maj;
uint8_t jpic_min;
} fire_versions;
struct
{
uint8_t mpic_maj;
uint8_t mpic_min;
uint8_t core_maj;
uint8_t core_min;
uint8_t lpic_maj;
uint8_t lpic_min;
uint8_t hid_maj;
uint8_t hid_min;
} plasma_fire_vnet;
struct
{
uint8_t mpic_maj;
uint8_t mpic_min;
} vcan3_versions;
struct
{
uint8_t mpic_maj;
uint8_t mpic_min;
} vcanrf_versions;
struct
{
uint8_t zynq_core_major;
uint8_t zynq_core_minor;
} radgalaxy_versions;
struct
{
uint8_t zynq_core_major;
uint8_t zynq_core_minor;
} radstar2_versions;
struct
{
uint8_t mpic_maj;
uint8_t mpic_min;
uint8_t ext_flash_maj;
uint8_t ext_flash_min;
uint8_t nrf52_maj;
uint8_t nrf52_min;
} vividcan_versions;
struct
{
uint8_t zynq_core_major;
uint8_t zynq_core_minor;
} cmprobe_versions;
struct
{
uint8_t mchip_major;