Home2L - C/C++ API  v1.2-2-ga4fe (2023-04-15)
Smart Tools for a Private Home
List of all members
CBrownieSet Class Reference

Description

Set of Brownies

Definition at line 299 of file brownies.H.

#include "brownies.H"

Public Member Functions

Initialization / setting / getting ...
 CBrownieSet ()
 
 ~CBrownieSet ()
 
void Clear ()
 
CBrownieGet (const char *id)
 
CBrownieGet (int adr)
 Get a reference to the brownie for reading. To modify a brownie object, it must be first removed and then set again.
 
void Set (CBrownie *brownie)
 Add/Change brownie (takes ownership of CBrownie object).
 
CBrownieUnlink (int adr)
 Forget brownie and return it (caller becomes owner of CBrownie object).
 
void Del (int adr)
 Delete database entry.
 
Database file ...
bool ReadDatabase (const char *fileName=NULL)
 Read a database file. More...
 
bool WriteDatabase (const char *fileName=NULL)
 Write the set as a database file. More...
 
Resources ...

These methods are for use by the Brownie resource driver.

void ResourcesInit (CRcEventDriver *_rcDriver, class CBrownieLink *_rcLink)
 Register all resources and assign a driver and link to the Brownie set. More...
 
void ResourcesIterate (bool noLink=false, bool noSleep=false)
 Query Brownies and report any pending resource changes. More...
 
void ResourcesDone ()
 Forget about the driver / link and clean up all resources-related data. More...
 

Member Function Documentation

◆ ReadDatabase()

bool CBrownieSet::ReadDatabase ( const char *  fileName = NULL)

Read a database file.

Parameters
fileNameis the name of the database file relative to the etc domain (default: use 'br.config')

◆ WriteDatabase()

bool CBrownieSet::WriteDatabase ( const char *  fileName = NULL)

Write the set as a database file.

Parameters
fileNameis the name of the database file relative to PWD (default: use stdout)

◆ ResourcesInit()

void CBrownieSet::ResourcesInit ( CRcEventDriver _rcDriver,
class CBrownieLink _rcLink 
)

Register all resources and assign a driver and link to the Brownie set.

Parameters
_rcDriveris an CRcDriver object which must have been initialized before, usually with the driver name "brownies". This driver will be called to update resource changes, and its DriveValue() method should immediately call CBrownieSet::DriveValue().
_rcLinkis the link to be used for accessing the devices.

◆ ResourcesIterate()

void CBrownieSet::ResourcesIterate ( bool  noLink = false,
bool  noSleep = false 
)

Query Brownies and report any pending resource changes.

In detail, the following actions are typically performed:

  • Eventually sleep until 'br.minScanInterval' time has passed since the last invocation.
  • Query the "changed" registers of all primary hubs (fast mode).
  • Eventually pursue notifications from subnets (fast mode).
  • Iterate/update one or a few node completely (usually non-hub, but also hub).
Parameters
noLinkprohibits the use of the TWI link, to be used in maintenance mode to let the resources expire eventually.
noSleepprohibits sleeping, even if less than 'br.minScanInterval' ticks have passed since the last invocation

◆ ResourcesDone()

void CBrownieSet::ResourcesDone ( )

Forget about the driver / link and clean up all resources-related data.

This must be called from the drivers 'rcdStop' operation or after the driver was stopped. It is not allowed to call ResourcesDriverValue() or ResourcesIterate() after this.


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