moddef-cpp
Idiomatic C++ runtime for ModDef
Loading...
Searching...
No Matches
transport.hpp File Reference

Transport (spec §32.3). More...

#include <cstdint>
#include <span>
#include "moddef/error.hpp"
#include "moddef/transport.h"

Go to the source code of this file.

Classes

class  moddef::Transport
 Blocking register-level transport. More...
 

Namespaces

namespace  moddef
 
namespace  moddef::detail
 

Functions

md_err_t moddef::detail::status_of (const Result< void > &r) noexcept
 
md_err_t moddef::detail::c_read_holding (void *ctx, std::uint16_t off, std::uint16_t n, std::uint16_t *out)
 
md_err_t moddef::detail::c_read_input (void *ctx, std::uint16_t off, std::uint16_t n, std::uint16_t *out)
 
md_err_t moddef::detail::c_read_coils (void *ctx, std::uint16_t off, std::uint16_t n, bool *out)
 
md_err_t moddef::detail::c_read_discrete (void *ctx, std::uint16_t off, std::uint16_t n, bool *out)
 
md_err_t moddef::detail::c_write_holding (void *ctx, std::uint16_t off, std::uint16_t n, const std::uint16_t *w)
 
md_err_t moddef::detail::c_write_coil (void *ctx, std::uint16_t off, bool on)
 
md_transport_t moddef::detail::bind (Transport &t) noexcept
 

Detailed Description

Transport (spec §32.3).

Subclass moddef::Transport and override the six blocking calls to bind ModDef to your Modbus stack. The adapter thunks a Transport& into the C core's md_transport_t function table (ctx carries the object pointer).