|
MC Protocol Serial C++ 0.2.3
MC protocol serial library for MCU-oriented environments
|
MC protocol serial library for MCU-oriented environments.
This repository is for cases like these:
serial / RS-232C / RS-485C++ library that does not allocate dynamicallyLinux, RP2040, ESP32-C3, or Arduino Mega 2560The current codebase includes:
MelsecSerialClientPosixSyncClientRP2040, ESP32-C3, and Arduino Mega 2560RP2040, ESP32-C3, and Arduino Mega 2560RJ71C24-R2, LJ71C24, QJ71C24N, and FX5UC-32MT/DPlatformIO Registry:
Choose the first path that matches what you are trying to do.
Start with host_sync_quickstart.cpp if you want the smallest blocking example on Windows or POSIX.
PosixSyncClient facadeStart with MCU Quickstart and Examples Index if you want to run on RP2040, ESP32-C3, or Arduino Mega 2560.
TTL UART -> level shifter -> RS-232C wiringStart with mcu_async_batch_read.cpp if you want the async state machine directly and plan to integrate your own UART layer or scheduler.
Before building against real hardware, confirm the exact serial settings for your target in HARDWARE_VALIDATION.md.
The example projects keep intentionally simple defaults. Those defaults are example defaults, not the authority for the current validated settings.
2C, 3C, and 4C command handling are in place. 2C is ASCII-only. The codebase also has initial 1C and 1E support for narrower subsets.2C / 3C / 4C ASCII currently support Format1, Format2, Format3, and Format4. Format2 is the block-numbered variant and maps to ProtocolConfig::ascii_block_number or CLI --block-no.RJ71C24-R2, LJ71C24, QJ71C24N, and FX5UC-32MT/D.0601/1601 is the supported public U... path.RJ71C24-R2 + R120PCPU iQ-R spot-device path, Jn\\... batch and multi-block surfaces are validated.For the exact PASS / status matrix and the verified serial settings for each target, see HARDWARE_VALIDATION.md.
1C and 1E remain subset implementations. They are useful, but they do not expose the full 3C / 4C surface.--series selection.U... access on the helper path only.Jn\\... random and monitor remain outside the currently validated public surface.FX5UC-32MT/D treats 0613/1613/0601/1601 and 0801/0802 as unsupported / not applicable on serial 3C/4C.write-words and write-bits are still split automatically to fit fixed request buffers.1005 remote latch clear and 1630 / 1631 remote password unlock/lock on RJ71C24-R2 + R120PCPU. Parked implementation gaps such as 1612, 0630, and 2101 remain documented in TODO.md.For target-specific limits and current follow-up items, use HARDWARE_VALIDATION.md and TODO.md.
The library exposes three practical entry paths:
mcprotocol/serial/high_level.hppmcprotocol/serial/host_sync.hppMelsecSerialClientUse these docs for the details:
PlatformIO packaging, environment names, reduced/ultra profiles, and build-time tuning macros are documented here:
Local documentation tasks and GitHub automation are documented here: