10#include "dawn/common/descobject.hxx"
11#include "dawn/common/objectcfg.hxx"
12#include "dawn/common/objectid.hxx"
13#include "dawn/porting/config.hxx"
15#ifndef CONFIG_DAWN_OBJECT_NAME_SIZE
16# define CONFIG_DAWN_OBJECT_NAME_SIZE 16
57 , uobjid(desc.getObjectId())
316 DESCVALID_ERR_LEN_ALIGN = -1,
317 DESCVALID_ERR_NO_OBJSIZE = -2,
318 DESCVALID_ERR_NO_CFG_HEADER = -3,
319 DESCVALID_ERR_CFG_TRUNCATED = -4,
320 DESCVALID_ERR_CFG_DATA = -6
346 static int validateDesc(
const uint32_t *desc,
size_t len);
348#ifdef CONFIG_DAWN_OBJECT_HAS_NAME
358 virtual const char *getClassNameStr()
const = 0;
369 const char *getName()
const;
420#ifdef CONFIG_DAWN_OBJECT_HAS_NAME
429 mutable char name[CONFIG_DAWN_OBJECT_NAME_SIZE] = {};
434 CDescObject &objdesc;
435 SObjectId::UObjectId uobjid;
Descriptor wrapper for individual object configuration.
Base class for all Dawn objects (IOs, Programs, Protocols).
virtual int init()
One-time initialize object after bindings are resolved.
uint8_t getType() const
Get object type field.
virtual int trigger(uint8_t cmd)
Execute a trigger command.
uint16_t getPriv() const
Get instance/private data field.
virtual int doStart()
Start implementation hook.
uint16_t getCls() const
Get object class field.
EObjectState
Object operational state returned by getState()
@ STATE_STOPPED
Object is stopped.
@ STATE_RUNNING
Object is running.
uint8_t getFlags() const
Get type-specific flags field.
virtual int doStop()
Stop implementation hook.
virtual bool hasThread() const
Check if a background thread is active.
static int descValidDefault(const uint32_t *data, size_t len)
Default descriptor validation method.
virtual EObjectState getState() const
Get current operational state.
virtual int onSetObjConfig(SObjectCfg::ObjectCfgId objcfg, uint32_t *data, size_t len)
Pre-update hook for runtime configuration writes.
virtual int deinit()
De-initialize object.
SObjectId::ObjectId getIdV() const
Get object identifier as raw 32-bit value.
CDescObject & getDesc()
Get descriptor object for this object.
size_t getDtypeSize() const
Get size of this object's data type.
int getObjConfig(SObjectCfg::ObjectCfgId objcfg, uint32_t *data, size_t len)
Get object configuration item.
SObjectId::UObjectId getId() const
Get object identifier as union structure.
CObject(CDescObject &desc)
Construct a CObject from a descriptor.
virtual int configure()
Configure object from descriptor data.
int setObjConfig(SObjectCfg::ObjectCfgId objcfg, uint32_t *data, size_t len)
Set object configuration item.
uint8_t getDtype() const
Get data type field.
@ CMD_RESET
Reset object internal state.
@ CMD_TRIGGER3
Object-specific trigger slot 3.
@ CMD_TRIGGER2
Object-specific trigger slot 2.
@ CMD_TRIGGER1
Object-specific trigger slot 1.
static int validateDesc(const uint32_t *desc, size_t len)
Validate entire descriptor.
bool getCfgFlag() const
Check if configuration flag is set.
uint32_t ObjectCfgId
ConfigID type - single 32-bit value.
Out-of-tree user-extension hooks for Dawn.
uint32_t ObjectId
ObjectID type - single 32-bit value.
32-bit encoded object identifier (union with bit field).