Fix get_temp_value for lwm2m-ipso-object example

Signed-off-by: Kiril Petrov <contiki@geomi.org>
This commit is contained in:
Kiril Petrov 2018-08-28 23:38:05 -07:00 committed by Kiril Petrov
parent 6ebdbf0675
commit e19e67b510

View File

@ -74,8 +74,8 @@ static lwm2m_status_t
get_temp_value(const ipso_sensor_t *s, int32_t *value) get_temp_value(const ipso_sensor_t *s, int32_t *value)
{ {
#ifdef IPSO_TEMPERATURE #ifdef IPSO_TEMPERATURE
if(IPSO_TEMPERATURE.read_value == NULL || if(IPSO_TEMPERATURE.read_value != NULL &&
IPSO_TEMPERATURE.read_value(value) != 0) { IPSO_TEMPERATURE.read_value(value) == 0) {
return LWM2M_STATUS_OK; return LWM2M_STATUS_OK;
} }
#endif /* IPSO_TEMPERATURE */ #endif /* IPSO_TEMPERATURE */