Dawn Framework 1.0
Universal data acquisition framework for embedded systems
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
dawn::CIOSysinfo Class Reference

System information I/O providing uptime and CPU load. More...

#include <sysinfo.hxx>

Inheritance diagram for dawn::CIOSysinfo:
[legend]
Collaboration diagram for dawn::CIOSysinfo:
[legend]

Public Types

enum  {
  IO_CFG_FIRST = 0 , IO_CFG_DEVNO = 1 , IO_CFG_LIMIT_MIN = 2 , IO_CFG_LIMIT_MAX = 3 ,
  IO_CFG_LIMIT_STEP = 4 , IO_CFG_NOTIFY = 5 , IO_CFG_LAST = 31
}
 I/O common configuration IDs. More...
 
enum  { CMD_RESET = 0 , CMD_TRIGGER1 = 1 , CMD_TRIGGER2 = 2 , CMD_TRIGGER3 = 3 }
 Control command identifiers for control() More...
 
enum  
 Default descriptor validation failure codes. More...
 
enum  EIOClass {
  IO_CLASS_ANY = 0 , IO_CLASS_CONFIG = 1 , IO_CLASS_TRIGGER = 2 , IO_CLASS_DESCRIPTOR = 3 ,
  IO_CLASS_CONTROL = 4 , IO_CLASS_CAPABILITIES = 53 , IO_CLASS_DESC_SELECTOR = 54 , IO_CLASS_DUMMY = 5 ,
  IO_CLASS_TIMESTAMP = 6 , IO_CLASS_RAND = 7 , IO_CLASS_DUMMY_NOTIFY = 8 , IO_CLASS_FILE = 9 ,
  IO_CLASS_SENSOR_ACCELEROMETER = 10 , IO_CLASS_SENSOR_MAGNETICFIELD = 11 , IO_CLASS_SENSOR_GYROSCOPE = 12 , IO_CLASS_SENSOR_LIGHT = 13 ,
  IO_CLASS_SENSOR_BAROMETER = 14 , IO_CLASS_SENSOR_PROXIMITY = 15 , IO_CLASS_SENSOR_HUMIDITY = 16 , IO_CLASS_SENSOR_TEMPERATURE = 17 ,
  IO_CLASS_SENSOR_ATEMPERATURE = 18 , IO_CLASS_SENSOR_RGB = 19 , IO_CLASS_SENSOR_IR = 20 , IO_CLASS_SENSOR_UV = 21 ,
  IO_CLASS_SENSOR_GAS = 22 , IO_CLASS_SENSOR_PRODUCER_ACCELEROMETER = 23 , IO_CLASS_SENSOR_PRODUCER_MAGNETICFIELD = 24 , IO_CLASS_SENSOR_PRODUCER_GYROSCOPE = 25 ,
  IO_CLASS_SENSOR_PRODUCER_LIGHT = 26 , IO_CLASS_SENSOR_PRODUCER_BAROMETER = 27 , IO_CLASS_SENSOR_PRODUCER_PROXIMITY = 28 , IO_CLASS_SENSOR_PRODUCER_HUMIDITY = 29 ,
  IO_CLASS_SENSOR_PRODUCER_TEMPERATURE = 30 , IO_CLASS_SENSOR_PRODUCER_ATEMPERATURE = 31 , IO_CLASS_SENSOR_PRODUCER_RGB = 32 , IO_CLASS_SENSOR_PRODUCER_IR = 33 ,
  IO_CLASS_SENSOR_PRODUCER_UV = 34 , IO_CLASS_SENSOR_PRODUCER_GAS = 35 , IO_CLASS_SENSOR_PRODUCER_CONFIG = 36 , IO_CLASS_SYSTEM_UPTIME = 41 ,
  IO_CLASS_SYSTEM_CPULOAD = 42 , IO_CLASS_SYSTEM_RESET = 43 , IO_CLASS_SYSTEM_RESETCAUSE = 44 , IO_CLASS_SYSTEM_POWEROFF = 45 ,
  IO_CLASS_SYSTEM_HOSTNAME = 46 , IO_CLASS_SYSTEM_UUID = 47 , IO_CLASS_SYSTEM_SYSTEMTIME = 48 , IO_CLASS_GPI_SINGLE = 60 ,
  IO_CLASS_GPO_SINGLE = 61 , IO_CLASS_BUTTONS = 62 , IO_CLASS_LEDS = 63 , IO_CLASS_RGBLED = 64 ,
  IO_CLASS_PWM = 78 , IO_CLASS_DAC = 81 , IO_CLASS_ADC_FETCH = 82 , IO_CLASS_ADC_SYNC = 83 ,
  IO_CLASS_ADC_STREAM = 84 , IO_CLASS_ENCODER = 85 , IO_CLASS_ENCODER_INDEX = 86 , IO_CLASS_VIRT = 100 ,
  IO_CLASS_USER_START = 500 , IO_CLASS_USER , IO_CLASS_LAST
}
 I/O object class types. More...
 
enum  EIOFlags { IO_FLAGS_NONE = 0 , IO_FLAGS_TS = (1 << 0) }
 I/O common flags. More...
 
enum  EIONotifyType { IO_NOTIFY_POLL = 0 , IO_NOTIFY_STREAM = 1 }
 Notifier type enumeration. More...
 
