Home2L - C/C++ API v1.4-0-g38cc (2024-05-25)
Smart Tools for a Private Home
|
Representation of a Brownie device.
Definition at line 167 of file brownies.H.
#include "brownies.H"
Public Member Functions | |
Initialization / setting / getting ... | |
CBrownie () | |
~CBrownie () | |
void | Clear () |
void | SetId (const char *id) |
void | SetFeatureRecord (TBrFeatureRecord *_featureRecord) |
void | SetConfigRecord (TBrConfigRecord *_configRecord) |
void | SetDatabaseString (const char *s) |
bool | SetFromStr (const char *str, CString *ret=NULL) |
Set fields in the feature record or config record according to a text line in database string syntax. More... | |
const char * | ToStr (CString *ret, bool withIdentification=true, bool withVersionInfo=true) |
Return the contents of the feature record and the config record as a string in the database syntax. | |
Accessing fields ... | |
int | Adr () |
Get the TWI address of the Brownie. | |
const char * | Id () |
Get the ID record (a null-terminated string). | |
TBrFeatureRecord * | FeatureRecord () |
Get the feature record. | |
TBrConfigRecord * | ConfigRecord () |
Get the config record. | |
const char * | DatabaseString () |
Get options set in the database file as a string. | |
Validity status ... | |
bool | IsValid () |
Data is generally valid. | |
bool | HasFeatures () |
Feature record appears to be valid (either set from database or from device). | |
bool | HasDeviceFeatures () |
Feature record is valid and comes from the device. | |
bool | HasDeviceConfig () |
Config record is valid and comes from the device. | |
Compatibility and device checking ... | |
bool | IsCompatible (const char *_databaseString) |
Check if the current object, typically read back from a device, is compatible to the passed database string. | |
bool | UpdateFromDevice (class CBrownieLink *link) |
Read out device, check for compatibility, and update the feature record and config record on success. More... | |
Friends | |
class | CBrownieSet |
bool CBrownie::SetFromStr | ( | const char * | str, |
CString * | ret = NULL |
||
) |
Set fields in the feature record or config record according to a text line in database string syntax.
If 'ret' is != NULL, a string showing the values of all options mentioned in 'str' is returned. It is allowed to pass option names without assignment in 'str' in order to obtatin the values this way. On error, a warning is emitted and 'false' is returned.
bool CBrownie::UpdateFromDevice | ( | class CBrownieLink * | link | ) |
Read out device, check for compatibility, and update the feature record and config record on success.
link | is the link, the address must be set appropriately before. |