11#include <netinet/in.h>
14#include "dawn/common/thread.hxx"
15#include "dawn/porting/config.hxx"
16#include "dawn/proto/simplebase.hxx"
34 PROTO_UDP_CFG_FIRST = 0,
35 PROTO_UDP_CFG_IOBIND = 1,
36 PROTO_UDP_CFG_PORT = 2,
37 PROTO_UDP_CFG_BIND_ADDR = 3,
38 PROTO_UDP_CFG_LAST = 31
45 , port(CONFIG_DAWN_PROTO_UDP_PORT)
51 ~CProtoUdp()
override;
53#ifdef CONFIG_DAWN_OBJECT_HAS_NAME
54 const char *getClassNameStr()
const override
92 struct sockaddr_in sender;
93 std::mutex senderMutex;
95 int sendFrame(uint8_t cmd,
const uint8_t *payload,
size_t len)
override;
100 int pollBefore(
struct pollfd *pfds, nfds_t nfds);
101 void pollAfter(
int ret);
102 int pollOnReady(
struct pollfd *pfds, nfds_t nfds,
int pollRet);
104 static int cbPollBefore(
void *priv,
struct pollfd *pfds, nfds_t nfds);
105 static void cbPollAfter(
void *priv,
struct pollfd *pfds, nfds_t nfds,
int ret);
106 static int cbPollOnReady(
void *priv,
struct pollfd *pfds, nfds_t nfds,
int pollRet);
Descriptor wrapper for individual object configuration.
@ PROTO_CLASS_UDP
UDP-based protocol.
CProtoSimpleBase(CDescObject &desc)
Constructor.
bool hasThread() const
Check if a background thread is active.
int deinit()
De-initialize object.
int init()
One-time initialize object after bindings are resolved.
int configure()
Configure object from descriptor data.
int doStart()
Start implementation hook.
int doStop()
Stop implementation hook.
CThreadedObject()
Constructor - initializes thread management state.
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.
Configuration for binding an I/O object to a simple protocol.
@ 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.