Library addition (sensors_get_detected_chips), program addition

(print detected chips)

Yes! I am getting somewhere now. The sensors program does at last something
visible: it prints all detected chips. OK, cat /proc/sys/dev/sensors/chips
is faster. But it is a start...


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@102 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Frodo Looijaard committed 1998-12-22 02:06:51 +00:00
1 parent 849acbe439
commit c9d9c6c682
3 files changed
+27

No files matched your search

+8
View File
@@ -206,3 +206,11 @@ int sensors_set_value(sensors_chip_name name, int feature, double value)
return -SENSORS_ERR_PROC;
return 0;
}
const sensors_chip_name *sensors_get_detected_chips (int *nr)
{
const sensors_chip_name *res;
res = *nr >= sensors_proc_chips_count?NULL:&sensors_proc_chips[*nr].name;
(*nr)++;
return res;
}
+7
View File
@@ -78,4 +78,11 @@ extern int sensors_get_feature(sensors_chip_name name, int feature,
extern int sensors_set_value(sensors_chip_name name, int feature,
double value);
/* This function returns all detected chips, one by one. To start at the
beginning of the list, use 0 for nr; NULL is returned if we are
at the end of the list. Do not try to change these chip names, as
they point to internal structures! Do not use nr for anything else. */
extern const sensors_chip_name *sensors_get_detected_chips(int *nr);
#endif /* def LIB_SENSORS_ERROR_H */