enum  EObjectState { STATE_STOPPED = 0 , STATE_RUNNING = 1 }
 Object operational state returned by getState() More...
 

Public Member Functions

virtual int configure ()
 Configure object from descriptor data.
 
io_ddata_tddata_alloc (size_t batch, size_t chunk_size=0)
 Allocate data buffer for this I/O.
 
virtual int deinit ()
 De-initialize object.
 
bool getCfgFlag () const
 Check if configuration flag is set.
 
uint16_t getCls () const
 Get object class field.
 
int getConfig (uint32_t cfgid, uint32_t *data, size_t len)
 Get I/O configuration item.
 
int getData (IODataCmn &data, size_t len, size_t offset=0)
 Get data from I/O (public interface with stats tracking).
 
size_t getDataDim () const
 Get data vector dimension.
 
int getDataImpl (IODataCmn &data, size_t len)
 Get data implementation (override in derived classes).
 
size_t getDataSize () const
 Get data size in bytes.
 
CDescObjectgetDesc ()
 Get descriptor object for this object.
 
uint8_t getDtype () const
 Get data type field.
 
size_t getDtypeSize () const
 Get size of this object's data type.
 
virtual int getFd () const
 Get file descriptor for notifications.
 
uint8_t getFlags () const
 Get type-specific flags field.
 
SObjectId::UObjectId getId () const
 Get object identifier as union structure.
 
SObjectId::ObjectId getIdV () const
 Get object identifier as raw 32-bit value.
 
int getObjConfig (SObjectCfg::ObjectCfgId objcfg, uint32_t *data, size_t len)
 Get object configuration item.
 
uint16_t getPriv () const
 Get instance/private data field.
 
virtual EObjectState getState () const
 Get current operational state.
 
uint8_t getType () const
 Get object type field.
 
virtual bool hasThread () const
 Check if a background thread is active.
 
int init ()
 One-time initialize object after bindings are resolved.
 
bool isBatch () const
 Check if IO supports batch operations.
 
bool isNotify () const
 Check if IO supports notifications.
 
bool isRead () const
 Check if IO supports read operations.
 
virtual bool isSeekable () const
 Check if IO supports partial (seekable) access.
 
bool isTimestamp () const
 Check if I/O supports timestamp.
 
bool isWrite () const
 Check if IO supports write operations.
 
int setConfig (uint32_t cfgid, uint32_t *data, size_t len)
 Set I/O configuration item.
 
int setData (IODataCmn &data, size_t offset=0)
 Set data for I/O (public interface with stats tracking).
 
int setDataImpl (IODataCmn &data)
 Set data implementation (override in derived classes).
 
int setObjConfig (SObjectCfg::ObjectCfgId objcfg, uint32_t *data, size_t len)
 Set object configuration item.
 
int start ()
 Start object.
 
int stop ()
 Stop object.
 
virtual int trigger (uint8_t cmd)
 Execute a trigger command.
 

Static Public Member Functions

static SObjectCfg::ObjectCfgId cfgIdCmn (bool rw, uint8_t dtype, uint8_t size, uint8_t id)
 Create ConfigID for I/O common configuration.
 
static SObjectCfg::ObjectCfgId cfgIdDevno (bool rw=false)
 Create ConfigID for device number configuration.
 
static SObjectCfg::ObjectCfgId cfgIdLimitMax (uint8_t dtype, uint16_t size)
 Create ConfigID for maximum I/O limits.
 
static SObjectCfg::ObjectCfgId cfgIdLimitMin (uint8_t dtype, uint16_t size)
 Create ConfigID for minimum I/O limits.
 
static SObjectCfg::ObjectCfgId cfgIdLimitStep (uint8_t dtype, uint16_t size)
 Create ConfigID for step I/O limits.
 
static SObjectCfg::ObjectCfgId cfgIdNotify (bool rw=false)
 Create ConfigID for notifier configuration.
 
static int descValidDefault (const uint32_t *data, size_t len)
 Default descriptor validation method.
 
static int validateDesc (const uint32_t *desc, size_t len)
 Validate entire descriptor.
 

Protected Member Functions

size_t cfgCmnOffset (const SObjectCfg::SObjectCfgItem *cfg)
 Get offset of configuration item in descriptor.
 
virtual int doStart ()
 Start implementation hook.
 
virtual int doStop ()
 Stop implementation hook.
 
int getCmnDevno () const
 Get device number for this I/O.
 
const uint32_t * getCmnLimitMax ()
 Get maximum I/O limit words.
 
const uint32_t * getCmnLimitMin ()
 Get minimum I/O limit words.
 
const CIOLimitsgetCmnLimits () const
 Get common IO limits container.
 
const uint32_t * getCmnLimitStep ()
 Get step I/O limit words.
 
size_t getCmnLimitWords ()
 Get number of 32-bit words in I/O limit arrays.
 
virtual int getDataAtImpl (IODataCmn &data, size_t len, size_t offset)
 Get data at byte offset (override in seekable IOs).
 
uint64_t getTimestamp ()
 Get current timestamp.
 
virtual int onSetObjConfig (SObjectCfg::ObjectCfgId objcfg, uint32_t *data, size_t len)
 Pre-update hook for runtime configuration writes.
 
virtual int setDataAtImpl (IODataCmn &data, size_t offset)
 Set data at byte offset (override in seekable IOs).
 

Detailed Description

System information I/O providing uptime and CPU load.

