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

Common IO runtime limits container and validator. More...

#include <limits.hxx>

Public Types

enum  { CFG_LIMIT_MIN = 2 , CFG_LIMIT_MAX = 3 , CFG_LIMIT_STEP = 4 }
 Common IO limit configuration identifiers. More...
 

Public Member Functions

 CIOLimits ()
 Construct empty limits.
 
int bind (uint8_t id, uint8_t dtype, size_t words, const uint32_t *data)
 Bind one limit config item.
 
const uint32_t * getMax () const
 Get maximum limit words pointer.
 
const uint32_t * getMin () const
 Get minimum limit words pointer.
 
const uint32_t * getStep () const
 Get step limit words pointer.
 
size_t getWords () const
 Get configured limit array size in words.
 
bool isConfigured () const
 Check whether any limits are configured.
 
void reset ()
 Reset all configured limits.
 
int validate (const uint32_t *data, size_t words, uint8_t dtype) const
 Validate payload against configured limits.
 

Detailed Description

Common IO runtime limits container and validator.

Stores descriptor-backed min/max/step arrays and validates payload words against configured limits.

Definition at line 23 of file limits.hxx.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Common IO limit configuration identifiers.

Must match IO_CFG_*.

Enumerator
CFG_LIMIT_MIN 

Minimum limit words.

CFG_LIMIT_MAX 

Maximum limit words.

CFG_LIMIT_STEP 

Step limit words.

Definition at line 30 of file limits.hxx.

Member Function Documentation

◆ bind()

int CIOLimits::bind ( uint8_t  id,
uint8_t  dtype,
size_t  words,
const uint32_t *  data 
)
inline

Bind one limit config item.

No-op bind when IO limits feature is disabled.

Parameters
idLimit config ID (CFG_LIMIT_MIN/MAX/STEP).
dtypeConfig data type.
wordsNumber of uint32 words in limit array.
dataPointer to descriptor-backed limit words.
Returns
OK on success, negative error code on failure.

Definition at line 164 of file limits.hxx.

◆ validate()

int CIOLimits::validate ( const uint32_t *  data,
size_t  words,
uint8_t  dtype 
) const
inline

Validate payload against configured limits.

No-op validation when IO limits feature is disabled.

Parameters
dataPayload words.
wordsPayload size in uint32 words.
dtypePayload data type.
Returns
OK on success, negative error code on failure.

Definition at line 177 of file limits.hxx.

Here is the caller graph for this function:

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