-
Notifications
You must be signed in to change notification settings - Fork 0
/
powerusb.1
105 lines (105 loc) · 2.86 KB
/
powerusb.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
.TH powerusb 1 2021-09-22 PowerUSB Users Guide
.SH NAME
powerusb \- Command line interface to the
.B PowerUSB
.I USB controlled
power strip.
.SH SYNOPSIS
powerusb [-devw] -p port [-s on/off]
.SH DESCRIPTION
This application provides a command line interface to the
.B libpowerusb
library. The port argument can be 1, 2 or 3. The -s value is case independent text of 'on' or 'off'.
The application will use the libusb-1.0.0 and libhid facilities to connect to the last found USB device
with the
.B VENDOR_ID
of
.I 0x04f8
and the
.B PRODUCT_ID
of
.I 0x003f.
.SH OPTIONS
.IP -d
Switch to default state manipulation instead of control of ports.
.IP -e
Use exit code to report state instead of string values printed.
.IP -v
Increase verbosity of detail printed.
-IP -D
Show debugging information.
.IP f
Get firmware version.
.IP m
Get device model information.
.IP "-p N"
Specify port number as N, 1, 2 or 3 must be provided.
.IP "-s on/off"
Specify state to set as default (-d also used) or as current state.
.IP -r
Reset onboard controller.
.IP -w
Open in windowing mode providing a curses interface to changing plug state
and observing inputs and outputs.
.IP "-R [watchdog reset interval]"
Configure Watchdog Reset period for power to remain off.
.IP "-W [watchdog period]"
Period of time for each watchdog petting operation.
.IP "-F [fail count]"
Set number of times the watchdog pet must fail before starting watchdog operations.
.SH EXIT STATUS
If the -e argument is specified than a 0 exit means off and a 1 exit means on.
An exit code of 2 always is used for errors.
.SH ENVIRONMENT
The libpowerusb.so library needs to be in the system library path, or you can use the LD_LIBRARY_PATH
environment variable to specify the directory it should be loaded from.
.SH FILES
The /etc/udev/rules.d directory will need a udev control rules file to specify permission changes
on the device files if a non-root user will be using this command.
.SH VERSIONS
This version is separate and incompatible with the PowerUSB released original Linux support.
.SH EXAMPLE
To change the default state of port 1 to on, you can use the following command line:
.PP
.RS 4
$ powerusb -d -p 1 -s on
.RE
.PP
To switch port 2 to on, the following command line is used.
.PP
.RS 4
$ powerusb -p 2 -s on
.RE
.PP
To see the current state of port 2, the following command line is used.
.PP
.RS 4
$ powerusb -p 2
On
.RE
.PP
To use the exit code to detect the current state of a port, use the -e command line argument.
A 0 exit code indicates off and a 1 exit code indicates on. The following shellscript could be
used to get the current state of the passed port number.
.RS 4
.PP
.PD 0
#!/bin/bash
.P
if powerusb -p $1 e; then
.P
echo "Port $1 is not on"
.P
else
.P
echo "Port $1 is on"
.P
fi
.PP
.RE
.SH AUTHORS
.PP
SeqTek LLC used the original distributed support for Linux to create this updated version.
.SH SEE ALSO
.B libusb-1.0.0(3),
.B libhid(3)