Merge pull request #633 from retfie/lwm2m-ipso-object

Fix get_temp_value for lwm2m-ipso-object example
This commit is contained in:
Joakim Eriksson 2018-08-30 13:07:10 +02:00 committed by GitHub
commit ee8fccb70a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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