48 [[nodiscard]]
bool is_open() const noexcept;
111 std::string_view head_device,
112 std::uint16_t points,
113 std::span<
std::uint16_t> out_words) noexcept;
117 std::string_view head_device,
118 std::span<
std::uint16_t> out_words) noexcept;
123 std::span<
std::uint16_t> out_words) noexcept;
128 std::span<
std::uint16_t> out_words) noexcept;
132 std::string_view head_device,
133 std::uint16_t points,
138 std::string_view head_device,
143 std::string_view head_device,
144 std::span<const
std::uint16_t> words) noexcept;
156 std::string_view head_device,
161 std::span<const highlevel::RandomReadSpec> items,
162 std::span<
std::uint32_t> out_values) noexcept;
166 std::string_view device,
167 std::uint32_t& out_value,
168 bool double_word = false) noexcept;
172 std::span<const highlevel::RandomWriteWordSpec> items) noexcept;
180 std::string_view device,
182 bool double_word = false) noexcept;
186 std::span<const highlevel::RandomWriteBitSpec> items) noexcept;
190 std::string_view device,
195 std::span<const highlevel::RandomReadSpec> items) noexcept;
199 std::string_view device,
200 bool double_word = false) noexcept;
214 std::span<
std::uint16_t> out_words) noexcept;
217 struct CompletionState {
222 static void on_request_complete(
void* user,
Status status)
noexcept;
223 [[nodiscard]]
Status run_until_complete() noexcept;
226 MelsecSerialClient client_ {};
227 ProtocolConfig protocol_config_ {};
229 CompletionState completion_ {};
Minimal blocking host-side serial-port wrapper used by the CLI tools.
Host-side synchronous convenience wrapper built on PosixSerialPort and MelsecSerialClient.
Status register_extended_file_register_monitor(const ExtendedFileRegisterMonitorRegistration &request) noexcept
Registers extended file-register monitor data synchronously.
Status direct_read_extended_file_register_words(const ExtendedFileRegisterDirectBatchReadWordsRequest &request, std::span< std::uint16_t > out_words) noexcept
Reads direct extended file-register words synchronously.
const ProtocolConfig & protocol_config() const noexcept
Returns the currently configured protocol settings.
Status read_cpu_model(CpuModelInfo &out_info) noexcept
Reads the remote CPU model synchronously.
Status initialize_c24_transmission_sequence() noexcept
Initializes C24 format-5 transmission sequence synchronously (1615).
Status register_monitor(std::span< const highlevel::RandomReadSpec > items) noexcept
Registers a sparse monitor synchronously from string-address specs.
PosixSyncClient & operator=(const PosixSyncClient &)=delete
Status random_write_bits(std::span< const highlevel::RandomWriteBitSpec > items) noexcept
Writes sparse bit items synchronously from string-address specs.
Status read_monitor(std::span< std::uint32_t > out_values) noexcept
Reads the most recently registered monitor items synchronously.
Status random_read(std::span< const highlevel::RandomReadSpec > items, std::span< std::uint32_t > out_values) noexcept
Reads sparse word/dword items synchronously from string-address specs.
Status remote_stop() noexcept
Issues remote STOP (1002) synchronously.
Status control_global_signal(const GlobalSignalControlRequest &request) noexcept
Controls C24 global signal ON/OFF synchronously (1618).
Status write_bits(std::string_view head_device, std::span< const BitValue > bits) noexcept
Writes contiguous bits synchronously to a string address such as M100.
Status random_write_words(std::span< const highlevel::RandomWriteWordSpec > items) noexcept
Writes sparse word/dword items synchronously from string-address specs.
Status random_write_word(std::string_view device, std::uint32_t value, bool double_word=false) noexcept
Writes one sparse word/dword item synchronously from a string address.
Status write_words(std::string_view head_device, std::span< const std::uint16_t > words) noexcept
Writes contiguous words synchronously to a string address such as D100.
Status write_user_frame(const UserFrameWriteRequest &request) noexcept
Writes user-frame registration data synchronously (1610, subcommand 0000).
Status write_extended_file_register_words(const ExtendedFileRegisterBatchWriteWordsRequest &request) noexcept
Writes extended file-register words synchronously.
PosixSyncClient(const PosixSyncClient &)=delete
Status direct_write_extended_file_register_words(const ExtendedFileRegisterDirectBatchWriteWordsRequest &request) noexcept
Writes direct extended file-register words synchronously.
bool is_open() const noexcept
Returns whether the underlying serial port is open.
Status read_extended_file_register_words(const ExtendedFileRegisterBatchReadWordsRequest &request, std::span< std::uint16_t > out_words) noexcept
Reads extended file-register words synchronously.
Status delete_user_frame(const UserFrameDeleteRequest &request) noexcept
Deletes user-frame registration data synchronously (1610, subcommand 0001).
Status unlock_remote_password(std::string_view remote_password) noexcept
Unlocks remote-password-protected access (1630) synchronously.
Status remote_pause(RemoteOperationMode mode=RemoteOperationMode::DoNotExecuteForcibly) noexcept
Issues remote PAUSE (1003) synchronously.
Status random_write_extended_file_register_words(std::span< const ExtendedFileRegisterRandomWriteWordItem > items) noexcept
Writes extended file-register words randomly.
Status remote_run(RemoteOperationMode mode=RemoteOperationMode::DoNotExecuteForcibly, RemoteRunClearMode clear_mode=RemoteRunClearMode::DoNotClear) noexcept
Issues remote RUN (1001) synchronously.
void close() noexcept
Closes the serial port and clears any in-flight request state.
Status remote_reset() noexcept
Issues remote RESET (1006) synchronously.
Status open(const PosixSerialConfig &serial_config, const ProtocolConfig &protocol_config) noexcept
Opens the serial port and configures the underlying MC protocol client.
PosixSyncClient()=default
Status read_user_frame(const UserFrameReadRequest &request, UserFrameRegistrationData &out_data) noexcept
Reads user-frame registration data synchronously (0610).
Status clear_error_information() noexcept
Clears serial/C24 error information (1617) synchronously.
Status random_write_bit(std::string_view device, BitValue value) noexcept
Writes one sparse bit item synchronously from a string address.
Status remote_latch_clear() noexcept
Issues remote latch clear (1005) synchronously.
Status read_bits(std::string_view head_device, std::uint16_t points, std::span< BitValue > out_bits) noexcept
Reads contiguous bits synchronously from a string address such as M100.
Status read_extended_file_register_monitor(std::span< std::uint16_t > out_words) noexcept
Reads the most recently registered extended file-register monitor items synchronously.
Status read_words(std::string_view head_device, std::uint16_t points, std::span< std::uint16_t > out_words) noexcept
Reads contiguous words synchronously from a string address such as D100.
Status deregister_cpu_monitoring() noexcept
Deregisters programmable-controller CPU monitoring synchronously (0631).
Status lock_remote_password(std::string_view remote_password) noexcept
Locks remote-password-protected access (1631) synchronously.
Asynchronous request-execution state machine for serial MC protocol traffic.
Optional string-address helpers and protocol presets for common library entry paths.
RemoteOperationMode
Conflict-handling mode for remote RUN / PAUSE.
BitValue
Logical single-bit value used by bit read/write APIs.
RemoteRunClearMode
Clear scope applied during remote RUN initialization.
Extended file-register batch write (EW on 1C ACPU-common, chapter-18 block path on 1E).
Direct extended file-register batch read (NR on 1C QnA-common, chapter-18 direct path on 1E).
Direct extended file-register batch write (NW on 1C QnA-common, chapter-18 direct path on 1E).
Extended file-register monitor registration (EM on 1C, chapter-18 on 1E).
One item inside extended file-register random write (ET on 1C, chapter-18 on 1E).
C24 global-signal ON/OFF request (1618).
Host-side serial-port configuration used by PosixSerialPort.
Top-level protocol configuration shared by codecs and client requests.
Result object returned by most public APIs.
User-frame registration-data delete request (1610, subcommand 0001).
User-frame registration-data payload returned by 0610.
User-frame registration-data write request (1610, subcommand 0000).