Make apm(8) understand AC Line state 2 as "backup power".
Submitted by: liamfoy@sepulcrum.org
This commit is contained in:
parent
5a8d0950c1
commit
b3d2f94ea7
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=146812
@ -49,10 +49,12 @@ per line in the order given here.
|
|||||||
.It Fl a
|
.It Fl a
|
||||||
Display the current AC-line status as an integer value.
|
Display the current AC-line status as an integer value.
|
||||||
The values
|
The values
|
||||||
0 and 1 correspond to the
|
0, 1 and 2 correspond to the
|
||||||
.Dq off-line
|
.Dq off-line
|
||||||
state or
|
state,
|
||||||
.Dq on-line
|
.Dq on-line
|
||||||
|
state or
|
||||||
|
.Dq backup power
|
||||||
state, respectively.
|
state, respectively.
|
||||||
.It Fl b
|
.It Fl b
|
||||||
Display an integer value reflecting the current battery status.
|
Display an integer value reflecting the current battery status.
|
||||||
|
@ -195,14 +195,14 @@ print_all_info(int fd, apm_info_t aip, int bioscall_available)
|
|||||||
{
|
{
|
||||||
struct apm_bios_arg args;
|
struct apm_bios_arg args;
|
||||||
int apmerr;
|
int apmerr;
|
||||||
const char *line_msg[] = { "off-line", "on-line" };
|
const char *line_msg[] = { "off-line", "on-line" , "backup power"};
|
||||||
|
|
||||||
printf("APM version: %d.%d\n", aip->ai_major, aip->ai_minor);
|
printf("APM version: %d.%d\n", aip->ai_major, aip->ai_minor);
|
||||||
printf("APM Management: %s\n", aip->ai_status ? "Enabled" : "Disabled");
|
printf("APM Management: %s\n", aip->ai_status ? "Enabled" : "Disabled");
|
||||||
printf("AC Line status: ");
|
printf("AC Line status: ");
|
||||||
if (aip->ai_acline == APM_UNKNOWN)
|
if (aip->ai_acline == APM_UNKNOWN)
|
||||||
printf("unknown\n");
|
printf("unknown\n");
|
||||||
else if (aip->ai_acline > 1)
|
else if (aip->ai_acline > 2)
|
||||||
printf("invalid value (0x%x)\n", aip->ai_acline);
|
printf("invalid value (0x%x)\n", aip->ai_acline);
|
||||||
else
|
else
|
||||||
printf("%s\n", line_msg[aip->ai_acline]);
|
printf("%s\n", line_msg[aip->ai_acline]);
|
||||||
|
Loading…
Reference in New Issue
Block a user