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

Description

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).
 
TBrFeatureRecordFeatureRecord ()
 Get the feature record.
 
TBrConfigRecordConfigRecord ()
 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
 

Member Function Documentation

◆ SetFromStr()

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.

◆ UpdateFromDevice()

bool CBrownie::UpdateFromDevice ( class CBrownieLink link)

Read out device, check for compatibility, and update the feature record and config record on success.

Parameters
linkis the link, the address must be set appropriately before.
Returns
true on success; on failure, link->Status() may be called to determine if it was a link or a compatibility failure, in which case the link status would be brOk.

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