Clean up icsnVC40.h for the legacy API

pull/4/head
Paul Hollinsky 2018-10-22 12:46:27 -04:00
parent 9675bb81f7
commit a13adec04a
1 changed files with 639 additions and 714 deletions

View File

@ -1,4 +1,3 @@
#include "string.h" #include "string.h"
#include <string> #include <string>
#include <cstdint> #include <cstdint>
@ -22,7 +21,7 @@
#define NEOVI_COMMTYPE_USB_ISO_DONT_USE 2 #define NEOVI_COMMTYPE_USB_ISO_DONT_USE 2
#define NEOVI_COMMTYPE_TCPIP 3 #define NEOVI_COMMTYPE_TCPIP 3
//hardware constants // Hardware constants
#define NEODEVICE_UNKNOWN 0 #define NEODEVICE_UNKNOWN 0
#define NEODEVICE_BLUE 1 #define NEODEVICE_BLUE 1
#define NEODEVICE_SW_VCAN 2 #define NEODEVICE_SW_VCAN 2
@ -59,7 +58,7 @@
#define NEODEVICE_OBD2_SIM 0x80000000 #define NEODEVICE_OBD2_SIM 0x80000000
#define NEODEVICE_ALL 0xFFFFBFFF #define NEODEVICE_ALL 0xFFFFBFFF
//device ID's // Device ID's
const int NETID_DEVICE = 0; const int NETID_DEVICE = 0;
const int NETID_HSCAN = 1; const int NETID_HSCAN = 1;
const int NETID_MSCAN = 2; const int NETID_MSCAN = 2;
@ -119,7 +118,6 @@ const int NETID_OP_ETHERNET10 = 78;
const int NETID_OP_ETHERNET11 = 79; const int NETID_OP_ETHERNET11 = 79;
const int NETID_OP_ETHERNET12 = 87; const int NETID_OP_ETHERNET12 = 87;
// Constants used to calculate the timestamp // Constants used to calculate the timestamp
const double NEOVI_TIMESTAMP_2 = 0.1048576; const double NEOVI_TIMESTAMP_2 = 0.1048576;
const double NEOVI_TIMESTAMP_1 = 0.0000016; const double NEOVI_TIMESTAMP_1 = 0.0000016;
@ -184,7 +182,7 @@ const long NEO_CFG_MPIC_HS_CAN_CNF1 = 512 + 10;
const long NEO_CFG_MPIC_HS_CAN_CNF2 = 512 + 9; const long NEO_CFG_MPIC_HS_CAN_CNF2 = 512 + 9;
const long NEO_CFG_MPIC_HS_CAN_CNF3 = 512 + 8; const long NEO_CFG_MPIC_HS_CAN_CNF3 = 512 + 8;
const long NEO_CFG_MPIC_HS_CAN_MODE = 512 + 54; const long NEO_CFG_MPIC_HS_CAN_MODE = 512 + 54;
// med speed CAN // Med speed CAN
const long NEO_CFG_MPIC_MS_CAN_CNF1 = 512 + 22; const long NEO_CFG_MPIC_MS_CAN_CNF1 = 512 + 22;
const long NEO_CFG_MPIC_MS_CAN_CNF2 = 512 + 21; const long NEO_CFG_MPIC_MS_CAN_CNF2 = 512 + 21;
const long NEO_CFG_MPIC_MS_CAN_CNF3 = 512 + 20; const long NEO_CFG_MPIC_MS_CAN_CNF3 = 512 + 20;
@ -204,7 +202,7 @@ const long SPY_STATUS2_HIGH_VOLTAGE = 4;
const long SPY_STATUS2_LONG_MESSAGE = 8; const long SPY_STATUS2_LONG_MESSAGE = 8;
const long SPY_STATUS2_GLOBAL_CHANGE = 0x10000; const long SPY_STATUS2_GLOBAL_CHANGE = 0x10000;
const long SPY_STATUS2_ERROR_FRAME = 0x20000; const long SPY_STATUS2_ERROR_FRAME = 0x20000;
const long SPY_STATUS2_END_OF_LONG_MESSAGE = 0x100000; //for ISO and J1708; const long SPY_STATUS2_END_OF_LONG_MESSAGE = 0x100000; // for ISO and J1708
// LIN/ISO Specific - check protocol before handling // LIN/ISO Specific - check protocol before handling
const long SPY_STATUS2_LIN_ERR_RX_BREAK_NOT_0 = 0x200000; const long SPY_STATUS2_LIN_ERR_RX_BREAK_NOT_0 = 0x200000;
const long SPY_STATUS2_LIN_ERR_RX_BREAK_TOO_SHORT = 0x400000; const long SPY_STATUS2_LIN_ERR_RX_BREAK_TOO_SHORT = 0x400000;
@ -222,16 +220,16 @@ const long SPY_STATUS2_RX_TIMEOUT_ERROR = 0x40000000;
const long SPY_STATUS2_LIN_NO_SLAVE_DATA = 0x80000000; const long SPY_STATUS2_LIN_NO_SLAVE_DATA = 0x80000000;
// MOST Specific - check protocol before handling // MOST Specific - check protocol before handling
const long SPY_STATUS2_MOST_PACKET_DATA = 0x200000; const long SPY_STATUS2_MOST_PACKET_DATA = 0x200000;
const long SPY_STATUS2_MOST_STATUS = 0x400000; //reflects changes in light/lock/MPR/SBC/etc. const long SPY_STATUS2_MOST_STATUS = 0x400000; // Reflects changes in light/lock/MPR/SBC/etc.
const long PY_STATUS2_MOST_LOW_LEVEL = 0x800000; // MOST low level message, allocs, deallocs, remote requests. const long PY_STATUS2_MOST_LOW_LEVEL = 0x800000; // MOST low level message, allocs, deallocs, remote requests.
const long SPY_STATUS2_MOST_CONTROL_DATA = 0x1000000; const long SPY_STATUS2_MOST_CONTROL_DATA = 0x1000000;
const long SPY_STATUS2_MOST_MHP_USER_DATA = 0x2000000; // MOST HIGH User Data Frame const long SPY_STATUS2_MOST_MHP_USER_DATA = 0x2000000; // MOST HIGH User Data Frame
const long SPY_STATUS2_MOST_MHP_CONTROL_DATA = 0x4000000; // MOST HIGH Control Data const long SPY_STATUS2_MOST_MHP_CONTROL_DATA = 0x4000000; // MOST HIGH Control Data
const long SPY_STATUS2_MOST_I2S_DUMP = 0x8000000; const long SPY_STATUS2_MOST_I2S_DUMP = 0x8000000;
const long SPY_STATUS2_MOST_TOO_SHORT = 0x10000000; const long SPY_STATUS2_MOST_TOO_SHORT = 0x10000000;
const long SPY_STATUS2_MOST_MOST50 = 0x20000000; //absence of MOST50 and MOST150 implies it's MOST25 const long SPY_STATUS2_MOST_MOST50 = 0x20000000; // Absence of MOST50 and MOST150 implies it's MOST25
const long SPY_STATUS2_MOST_MOST150 = 0x40000000; const long SPY_STATUS2_MOST_MOST150 = 0x40000000;
const long SPY_STATUS2_MOST_CHANGED_PAR = 0x80000000; //first byte in ack reflects what changed const long SPY_STATUS2_MOST_CHANGED_PAR = 0x80000000; //First byte in ack reflects what changed
// Ethernet Specific - check protocol before handling // Ethernet Specific - check protocol before handling
const long SPY_STATUS2_ETHERNET_CRC_ERROR = 0x200000; const long SPY_STATUS2_ETHERNET_CRC_ERROR = 0x200000;
const long SPY_STATUS2_ETHERNET_FRAME_TOO_SHORT = 0x400000; const long SPY_STATUS2_ETHERNET_FRAME_TOO_SHORT = 0x400000;
@ -277,8 +275,7 @@ const int SPY_PROTOCOL_CANFD = 30;
const int SPY_PROTOCOL_GMFSA = 31; const int SPY_PROTOCOL_GMFSA = 31;
const int SPY_PROTOCOL_TCP = 32; const int SPY_PROTOCOL_TCP = 32;
// These are used in status2 for Vehicle Spy 3
// these are used in status2 for Vehicle Spy 3
const long icsspystatusChangeLength = 0x10; const long icsspystatusChangeLength = 0x10;
const long icsspystatusChangeBitH1 = 0x20; const long icsspystatusChangeBitH1 = 0x20;
const long icsspystatusChangeBitH2 = 0x40; const long icsspystatusChangeBitH2 = 0x40;
@ -318,8 +315,7 @@ const int ISO15765_2_NETWORK_SWCAN2 = 0x24;
#pragma pack(1) #pragma pack(1)
// One byte aligned // One byte aligned
typedef struct ALIGNED_(1) typedef struct ALIGNED_(1) {
{
int iType; // 1,2,3 for Generation of HW int iType; // 1,2,3 for Generation of HW
// Date and Time type 1 and 2 // Date and Time type 1 and 2
@ -349,14 +345,11 @@ typedef struct ALIGNED_(1)
#pragma pack(pop) #pragma pack(pop)
#pragma pack(push) #pragma pack(push)
#pragma pack(2) #pragma pack(2)
//two byte aligned // Two byte aligned
typedef struct ALIGNED_(2) typedef struct ALIGNED_(2) {
{
unsigned char Mode; unsigned char Mode;
unsigned char SetBaudrate; unsigned char SetBaudrate;
unsigned char Baudrate; unsigned char Baudrate;
@ -370,9 +363,8 @@ typedef struct ALIGNED_(2)
unsigned char innerFrameDelay25us; unsigned char innerFrameDelay25us;
} CAN_SETTINGS; } CAN_SETTINGS;
typedef struct ALIGNED_(2) typedef struct ALIGNED_(2) {
{ unsigned char FDMode; // Mode, secondary baudrate for canfd
unsigned char FDMode; /* mode, secondary baudrate for canfd */
unsigned char FDBaudrate; unsigned char FDBaudrate;
unsigned char FDTqSeg1; unsigned char FDTqSeg1;
unsigned char FDTqSeg2; unsigned char FDTqSeg2;
@ -383,8 +375,7 @@ typedef struct ALIGNED_(2)
unsigned char reserved; unsigned char reserved;
} CANFD_SETTINGS; } CANFD_SETTINGS;
typedef struct ALIGNED_(2) typedef struct ALIGNED_(2) {
{
unsigned char Mode; unsigned char Mode;
unsigned char SetBaudrate; unsigned char SetBaudrate;
unsigned char Baudrate; unsigned char Baudrate;
@ -396,11 +387,10 @@ typedef struct ALIGNED_(2)
unsigned short BRP; unsigned short BRP;
unsigned short high_speed_auto_switch; unsigned short high_speed_auto_switch;
unsigned char auto_baud; unsigned char auto_baud;
unsigned char Reserved; //leave as 0 unsigned char Reserved; // Leave as 0
} SWCAN_SETTINGS; } SWCAN_SETTINGS;
typedef struct ALIGNED_(2) typedef struct ALIGNED_(2) {
{
unsigned int Baudrate; unsigned int Baudrate;
unsigned short spbrg; unsigned short spbrg;
unsigned char brgh; unsigned char brgh;
@ -409,25 +399,21 @@ typedef struct ALIGNED_(2)
unsigned char Mode; unsigned char Mode;
} LIN_SETTINGS; } LIN_SETTINGS;
typedef struct ALIGNED_(2) typedef struct ALIGNED_(2) {
{
uint16_t monkey; uint16_t monkey;
unsigned char duplex; /* 0 = half, 1 = full */ unsigned char duplex; // 0 = half, 1 = full
unsigned char link_speed; unsigned char link_speed;
unsigned char auto_neg; unsigned char auto_neg;
unsigned char led_mode; unsigned char led_mode;
unsigned char rsvd[4]; unsigned char rsvd[4];
} ETHERNET_SETTINGS; } ETHERNET_SETTINGS;
typedef struct ALIGNED_(2) typedef struct ALIGNED_(2) {
{
// CAN // CAN
unsigned int can1_tx_id; unsigned int can1_tx_id;
unsigned int can1_rx_id; unsigned int can1_rx_id;
union union {
{ struct {
struct
{
unsigned bExtended : 1; unsigned bExtended : 1;
unsigned : 15; unsigned : 15;
}; };
@ -436,10 +422,8 @@ typedef struct ALIGNED_(2)
unsigned int can2_tx_id; unsigned int can2_tx_id;
unsigned int can2_rx_id; unsigned int can2_rx_id;
union union {
{ struct {
struct
{
unsigned bExtended : 1; unsigned bExtended : 1;
unsigned : 15; unsigned : 15;
}; };
@ -450,10 +434,8 @@ typedef struct ALIGNED_(2)
unsigned int can3_tx_id; unsigned int can3_tx_id;
unsigned int can3_rx_id; unsigned int can3_rx_id;
union union {
{ struct {
struct
{
unsigned bExtended : 1; unsigned bExtended : 1;
unsigned : 15; unsigned : 15;
}; };
@ -462,10 +444,8 @@ typedef struct ALIGNED_(2)
unsigned int can4_tx_id; unsigned int can4_tx_id;
unsigned int can4_rx_id; unsigned int can4_rx_id;
union union {
{ struct {
struct
{
unsigned bExtended : 1; unsigned bExtended : 1;
unsigned : 15; unsigned : 15;
}; };
@ -473,18 +453,15 @@ typedef struct ALIGNED_(2)
} can4_options; } can4_options;
unsigned int reserved[5]; unsigned int reserved[5];
} STextAPISettings; } STextAPISettings;
typedef struct ALIGNED_(2) typedef struct ALIGNED_(2) {
{
unsigned short time_500us; unsigned short time_500us;
unsigned short k; unsigned short k;
unsigned short l; unsigned short l;
} ISO9141_KEYWORD2000__INIT_STEP; } ISO9141_KEYWORD2000__INIT_STEP;
typedef struct ALIGNED_(2) typedef struct ALIGNED_(2) {
{
unsigned int Baudrate; unsigned int Baudrate;
unsigned short spbrg; unsigned short spbrg;
unsigned short brgh; unsigned short brgh;
@ -496,8 +473,7 @@ typedef struct ALIGNED_(2)
unsigned short chksum_enabled; unsigned short chksum_enabled;
} ISO9141_KEYWORD2000_SETTINGS; } ISO9141_KEYWORD2000_SETTINGS;
typedef struct ALIGNED_(2) typedef struct ALIGNED_(2) {
{
uint8_t ucInterfaceType; uint8_t ucInterfaceType;
uint8_t reserved0; uint8_t reserved0;
uint8_t reserved1; uint8_t reserved1;
@ -512,15 +488,13 @@ typedef struct ALIGNED_(2)
uint32_t uFlags; uint32_t uFlags;
}OP_ETH_GENERAL_SETTINGS; }OP_ETH_GENERAL_SETTINGS;
typedef struct ALIGNED_(2) typedef struct ALIGNED_(2) {
{
uint8_t ucConfigMode; uint8_t ucConfigMode;
uint8_t preemption_en; uint8_t preemption_en;
uint8_t reserved0[14]; uint8_t reserved0[14];
}OP_ETH_SETTINGS; }OP_ETH_SETTINGS;
typedef struct ALIGNED_(2) typedef struct ALIGNED_(2) {
{
uint32_t ecu_id; uint32_t ecu_id;
CAN_SETTINGS can1; CAN_SETTINGS can1;
SWCAN_SETTINGS swcan1; SWCAN_SETTINGS swcan1;
@ -534,9 +508,7 @@ typedef struct ALIGNED_(2)
uint16_t can_switch_mode; uint16_t can_switch_mode;
uint16_t rsvd; uint16_t rsvd;
} SVividCANSettings; } SVividCANSettings;
typedef struct ALIGNED_(2) {
typedef struct ALIGNED_(2)
{
CAN_SETTINGS can1; CAN_SETTINGS can1;
CAN_SETTINGS can2; CAN_SETTINGS can2;
CANFD_SETTINGS canfd1; CANFD_SETTINGS canfd1;
@ -557,8 +529,7 @@ typedef struct ALIGNED_(2)
uint16_t ain_sample_period; uint16_t ain_sample_period;
uint16_t ain_threshold; uint16_t ain_threshold;
struct struct {
{
uint32_t : 1; uint32_t : 1;
uint32_t enableLatencyTest : 1; uint32_t enableLatencyTest : 1;
uint32_t reserved : 30; uint32_t reserved : 30;
@ -567,8 +538,7 @@ typedef struct ALIGNED_(2)
STextAPISettings text_api; STextAPISettings text_api;
} SOBD2SimSettings; } SOBD2SimSettings;
typedef struct ALIGNED_(2) typedef struct ALIGNED_(2) {
{
unsigned short perf_en; unsigned short perf_en;
// CAN // CAN
@ -628,7 +598,7 @@ typedef struct ALIGNED_(2)
unsigned short idle_wakeup_network_enables_1; unsigned short idle_wakeup_network_enables_1;
unsigned short idle_wakeup_network_enables_2; unsigned short idle_wakeup_network_enables_2;
//reserved for HSCAN6/7, LSFT2, etc.. // Reserved for HSCAN6/7, LSFT2, etc..
unsigned short network_enables_3; unsigned short network_enables_3;
unsigned short idle_wakeup_network_enables_3; unsigned short idle_wakeup_network_enables_3;
@ -636,9 +606,8 @@ typedef struct ALIGNED_(2)
STextAPISettings text_api; STextAPISettings text_api;
} SRADGalaxySettings; } SRADGalaxySettings;
typedef struct ALIGNED_(2) typedef struct ALIGNED_(2) {
{ // Performance Test
/* Performance Test */
uint16_t perf_en; uint16_t perf_en;
CAN_SETTINGS can1; CAN_SETTINGS can1;
@ -654,21 +623,18 @@ typedef struct ALIGNED_(2)
uint16_t network_enabled_on_boot; uint16_t network_enabled_on_boot;
/* ISO15765-2 Transport Layer */ // ISO15765-2 Transport Layer
int16_t iso15765_separation_time_offset; int16_t iso15765_separation_time_offset;
STextAPISettings text_api; STextAPISettings text_api;
struct struct {
{
uint32_t disableUsbCheckOnBoot : 1; uint32_t disableUsbCheckOnBoot : 1;
uint32_t enableLatencyTest : 1; uint32_t enableLatencyTest : 1;
uint32_t reserved : 30; uint32_t reserved : 30;
} flags; } flags;
} SVCAN412Settings; } SVCAN412Settings;
typedef struct ALIGNED_(2) {
typedef struct ALIGNED_(2)
{
uint16_t perf_en; uint16_t perf_en;
OP_ETH_GENERAL_SETTINGS opEthGen; OP_ETH_GENERAL_SETTINGS opEthGen;
OP_ETH_SETTINGS opEth1; OP_ETH_SETTINGS opEth1;
@ -703,9 +669,7 @@ typedef struct ALIGNED_(2)
STextAPISettings text_api; STextAPISettings text_api;
} SRADStar2Settings; } SRADStar2Settings;
//_stChipVersions typedef struct ALIGNED_(2) {
typedef struct ALIGNED_(2)
{
unsigned char mpic_maj; unsigned char mpic_maj;
unsigned char mpic_min; unsigned char mpic_min;
unsigned char upic_maj; unsigned char upic_maj;
@ -716,8 +680,7 @@ typedef struct ALIGNED_(2)
unsigned char jpic_min; unsigned char jpic_min;
} fire_versions; } fire_versions;
typedef struct ALIGNED_(2) typedef struct ALIGNED_(2) {
{
unsigned char mpic_maj; unsigned char mpic_maj;
unsigned char mpic_min; unsigned char mpic_min;
unsigned char core_maj; unsigned char core_maj;
@ -728,16 +691,14 @@ typedef struct ALIGNED_(2)
unsigned char hid_min; unsigned char hid_min;
} plasma_fire_vnet; } plasma_fire_vnet;
typedef struct ALIGNED_(2) typedef struct ALIGNED_(2) {
{
unsigned char mpic_maj; unsigned char mpic_maj;
unsigned char mpic_min; unsigned char mpic_min;
unsigned int Reserve; unsigned int Reserve;
unsigned short Reserve2; unsigned short Reserve2;
} vcan3_versions; } vcan3_versions;
typedef struct ALIGNED_(2) typedef struct ALIGNED_(2) {
{
CAN_SETTINGS can1; CAN_SETTINGS can1;
CAN_SETTINGS can2; CAN_SETTINGS can2;
CAN_SETTINGS can3; CAN_SETTINGS can3;
@ -786,8 +747,7 @@ typedef struct ALIGNED_(2)
unsigned short reservedZero; unsigned short reservedZero;
} SVCANRFSettings; } SVCANRFSettings;
typedef struct ALIGNED_(2) typedef struct ALIGNED_(2) {
{
unsigned int ecu_id; unsigned int ecu_id;
CAN_SETTINGS can1; CAN_SETTINGS can1;
@ -807,29 +767,24 @@ typedef struct ALIGNED_(2)
unsigned int rsvd; unsigned int rsvd;
} SEEVBSettings; } SEEVBSettings;
// --- J1708 Settings // J1708 Settings
typedef struct ALIGNED_(2) typedef struct ALIGNED_(2) {
{
unsigned short enable_convert_mode; unsigned short enable_convert_mode;
} J1708_SETTINGS; } J1708_SETTINGS;
// UART Settings
// --- UART Settings typedef struct ALIGNED_(2) {
typedef struct ALIGNED_(2)
{
unsigned short Baudrate; unsigned short Baudrate;
unsigned short spbrg; unsigned short spbrg;
unsigned short brgh; unsigned short brgh;
unsigned short parity; unsigned short parity;
unsigned short stop_bits; unsigned short stop_bits;
unsigned char flow_control; // 0- off, 1 - Simple CTS RTS, unsigned char flow_control; // 0 - off, 1 - Simple CTS RTS
unsigned char reserved_1; unsigned char reserved_1;
union union {
{
unsigned int bOptions; unsigned int bOptions;
struct struct {
{
unsigned invert_tx : 1; unsigned invert_tx : 1;
unsigned invert_rx : 1; unsigned invert_rx : 1;
unsigned half_duplex : 1; unsigned half_duplex : 1;
@ -839,27 +794,23 @@ typedef struct ALIGNED_(2)
}; };
} UART_SETTINGS; } UART_SETTINGS;
typedef struct ALIGNED_(2) typedef struct ALIGNED_(2) {
{ unsigned short netId; // NetID of CAN network to use.
unsigned short netId; // Netid of CAN network to use.
unsigned char zero0; unsigned char zero0;
unsigned char Config; unsigned char Config;
// Bit 0: enable bit to enalbe most // Bit 0: enable bit to enalbe most
///Bit 1-3: index of which miscio to use for timestamp sync. 0 => MISC1 // Bit 1-3: index of which miscio to use for timestamp sync. 0 => MISC1
// Bit 4: Echo to CAN enable // Bit 4: Echo to CAN enable
// Bit 5-7: Reserve // Bit 5-7: Reserve
} SNeoMostGatewaySettings; } SNeoMostGatewaySettings;
typedef struct ALIGNED_(2) typedef struct ALIGNED_(2) {
{
CAN_SETTINGS can1; CAN_SETTINGS can1;
CAN_SETTINGS can2; CAN_SETTINGS can2;
CAN_SETTINGS can3; CAN_SETTINGS can3;
CAN_SETTINGS can4; CAN_SETTINGS can4;
SWCAN_SETTINGS swcan; SWCAN_SETTINGS swcan;
CAN_SETTINGS lsftcan; CAN_SETTINGS lsftcan;
LIN_SETTINGS lin1; LIN_SETTINGS lin1;
LIN_SETTINGS lin2; LIN_SETTINGS lin2;
LIN_SETTINGS lin3; LIN_SETTINGS lin3;
@ -870,13 +821,10 @@ typedef struct ALIGNED_(2)
unsigned short cgi_tx_ifs_bit_times; unsigned short cgi_tx_ifs_bit_times;
unsigned short cgi_rx_ifs_bit_times; unsigned short cgi_rx_ifs_bit_times;
unsigned short cgi_chksum_enable; unsigned short cgi_chksum_enable;
unsigned short network_enables; unsigned short network_enables;
unsigned short network_enabled_on_boot; unsigned short network_enabled_on_boot;
unsigned int pwm_man_timeout; unsigned int pwm_man_timeout;
unsigned short pwr_man_enable; unsigned short pwr_man_enable;
unsigned short misc_io_initial_ddr; unsigned short misc_io_initial_ddr;
unsigned short misc_io_initial_latch; unsigned short misc_io_initial_latch;
unsigned short misc_io_analog_enable; unsigned short misc_io_analog_enable;
@ -884,14 +832,11 @@ typedef struct ALIGNED_(2)
unsigned short misc_io_on_report_events; unsigned short misc_io_on_report_events;
unsigned short ain_sample_period; unsigned short ain_sample_period;
unsigned short ain_threshold; unsigned short ain_threshold;
// ISO 15765-2 Transport Layer // ISO 15765-2 Transport Layer
short iso15765_separation_time_offset; short iso15765_separation_time_offset;
// ISO9141 - KEYWORD 2000 // ISO9141 - KEYWORD 2000
short iso9141_kwp_enable_reserved; short iso9141_kwp_enable_reserved;
ISO9141_KEYWORD2000_SETTINGS iso9141_kwp_settings; ISO9141_KEYWORD2000_SETTINGS iso9141_kwp_settings;
// Performance Test // Performance Test
unsigned short perf_en; unsigned short perf_en;
@ -927,8 +872,7 @@ typedef struct ALIGNED_(2)
unsigned short vnetBits; // First bit enables Android Messages unsigned short vnetBits; // First bit enables Android Messages
} SFireSettings; } SFireSettings;
typedef struct ALIGNED_(2) typedef struct ALIGNED_(2) {
{
uint16_t perf_en; uint16_t perf_en;
CAN_SETTINGS can1; CAN_SETTINGS can1;
CANFD_SETTINGS canfd1; CANFD_SETTINGS canfd1;
@ -997,8 +941,7 @@ typedef struct ALIGNED_(2)
uint16_t digitalIoThresholdEnable; uint16_t digitalIoThresholdEnable;
} SFire2Settings; } SFire2Settings;
typedef struct ALIGNED_(2) typedef struct ALIGNED_(2) {
{
CAN_SETTINGS can1; CAN_SETTINGS can1;
CAN_SETTINGS can2; CAN_SETTINGS can2;
unsigned short network_enables; unsigned short network_enables;
@ -1012,9 +955,8 @@ typedef struct ALIGNED_(2)
} SVCAN3Settings; } SVCAN3Settings;
typedef struct ALIGNED_(2) _stCM_ISO157652_TxMessage typedef struct ALIGNED_(2) _stCM_ISO157652_TxMessage {
{ // Transmit message
//transmit message
unsigned short vs_netid; ///< The netid of the message (determines which network to transmit on), not supported unsigned short vs_netid; ///< The netid of the message (determines which network to transmit on), not supported
unsigned char padding; ///< The padding byte to use to fill the unused portion of unsigned char padding; ///< The padding byte to use to fill the unused portion of
@ -1034,18 +976,15 @@ typedef struct ALIGNED_(2) _stCM_ISO157652_TxMessage
//flow control timeouts //flow control timeouts
unsigned short fs_timeout; ///< max timeout (ms) for waiting on flow control respons, not supported. unsigned short fs_timeout; ///< max timeout (ms) for waiting on flow control respons, not supported.
unsigned short fs_wait; ///< max timeout (ms) for waiting on flow control response that does not have unsigned short fs_wait; ///< max timeout (ms) for waiting on flow control response that does not have flow status set to WAIT, not supported.
///flow status set to WAIT, not supported.
unsigned char data[4*1024]; ///< The data unsigned char data[4*1024]; ///< The data
unsigned int num_bytes; ///< Number of data bytes unsigned int num_bytes; ///< Number of data bytes
//option bits //option bits
union union {
{ struct {
struct
{
unsigned id_29_bit_enable:1; ///< Enables 29 bit arbId for transmitted frames. Set to 1 so transmitted frames use 29 bit ids, not supported. unsigned id_29_bit_enable:1; ///< Enables 29 bit arbId for transmitted frames. Set to 1 so transmitted frames use 29 bit ids, not supported.
unsigned fc_id_29_bit_enable:1; ///< Enables 29 bit arbId for Flow Control filter. Set to 1 if receiver response uses 29 bit ids, not supported. unsigned fc_id_29_bit_enable:1; ///< Enables 29 bit arbId for Flow Control filter. Set to 1 if receiver response uses 29 bit ids, not supported.
unsigned ext_address_enable:1; ///< Enables Extended Addressing, Set to 1 if transmitted frames should have extended addres byte, not supported. unsigned ext_address_enable:1; ///< Enables Extended Addressing, Set to 1 if transmitted frames should have extended addres byte, not supported.
@ -1061,7 +1000,6 @@ typedef struct ALIGNED_(2) _stCM_ISO157652_TxMessage
unsigned int flags; unsigned int flags;
}; };
} stCM_ISO157652_TxMessage; } stCM_ISO157652_TxMessage;
@ -1069,13 +1007,11 @@ typedef struct ALIGNED_(2) _stCM_ISO157652_TxMessage
#pragma warning(push) #pragma warning(push)
#pragma warning(disable : 4324) // nameless struct/union #pragma warning(disable : 4324) // nameless struct/union
#endif #endif
typedef struct ALIGNED_(2) typedef struct ALIGNED_(2) {
{
//transmit message //transmit message
unsigned short vs_netid; ///< The netid of the message (determines which network to decode receives), not supported unsigned short vs_netid; ///< The netid of the message (determines which network to decode receives), not supported
unsigned char padding; ///< The padding byte to use to fill the unused portion of unsigned char padding; ///< The padding byte to use to fill the unused portion of transmitted CAN frames (flow control), see paddingEnable.
/// transmitted CAN frames (flow control), see paddingEnable.
unsigned int id; ///< ArbId filter value for frames from transmitter (from ECU to neoVI). unsigned int id; ///< ArbId filter value for frames from transmitter (from ECU to neoVI).
unsigned int id_mask; ///< ArbId filter mask for frames from transmitter (from ECU to neoVI). unsigned int id_mask; ///< ArbId filter mask for frames from transmitter (from ECU to neoVI).
@ -1091,10 +1027,8 @@ typedef struct ALIGNED_(2)
unsigned short cf_timeout; ///< max timeout (ms) for waiting on consecutive frame. Set this to N_CR_MAX's value in J2534. unsigned short cf_timeout; ///< max timeout (ms) for waiting on consecutive frame. Set this to N_CR_MAX's value in J2534.
//option bits //option bits
union union {
{ struct {
struct
{
unsigned id_29_bit_enable:1; ///< Enables 29 bit arbId filter for frames (from ECU to neoVI). unsigned id_29_bit_enable:1; ///< Enables 29 bit arbId filter for frames (from ECU to neoVI).
unsigned fc_id_29_bit_enable:1; ///< Enables 29 bit arbId for Flow Control (from neoVI to ECU). unsigned fc_id_29_bit_enable:1; ///< Enables 29 bit arbId for Flow Control (from neoVI to ECU).
unsigned ext_address_enable:1; ///< Enables Extended Addressing (from ECU to neoVI). unsigned ext_address_enable:1; ///< Enables Extended Addressing (from ECU to neoVI).
@ -1108,19 +1042,14 @@ typedef struct ALIGNED_(2)
}; };
unsigned char reserved[16]; unsigned char reserved[16];
} stCM_ISO157652_RxMessage; } stCM_ISO157652_RxMessage;
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning(pop) #pragma warning(pop)
#endif #endif
#pragma pack(pop) #pragma pack(pop)
typedef struct typedef struct{
{
int DeviceType; int DeviceType;
int Handle; int Handle;
int NumberOfClients; int NumberOfClients;
@ -1128,9 +1057,7 @@ typedef struct
int MaxAllowedClients; int MaxAllowedClients;
} NeoDevice; } NeoDevice;
typedef struct { // Matching C structure
typedef struct // matching C structure
{
unsigned long StatusValue; // 4 unsigned long StatusValue; // 4
unsigned long StatusMask; // 4 unsigned long StatusMask; // 4
unsigned long Status2Value; // 4 unsigned long Status2Value; // 4
@ -1153,8 +1080,7 @@ typedef struct // matching C structure
unsigned long NodeID; unsigned long NodeID;
} spyFilterLong; } spyFilterLong;
typedef struct // matching C structure typedef struct { // Matching C structure
{
unsigned long StatusBitField; // 4 unsigned long StatusBitField; // 4
unsigned long StatusBitField2; // 4 unsigned long StatusBitField2; // 4
unsigned long TimeHardware; // 4 unsigned long TimeHardware; // 4
@ -1179,8 +1105,7 @@ typedef struct // matching C structure
unsigned char MiscData; unsigned char MiscData;
} icsSpyMessage; } icsSpyMessage;
typedef struct // matching C structure typedef struct { // Matching C structure
{
unsigned long StatusBitField; // 4 unsigned long StatusBitField; // 4
unsigned long StatusBitField2; // 4 unsigned long StatusBitField2; // 4
unsigned long TimeHardware; // 4 unsigned long TimeHardware; // 4