4 #include "../hubolib.h"
25 vector <string> devList;
27 printf (
"DS18x20 demo. Press Stg-C to exit.\n");
46 for (
int i=0; i<devList.size(); i++)
49 printf (
"%02d. %s: ", i+1, devList[i].c_str());
56 printf (
"Result=%s ", bResult?
"true":
"false");
57 printf (
"bCRC=%s ", bCRC?
"true":
"false");
58 printf (
"temp=%lf duration=%ld\n", temperature, t_duration_ms);
bool Is_DS18x20_Devices(const char *pSensorID)
Check whether a 1wire device name refers to a DS18S20 or DS18B20 temperature sensor.
bool 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.
bool Get_1w_Devices(std::vector< std::string > &deviceList)
Returns a list of 1wire devices found on the bus.
void PrintTemperatureInfo(vector< string > &devList)