mirror of
https://github.com/eclipse/upm.git
synced 2025-03-15 04:57:30 +03:00
th02: throw exception(s) on fatal errors
Signed-off-by: Jon Trulson <jtrulson@ics.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
parent
f358b2e16d
commit
26317cbd2a
@ -55,8 +55,8 @@ TH02::getTemperature () {
|
||||
|
||||
/* Start a new temperature conversion */
|
||||
if (m_i2c.writeReg(TH02_REG_CONFIG, TH02_CMD_MEASURE_TEMP)) {
|
||||
cerr << __FUNCTION__ << "@" << __LINE__
|
||||
<< ": writeReg failed" << endl;
|
||||
throw std::runtime_error(std::string(__FUNCTION__) +
|
||||
": I2c.writeReg() failed");
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
@ -76,8 +76,8 @@ TH02::getHumidity () {
|
||||
|
||||
/* Start a new humidity conversion */
|
||||
if (m_i2c.writeReg(TH02_REG_CONFIG, TH02_CMD_MEASURE_HUMI)) {
|
||||
cerr << __FUNCTION__ << "@" << __LINE__
|
||||
<< ": writeReg failed" << endl;
|
||||
throw std::runtime_error(std::string(__FUNCTION__) +
|
||||
": I2c.writeReg() failed");
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user