mirror of
https://github.com/lm-sensors/lm-sensors
synced 2025-10-09 14:05:59 +00:00
Unknown chip support
Some basic support, in the form of sensors_get_all_features(), for chips that are known to the library, but unknown to the application. prog/sensors has a demo of how to use this, in function print_unknown_chip in chips.c. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@110 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#define SENSORS_CHIP_NAME_BUS_ANY_I2C -3
|
||||
#define SENSORS_CHIP_NAME_ADDR_ANY -1
|
||||
|
||||
/* A chip name is encoded is in this structure */
|
||||
typedef struct sensors_chip_name {
|
||||
char *prefix;
|
||||
int bus;
|
||||
@@ -80,7 +81,7 @@ extern int sensors_get_feature(sensors_chip_name name, int feature,
|
||||
|
||||
/* Set the value of a feature of a certain chip. Note that chip should not
|
||||
contain wildcard values! This function will return 0 on success, and <0
|
||||
on failure. */
|
||||
on failure. BUGGY! */
|
||||
extern int sensors_set_feature(sensors_chip_name name, int feature,
|
||||
double value);
|
||||
|
||||
@@ -91,4 +92,35 @@ extern int sensors_set_feature(sensors_chip_name name, int feature,
|
||||
extern const sensors_chip_name *sensors_get_detected_chips(int *nr);
|
||||
|
||||
|
||||
/* These defines are used in the mode field of sensors_feature_data */
|
||||
#define SENSORS_MODE_NO_RW 0
|
||||
#define SENSORS_MODE_R 1
|
||||
#define SENSORS_MODE_W 2
|
||||
#define SENSORS_MODE_RW 3
|
||||
|
||||
/* This define is used in the mapping field of sensors_feature_data if no
|
||||
mapping is available */
|
||||
#define SENSORS_NO_MAPPING -1
|
||||
|
||||
/* This structure is used when you want to get all features of a specific
|
||||
chip. */
|
||||
typedef struct sensors_feature_data {
|
||||
int number;
|
||||
const char *name;
|
||||
int mapping;
|
||||
int unused;
|
||||
int mode;
|
||||
} sensors_feature_data;
|
||||
|
||||
/* This returns all features of a specific chip. They are returned in
|
||||
bunches: everything with the same mapping is returned just after each
|
||||
other, with the master feature in front (that feature does not map to
|
||||
itself, but has SENSORS_NO_MAPPING as mapping field). nr1 and nr2 are
|
||||
two internally used variables. Set both to zero to start again at the
|
||||
begin of the list. If no more features are found NULL is returned.
|
||||
Do not try to change the returned structure; you will corrupt internal
|
||||
data structures. */
|
||||
extern const sensors_feature_data *sensors_get_all_features
|
||||
(sensors_chip_name name, int *nr1,int *nr2);
|
||||
|
||||
#endif /* def LIB_SENSORS_ERROR_H */
|
||||
|
Reference in New Issue
Block a user