summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorYojiro Uo <yuo@cvs.openbsd.org>2012-09-20 20:11:59 +0000
committerYojiro Uo <yuo@cvs.openbsd.org>2012-09-20 20:11:59 +0000
commit862a65ad28ed788f381eaec33721df1ee8b6ee61 (patch)
tree6f03c3aec2b8c99104edb01384f26c9896b7f700 /sbin
parent0e23b6d7673107501af89200b19d0af5aea84086 (diff)
add more sensor types to sensor framework.
- Pressure (10^-3 Pa) - distance (10^-6 m) - acceleration (10^-6 m/s^2) ok deraadt@ reyk@
Diffstat (limited to 'sbin')
-rw-r--r--sbin/sysctl/sysctl.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c
index 0090989fc5e..076b0815d23 100644
--- a/sbin/sysctl/sysctl.c
+++ b/sbin/sysctl/sysctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysctl.c,v 1.183 2012/04/12 12:33:04 deraadt Exp $ */
+/* $OpenBSD: sysctl.c,v 1.184 2012/09/20 20:11:58 yuo Exp $ */
/* $NetBSD: sysctl.c,v 1.9 1995/09/30 07:12:50 thorpej Exp $ */
/*
@@ -2546,6 +2546,15 @@ print_sensor(struct sensor *s)
case SENSOR_ANGLE:
printf("%3.4f degrees", s->value / 1000000.0);
break;
+ case SENSOR_DISTANCE:
+ printf("%.2f mm", s->value / 1000.0);
+ break;
+ case SENSOR_PRESSURE:
+ printf("%.2f Pa", s->value / 1000.0);
+ break;
+ case SENSOR_ACCEL:
+ printf("%2.4f m/s^2", s->value / 1000000.0);
+ break;
default:
printf("unknown");
}