Jean Delvare
5b1068a007
Rename SENSORS_FEATURE_TEMP_SENS to SENSORS_FEATURE_TEMP_TYPE. This
...
better reflects what this feature is, in line with the sysfs file name.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4730 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-29 14:08:47 +00:00
Jean Delvare
38d1d82cec
Looking up a mapping can't fail if looking up the feature itself
...
succeeded (or that would be a bug in the library code.)
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4729 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-29 14:00:47 +00:00
Jean Delvare
2ee12591df
Remove "generic" from all printing function names. This is the default
...
mode now so no need to mention it explicitly.
Rename print_vid_info to print_chip_vid and move it around for
consistency.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4728 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 21:26:20 +00:00
Jean Delvare
984ebb419f
Fix a memory leak on error when printing an unknown chip.
...
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4727 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 21:20:55 +00:00
Jean Delvare
eaeaffb89b
Fix a memory leak on error in raw print mode.
...
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4726 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 21:14:37 +00:00
Jean Delvare
4e5d695411
Don't print the feature name for subfeatures in raw mode. Subfeatures
...
typically don't have a label so printing their label is equivalent
to printing their name, so printing it again is redundant.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4725 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 21:10:42 +00:00
Jean Delvare
deb41a945d
Move print_chip_raw() at the top of the file, as it is indepdendent from
...
all the other functions.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4724 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 20:55:36 +00:00
Jean Delvare
9fe77731a9
Fix error message in print_chip_raw().
...
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4723 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 20:52:24 +00:00
Jean Delvare
c575eb9f90
Fix error message in unknown chip printing routine.
...
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4722 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 20:48:36 +00:00
Jean Delvare
2c04e9e370
Avoid the conversions from double to float.
...
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4721 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 20:45:29 +00:00
Jean Delvare
60b2bafabd
Drop function get_feature_value, it wasn't adding much value.
...
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4720 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 20:41:53 +00:00
Jean Delvare
868fd8d093
Avoid the conversions from double to float.
...
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4719 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 20:41:03 +00:00
Jean Delvare
4716a8c8f1
Change print_temp_limits() to expose a sane interface. This lets us get
...
rid of arbitrary constants. Now we can reuse the same code to display
the extra temperature limits.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4718 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 20:37:15 +00:00
Jean Delvare
9da5883c98
Move the printing of the current temperature out of print_temp_info().
...
That way we don't need to use an arbitrary value to carry the fault
information.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4717 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 20:36:46 +00:00
Jean Delvare
02e4d6fe83
print_temp_info is only ever called with precision values of 1, so we
...
can hard-code this precision for improved performance.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4716 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 20:35:26 +00:00
Jean Delvare
2cc20c4487
Only consider the main features when computing how much room we need
...
to print the labels. This is both a fix (beforehand we would leave
enough room to print possibly long subfeature names, even though we
do not actually print subfeature names at all) and a significant
performance boost. This change alone shrinks the CPU cost of a sensors
run by 4.5%.
I am still worried that this feature causes us to allocate each label
string twice, but I guess this overhead is now acceptable.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4715 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 20:34:55 +00:00
Jean Delvare
f0f3df8a48
Labels do fit in the imparted space by construction now, so no need
...
to check.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4714 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 20:33:21 +00:00
Jean Delvare
7ba794d9ba
Clean up the global variables:
...
* do_sets, do_raw and hide_adapter are only used in main.c and could
thus be declared static.
* fahrenheit and degstr are used in chips.c as well, so they should be
declared in a header file.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4713 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 13:24:46 +00:00
Jean Delvare
55291db894
Reorder the functions so as to get rid of unneeded forward
...
declarations.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4712 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 13:22:28 +00:00
Jean Delvare
364bd24c44
config_file doesn't need to be a global. Also move the handling of
...
the configuration file in a single separate function for clarity.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4711 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 13:21:05 +00:00
Jean Delvare
c649ae5ac3
Merge chips_generic.c into chips.c. The boundary between both files was
...
only historical, and prevents us from doing a number of cleanups.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4710 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 12:19:07 +00:00
Jean Delvare
7268001a5d
libsensors no longer returns ignored features so no need to check for
...
this in applications anymore.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4709 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 11:45:46 +00:00
Jean Delvare
252c5faf86
Mass reindent and coding style cleanups.
...
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4708 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 10:57:16 +00:00
Jean Delvare
41a6e5b598
Executing the set statements is an exclusive action.
...
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4707 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 08:59:26 +00:00
Jean Delvare
c91457b7de
Executing the set statements is an exclusive action.
...
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4706 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 08:57:48 +00:00
Jean Delvare
5ba408a37f
Merge most of the usage help text into a single string. This is way
...
more efficient.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4705 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 08:43:30 +00:00
Jean Delvare
ec8ba95b53
Refactor the configuration file path.
...
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4704 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 08:42:20 +00:00
Jean Delvare
b8b417c51e
Thanks to the new prototype of sensors_get_detected_chips, we no
...
longer need to build an array from the chip names passed on the
command line. Instead, we can process them one after the other
directly. This saves some memory and allows for minor code cleanups.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4703 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 08:28:10 +00:00
Jean Delvare
a9a48ea2a9
Make sensors_match_chip internal to libsensors. It is no longer used by
...
applications in practice.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4702 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 08:26:51 +00:00
Jean Delvare
4d6bec8bb2
Add a parameter to sensors_get_detected_chips(), to optionally let the
...
caller select which subset of chips it wants. This is slightly better
size-wise than letting all applications do the filtering by themselves.
This will change the way the command line parameters of "sensors" are
interpreted. Beforehand, the chips were always returned in the order
in which they were listed by the library. Also, each chip could be listed
only once. From now on, the chips will be listed in the order in which
they are passed on the command line, which I think makes more sense. A
side effect is that chips can be listed more than once, if that's what
the user asks for. Not very useful though.
This change makes it possible to make sensors_match_chip() internal
to the library. Filtering the list of chips returned by
sensors_get_detected_chips() was the last known external use for this
function.
This patch looks much bigger than it really is, but the largest part is
really only code reindentation.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4701 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 08:26:20 +00:00
Jean Delvare
ff4cfd53d5
Delete file BUGS. All documented bugs are in kernel drivers so the
...
information no longer belongs to this package. Most of it seems to be
outdated anyway.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4700 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-25 11:49:07 +00:00
Jean Delvare
0c24a60643
Drop the CONFORMING TO sections from the man pages. lm-sensors is in no way
...
an official standard so it doesn't make much sense. Instead, use the 4th
field of .TH to mention that these tools are part of lm-sensors.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4699 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-23 08:14:48 +00:00
Jean Delvare
bf1ff10ab4
Relabel "sensors -u" from "unknown chip" to "raw chip". sensors uses generic
...
code to display all the chips now so the notion of "unknown chip" no longer
exists, however this raw output format can still be useful for debugging.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4698 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-23 07:45:58 +00:00
Jean Delvare
90c2942bef
Drop sensors option -U, --hide-unknown. libsensors no longer exposes
...
chips with no features, and it builds the features list dynamically, so
applications no longer get to see unknown chips.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4697 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-22 18:43:48 +00:00
Jean Delvare
a30d37899f
Drop SENSORS_MODE_NO_RW and SENSORS_MODE_RW. The mode is a bitfield,
...
we typically set, or test for, a specific bit.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4696 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-22 17:07:11 +00:00
Jean Delvare
b0fb417996
sensors_get_value() and sensors_set_value(), respectively.
...
The new names better reflect what the functions do.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4695 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-22 17:06:13 +00:00
Jean Delvare
8bcdc331a0
Change the prototype of sensors_get_label(). Errors can be reported
...
with a NULL pointer.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4694 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-22 17:05:01 +00:00
Jean Delvare
12655c1d85
Drop support for reloading the configuration with sensors_init().
...
Instead, the application will have to call sensors_exit() explicitly
before calling sensors_init() again. Most applications don't offer
any way to reload the configuration file, so better optimize for the
initial load.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4693 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-22 17:04:12 +00:00
Jean Delvare
fe165fea49
Fix error message.
...
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4692 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-21 09:08:52 +00:00
Jean Delvare
e6110c7e18
Fix error message.
...
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4691 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-21 09:07:32 +00:00
Jean Delvare
5741c56213
Contrary to what the comment says, sensors_proc_bus_count may be a
...
perfectly valid bus number. We need to use a different value for
chip configuration entries we want to ignore.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4690 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-19 15:27:14 +00:00
Jean Delvare
5524486161
Add support for hardware monitoring chips on SPI buses.
...
SPI bus statements in the configuration file are not yet supported, as
SPI buses don't have a name attribute yet, it's not possible to identify
them and thus no substitution is possible.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4689 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-19 15:07:05 +00:00
Jean Delvare
f1cc941e29
Contrary to what the comment says, sensors_proc_bus_count may be a
...
perfectly valid bus number. We need to use a different value for
chip configuration entries we want to ignore.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4688 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-19 15:05:52 +00:00
Jean Delvare
a74addb5d4
Support more bus types (part 2 of 2). Originally libsensors was very
...
i2c-centric. Make it more neutral so that we can cleanly support
additional bus types such as SPI or One-Wire.
This second part updates sensors_bus to use sensors_bus_id. Thanks
to Mark M. Hoffman for showing me how the configuration file
parser could be modified to support that change.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4687 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-19 15:04:29 +00:00
Jean Delvare
7ee15371df
Support more bus types (part 1 of 2). Originally libsensors was very
...
i2c-centric. Make it more neutral so that we can cleanly support
additional bus types such as SPI or One-Wire.
This first part introduces sensors_bus_id, and updates
sensors_chip_name to use it.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4686 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-19 15:03:50 +00:00
Jean Delvare
af2880326f
Drop chip names including dashes, as these are no longer supported.
...
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4685 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-19 14:18:52 +00:00
Jean Delvare
de4eca1ff7
Fix a broken comment.
...
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4684 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-18 06:58:33 +00:00
Jean Delvare
a692aed705
Fix a broken comment.
...
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4683 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-18 06:56:06 +00:00
Jean Delvare
4695755d89
Drop unneeded frees.
...
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4682 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-17 21:11:57 +00:00
Jean Delvare
557feb2696
Fix error message when a chip is specified on the command line
...
with no prefix and that chip isn't found.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4681 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-17 11:36:01 +00:00