if (ch->enabled) {
analog.meaning->channels = g_slist_append(NULL, ch);
analog.meaning->mq = SR_MQ_TEMPERATURE;
- if (devc->temp_unit == 1)
+ if (devc->temp_unit == 1) {
analog.meaning->unit = SR_UNIT_FAHRENHEIT;
- else
+ analog.encoding->digits = 0;
+ analog.spec->spec_digits = 0;
+ } else {
analog.meaning->unit = SR_UNIT_CELSIUS;
+ analog.encoding->digits = 1;
+ analog.spec->spec_digits = 1;
+ }
analog.data = (void *)temp;
sr_session_send(sdi, &packet);
g_slist_free(analog.meaning->channels);
analog.meaning->channels = g_slist_append(NULL, ch);
analog.meaning->mq = SR_MQ_RELATIVE_HUMIDITY;
analog.meaning->unit = SR_UNIT_PERCENTAGE;
+ analog.encoding->digits = 1;
+ analog.spec->spec_digits = 1;
analog.data = (void *)rh;
sr_session_send(sdi, &packet);
g_slist_free(analog.meaning->channels);