|
MC Protocol Serial C++ 0.2.3
MC protocol serial library for MCU-oriented environments
|
Namespaces | |
| namespace | CommandCodec |
| Command-payload codec helpers below the frame layer. | |
| namespace | detail |
| namespace | highlevel |
| namespace | link_direct_detail |
Classes | |
| struct | BatchReadBitsRequest |
Contiguous bit-read request (0401 bit path). More... | |
| struct | BatchReadWordsRequest |
| struct | BatchWriteBitsRequest |
Contiguous bit-write request (1401 bit path). More... | |
| struct | BatchWriteWordsRequest |
Contiguous word-write request (1401). More... | |
| struct | CpuModelInfo |
| struct | DecodeResult |
Result returned by FrameCodec::decode_response(). More... | |
| struct | DeviceAddress |
| Device code plus numeric address. More... | |
| struct | ExtendedFileRegisterAddress |
Extended file-register address using block number plus R word number. More... | |
| struct | ExtendedFileRegisterBatchReadWordsRequest |
| struct | ExtendedFileRegisterBatchWriteWordsRequest |
Extended file-register batch write (EW on 1C ACPU-common, chapter-18 block path on 1E). More... | |
| struct | ExtendedFileRegisterDirectBatchReadWordsRequest |
Direct extended file-register batch read (NR on 1C QnA-common, chapter-18 direct path on 1E). More... | |
| struct | ExtendedFileRegisterDirectBatchWriteWordsRequest |
Direct extended file-register batch write (NW on 1C QnA-common, chapter-18 direct path on 1E). More... | |
| struct | ExtendedFileRegisterMonitorRegistration |
Extended file-register monitor registration (EM on 1C, chapter-18 on 1E). More... | |
| struct | ExtendedFileRegisterRandomWriteWordItem |
One item inside extended file-register random write (ET on 1C, chapter-18 on 1E). More... | |
| class | FrameCodec |
| Frame-level encode/decode helper for complete serial MC frames. More... | |
| struct | GlobalSignalControlRequest |
C24 global-signal ON/OFF request (1618). More... | |
| struct | HostBufferReadRequest |
| struct | HostBufferWriteRequest |
Host-buffer write request (1613). More... | |
| struct | LinkDirectDevice |
Parsed Jn\\... link-direct device reference such as J1\\W100. More... | |
| struct | LinkDirectMonitorRegistration |
Jn\\... monitor registration payload (0801 + device extension specification). More... | |
| struct | LinkDirectMultiBlockReadBlock |
One Jn\\... block used by native multi-block read. More... | |
| struct | LinkDirectMultiBlockReadRequest |
Jn\\... native multi-block read request. More... | |
| struct | LinkDirectMultiBlockWriteBlock |
One Jn\\... block used by native multi-block write. More... | |
| struct | LinkDirectMultiBlockWriteRequest |
Jn\\... native multi-block write request. More... | |
| struct | LinkDirectRandomReadItem |
One sparse Jn\\... item used by native random-read and monitor registration. More... | |
| struct | LinkDirectRandomWriteBitItem |
One sparse Jn\\... bit item used by native random bit-write. More... | |
| struct | LinkDirectRandomWriteWordItem |
One sparse Jn\\... word item used by native random word-write. More... | |
| class | MelsecSerialClient |
| Asynchronous MC protocol client for UART / serial integrations. More... | |
| struct | ModuleBufferReadRequest |
Module-buffer byte read request (0601 helper path). More... | |
| struct | ModuleBufferWriteRequest |
Module-buffer byte write request (1601 helper path). More... | |
| struct | MonitorRegistration |
| struct | MultiBlockReadBlock |
One block inside native multi-block read (0406). More... | |
| struct | MultiBlockReadBlockResult |
Parsed layout description for one block returned by parse_multi_block_read_response(). More... | |
| struct | MultiBlockReadRequest |
| Native multi-block read request composed of multiple contiguous blocks. More... | |
| struct | MultiBlockWriteBlock |
One block inside native multi-block write (1406). More... | |
| struct | MultiBlockWriteRequest |
| Native multi-block write request composed of multiple contiguous blocks. More... | |
| struct | PosixSerialConfig |
Host-side serial-port configuration used by PosixSerialPort. More... | |
| class | PosixSerialPort |
| Minimal blocking host-side serial-port wrapper used by the CLI tools. More... | |
| class | PosixSyncClient |
Host-side synchronous convenience wrapper built on PosixSerialPort and MelsecSerialClient. More... | |
| struct | ProtocolConfig |
| Top-level protocol configuration shared by codecs and client requests. More... | |
| struct | QualifiedBufferWordDevice |
Parsed U...\\G... or U...\\HG... qualified word device. More... | |
| struct | RandomReadItem |
| struct | RandomReadRequest |
| Native random-read request made of sparse word/dword items. More... | |
| struct | RandomWriteBitItem |
One bit item inside native random write (1402 bit path). More... | |
| struct | RandomWriteWordItem |
One word or double-word item inside native random write (1402 word path). More... | |
| struct | RawResponseFrame |
| Raw decoded response frame before command-specific parsing. More... | |
| struct | RouteConfig |
| Route header fields for serial MC requests. More... | |
| struct | Rs485Hooks |
| Optional RS-485 callbacks used by the async client around TX start/end. More... | |
| struct | Status |
| Result object returned by most public APIs. More... | |
| struct | TimeoutConfig |
| Timeout settings used by the frame decoder and async client. More... | |
| struct | UserFrameDeleteRequest |
User-frame registration-data delete request (1610, subcommand 0001). More... | |
| struct | UserFrameReadRequest |
| struct | UserFrameRegistrationData |
User-frame registration-data payload returned by 0610. More... | |
| struct | UserFrameWriteRequest |
User-frame registration-data write request (1610, subcommand 0000). More... | |
Typedefs | |
Diagnostic And Transport Helper Types | |
CPU-model response payload returned by | |
| using | CompletionHandler = void(*)(void *user, Status status) |
| Completion callback used by the async client. | |
Enumerations | |
| enum class | DecodeStatus : std::uint8_t { Incomplete , Complete , Error } |
| High-level result of frame decoding. More... | |
| enum class | QualifiedBufferDeviceKind : std::uint8_t { G , HG } |
Qualified buffer-memory family used by helper U... accessors. More... | |
| enum class | StatusCode : std::uint8_t { Ok = 0 , InvalidArgument , Busy , Timeout , Transport , Framing , SumCheckMismatch , Parse , UnsupportedConfiguration , PlcError , BufferTooSmall , Cancelled } |
| Library-level status code returned by encode, decode, transport, and client operations. More... | |
| enum class | FrameKind : std::uint8_t { C4 , C3 , C2 , C1 , E1 } |
| MC protocol frame family used on the serial link. More... | |
| enum class | CodeMode : std::uint8_t { Ascii , Binary } |
| Request/response payload encoding. More... | |
| enum class | AsciiFormat : std::uint8_t { Format1 , Format2 , Format3 , Format4 } |
ASCII formatting variant for C4 / C3 / C2 serial frames. More... | |
| enum class | PlcSeries : std::uint8_t { IQ_R , IQ_L , Q_L , QnA , A } |
| PLC family selection used for subcommand and device-layout differences. More... | |
| enum class | RouteKind : std::uint8_t { HostStation , MultidropStation } |
| Route layout inside the request header. More... | |
| enum class | DeviceCode : std::uint8_t { X , Y , M , L , SM , F , V , B , D , SD , W , TS , TC , TN , STS , STC , STN , CS , CC , CN , SB , SW , S , DX , DY , LTS , LTC , LTN , LSTS , LSTC , LSTN , LCS , LCC , LCN , LZ , Z , R , RD , ZR , G , HG } |
| Device-family identifier used by the request codecs. More... | |
| enum class | BitValue : std::uint8_t { Off = 0 , On = 1 } |
| Logical single-bit value used by bit read/write APIs. More... | |
| enum class | RemoteOperationMode : std::uint16_t { DoNotExecuteForcibly = 0x0001 , ExecuteForcibly = 0x0003 } |
| Conflict-handling mode for remote RUN / PAUSE. More... | |
| enum class | RemoteRunClearMode : std::uint8_t { DoNotClear = 0x00 , ClearOutsideLatchRange = 0x01 , AllClear = 0x02 } |
| Clear scope applied during remote RUN initialization. More... | |
| enum class | GlobalSignalTarget : std::uint8_t { ReceivedSide = 0x00 , X1A = 0x01 , X1B = 0x02 } |
C24 global-signal selector used by command 1618. More... | |
| enum class | ResponseType : std::uint8_t { SuccessData , SuccessNoData , PlcError } |
| Decoded PLC response class before command-specific parsing. More... | |
Functions | |
| constexpr BitValue | sparse_native_requested_bit_value (std::uint32_t raw_value) noexcept |
| Returns the requested-point value from a sparse native bit result word. | |
| constexpr std::uint16_t | sparse_native_mask_word (std::uint32_t raw_value) noexcept |
| Returns the raw 16-point mask word from a sparse native bit result. | |
| Status | parse_link_direct_device (std::string_view text, LinkDirectDevice &out_device) noexcept |
Parses a Jn\\... link-direct device string such as J1\\W100 or J1\\X10. | |
| constexpr const char * | qualified_buffer_kind_name (QualifiedBufferDeviceKind kind) noexcept |
Returns "G" or "HG" for the helper device kind. | |
| constexpr std::uint32_t | qualified_buffer_word_to_byte_address (std::uint32_t word_address) noexcept |
| Converts a qualified word address to the corresponding module-buffer byte address. | |
| Status | parse_qualified_buffer_word_device (std::string_view text, QualifiedBufferWordDevice &out_device) noexcept |
Parses a helper qualified device string such as U3E0\\G10 or U3E0\\HG20. | |
| Status | make_qualified_buffer_read_words_request (const QualifiedBufferWordDevice &device, std::uint16_t word_length, ModuleBufferReadRequest &out_request) noexcept |
| Builds a module-buffer read request for a helper qualified word range. | |
| Status | encode_qualified_buffer_word_values (std::span< const std::uint16_t > words, std::span< std::byte > out_bytes, std::size_t &out_size) noexcept |
| Encodes helper qualified word values into little-endian module-buffer bytes. | |
| Status | make_qualified_buffer_write_words_request (const QualifiedBufferWordDevice &device, std::span< const std::uint16_t > words, std::span< std::byte > byte_storage, ModuleBufferWriteRequest &out_request, std::size_t &out_byte_count) noexcept |
| Builds a module-buffer write request for helper qualified word access. | |
| Status | decode_qualified_buffer_word_values (std::span< const std::byte > bytes, std::span< std::uint16_t > out_words) noexcept |
| Decodes little-endian module-buffer bytes into helper qualified word values. | |
| constexpr Status | ok_status () noexcept |
| Returns the default success status. | |
| constexpr Status | make_status (StatusCode code, const char *message, std::uint16_t plc_error_code=0) noexcept |
| Builds a status value with an optional PLC end code. | |
Variables | |
| constexpr std::size_t | kMaxRequestFrameBytes |
| constexpr std::size_t | kMaxResponseFrameBytes |
| constexpr std::size_t | kMaxRequestDataBytes |
| constexpr std::size_t | kMaxBatchWordPoints |
| constexpr std::size_t | kMaxBatchBitPointsAscii |
| constexpr std::size_t | kMaxBatchBitPointsBinary |
| constexpr std::size_t | kMaxRandomAccessItems |
| constexpr std::size_t | kMaxMultiBlockCount |
| constexpr std::size_t | kMaxMonitorItems |
| constexpr std::size_t | kMaxLoopbackBytes |
| constexpr std::size_t | kMaxUserFrameRegistrationBytes = 80U |
| constexpr std::size_t | kCpuModelNameLength = 16 |
| using mcprotocol::serial::CompletionHandler = typedef void (*)(void* user, Status status) |
|
strong |
ASCII formatting variant for C4 / C3 / C2 serial frames.
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
MC protocol frame family used on the serial link.
|
strong |
|
strong |
|
strong |
Qualified buffer-memory family used by helper U... accessors.
| Enumerator | |
|---|---|
| G | |
| HG | |
Definition at line 15 of file qualified_buffer.hpp.
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
Library-level status code returned by encode, decode, transport, and client operations.
| Enumerator | |
|---|---|
| Ok | |
| InvalidArgument | |
| Busy | |
| Timeout | |
| Transport | |
| Framing | |
| SumCheckMismatch | |
| Parse | |
| UnsupportedConfiguration | |
| PlcError | |
| BufferTooSmall | |
| Cancelled | |
Definition at line 8 of file status.hpp.
|
inlinenoexcept |
Decodes little-endian module-buffer bytes into helper qualified word values.
Definition at line 248 of file qualified_buffer.hpp.
|
inlinenoexcept |
Encodes helper qualified word values into little-endian module-buffer bytes.
Definition at line 188 of file qualified_buffer.hpp.
|
inlinenoexcept |
Builds a module-buffer read request for a helper qualified word range.
Definition at line 164 of file qualified_buffer.hpp.
|
inlinenoexcept |
Builds a module-buffer write request for helper qualified word access.
Definition at line 215 of file qualified_buffer.hpp.
|
inlineconstexprnoexcept |
Builds a status value with an optional PLC end code.
Definition at line 42 of file status.hpp.
|
inlineconstexprnoexcept |
Returns the default success status.
Definition at line 37 of file status.hpp.
|
inlinenoexcept |
Parses a Jn\\... link-direct device string such as J1\\W100 or J1\\X10.
Definition at line 164 of file link_direct.hpp.
|
inlinenoexcept |
Parses a helper qualified device string such as U3E0\\G10 or U3E0\\HG20.
Definition at line 94 of file qualified_buffer.hpp.
|
constexprnoexcept |
Returns "G" or "HG" for the helper device kind.
Definition at line 28 of file qualified_buffer.hpp.
|
constexprnoexcept |
Converts a qualified word address to the corresponding module-buffer byte address.
Definition at line 34 of file qualified_buffer.hpp.
|
constexprnoexcept |
|
constexprnoexcept |
Returns the requested-point value from a sparse native bit result word.
On 2C/3C/4C, native sparse bit reads (0403) and monitor reads (0802) return the addressed point inside a 16-point mask word. The requested head device is represented by bit 0 of that returned word.
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |