8#include "dawn/common/thread.hxx"
9#include "dawn/porting/config.hxx"
10#include "dawn/proto/common.hxx"
11#include "dawn/proto/modbus/regs.hxx"
12#include <nxmodbus/nxmodbus.h>
31 PROTO_MODBUS_TCP_CFG_FIRST = 0,
32 PROTO_MODBUS_TCP_CFG_IOBIND = 1,
33 PROTO_MODBUS_TCP_CFG_PORT = 2,
34 PROTO_MODBUS_TCP_CFG_LAST = 31
41 , saddr(CONFIG_DAWN_PROTO_MODBUS_TCP_ADDR)
42 , port(CONFIG_DAWN_PROTO_MODBUS_TCP_PORT)
48#ifdef CONFIG_DAWN_OBJECT_HAS_NAME
49 const char *getClassNameStr()
const override
85 nxmb_handle_t mbhandle;
86 struct nxmb_callbacks_s callbacks;
93 int modbusInitialize();
97 return this->
getIO(
id);
CIOCommon * getIO(SObjectId::ObjectId id)
Get an I/O object by ID.
Descriptor wrapper for individual object configuration.
Base class for all I/O objects.
Base class for all protocol implementations.
@ PROTO_CLASS_MODBUS_TCP
Modbus TCP (network implementation).
Modbus register management base class (shared RTU/TCP logic).
Modbus TCP protocol implementation.
int init()
One-time initialize object after bindings are resolved.
int doStart()
Start implementation hook.
int doStop()
Stop implementation hook.
bool hasThread() const
Check if a background thread is active.
int configure()
Configure object from descriptor data.
int deinit()
De-initialize object.
Portable thread owner abstraction for Dawn components.
static ObjectCfgId objectCfg(uint8_t type, uint16_t cls, uint8_t dtype, bool rw, uint16_t size, uint8_t id)
Construct 32-bit ConfigID from component fields.
uint32_t ObjectCfgId
ConfigID type - single 32-bit value.
Out-of-tree user-extension hooks for Dawn.
I/O binding configuration loaded from descriptor.
@ OBJTYPE_PROTO
Protocol object type.
@ DTYPE_ANY
Wildcard data type (matches any actual type).
@ DTYPE_UINT16
Unsigned 16-bit integer (0 to 65535).
uint32_t ObjectId
ObjectID type - single 32-bit value.
static ObjectId objectId(uint8_t type, uint16_t cls, uint8_t dtype, uint8_t flags, uint16_t priv)
Construct 32-bit ObjectID from component fields.