Structure Definitions (Common)
This page describes the common structure definitions for this product.
Main APIs
Definition List
| Type Name | Description |
|---|---|
| StMPXAPIVersion | API version information |
| StMPXDeviceInfo | MicroPeckerX device information |
| StMPXLog | Log information for the log acquisition API |
Definition Details
StMPXAPIVersion
Members of the StMPXAPIVersion structure (API version information) are as follows.
| Variable | Type | Description |
|---|---|---|
| APIVersion | int8_t [32] | API version number |
StMPXDeviceInfo
Members of the StMPXDeviceInfo structure (MicroPeckerX device information) are as follows.
| Variable | Type | Description | Notes |
|---|---|---|---|
| Serial | uint32_t | Serial number | Same as the serial No. label attached to MicroPeckerX. |
| Model | int8_t [64] | Product model name (example: S810-MX-FD2) |
StMPXLog
Members of the StMPXLog structure (log information for the log acquisition API) are as follows.
| Variable | Type | Description | Notes |
|---|---|---|---|
| mSec | uint32_t | Timestamp (milliseconds) | The timestamp is represented by combining the values of mSec and uSec.For example, for 12.345 ms (12 ms and 345 us), mSec is 12 and uSec is 345. |
| uSec | uint16_t | Timestamp (microseconds) | |
| Protocol | uint8_t | Protocol | For the meaning of each value, see Log Type. |
| Dir | uint8_t | Direction | For the meaning of each value, see Log Direction. |
| Misc | union | Miscellaneous information | A union that collects information that differs between CAN communication and LIN communication (for details, see Misc in StMPXLog). |
| Data | uint8_t [64] | Data | Element numbers (0 to 63) correspond to data D1 to D64 respectively. For LIN communication, the element number equal to DL is the checksum. |
Supplementary Information
Misc in StMPXLog
Misc in the StMPXLog structure is a union whose active branch changes according to the protocol (CAN/LIN).
As shown below, determine the protocol from the value of Protocol, and read the active branch according to the result (a union shares the same memory, so multiple branches cannot be read at the same time).
| Judgment Condition (Protocol) | Active Member |
|---|---|
| Any of the following 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 the StMPXLog structure is a structure with the following members.
| Variable | Type | Description | Notes |
|---|---|---|---|
| ID | uint32_t | CAN ID (standard ID or extended ID) | For standard ID, the lower 11 bits (bit 10 to bit 0) are set. |
| RTR | uint8_t | Remote transmission request (RTR) | For the meaning of each value, see CAN Remote Transmission Request. |
| IDE | uint8_t | ID format (IDE) | For the meaning of each value, see CAN ID Format. |
| DL | uint8_t | Data length (DL) | |
| Error | uint8_t | Error flag | For the meaning of each value, see CAN Error Flag. |
| ErrorInfo | uint32_t | Error information | For the meaning of each value, see CAN Error Information. |
Misc.LIN in StMPXLog
Misc.LIN in the StMPXLog structure is a structure with the following members.
| Variable | Type | Description | Notes |
|---|---|---|---|
| ID | uint8_t | LIN ID | |
| SBLen | uint8_t | SyncBreak width | |
| WakeupWidth | uint16_t | Wakeup pulse width | |
| Type | uint8_t | LIN log type | For the meaning of each value, see LIN Log Type. |
| DL | uint8_t | Data length (DL) | |
| Reserved1 | uint8_t [2] | Reserved area 1 | |
| ErrorCode | uint8_t | Error code | For the meaning of each value, see LIN Error Code. |
| Reserved2 | uint8_t [3] | Reserved area 2 |