Skip to main content
Version: 4.00

Migration Guide from Ver.3.00

This page summarizes implementation differences when migrating S810-MX-ADL2N from Ver.3.00 to Ver.4.00, with a focus on updating existing code.

Migration Overview​

The following two points affect implementation when migrating from Ver.3.00 to Ver.4.00.

  1. Update type notation for API arguments and structure members used in C/C++ to fixed-width integer types.
  2. If logs are acquired in callback function mode, change to API mode.

Type Notation Changes​

When implementing in C/C++ using MPXCtrlFree.h, the type notation for Ver.4.00 API arguments and structure members has changed to the following fixed-width integer types.

Ver.3.00 notationVer.4.00 notation
charint8_t
unsigned charuint8_t
unsigned shortuint16_t
unsigned longuint32_t

When MPXCtrlFree.h is included, use the definitions provided by the header file. If API declarations or structure definitions are written independently without using the header file, update them to use the same type notation as MPXCtrlFree.h.

Do not mix old and new type notation in API declarations or structure members, including pointer types.

API Specification Differences (Old -> New)​

Info

Fixed-width integer type notation changes for API arguments are described in Type Notation Changes and are omitted as specification differences in this section.

Common APIs​

Changes to fixed-width integer type notation for argument types are omitted.

Ver.3.00Ver.4.00Compatibility impact
MPXGetAPIVersion(StMPXAPIVersion*)SameNo change
MPXOpen(...)SameNo change
MPXClose()SameNo change
MPXSetLED(...)SameNo change
MPXGetStatus(...)SameNo change
MPXMonitorStart(...)SameNo change
MPXMonitorStop(...)SameNo change
MPXGetTimeStamp(...)SameNo change
MPXSetLogCallBack(...)DiscontinuedChange to log API mode
MPXSetGetLogMode(...)SameNo change when using log API mode; change to log API mode when using callback mode
Optional
MPXGetLog(...)SameNo change
tip

Ver.4.00 discontinues callback function mode for log acquisition. If callback function mode is in use, it must be replaced with API mode. As a result, log acquisition mode is fixed to API mode, so calling MPXSetGetLogMode is optional.

CAN/CAN FD APIs​

There are no changes.

LIN APIs​

There are no changes.

Constants and Structures Migration Points​

Log Acquisition Flow and Log Structure Changes​

Ver.4.00 discontinues callback function mode for log acquisition. If callback function mode is in use, it must be replaced with API mode. As a result, log acquisition mode is fixed to API mode, so calling MPXSetGetLogMode is optional.

Return Code (ER) Differences​

ER codes are the same in Ver.3.00 and Ver.4.00.

ConstantValue
E_OK0
E_PARAM1
E_DEVICE2
E_COMM3
E_TGT4
E_TRG_BUSY11
E_DCT_FULL12
E_STATUS105
E_TIMEOUT202
E_OTHER255

Implementation Procedure (Existing Application Replacement Flow)​

  1. In C/C++, change the type notation of variables assigned to API arguments and structure members to fixed-width integer types.
  2. Change the log acquisition mode from callback function mode to API mode.

Language-Specific Replacement Examples​

C/C++ Replacement Example​

// Ver.3.00
StMPXDeviceInfo devs[8] = {};
unsigned char count = 0;
ER er = MPXOpen(devs, 8, &count);
unsigned long serial = (count > 0) ? devs[0].Serial : 0;
er = MPXCANSetParam(serial, innerCh, &param);
er = MPXCANGetLogEx(serial, innerCh, logs, num, &got, &over);

// ADL2N
StMPXDeviceInfo devs[8] = {};
uint8_t count = 0;
ER er = MPXOpen(devs, 8, &count);
uint32_t serial = (count > 0) ? devs[0].Serial : 0;
er = MPXCANSetParam(serial, innerCh, &param);
er = MPXCANGetLogEx(serial, innerCh, logs, num, &got, &over);

Migration Checklist​

  • Type notation in C/C++ API declarations, structure definitions, and related variables updated to fixed-width integer types
  • Log acquisition mode changed from callback function mode to API mode