Structure Definitions (Common)
This section describes common structure definitions of this product.
Main APIs
- StMPXAPIVersion: MPXGetAPIVersion
- StMPXDeviceInfo: MPXOpen
- StMPXLogCB: MPXSetLogCallBack
- StMPXLog: MPXGetLog
Definition List
| Type Name | Description |
|---|---|
| StMPXAPIVersion | API version information |
| StMPXDeviceInfo | Device information of MicroPeckerX |
| StMPXLogCB | Log information for callback mode |
| StMPXLog | Log information for log acquisition API mode |
Definition Details
StMPXAPIVersion
Members of StMPXAPIVersion (API version information) are as follows.
| Variable | Type | Description |
|---|---|---|
| APIVersion | char [32] | API version number |
StMPXDeviceInfo
Members of StMPXDeviceInfo (MicroPeckerX device information) are as follows.
| Variable | Type | Description | Notes |
|---|---|---|---|
| Serial | unsigned long | Serial number | Same as the serial number printed on the serial label attached to MicroPeckerX. |
| Model | char [64] | Product model name (for example, S810-MX-FD2) |
StMPXLogCB
Members of StMPXLogCB (log information for callback mode) are as follows.
| Variable | Type | Description | Notes |
|---|---|---|---|
| mSec | unsigned long | Timestamp (milliseconds) | Timestamp is represented by combining mSec and uSec.For example, for 12.345ms (12ms + 345us), mSec=12 and uSec=345. |
| uSec | unsigned short | Timestamp (microseconds) | |
| LogType | unsigned char | Log type | Bit-field structure (see LogType in StMPXLogCB). |
| DL | union | Data length | Union containing protocol-dependent fields (CAN/LIN) (see DL in StMPXLogCB). |
| Misc | union | Miscellaneous information | Union containing protocol/error-dependent fields (CAN/LIN) (see Misc in StMPXLogCB). |
| Data | unsigned char [64] | Data | Element 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.
| Variable | Type | Description | Notes |
|---|---|---|---|
| mSec | unsigned long | Timestamp (milliseconds) | Timestamp is represented by combining mSec and uSec.For example, for 12.345ms (12ms + 345us), mSec=12 and uSec=345. |
| uSec | unsigned short | Timestamp (microseconds) | |
| Protocol | unsigned char | Protocol | See Log Type for value meanings. |
| Dir | unsigned char | Direction | See Log Direction for value meanings. |
| Misc | union | Miscellaneous information | Union containing different fields for CAN and LIN (see Misc in StMPXLog). |
| Data | unsigned char [64] | Data | Element 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.
| Variable | Bits | Description | Notes |
|---|---|---|---|
| Type | 6 | Log type | See Log Type. |
| Dir | 1 | Direction | See Log Direction. |
| Error | 1 | Error flag | See 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_NOBRS | DL.CAN |
MPX_LOG_TYPE_LIN | DL.LIN |
DL.CAN in StMPXLogCB
DL.CAN in StMPXLogCB is a bit-field structure of unsigned char.
Members are as follows.
| Variable | Bits | Description | Notes |
|---|---|---|---|
| NotUsed | 4 | Not used | |
| DLC | 4 | Data 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.
| Variable | Type | Description |
|---|---|---|
| DL | unsigned char | Data 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.
| Condition | Active Member | |
|---|---|---|
LogType.Type | LogType.Error | |
Any of: MPX_LOG_TYPE_CAN, MPX_LOG_TYPE_CANFD, MPX_LOG_TYPE_CANFD_NOBRS | MPX_CAN_ERRFLG_FALSE | Misc.CAN.ID |
MPX_CAN_ERRFLG_TRUE | Misc.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.
| Variable | Bits | Description | Notes |
|---|---|---|---|
| ID | 29 | CAN ID (standard or extended) | For standard ID, value is set in lower 11 bits (bit10 to bit0). |
| Reserved | 1 | Reserved | |
| RTR | 1 | Remote Transmission Request (RTR) | See CAN RTR. |
| IDE | 1 | ID 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.
| Variable | Type | Description | Notes |
|---|---|---|---|
| Type | unsigned char | LIN log type | See LIN Log Type. |
| SBLen | unsigned char | SyncBreak width | |
| Field | union | Field information | Union 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_WAKEUP | Misc.LIN.Field.ID |
MPX_LIN_LOG_TYPE_WAKEUP | Misc.LIN.Field.WakeupWidth |
Misc.LIN.Field.ID in StMPXLogCB
Misc.LIN.Field.ID in StMPXLogCB has the following members.
| Variable | Type | Description | Notes |
|---|---|---|---|
| ID | unsigned char | LIN ID | |
| ErrorCode | unsigned char | Error code | See 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_NOBRS | Misc.CAN |
MPX_LOG_TYPE_LIN | Misc.LIN |
Misc.CAN in StMPXLog
Misc.CAN in StMPXLog has the following members.
| Variable | Type | Description | Notes |
|---|---|---|---|
| ID | unsigned long | CAN ID (standard or extended) | For standard ID, value is set in lower 11 bits (bit10 to bit0). |
| RTR | unsigned char | Remote Transmission Request (RTR) | See CAN RTR. |
| IDE | unsigned char | ID format (IDE) | See CAN ID Format. |
| DL | unsigned char | Data length (DL) | |
| Error | unsigned char | Error flag | See CAN Error Flag. |
| ErrorInfo | unsigned long | Error information | See CAN Error Information. |
Misc.LIN in StMPXLog
Misc.LIN in StMPXLog has the following members.
| Variable | Type | Description | Notes |
|---|---|---|---|
| ID | unsigned char | LIN ID | |
| SBLen | unsigned char | SyncBreak width | |
| WakeupWidth | unsigned short | Wakeup pulse width | |
| Type | unsigned char | LIN log type | See LIN Log Type. |
| DL | unsigned char | Data length (DL) | |
| Reserved1 | unsigned char [2] | Reserved 1 | |
| ErrorCode | unsigned char | Error code | See LIN Error Code. |
| Reserved2 | unsigned char [3] | Reserved 2 |