Provides read-only access to system-level information including system uptime (elapsed time since boot) and CPU load metrics.

Definition at line 22 of file sysinfo.hxx.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited

I/O common configuration IDs.

Standard configuration identifiers for I/O objects:

  • IO_CFG_DEVNO: Device number configuration
  • IO_CFG_LIMIT_*: I/O data limits (min/max/step).
Enumerator
IO_CFG_FIRST 

First config ID.

IO_CFG_DEVNO 

Device number configuration.

IO_CFG_LIMIT_MIN 

Minimum limit words.

IO_CFG_LIMIT_MAX 

Maximum limit words.

IO_CFG_LIMIT_STEP 

Step limit words.

IO_CFG_NOTIFY 

Notifier configuration (type + priority)

IO_CFG_LAST 

Last config ID.

Definition at line 208 of file common.hxx.

◆ anonymous enum

anonymous enum
inherited

Control command identifiers for control()

Enumerator
CMD_RESET 

Reset object internal state.

CMD_TRIGGER1 

Object-specific trigger slot 1.

CMD_TRIGGER2 

Object-specific trigger slot 2.

CMD_TRIGGER3 

Object-specific trigger slot 3.

Definition at line 40 of file object.hxx.

◆ anonymous enum

anonymous enum
inherited

Default descriptor validation failure codes.

Negative values identify which length check failed in descValidDefault().

Definition at line 314 of file object.hxx.

◆ EIOClass

enum dawn::CIOCommon::EIOClass
inherited

I/O object class types.

Enumerator
IO_CLASS_ANY 

Any I/O class.

IO_CLASS_CONFIG 

Configuration I/O.

IO_CLASS_TRIGGER 

Trigger I/O.

IO_CLASS_DESCRIPTOR 

Descriptor I/O.

IO_CLASS_CONTROL 

Control I/O.

IO_CLASS_CAPABILITIES 

Capabilities bitmask I/O.

IO_CLASS_DESC_SELECTOR 

Descriptor slot selector I/O.

IO_CLASS_DUMMY 

Dummy I/O (for testing)

IO_CLASS_TIMESTAMP 

Timestamp generator.

IO_CLASS_RAND 

Random number generator.

IO_CLASS_DUMMY_NOTIFY 

Timer-driven dummy IO.

IO_CLASS_FILE 

File system I/O.

IO_CLASS_SENSOR_ACCELEROMETER 

Accelerometer sensor.

IO_CLASS_SENSOR_MAGNETICFIELD 

Magnetic field sensor.

IO_CLASS_SENSOR_GYROSCOPE 

Gyroscope sensor.

IO_CLASS_SENSOR_LIGHT 

Light sensor.

IO_CLASS_SENSOR_BAROMETER 

Barometer sensor.

IO_CLASS_SENSOR_PROXIMITY 

Proximity sensor.

IO_CLASS_SENSOR_HUMIDITY 

Humidity sensor.

IO_CLASS_SENSOR_TEMPERATURE 

Temperature sensor.

IO_CLASS_SENSOR_ATEMPERATURE 

Ambient temperature sensor.

IO_CLASS_SENSOR_RGB 

RGB color sensor.

IO_CLASS_SENSOR_IR 

Infrared sensor.

IO_CLASS_SENSOR_UV 

Ultraviolet sensor.

IO_CLASS_SENSOR_GAS 

Gas sensor.

IO_CLASS_SENSOR_PRODUCER_ACCELEROMETER 

Accelerometer publisher.

IO_CLASS_SENSOR_PRODUCER_MAGNETICFIELD 

Magnetic field publisher.

IO_CLASS_SENSOR_PRODUCER_GYROSCOPE 

Gyroscope publisher.

IO_CLASS_SENSOR_PRODUCER_LIGHT 

Light publisher.

IO_CLASS_SENSOR_PRODUCER_BAROMETER 

Barometer publisher.

IO_CLASS_SENSOR_PRODUCER_PROXIMITY 

Proximity publisher.

IO_CLASS_SENSOR_PRODUCER_HUMIDITY 

Humidity publisher.

IO_CLASS_SENSOR_PRODUCER_TEMPERATURE 

Temperature publisher.

IO_CLASS_SENSOR_PRODUCER_ATEMPERATURE 

Ambient temperature publisher.

IO_CLASS_SENSOR_PRODUCER_RGB 

RGB color publisher.

IO_CLASS_SENSOR_PRODUCER_IR 

Infrared publisher.

IO_CLASS_SENSOR_PRODUCER_UV 

Ultraviolet publisher.

IO_CLASS_SENSOR_PRODUCER_GAS 

Gas publisher.

IO_CLASS_SENSOR_PRODUCER_CONFIG 

Sensor producer configuration IDs.

IO_CLASS_SYSTEM_UPTIME 

System uptime.

IO_CLASS_SYSTEM_CPULOAD 

CPU load.

IO_CLASS_SYSTEM_RESET 

System reset control.

IO_CLASS_SYSTEM_RESETCAUSE 

Reset cause.

IO_CLASS_SYSTEM_POWEROFF 

Power off control.

IO_CLASS_SYSTEM_HOSTNAME 

System hostname.

IO_CLASS_SYSTEM_UUID 

UUID.

IO_CLASS_SYSTEM_SYSTEMTIME 

System time.

IO_CLASS_GPI_SINGLE 

