Home2L - C/C++ API  v1.2-2-ga4fe (2023-04-15)
Smart Tools for a Private Home
Classes | Enumerations | Functions | Variables
Host Library

Description

Linux host library to use and communicate with Brownies.

This module contains all functionality to access Home2L Brownies from Linux hosts. This includes the Resources driver functionality.

Notes

Threading

Unless specified otherwise, the methods in this module are not thread-safe. All actions related to certain a CBrownieSet or a CBrownieLink object or a combination thereof must originate from the same thread (called the "Brownie thread"), which does not necessarily have to be main UI thread.

Timers (CTimer) are not used in this module.

Collaboration diagram for Host Library:

Classes

class  CBrownie
 Representation of a Brownie device. More...
 
class  CBrownieSet
 Set of Brownies More...
 
class  CBrownieLink
 Brownie communication (TWI) link More...
 

Enumerations

enum  ETwiIfType { ifNone = 0 , ifSocket , ifI2cDev , ifElvI2c , ifEND }
 Brownie link interface type. More...
 

Functions

const char * BrStatusStr (EBrStatus s)
 Get a readable string for Brownie status codes.
 
const char * BrMcuStr (int mcuType, const char *unknown=NULL)
 Get a readable string (for example, "t84") for an MCU model ID (see BR_MCU_* macros). On error, the value passed by 'unkown' is returned.
 
int BrMcuFromStr (const char *mcuStr)
 Get the MCU model ID (see BR_MCU_* macros) from a string (for example, "t84"). On error, BR_MCU_NONE is returned.
 
uint32_t BrVersionGet (TBrFeatureRecord *featureRecord)
 Retrieve version from feature record.
 
static const char * BrVersionGetAsStr (CString *ret, TBrFeatureRecord *featureRecord)
 Get a readable string of the version fields of the feature record. The result is written to '*ret' and returned.
 
bool BrVersionFromStr (TBrFeatureRecord *featureRecord, const char *str)
 Set the version fields of the feature record according to the given version string.
 
const char * BrFeaturesToStr (CString *ret, TBrFeatureRecord *featureRecord)
 Get a readable string of the feature-related fields of the feature record. The result is written to '*ret' and returned.
 
bool BrFeaturesFromStr (TBrFeatureRecord *featureRecord, const char *str)
 Set the feature-related fields of the feature record according to the given string.
 

Variables

const char * envBrDatabaseFile
 Name of the selected database file (read-only).
 
const char * envBrLinkDev
 Name of the selected link device (read-only).
 

Enumeration Type Documentation

◆ ETwiIfType

enum ETwiIfType

Brownie link interface type.

Enumerator
ifNone 

(None)

ifSocket 

Unix domain socket (to connect to already running Brownie driver instance on the local machine)

ifI2cDev 

Linux i2c dev.

ifElvI2c 

ELV USB-i2c.

Definition at line 388 of file brownies.H.