static enum hxb_error_code read(struct hxb_value* value) { if (read_humidity(&value->v_float)) { health_update(HE_HYT_BROKEN, 0); return HXB_ERR_SUCCESS; } else { health_update(HE_HYT_BROKEN, 1); return HXB_ERR_NO_VALUE; } }
/* * Instruct the DHT to begin sampling. Keep polling until it returns true. * The tempearture is in degrees Celsius, and the humidity is in %. */ bool DHT_nonblocking::measure( float *temperature, float *humidity ) { if( read_nonblocking( ) == true ) { *temperature = read_temperature( ); *humidity = read_humidity( ); return( true ); } else { return( false ); } }
static inline void read_child_node (GWeatherInfo *info, xmlNodePtr node) { if (strcmp ((char*) node->name, "symbol") == 0) read_symbol (info, node); else if (strcmp ((char*) node->name, "windDirection") == 0) read_wind_direction (info, node); else if (strcmp ((char*) node->name, "windSpeed") == 0) read_wind_speed (info, node); else if (strcmp ((char*) node->name, "temperature") == 0) read_temperature (info, node); else if (strcmp ((char*) node->name, "pressure") == 0) read_pressure (info, node); else if (strcmp ((char*) node->name, "humidity") == 0) read_humidity (info, node); }