Single GPIO input.

IO_CLASS_GPO_SINGLE 

Single GPIO output.

IO_CLASS_BUTTONS 

Button input.

IO_CLASS_LEDS 

LED output.

IO_CLASS_RGBLED 

RGB LED output.

IO_CLASS_PWM 

PWM output.

IO_CLASS_DAC 

Digital-to-analog converter.

IO_CLASS_ADC_FETCH 

ADC fetch (on-demand)

IO_CLASS_ADC_SYNC 

ADC sync (HW-triggered control loop)

IO_CLASS_ADC_STREAM 

ADC stream (batch/high-throughput)

IO_CLASS_ENCODER 

Quadrature encoder (position)

IO_CLASS_ENCODER_INDEX 

Quadrature encoder (position+index)

IO_CLASS_VIRT 

Virtual I/O.

IO_CLASS_USER_START 

User-defined types start here.

IO_CLASS_USER 

User-defined I/O.

IO_CLASS_LAST 

Last I/O class marker.

Definition at line 84 of file common.hxx.

◆ EIOFlags

enum dawn::CIOCommon::EIOFlags
inherited

I/O common flags.

IO_FLAGS_NONE: No special flags - IO_FLAGS_TS: I/O supports timestamp (set in flags field of ObjectID).

Enumerator
IO_FLAGS_NONE 

No flags.

IO_FLAGS_TS 

Timestamp support flag.

Definition at line 73 of file common.hxx.

◆ EIONotifyType

Notifier type enumeration.

Enumerator
IO_NOTIFY_POLL 

Poll-based notifier (default)

IO_NOTIFY_STREAM 

Stream notifier (blocking read, one per IO)

Definition at line 221 of file common.hxx.

◆ EObjectState

Object operational state returned by getState()

Enumerator
STATE_STOPPED 

Object is stopped.

STATE_RUNNING 

Object is running.

Definition at line 32 of file object.hxx.

Member Function Documentation

◆ cfgCmnOffset()

size_t CIOCommon::cfgCmnOffset ( const SObjectCfg::SObjectCfgItem cfg)
protectedinherited

◆ cfgIdCmn()

static SObjectCfg::ObjectCfgId dawn::CIOCommon::cfgIdCmn ( bool  rw,
uint8_t  dtype,
uint8_t  size,
uint8_t  id 
)
inlinestaticinherited

Create ConfigID for I/O common configuration.

Constructs a configuration ID for I/O-specific configuration items.

Parameters
rwRead-write flag (false=read-only, true=read-write).
dtypeData type (DTYPE_UINT32, DTYPE_CHAR, etc.).
sizeConfiguration data size in 32-bit words.
idConfiguration identifier (0-31).
Returns
ConfigID value for use in configuration operations.

Definition at line 600 of file common.hxx.

References dawn::CIOCommon::IO_CLASS_ANY, dawn::SObjectCfg::objectCfg(), and dawn::SObjectId::OBJTYPE_IO.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cfgIdDevno()

static SObjectCfg::ObjectCfgId dawn::CIOCommon::cfgIdDevno ( bool  rw = false)
inlinestaticinherited

Create ConfigID for device number configuration.

Parameters
rwRead-write flag (default: false for read-only).
Returns
ConfigID for IO_CFG_DEVNO (DTYPE_UINT32, size=1).

Definition at line 616 of file common.hxx.

References dawn::CIOCommon::cfgIdCmn(), dawn::SObjectId::DTYPE_UINT32, and dawn::CIOCommon::IO_CFG_DEVNO.

Here is the call graph for this function:

◆ cfgIdLimitMax()

static SObjectCfg::ObjectCfgId dawn::CIOCommon::cfgIdLimitMax ( uint8_t  dtype,
uint16_t  size 
)
inlinestaticinherited

Create ConfigID for maximum I/O limits.

Parameters
dtypeLimit data type.
sizeLimit data size in 32-bit words.
Returns
ConfigID for IO_CFG_LIMIT_MAX.

Definition at line 642 of file common.hxx.

References dawn::CIOCommon::cfgIdCmn(), and dawn::CIOCommon::IO_CFG_LIMIT_MAX.

Here is the call graph for this function:

◆ cfgIdLimitMin()

static SObjectCfg::ObjectCfgId dawn::CIOCommon::cfgIdLimitMin ( uint8_t  dtype,
uint16_t  size 
)
inlinestaticinherited

Create ConfigID for minimum I/O limits.

Parameters
dtypeLimit data type.
sizeLimit data size in 32-bit words.
Returns
ConfigID for IO_CFG_LIMIT_MIN.

Definition at line 629 of file common.hxx.

References dawn::CIOCommon::cfgIdCmn(), and dawn::CIOCommon::IO_CFG_LIMIT_MIN.

Here is the call graph for this function:

◆ cfgIdLimitStep()

static SObjectCfg::ObjectCfgId dawn::CIOCommon::cfgIdLimitStep ( uint8_t  dtype,
uint16_t  size 
)
inlinestaticinherited

Create ConfigID for step I/O limits.

Parameters
dtypeLimit data type.
sizeLimit data size in 32-bit words.
Returns
ConfigID for IO_CFG_LIMIT_STEP.

Definition at line 655 of file common.hxx.

References dawn::CIOCommon::cfgIdCmn(), and dawn::CIOCommon::IO_CFG_LIMIT_STEP.

