* [lm-sensors] [PATCH] sensors: add humidity data to output of sensors command
@ 2012-06-19 11:34 Iain Paton
2012-09-11 4:17 ` Guenter Roeck
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Iain Paton @ 2012-06-19 11:34 UTC (permalink / raw)
To: lm-sensors
Testing out a humidity sensor recently and was thinking the driver wasn't working somehow.
Discovered instead that the driver works fine, but the sensors command was ignoring the
humidity data.
This adds output of humidity data for sensors that support it.
Please consider applying it.
Thanks,
Iain
diff -Naur lm_sensors-3.3.2-org/prog/sensors/chips.c lm_sensors-3.3.2/prog/sensors/chips.c
--- lm_sensors-3.3.2-org/prog/sensors/chips.c 2012-03-07 16:12:56.000000000 +0000
+++ lm_sensors-3.3.2/prog/sensors/chips.c 2012-06-18 17:35:15.769803432 +0100
@@ -658,6 +658,27 @@
free(label);
}
+static void print_chip_humidity(const sensors_chip_name *name,
+ const sensors_feature *feature,
+ int label_size)
+{
+ char *label;
+ const sensors_subfeature *subfeature;
+ double vid;
+
+ subfeature = sensors_get_subfeature(name, feature,
+ SENSORS_SUBFEATURE_HUMIDITY_INPUT);
+ if (!subfeature)
+ return;
+
+ if ((label = sensors_get_label(name, feature))
+ && !sensors_get_value(name, subfeature->number, &vid)) {
+ print_label(label, label_size);
+ printf("%6.1f \%RH\n", vid);
+ }
+ free(label);
+}
+
static void print_chip_beep_enable(const sensors_chip_name *name,
const sensors_feature *feature,
int label_size)
@@ -792,6 +813,9 @@
case SENSORS_FEATURE_INTRUSION:
print_chip_intrusion(name, feature, label_size);
break;
+ case SENSORS_FEATURE_HUMIDITY:
+ print_chip_humidity(name, feature, label_size);
+ break;
default:
continue;
}
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [lm-sensors] [PATCH] sensors: add humidity data to output of sensors command
2012-06-19 11:34 [lm-sensors] [PATCH] sensors: add humidity data to output of sensors command Iain Paton
@ 2012-09-11 4:17 ` Guenter Roeck
2012-09-11 7:04 ` Jean Delvare
2012-09-11 19:06 ` Guenter Roeck
2 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2012-09-11 4:17 UTC (permalink / raw)
To: lm-sensors
Hi Jean,
On Tue, Jun 19, 2012 at 11:34:57AM +0000, Iain Paton wrote:
> Testing out a humidity sensor recently and was thinking the driver wasn't working somehow.
> Discovered instead that the driver works fine, but the sensors command was ignoring the
> humidity data.
> This adds output of humidity data for sensors that support it.
>
> Please consider applying it.
>
> Thanks,
> Iain
>
mind if I apply this patch to lm-sensors ?
Thanks,
Guenter
> diff -Naur lm_sensors-3.3.2-org/prog/sensors/chips.c lm_sensors-3.3.2/prog/sensors/chips.c
> --- lm_sensors-3.3.2-org/prog/sensors/chips.c 2012-03-07 16:12:56.000000000 +0000
> +++ lm_sensors-3.3.2/prog/sensors/chips.c 2012-06-18 17:35:15.769803432 +0100
> @@ -658,6 +658,27 @@
> free(label);
> }
>
> +static void print_chip_humidity(const sensors_chip_name *name,
> + const sensors_feature *feature,
> + int label_size)
> +{
> + char *label;
> + const sensors_subfeature *subfeature;
> + double vid;
> +
> + subfeature = sensors_get_subfeature(name, feature,
> + SENSORS_SUBFEATURE_HUMIDITY_INPUT);
> + if (!subfeature)
> + return;
> +
> + if ((label = sensors_get_label(name, feature))
> + && !sensors_get_value(name, subfeature->number, &vid)) {
> + print_label(label, label_size);
> + printf("%6.1f \%RH\n", vid);
> + }
> + free(label);
> +}
> +
> static void print_chip_beep_enable(const sensors_chip_name *name,
> const sensors_feature *feature,
> int label_size)
> @@ -792,6 +813,9 @@
> case SENSORS_FEATURE_INTRUSION:
> print_chip_intrusion(name, feature, label_size);
> break;
> + case SENSORS_FEATURE_HUMIDITY:
> + print_chip_humidity(name, feature, label_size);
> + break;
> default:
> continue;
> }
>
> _______________________________________________
> lm-sensors mailing list
> lm-sensors@lm-sensors.org
> http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
>
>
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [lm-sensors] [PATCH] sensors: add humidity data to output of sensors command
2012-06-19 11:34 [lm-sensors] [PATCH] sensors: add humidity data to output of sensors command Iain Paton
2012-09-11 4:17 ` Guenter Roeck
@ 2012-09-11 7:04 ` Jean Delvare
2012-09-11 19:06 ` Guenter Roeck
2 siblings, 0 replies; 4+ messages in thread
From: Jean Delvare @ 2012-09-11 7:04 UTC (permalink / raw)
To: lm-sensors
On Mon, 10 Sep 2012 21:17:27 -0700, Guenter Roeck wrote:
> Hi Jean,
>
> On Tue, Jun 19, 2012 at 11:34:57AM +0000, Iain Paton wrote:
> > Testing out a humidity sensor recently and was thinking the driver wasn't working somehow.
> > Discovered instead that the driver works fine, but the sensors command was ignoring the
> > humidity data.
> > This adds output of humidity data for sensors that support it.
> >
> > Please consider applying it.
> >
> > Thanks,
> > Iain
> >
> mind if I apply this patch to lm-sensors ?
Please do, I could never find the time to review or test it :(
--
Jean Delvare
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [lm-sensors] [PATCH] sensors: add humidity data to output of sensors command
2012-06-19 11:34 [lm-sensors] [PATCH] sensors: add humidity data to output of sensors command Iain Paton
2012-09-11 4:17 ` Guenter Roeck
2012-09-11 7:04 ` Jean Delvare
@ 2012-09-11 19:06 ` Guenter Roeck
2 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2012-09-11 19:06 UTC (permalink / raw)
To: lm-sensors
On Tue, Sep 11, 2012 at 09:04:00AM +0200, Jean Delvare wrote:
> On Mon, 10 Sep 2012 21:17:27 -0700, Guenter Roeck wrote:
> > Hi Jean,
> >
> > On Tue, Jun 19, 2012 at 11:34:57AM +0000, Iain Paton wrote:
> > > Testing out a humidity sensor recently and was thinking the driver wasn't working somehow.
> > > Discovered instead that the driver works fine, but the sensors command was ignoring the
> > > humidity data.
> > > This adds output of humidity data for sensors that support it.
> > >
> > > Please consider applying it.
> > >
> > > Thanks,
> > > Iain
> > >
> > mind if I apply this patch to lm-sensors ?
>
> Please do, I could never find the time to review or test it :(
>
Cleaned up a bit, tested, and committed.
Guenter
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-09-11 19:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-19 11:34 [lm-sensors] [PATCH] sensors: add humidity data to output of sensors command Iain Paton
2012-09-11 4:17 ` Guenter Roeck
2012-09-11 7:04 ` Jean Delvare
2012-09-11 19:06 ` Guenter Roeck
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.