2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-08-31 06:15:15 +00:00

Add support for the standard beep_enable attribute (#2248).

git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4766 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare
2007-09-05 12:28:31 +00:00
parent 3c53f5fa85
commit 29bea1e843
4 changed files with 37 additions and 4 deletions

View File

@@ -390,6 +390,20 @@ static void print_chip_vid(const sensors_chip_name *name, int f_vid,
free(label);
}
static void print_chip_beep_enable(const sensors_chip_name *name, int f_beep,
int label_size)
{
char *label;
double beep_enable;
if ((label = sensors_get_label(name, f_beep))
&& !sensors_get_value(name, f_beep, &beep_enable)) {
print_label(label, label_size);
printf("%s\n", beep_enable ? "enabled" : "disabled");
}
free(label);
}
void print_chip(const sensors_chip_name *name)
{
const sensors_feature_data *feature;
@@ -415,6 +429,10 @@ void print_chip(const sensors_chip_name *name)
case SENSORS_FEATURE_VID:
print_chip_vid(name, feature->number, label_size);
break;
case SENSORS_FEATURE_BEEP_ENABLE:
print_chip_beep_enable(name, feature->number,
label_size);
break;
default:
continue;
}