Here is the call graph for this function:

◆ cfgIdNotify()

static SObjectCfg::ObjectCfgId dawn::CIOCommon::cfgIdNotify ( bool  rw = false)
inlinestaticinherited

Create ConfigID for notifier configuration.

Parameters
rwRead-write flag (default: false for read-only).
Returns
ConfigID for IO_CFG_NOTIFY (DTYPE_UINT32, size=2).

Definition at line 667 of file common.hxx.

References dawn::CIOCommon::cfgIdCmn(), dawn::SObjectId::DTYPE_UINT32, and dawn::CIOCommon::IO_CFG_NOTIFY.

Here is the call graph for this function:

◆ configure()

virtual int dawn::CObject::configure ( )
inlinevirtualinherited

◆ ddata_alloc()

io_ddata_t * CIOCommon::ddata_alloc ( size_t  batch,
size_t  chunk_size = 0 
)
inherited

Allocate data buffer for this I/O.

Allocates memory for storing data from this I/O.

For seekable IOs chunk_size must be non-zero; the allocated buffer is capped to min(chunk_size, getDataSize()) bytes with T=1 (byte) and dtype=UINT8, suitable for partial reads/writes via getData/setData with offset. Passing chunk_size=0 for a seekable IO returns nullptr.

For non-seekable IOs chunk_size is ignored and the full IO data size is allocated as usual.

Parameters
batchNumber of data items to allocate space for (1 for single, >1 for batch).
chunk_sizeMaximum chunk size in bytes for seekable IOs (ignored for non-seekable IOs; 0 is invalid for seekable IOs).
Returns
Pointer to allocated io_ddata_t structure, nullptr on failure.

Definition at line 247 of file common.cxx.

References dawn::SObjectId::DTYPE_UINT8, dawn::CIOCommon::getDataDim(), dawn::CIOCommon::getDataSize(), dawn::CObject::getDtype(), dawn::CIOCommon::isSeekable(), and dawn::CIOCommon::isTimestamp().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deinit()

virtual int dawn::CObject::deinit ( )
inlinevirtualinherited

◆ descValidDefault()

int CObject::descValidDefault ( const uint32_t *  data,
size_t  len 
)
staticinherited

Default descriptor validation method.

Provides basic validation that only checks if descriptor lengths are correct.

Parameters
dataDescriptor data pointer.
lenLength of descriptor data in 32-bit words.
Returns
OK on success, negative error code indicating validation stage.

Definition at line 42 of file object.cxx.

References dawn::SObjectCfg::UObjectCfgId::s, dawn::SObjectCfg::UObjectCfgId::size, and dawn::SObjectCfg::UObjectCfgId::v.

Here is the caller graph for this function:

◆ doStart()

virtual int dawn::CObject::doStart ( )
inlineprotectedvirtualinherited

◆ doStop()

virtual int dawn::CObject::doStop ( )
inlineprotectedvirtualinherited

◆ getCfgFlag()

bool CObject::getCfgFlag ( ) const
inherited

Check if configuration flag is set.

Returns
True if this object has configuration data.

Definition at line 160 of file object.cxx.

References dawn::CDescObject::getSize().

Here is the call graph for this function:

◆ getCls()

uint16_t CObject::getCls ( ) const
inherited

Get object class field.

Returns
Object class identifier (0-511).

Definition at line 170 of file object.cxx.

References dawn::SObjectId::UObjectId::cls, and dawn::SObjectId::UObjectId::s.

Here is the caller graph for this function:

◆ getCmnDevno()

int dawn::CIOCommon::getCmnDevno ( ) const
inlineprotectedinherited

Get device number for this I/O.

Returns
Device number configured for this I/O.

Definition at line 798 of file common.hxx.

Here is the caller graph for this function:

◆ getConfig()

int dawn::CIOCommon::getConfig ( uint32_t  cfgid,
uint32_t *  data,
size_t  len 
)
inlineinherited

Get I/O configuration item.

Retrieves a configuration parameter for this I/O.

Parameters
cfgidConfiguration ID (e.g., IO_CFG_DEVNO, IO_CFG_LIMIT_MIN).
dataPointer to buffer for configuration data.
lenLength of buffer in 32-bit words.
Returns
OK on success, negative error code on failure.

Definition at line 567 of file common.hxx.

References dawn::CObject::getObjConfig().

Here is the call graph for this function:

◆ getData()

int dawn::CIOCommon::getData ( IODataCmn data,
size_t  len,
size_t  offset = 0 
)
inlineinherited

Get data from I/O (public interface with stats tracking).

For seekable IOs always calls getDataAtImpl() (handles both offset=0 and offset>0, copies min(buf_size, available) bytes). For non-seekable IOs calls getDataImpl() when offset=0; offset>0 returns -ENOTSUP.

Parameters
dataReference to IODataCmn structure to receive data.
lenNumber of data items to read (must be 1 for seekable IOs).
offsetByte offset for seekable IOs (0 for standard access).
Returns
OK on success, negative error code on failure.

Definition at line 353 of file common.hxx.

References dawn::CIOCommon::getDataAtImpl(), dawn::CIOCommon::getDataImpl(), and dawn::CIOCommon::isSeekable().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDataAtImpl()

virtual int dawn::CIOCommon::getDataAtImpl ( IODataCmn data,
size_t  len,
size_t  offset 
)
inlineprotectedvirtualinherited

