Hubo Library
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Functions
1wire support

Functions

bool HuboLib::Get_1w_Devices (std::vector< std::string > &deviceList)
 Returns a list of 1wire devices found on the bus. More...
 
bool HuboLib::Is_DS18x20_Devices (const char *pSensorID)
 Check whether a 1wire device name refers to a DS18S20 or DS18B20 temperature sensor. More...
 
bool HuboLib::Get_DS18x20_Temperature (const char *pSensorID, double &temperature, bool &bCRC, long &t_duration_ms)
 Retrieve temperature, CRC value and the time that was required to read the temperature. More...
 

Detailed Description

Function Documentation

bool HuboLib::Get_1w_Devices ( std::vector< std::string > &  deviceList)

Returns a list of 1wire devices found on the bus.

Use this function to retrieve the list of 1wire devices found on the bus. This function uses the path to the devices as specified in the W1_Config class.

Parameters
deviceListVector holding a list of 1wire device names.
Returns
True if the path to the devices exist, false otherwise. That does however, not mean that a device has been found!
See also
For a simple example on how to use Get_1w_Devices() refer to the demo DS18x20.cpp.
Note
This call does not require a prior initialization of the library.
bool HuboLib::Get_DS18x20_Temperature ( const char *  pSensorID,
double &  temperature,
bool &  bCRC,
long &  t_duration_ms 
)

Retrieve temperature, CRC value and the time that was required to read the temperature.

Use this function to check a DS18S20 sensor for its temperature in degree Celsius. The CRC value determines whether the transmission from the sensor was correct. The duration that was needed to retrieve the temperature value might get some indication on the noise of the bus. Typically the value should be below one second.

Parameters
pSensorIDDevice name of sensor to retrieve the temperature from.
temperatureThe temperature of the sensor. Note that a value of plain 85.000 degree Celsius might refer to the power up default value and might not indicate a correct temperature!
bCRCThis value determines whether the transmission was correct or not.
t_duration_msThis is the time that was required to get the temperature from the sensor.
Returns
True if the device could be found, the temperature could be read and the CRC was correct.
See also
For a simple example on how to use Get_DS18x20_Temperature() refer to the demo DS18x20.cpp.
Note
This call does not require a prior initialization of the library.
bool HuboLib::Is_DS18x20_Devices ( const char *  pSensorID)

Check whether a 1wire device name refers to a DS18S20 or DS18B20 temperature sensor.

Use this function to check whether a 1wire device is kind of a temperature sensor DS18x20.

Parameters
pSensorIDDevice name to check.
Returns
True if the device is a temperature sensor, otherwise false.
See also
For a simple example on how to use Is_DS18x20_Devices() refer to the demo DS18x20.cpp.
Note
This call does not require a prior initialization of the library.