Home2L - C/C++ API v1.4-0-g38cc (2024-05-25)
Smart Tools for a Private Home
|
Set of Brownies
Definition at line 299 of file brownies.H.
#include "brownies.H"
Public Member Functions | |
Initialization / setting / getting ... | |
CBrownieSet () | |
~CBrownieSet () | |
void | Clear () |
CBrownie * | Get (const char *id) |
CBrownie * | Get (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). | |
CBrownie * | Unlink (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... | |
bool CBrownieSet::ReadDatabase | ( | const char * | fileName = NULL | ) |
Read a database file.
fileName | is the name of the database file relative to the etc domain (default: use 'br.config') |
bool CBrownieSet::WriteDatabase | ( | const char * | fileName = NULL | ) |
Write the set as a database file.
fileName | is the name of the database file relative to PWD (default: use stdout) |
void CBrownieSet::ResourcesInit | ( | CRcEventDriver * | _rcDriver, |
class CBrownieLink * | _rcLink | ||
) |
Register all resources and assign a driver and link to the Brownie set.
_rcDriver | is 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(). |
_rcLink | is the link to be used for accessing the devices. |
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:
noLink | prohibits the use of the TWI link, to be used in maintenance mode to let the resources expire eventually. |
noSleep | prohibits sleeping, even if less than 'br.minScanInterval' ticks have passed since the last invocation |
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.