Get data at byte offset (override in seekable IOs).

Called by getData() when offset > 0. Default returns -ENOTSUP. Seekable IOs override this to support partial reads. len must be 1; implementations should return -EINVAL otherwise.

Parameters
dataReference to IODataCmn buffer to receive data chunk.
lenNumber of items (must be 1 for seekable IOs).
offsetByte offset into IO data.
Returns
OK on success, -ENOTSUP if not supported, other negative on error.

Reimplemented in dawn::CIOCapabilities, dawn::CIODescriptor, and dawn::CIOFile.

Definition at line 755 of file common.hxx.

Here is the caller graph for this function:

◆ getDataDim()

size_t CIOSysinfo::getDataDim ( ) const
virtual

Get data vector dimension.

Returns the number of elements in a data item (e.g., 3 for XYZ accelerometer).

Returns
Number of data elements per item.

Implements dawn::CIOCommon.

Definition at line 25 of file sysinfo.cxx.

◆ getDataImpl()

int CIOSysinfo::getDataImpl ( IODataCmn data,
size_t  len 
)
virtual

Get data implementation (override in derived classes).

Parameters
dataReference to IODataCmn structure to receive data.
lenNumber of data items to read.
Returns
OK on success, -ENOTSUP if not supported, other negative on error.

Reimplemented from dawn::CIOCommon.

Definition at line 56 of file sysinfo.cxx.

References dawn::SObjectId::DTYPE_FLOAT, dawn::SObjectId::DTYPE_UB16, dawn::CObject::getCls(), dawn::IODataCmn::getDataPtr(), dawn::CObject::getDtype(), dawn::CIOCommon::IO_CLASS_SYSTEM_CPULOAD, and dawn::CIOCommon::IO_CLASS_SYSTEM_UPTIME.

Here is the call graph for this function:

◆ getDataSize()

size_t CIOSysinfo::getDataSize ( ) const
virtual

Get data size in bytes.

Returns the size of a single data item (without timestamp if present).

Returns
Size in bytes of one data item.

Implements dawn::CIOCommon.

Definition at line 135 of file sysinfo.cxx.

References dawn::CObject::getCls(), dawn::CIOCommon::IO_CLASS_SYSTEM_CPULOAD, and dawn::CIOCommon::IO_CLASS_SYSTEM_UPTIME.

Here is the call graph for this function:

◆ getDesc()

CDescObject & CObject::getDesc ( )
inherited

Get descriptor object for this object.

Returns
Reference to associated CDescObject.

Definition at line 190 of file object.cxx.

◆ getDtype()

uint8_t CObject::getDtype ( ) const
inherited

Get data type field.

Returns
Data type (DTYPE_UINT32, DTYPE_FLOAT, etc.).

Definition at line 175 of file object.cxx.

References dawn::SObjectId::UObjectId::dtype, and dawn::SObjectId::UObjectId::s.

Here is the caller graph for this function:

◆ getDtypeSize()

size_t CObject::getDtypeSize ( ) const
inherited

Get size of this object's data type.

Returns
Size in bytes for the configured data type.

Definition at line 195 of file object.cxx.

References dawn::SObjectId::getDtypeSize_(), and dawn::CDescObject::getObjectDtype().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFd()

virtual int dawn::CIOCommon::getFd ( ) const
inlinevirtualinherited

Get file descriptor for notifications.

Returns an fd for use with select/poll when descriptor changes.

Returns
Valid file descriptor (>=0) on success, -ENOTSUP if not supported.

Reimplemented in dawn::CIOAdcBase.

Definition at line 425 of file common.hxx.

◆ getFlags()

uint8_t CObject::getFlags ( ) const
inherited

Get type-specific flags field.

Returns
Flags value (0-3).

Definition at line 180 of file object.cxx.

References dawn::SObjectId::UObjectId::flags, and dawn::SObjectId::UObjectId::s.

Here is the caller graph for this function:

◆ getId()

SObjectId::UObjectId CObject::getId ( ) const
inherited

Get object identifier as union structure.

Returns
Reference to UObjectId structure.

Definition at line 150 of file object.cxx.

◆ getIdV()

SObjectId::ObjectId CObject::getIdV ( ) const
inherited

Get object identifier as raw 32-bit value.

Returns
ObjectID as uint32_t.

Definition at line 155 of file object.cxx.

References dawn::SObjectId::UObjectId::v.

Here is the caller graph for this function:

◆ getObjConfig()

int CObject::getObjConfig ( SObjectCfg::ObjectCfgId  objcfg,
uint32_t *  data,
size_t  len 
)
inherited

Get object configuration item.

Retrieves configuration data for this object.

Parameters
objcfgConfiguration ID specifying which config item to retrieve.
dataPointer to buffer for configuration data.
lenLength of buffer in 32-bit words.
Returns
OK on success, negative error code on failure.

Definition at line 240 of file object.cxx.

References dawn::SObjectCfg::SObjectCfgItem::data, dawn::SObjectCfg::objectCfgGetSize(), and dawn::CDescObject::objectCfgItemId().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPriv()

uint16_t CObject::getPriv ( ) const
inherited

Get instance/private data field.

Returns
Instance ID (0-16383).

Definition at line 185 of file object.cxx.

References dawn::SObjectId::UObjectId::priv, and dawn::SObjectId::UObjectId::s.

