Skip to main content

Structure Definitions (Common)

This section describes common structure definitions of this product.

Main APIs

Definition List

Type NameDescription
StMPXAPIVersionAPI version information
StMPXDeviceInfoDevice information of MicroPeckerX
StMPXLogCBLog information for callback mode
StMPXLogLog information for log acquisition API mode

Definition Details

StMPXAPIVersion

Members of StMPXAPIVersion (API version information) are as follows.

VariableTypeDescription
APIVersionchar [32]API version number

StMPXDeviceInfo

Members of StMPXDeviceInfo (MicroPeckerX device information) are as follows.

VariableTypeDescriptionNotes
Serialunsigned longSerial numberSame as the serial number printed on the serial label attached to MicroPeckerX.
Modelchar [64]Product model name (for example, S810-MX-FD2) 

StMPXLogCB

Members of StMPXLogCB (log information for callback mode) are as follows.

VariableTypeDescriptionNotes
mSecunsigned longTimestamp (milliseconds)Timestamp is represented by combining mSec and uSec.
For example, for 12.345ms (12ms + 345us), mSec=12 and uSec=345.
uSecunsigned shortTimestamp (microseconds)
LogTypeunsigned charLog typeBit-field structure (see LogType in StMPXLogCB).
DLunionData lengthUnion containing protocol-dependent fields (CAN/LIN) (see DL in StMPXLogCB).
MiscunionMiscellaneous informationUnion containing protocol/error-dependent fields (CAN/LIN) (see Misc in StMPXLogCB).
Dataunsigned char [64]DataElement indices 0 to 63 correspond to D1 to D64.
In LIN, the same index as DL is checksum.

StMPXLog

Members of StMPXLog (log information for log acquisition API mode) are as follows.

VariableTypeDescriptionNotes
mSecunsigned longTimestamp (milliseconds)Timestamp is represented by combining mSec and uSec.
For example, for 12.345ms (12ms + 345us), mSec=12 and uSec=345.
uSecunsigned shortTimestamp (microseconds)
Protocolunsigned charProtocolSee Log Type for value meanings.
Dirunsigned charDirectionSee Log Direction for value meanings.
MiscunionMiscellaneous informationUnion containing different fields for CAN and LIN (see Misc in StMPXLog).
Dataunsigned char [64]DataElement indices 0 to 63 correspond to D1 to D64.
In LIN, the same index as DL is checksum.

Supplementary Information

LogType in StMPXLogCB

LogType in StMPXLogCB is a bit-field structure of unsigned char.
Members are as follows.

VariableBitsDescriptionNotes
Type6Log typeSee Log Type.
Dir1DirectionSee Log Direction.
Error1Error flagSee CAN Error Flag.

DL in StMPXLogCB

DL in StMPXLogCB is a union whose active branch changes depending on protocol (CAN/LIN).
Determine protocol from LogType.Type and read only the active branch below (union shares memory, so do not read multiple branches simultaneously).

Condition (LogType.Type)Active Member (DL)
Any of: MPX_LOG_TYPE_CAN, MPX_LOG_TYPE_CANFD, MPX_LOG_TYPE_CANFD_NOBRSDL.CAN
MPX_LOG_TYPE_LINDL.LIN

DL.CAN in StMPXLogCB

DL.CAN in StMPXLogCB is a bit-field structure of unsigned char.
Members are as follows.

VariableBitsDescriptionNotes
NotUsed4Not used
DLC4Data length code (DLC)For DLC-to-DL mapping, see Data Length Code and Data Length.

DL.LIN in StMPXLogCB

DL.LIN in StMPXLogCB has the following member.

VariableTypeDescription
DLunsigned charData length

Misc in StMPXLogCB

Misc in StMPXLogCB is a union whose active branch changes depending on protocol (CAN/LIN) and error presence.
Determine protocol from LogType.Type and error presence from LogType.Error, then read only the active branch below.

