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.
Related Links
- Troubleshooting during migration: Common Issues and Solutions
- Migration from other products: Migration from ADL1N, Migration from SDK2N, Migration from SDK3N
Migration Overview
The following two points affect implementation when migrating from Ver.3.00 to Ver.4.00.
- Update type notation for API arguments and structure members used in C/C++ to fixed-width integer types.
- 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 notation | Ver.4.00 notation |
|---|---|
char | int8_t |
unsigned char | uint8_t |
unsigned short | uint16_t |
unsigned long | uint32_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)
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.00 | Ver.4.00 | Compatibility impact |
|---|---|---|
MPXGetAPIVersion(StMPXAPIVersion*) | Same | No change |
MPXOpen(...) | Same | No change |
MPXClose() | Same | No change |
MPXSetLED(...) | Same | No change |
MPXGetStatus(...) | Same | No change |
MPXMonitorStart(...) | Same | No change |
MPXMonitorStop(...) | Same | No change |
MPXGetTimeStamp(...) | Same | No change |
MPXSetLogCallBack(...) | Discontinued | Change to log API mode |
MPXSetGetLogMode(...) | Same | No change when using log API mode; change to log API mode when using callback mode Optional |
MPXGetLog(...) | Same | No change |
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.
| Constant | Value |
|---|---|
E_OK | 0 |
E_PARAM | 1 |
E_DEVICE | 2 |
E_COMM | 3 |
E_TGT | 4 |
E_TRG_BUSY | 11 |
E_DCT_FULL | 12 |
E_STATUS | 105 |
E_TIMEOUT | 202 |
E_OTHER | 255 |
Implementation Procedure (Existing Application Replacement Flow)
- In C/C++, change the type notation of variables assigned to API arguments and structure members to fixed-width integer types.
- 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, ¶m);
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, ¶m);
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
Related Pages
- Common API list: /S810-MX-ADL2N/Common/api_list_common
- Common API details: /S810-MX-ADL2N/Common/api_detail_common