Here is the caller graph for this function:

◆ getState()

virtual EObjectState dawn::CObject::getState ( ) const
inlinevirtualinherited

Get current operational state.

Default returns STATE_RUNNING after successful start(), STATE_STOPPED otherwise. Objects with richer states (e.g. paused) should override.

Returns
Current EObjectState value.

Definition at line 183 of file object.hxx.

References dawn::CObject::STATE_RUNNING, and dawn::CObject::STATE_STOPPED.

◆ getTimestamp()

uint64_t CIOCommon::getTimestamp ( )
protectedinherited

Get current timestamp.

Returns
Current system timestamp in microseconds.

Definition at line 194 of file common.cxx.

Here is the caller graph for this function:

◆ getType()

uint8_t CObject::getType ( ) const
inherited

Get object type field.

Returns
Object type (OBJTYPE_IO, OBJTYPE_PROTO, OBJTYPE_PROG).

Definition at line 165 of file object.cxx.

References dawn::SObjectId::UObjectId::s, and dawn::SObjectId::UObjectId::type.

◆ hasThread()

virtual bool dawn::CObject::hasThread ( ) const
inlinevirtualinherited

Check if a background thread is active.

Used by Dawn's main loop to detect when clean exit is possible. Objects without a background thread must return false. Independent of operational state tracked via getState().

Returns
True if a background thread is active, false otherwise.

Reimplemented in dawn::CProgBitPack, dawn::CProgBitSplit, dawn::CProgBuffer, dawn::CProgCounter, dawn::CProgExpression, dawn::CProgIODemux, dawn::CProgIOMux, dawn::CProgManyToOne, dawn::CProgOneToMany, dawn::CProgProcess, dawn::CProgRedirect, dawn::CProgSampling, dawn::CProgSelector, dawn::CProgSequencer, dawn::CProgSwitch, dawn::CProgToggle, dawn::CProgVecPack, dawn::CProgVecSplit, dawn::CProtoCan, dawn::CProtoIpc, dawn::CProtoModbusRtu, dawn::CProtoModbusTcp, dawn::CProtoNimblePrph, dawn::CProtoNxscope, dawn::CProtoSerial, dawn::CProtoShellPretty, and dawn::CProtoUdp.

Definition at line 169 of file object.hxx.

◆ init()

int CIOSysinfo::init ( )
virtual

One-time initialize object after bindings are resolved.

Called once during framework setup after dependency binding. Allocate lifetime resources here (buffers, register maps, etc.).

Returns
OK on success, negative error code on failure.

Reimplemented from dawn::CObject.

Definition at line 13 of file sysinfo.cxx.

References dawn::SObjectId::DTYPE_FLOAT, dawn::SObjectId::DTYPE_UB16, dawn::CObject::getCls(), dawn::CObject::getDtype(), and dawn::CIOCommon::IO_CLASS_SYSTEM_CPULOAD.

Here is the call graph for this function:

◆ isBatch()

bool dawn::CIOSysinfo::isBatch ( ) const
inlinevirtual

Check if IO supports batch operations.

Returns
True if batch data reading/writing is supported, false otherwise.

Implements dawn::CIOCommon.

Definition at line 69 of file sysinfo.hxx.

◆ isNotify()

bool dawn::CIOSysinfo::isNotify ( ) const
inlinevirtual

Check if IO supports notifications.

Returns
True if notification callbacks are supported, false otherwise.

Implements dawn::CIOCommon.

Definition at line 64 of file sysinfo.hxx.

◆ isRead()

bool dawn::CIOSysinfo::isRead ( ) const
inlinevirtual

Check if IO supports read operations.

Returns
True if getData() is supported, false otherwise.

Implements dawn::CIOCommon.

Definition at line 54 of file sysinfo.hxx.

◆ isSeekable()

virtual bool dawn::CIOCommon::isSeekable ( ) const
inlinevirtualinherited

Check if IO supports partial (seekable) access.

When true, getData/setData with non-zero offset route to getDataAtImpl/setDataAtImpl. When false, offset > 0 returns -ENOTSUP.

Returns
True if seekable access is supported, false otherwise.

Reimplemented in dawn::CIOCapabilities, dawn::CIODescriptor, and dawn::CIOFile.

Definition at line 502 of file common.hxx.

Here is the caller graph for this function:

◆ isTimestamp()

bool CIOCommon::isTimestamp ( ) const
inherited

Check if I/O supports timestamp.

Returns true if this I/O has timestamp support (IO_FLAGS_TS flag is set).

Returns
True if timestamps are available with data, false otherwise.

Definition at line 189 of file common.cxx.

References dawn::CObject::getFlags(), and dawn::CIOCommon::IO_FLAGS_TS.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isWrite()

bool dawn::CIOSysinfo::isWrite ( ) const
inlinevirtual

Check if IO supports write operations.

Returns
True if setData() is supported, false otherwise.

Implements dawn::CIOCommon.

Definition at line 59 of file sysinfo.hxx.

◆ onSetObjConfig()

virtual int dawn::CObject::onSetObjConfig ( SObjectCfg::ObjectCfgId  objcfg,
uint32_t *  data,
size_t  len 
)
inlineprotectedvirtualinherited

Pre-update hook for runtime configuration writes.

Called by setObjConfig() before descriptor-backed storage is updated. Derived classes may validate incoming data and prepare/apply runtime side effects. Returning a negative error rejects the update.