ConditionActive Member
LogType.TypeLogType.Error
Any of: MPX_LOG_TYPE_CAN, MPX_LOG_TYPE_CANFD, MPX_LOG_TYPE_CANFD_NOBRSMPX_CAN_ERRFLG_FALSEMisc.CAN.ID
MPX_CAN_ERRFLG_TRUEMisc.CAN.ErrorInfo
MPX_LOG_TYPE_LIN-Misc.LIN

Misc.CAN.ID in StMPXLogCB

Misc.CAN.ID in StMPXLogCB is a bit-field structure of unsigned long.
Members are as follows.

VariableBitsDescriptionNotes
ID29CAN ID (standard or extended)For standard ID, value is set in lower 11 bits (bit10 to bit0).
Reserved1Reserved
RTR1Remote Transmission Request (RTR)See CAN RTR.
IDE1ID format (IDE)See CAN ID Format.

Misc.CAN.ErrorInfo in StMPXLogCB

Misc.CAN.ErrorInfo in StMPXLogCB is an unsigned long value representing error flags.
See CAN Error Information for value meanings.

Misc.LIN in StMPXLogCB

Misc.LIN in StMPXLogCB has the following members.

VariableTypeDescriptionNotes
Typeunsigned charLIN log typeSee LIN Log Type.
SBLenunsigned charSyncBreak width 
FieldunionField informationUnion containing different fields by LIN Log Type (see Misc.LIN.Field in StMPXLogCB).

Misc.LIN.Field in StMPXLogCB

Misc.LIN.Field in StMPXLogCB is a union whose active branch changes by LIN log type.
Determine LIN log type from Misc.LIN.Type and read only the active branch below.

Condition (Misc.LIN.Type)Active Member
Other than MPX_LIN_LOG_TYPE_WAKEUPMisc.LIN.Field.ID
MPX_LIN_LOG_TYPE_WAKEUPMisc.LIN.Field.WakeupWidth

Misc.LIN.Field.ID in StMPXLogCB

Misc.LIN.Field.ID in StMPXLogCB has the following members.

VariableTypeDescriptionNotes
IDunsigned charLIN ID 
ErrorCodeunsigned charError codeSee LIN Error Code.

Misc.LIN.Field.WakeupWidth in StMPXLogCB

Misc.LIN.Field.WakeupWidth in StMPXLogCB is an unsigned short value representing wakeup pulse width (microseconds).

Misc in StMPXLog

Misc in StMPXLog is a union whose active branch changes by protocol (CAN/LIN).
Determine protocol from Protocol and read only the active branch below.

Condition (Protocol)Active Member
Any of: MPX_LOG_TYPE_CAN, MPX_LOG_TYPE_CANFD, MPX_LOG_TYPE_CANFD_NOBRSMisc.CAN
MPX_LOG_TYPE_LINMisc.LIN

Misc.CAN in StMPXLog

Misc.CAN in StMPXLog has the following members.

VariableTypeDescriptionNotes
IDunsigned longCAN ID (standard or extended)For standard ID, value is set in lower 11 bits (bit10 to bit0).
RTRunsigned charRemote Transmission Request (RTR)See CAN RTR.
IDEunsigned charID format (IDE)See CAN ID Format.
DLunsigned charData length (DL) 
Errorunsigned charError flagSee CAN Error Flag.
ErrorInfounsigned longError informationSee CAN Error Information.

Misc.LIN in StMPXLog

Misc.LIN in StMPXLog has the following members.

VariableTypeDescriptionNotes
IDunsigned charLIN ID 
SBLenunsigned charSyncBreak width 
WakeupWidthunsigned shortWakeup pulse width 
Typeunsigned charLIN log typeSee LIN Log Type.
DLunsigned charData length (DL) 
Reserved1unsigned char [2]Reserved 1 
ErrorCodeunsigned charError codeSee LIN Error Code.
Reserved2unsigned char [3]Reserved 2