Merge branch 'develop' into missing-header
This commit is contained in:
commit
36e1a8f82d
@ -205,7 +205,7 @@ notify_ready(void *not_used)
|
|||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
/**
|
/**
|
||||||
* \brief Returns a reading from the sensor
|
* \brief Returns a reading from the sensor
|
||||||
* \param type HDC_1000_SENSOR_TYPE_TEMP or HDC_1000_SENSOR_TYPE_HUMIDITY
|
* \param type HDC_1000_SENSOR_TYPE_TEMP or HDC_1000_SENSOR_TYPE_HUMID
|
||||||
* \return Temperature (centi degrees C) or Humidity (centi %RH)
|
* \return Temperature (centi degrees C) or Humidity (centi %RH)
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
@ -221,7 +221,7 @@ value(int type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if((type != HDC_1000_SENSOR_TYPE_TEMP) &&
|
if((type != HDC_1000_SENSOR_TYPE_TEMP) &&
|
||||||
type != HDC_1000_SENSOR_TYPE_HUMIDITY) {
|
type != HDC_1000_SENSOR_TYPE_HUMID) {
|
||||||
PRINTF("Invalid type\n");
|
PRINTF("Invalid type\n");
|
||||||
return CC26XX_SENSOR_READING_ERROR;
|
return CC26XX_SENSOR_READING_ERROR;
|
||||||
} else {
|
} else {
|
||||||
@ -231,7 +231,7 @@ value(int type)
|
|||||||
|
|
||||||
if(type == HDC_1000_SENSOR_TYPE_TEMP) {
|
if(type == HDC_1000_SENSOR_TYPE_TEMP) {
|
||||||
rv = (int)(temp * 100);
|
rv = (int)(temp * 100);
|
||||||
} else if(type == HDC_1000_SENSOR_TYPE_HUMIDITY) {
|
} else if(type == HDC_1000_SENSOR_TYPE_HUMID) {
|
||||||
rv = (int)(hum * 100);
|
rv = (int)(hum * 100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
* and latch them. It will then generate a sensors_changed event.
|
* and latch them. It will then generate a sensors_changed event.
|
||||||
*
|
*
|
||||||
* The user can then retrieve readings by calling .value() and by passing
|
* The user can then retrieve readings by calling .value() and by passing
|
||||||
* either HDC_1000_SENSOR_TYPE_TEMP or HDC_1000_SENSOR_TYPE_HUMIDITY as the
|
* either HDC_1000_SENSOR_TYPE_TEMP or HDC_1000_SENSOR_TYPE_HUMID as the
|
||||||
* argument. Multiple calls to value() will not trigger new readings, they will
|
* argument. Multiple calls to value() will not trigger new readings, they will
|
||||||
* simply return the most recent latched values.
|
* simply return the most recent latched values.
|
||||||
*
|
*
|
||||||
@ -65,7 +65,7 @@
|
|||||||
#include "lib/sensors.h"
|
#include "lib/sensors.h"
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
#define HDC_1000_SENSOR_TYPE_TEMP 1
|
#define HDC_1000_SENSOR_TYPE_TEMP 1
|
||||||
#define HDC_1000_SENSOR_TYPE_HUMIDITY 2
|
#define HDC_1000_SENSOR_TYPE_HUMID 2
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
/**
|
/**
|
||||||
* \name HDC1000 driver states
|
* \name HDC1000 driver states
|
||||||
|
@ -77,7 +77,7 @@ read_temp_value(const ipso_sensor_t *s, int32_t *value)
|
|||||||
static lwm2m_status_t
|
static lwm2m_status_t
|
||||||
read_hum_value(const ipso_sensor_t *s, int32_t *value)
|
read_hum_value(const ipso_sensor_t *s, int32_t *value)
|
||||||
{
|
{
|
||||||
*value = 10 * hdc_1000_sensor.value(HDC_1000_SENSOR_TYPE_HUMIDITY);
|
*value = 10 * hdc_1000_sensor.value(HDC_1000_SENSOR_TYPE_HUMID);
|
||||||
return LWM2M_STATUS_OK;
|
return LWM2M_STATUS_OK;
|
||||||
}
|
}
|
||||||
/* Lux reading */
|
/* Lux reading */
|
||||||
|
@ -203,7 +203,7 @@ get_hdc_reading()
|
|||||||
printf("HDC: Temp Read Error\n");
|
printf("HDC: Temp Read Error\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
value = hdc_1000_sensor.value(HDC_1000_SENSOR_TYPE_HUMIDITY);
|
value = hdc_1000_sensor.value(HDC_1000_SENSOR_TYPE_HUMID);
|
||||||
if(value != CC26XX_SENSOR_READING_ERROR) {
|
if(value != CC26XX_SENSOR_READING_ERROR) {
|
||||||
printf("HDC: Humidity=%d.%02d %%RH\n", value / 100, value % 100);
|
printf("HDC: Humidity=%d.%02d %%RH\n", value / 100, value % 100);
|
||||||
} else {
|
} else {
|
||||||
|
@ -636,7 +636,7 @@ get_hdc_reading()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(hdc_hum_reading.publish) {
|
if(hdc_hum_reading.publish) {
|
||||||
value = hdc_1000_sensor.value(HDC_1000_SENSOR_TYPE_HUMIDITY);
|
value = hdc_1000_sensor.value(HDC_1000_SENSOR_TYPE_HUMID);
|
||||||
if(value != CC26XX_SENSOR_READING_ERROR) {
|
if(value != CC26XX_SENSOR_READING_ERROR) {
|
||||||
hdc_hum_reading.raw = value;
|
hdc_hum_reading.raw = value;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user