Parameters
objcfgConfiguration ID that will be updated.
dataPointer to new config words.
lenNumber of config words.
Returns
OK on success, or negative error code to reject update.

Reimplemented in dawn::CIOAdcStream, dawn::CIOAdcSync, and dawn::CIOPwm.

Definition at line 386 of file object.hxx.

Here is the caller graph for this function:

◆ setConfig()

int dawn::CIOCommon::setConfig ( uint32_t  cfgid,
uint32_t *  data,
size_t  len 
)
inlineinherited

Set I/O configuration item.

Updates a configuration parameter for this I/O.

Parameters
cfgidConfiguration ID (e.g., IO_CFG_DEVNO, IO_CFG_LIMIT_MIN).
dataPointer to configuration data.
lenLength of data in 32-bit words.
Returns
OK on success, negative error code on failure.

Definition at line 583 of file common.hxx.

References dawn::CObject::setObjConfig().

Here is the call graph for this function:

◆ setData()

int dawn::CIOCommon::setData ( IODataCmn data,
size_t  offset = 0 
)
inlineinherited

Set data for I/O (public interface with stats tracking).

For seekable IOs always calls setDataAtImpl() (handles both offset=0 and offset>0). For non-seekable IOs calls setDataImpl() when offset=0; offset>0 returns -ENOTSUP.

Parameters
dataReference to IODataCmn structure containing data.
offsetByte offset for seekable IOs (0 for standard access).
Returns
OK on success, negative error code on failure.

Definition at line 392 of file common.hxx.

References dawn::CIOCommon::isSeekable(), dawn::CIOCommon::setDataAtImpl(), and dawn::CIOCommon::setDataImpl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDataAtImpl()

virtual int dawn::CIOCommon::setDataAtImpl ( IODataCmn data,
size_t  offset 
)
inlineprotectedvirtualinherited

Set data at byte offset (override in seekable IOs).

Called by setData() when offset > 0. Default returns -ENOTSUP. Seekable IOs override this to support partial writes.

Parameters
dataReference to IODataCmn buffer containing data chunk.
offsetByte offset into IO data.
Returns
OK on success, -ENOTSUP if not supported, other negative on error.

Reimplemented in dawn::CIODescriptor, and dawn::CIOFile.

Definition at line 774 of file common.hxx.

Here is the caller graph for this function:

◆ setDataImpl()

int CIOSysinfo::setDataImpl ( IODataCmn data)
virtual

Set data implementation (override in derived classes).

Parameters
dataReference to IODataCmn structure containing data.
Returns
OK on success, -ENOTSUP if not supported, other negative on error.

Reimplemented from dawn::CIOCommon.

Definition at line 128 of file sysinfo.cxx.

◆ setObjConfig()

int CObject::setObjConfig ( SObjectCfg::ObjectCfgId  objcfg,
uint32_t *  data,
size_t  len 
)
inherited

Set object configuration item.

Updates a configuration item for this object.

Parameters
objcfgConfiguration ID specifying which config item to update.
dataPointer to configuration data.
lenLength of configuration data in 32-bit words.
Returns
OK on success, negative error code on failure.

Definition at line 200 of file object.cxx.

References dawn::SObjectCfg::SObjectCfgItem::data, dawn::SObjectCfg::objectCfgGetRw(), dawn::SObjectCfg::objectCfgGetSize(), dawn::CDescObject::objectCfgItemId(), and dawn::CObject::onSetObjConfig().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ start()

int dawn::CObject::start ( )
inlineinherited

Start object.

Tracks operational state and calls doStart(). This phase may run many times during an object's lifetime and should not perform one-time allocation. Sets started on successful doStart() return.

Returns
OK on success, negative error code on failure.

Definition at line 116 of file object.hxx.

References dawn::CObject::doStart().

Here is the call graph for this function:

◆ stop()

int dawn::CObject::stop ( )
inlineinherited

Stop object.

Tracks operational state and calls doStop(). This phase may run many times during an object's lifetime and should not perform one-time deallocation. Always clears started regardless of doStop() return value.

Returns
OK on success, negative error code on failure.

Definition at line 145 of file object.hxx.

References dawn::CObject::doStop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ trigger()

virtual int dawn::CObject::trigger ( uint8_t  cmd)
inlinevirtualinherited

Execute a trigger command.

Parameters
cmdCommand identifier (EObjectCmd value).
Returns
OK on success, -ENOTSUP if not supported.

Reimplemented in dawn::CIOAdcFetch, dawn::CIOAdcStream, dawn::CIOAdcSync, dawn::CIOEncoder, dawn::CIOEncoderIndex, dawn::CIOPwm, dawn::CProgBuffer, dawn::CProgCounter, dawn::CProgProcess, dawn::CProgSequencer, dawn::CProgThresholdBase, and dawn::CProgToggle.

Definition at line 195 of file object.hxx.

◆ validateDesc()

int CObject::validateDesc ( const uint32_t *  desc,
size_t  len 
)
staticinherited

Validate entire descriptor.

Validates a descriptor binary object-by-object using default checks.

Parameters
descDescriptor binary pointer.
lenDescriptor length in 32-bit words.
Returns
OK on success, negative error code indicating validation stage.

Definition at line 123 of file object.cxx.

References dawn::CObject::descValidDefault().

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: