IXXAT - J1939 API V1.1 Documentation
|
Types, defines and structures for the J1939 API (C, C++)
Specifies certain defines and structures related to the J1939 API interface, as well as macros for interpreting relevant structures and types.
Types and Macros
J1939API_MAX_PARAM_COUNT
Specifies the maximum number of allowable parameters per PGN
#define J1939API_MAX_PARAM_COUNT 256
J1939API_MAX_PGN
Specifies the highest possible PGN
#define J1939API_MAX_PGN 0x1FFFF
J1939API_PGN_ALL
Specifies that all PGNs should be registered with the stack (open filter)
#define J1939API_PGN_ALL 0xFFFFFFFF
J1939API_PARAM_MAX_NAMELEN
Specifies the maximum string length for a parameter name
#define J1939API_PARAM_MAX_NAMELEN 60
J1939API_PARAM_MAX_UNITLEN
Specifies the maximum string length for a parameter unit
#define J1939API_PARAM_MAX_UNITLEN 30
J1939API_MAX_BOARDS
Maximum number of boards returned by the GetBoardList() function
#define J1939API_MAX_BOARDS 16
J1939API_BOARD_NAME_LEN
Maximum length of the J1939API_BOARDINFO name string
#define J1939API_BOARD_NAME_LEN 40
J1939API_BOARD_SN_LEN
Length of the J1939API_BOARDINFO serial number string
#define J1939API_BOARD_SN_LEN 8
J1939API_MSG_TYPEMASK
Specifies the bitmask for getting and setting the message type in the type byte of the J1939API_MSG
#define J1939API_MSG_TYPEMASK 0x07
J1939API_MSGTYPE_DATA
Specifies a J1939API_MSG of type: data (see also J1939API_MSG_GETTYPE(), J1939API_MSG_SETTYPE())
#define J1939API_MSGTYPE_DATA 0
J1939API_MSGTYPE_RAW
Specifies a J1939API_MSG of type: raw data (see also J1939API_MSG_GETTYPE(), J1939API_MSG_SETTYPE())
#define J1939API_MSGTYPE_RAW 1
J1939API_MSGTYPE_REQ
Specifies a J1939API_MSG of type: request (see also J1939API_MSG_GETTYPE(), J1939API_MSG_SETTYPE())
#define J1939API_MSGTYPE_REQ 2
J1939API_MSGTYPE_ERR
Specifies a J1939API_MSG of type: error (see also J1939API_MSG_GETTYPE(), J1939API_MSG_SETTYPE())
#define J1939API_MSGTYPE_ERR 3
J1939API_MSG_GLOBALBIT
Specifies the bit for specifying a globally transmitted message in the type byte of the J1939API_MSG
#define J1939API_MSG_GLOBALBIT 0x08
J1939API_MSG_GETTYPE()
Macro getting the message type bits of the type byte of a J1939API_MSG (see also J1939API_MSG_TYPEMASK, J1939API_MSGTYPE_DATA,
#define J1939API_MSG_GETTYPE(type_byte) \ ((type_byte) & J1939API_MSG_TYPEMASK)
J1939API_MSG_SETTYPE()
Macro setting the message type bits of the type byte of a J1939API_MSG (see also J1939API_MSG_TYPEMASK, J1939API_MSGTYPE_DATA,
#define J1939API_MSG_SETTYPE(type_byte, msg_type) \ { \ (type_byte) &= ~J1939API_MSG_TYPEMASK; \ (type_byte) |= (J1939API_MSG_TYPEMASK & (msg_type)); \ }
J1939API_MSG_CLEARTYPE()
Macro clearing the message type bits of the type byte of a J1939API_MSG (see also J1939API_MSG_TYPEMASK)
#define J1939API_MSG_CLEARTYPE(type_byte) \ J1939API_MSG_SETTYPE((type_byte), 0)
J1939API_MSG_ISGLOBAL()
Macro returning true if the global flag is set in the message type byte of a J1939API_MSG (see also J1939API_MSG_GLOBALBIT)
#define J1939API_MSG_ISGLOBAL(type_byte) \ (0 != ((type_byte) & J1939API_MSG_GLOBALBIT))
J1939API_MSG_DATABYTE()
Macro exposing the 32-bit parameter list of a J1939API_MSG as a byte array for usage with raw messages
#define J1939API_MSG_DATABYTE(param_list, byte_index) \ ((UINT8*)param_list)[byte_index]
J1939API_PARAMTYPE_INVALID
The returned subject parameter is invalid (see J1939API_PARAMATTR)
#define J1939API_PARAMTYPE_INVALID 0
J1939API_PARAMTYPE_INTEGER
The returned subject parameter describes an integer (see J1939API_PARAMATTR)
#define J1939API_PARAMTYPE_INTEGER 1
J1939API_PARAMTYPE_FLOAT
The returned subject parameter describes a double (see J1939API_PARAMATTR)
#define J1939API_PARAMTYPE_FLOAT 2
J1939API_PARAMTYPE_ASCII
The returned subject parameter describes an ASCII string (see J1939API_PARAMATTR)
#define J1939API_PARAMTYPE_ASCII 3
J1939API_PARAMTYPE_BITFIELD
The returned subject parameter describes a bit-field (see J1939API_PARAMATTR)
#define J1939API_PARAMTYPE_BITFIELD 4
J1939API_PARAMTYPE_BINARY
The returned subject parameter describes a binary object (see J1939API_PARAMATTR)
#define J1939API_PARAMTYPE_BINARY 5
J1939API_PARAMTYPE_BINARY
The returned subject parameter describes a binary large object (see J1939API_PARAMATTR)
#define J1939API_PARAMTYPE_BLOB 6
J1939API_MSG
The structure containing all the necessary J1939 message parameters for the API is as follows (see also J1939API_MAX_PARAM_COUNT):
typedef struct { UINT32 dwPgn; /* Parameter group number of the message */ UINT8 bPriority; /* J1939 message priority */ UINT16 wRemoteDevice; /* Dst/src address/handle of the message */ UINT8 bMsgType; /* Type byte of the message */ UINT16 wParamCount; /* Parameter count */ UINT32 adwParameters[J1939API_MAX_PARAM_COUNT]; /* Parameters */ } J1939API_MSG, *PJ1939API_MSG;
J1939API_PARAMATTR
The structure containing the relevant J1939 SP attributes is as follows (see also J1939API_PARAM_MAX_NAMELEN, J1939API_PARAM_MAX_UNITLEN,
J1939API_PARAMTYPE_INVALID , J1939API_PARAMTYPE_INTEGER, J1939API_PARAMTYPE_FLOAT , J1939API_PARAMTYPE_ASCII, J1939API_PARAMTYPE_BITFIELD, J1939API_PARAMTYPE_BINARY, (J1939API_PARAMTYPE_BITFIELD} ):
typedef struct { char acName[J1939API_PARAM_MAX_NAMELEN]; /* Parameter name string */ double dbResolution; /* Value resolution */ double dbOffset; /* Value offset */ double dbValue_Min; /* Minimum value */ double dbValue_Max; /* Maximum value */ char bType; /* Parameter Type */ char acUnit[J1939API_PARAM_MAX_UNITLEN]; /* Parameter unit string */ } J1939API_PARAMATTR, *PJ1939API_PARAMATTR;
J1939API_BOARDINFO
The structure containing the name and serial number of an available IXXAT VCI3 device is as follows: (see also J1939API_BOARD_NAME_LEN, J1939API_BOARD_SN_LEN)
typedef struct { char acName[J1939API_BOARD_NAME_LEN]; /* Board description string */ char acSerial[J1939API_BOARD_SN_LEN]; /* Board serial number */ } J1939API_BOARDINFO, *PJ1939API_BOARDINFO;
J1939API_NAME
The structure containing the inputs for the standard J1939 NAME message is as follows:
typedef struct { UINT8 fArbitraryAddressCapable; /* 1 bit */ UINT8 bIndustryGroup; /* 3 bit */ UINT8 bVehicleSystemInstance; /* 4 bit */ UINT8 bVehicleSystem; /* 7 bit */ UINT8 bFunction; /* 8 bit */ UINT8 bFunctionInstance; /* 5 bit */ UINT8 bECUInstance; /* 3 bit */ UINT16 wManufacturerCode; /* 11 bit */ UINT32 dwIdentityNumber; /* 21 bit */ } J1939API_NAME, *PJ1939API_NAME;
Document generated by c2doc 3.26.00 Copyright © 2005-2013 by IXXAT Automation GmbH All rights reserved.