1NUTSCAN_GET_SERIAL_P(3) NUT Manual NUTSCAN_GET_SERIAL_P(3)
2
3
4
6 nutscan_get_serial_ports_list - Get a port list name from a range of
7 port.
8
10 #include <nut-scan.h>
11
12 char ** nutscan_get_serial_ports_list(const char *ports_range);
13
15 The nutscan_get_serial_ports_list() function returns a null terminated
16 array of string generated from a port range. ports_range may be one of:
17
18 · a single character from 0 to 9 or a to z representing a serial
19 communication port depending on the operating system. For instance
20 "0" is converted to /dev/ttyS0 and /dev/ttyUSB0 on Linux; "1" is
21 converted to COM1 on Windows; "c" is converted to /dev/ttyc on
22 solaris...
23
24 · a range of character in the form "X-Y". For instance "0-1" will be
25 converted to /dev/ttyS0, /dev/ttyS1, /dev/ttyUSB0 and /dev/ttyUSB1
26 on Linux; "1-3" will be converted to COM1, COM2 and COM3 on
27 Windows; "a-c" will be converted to /dev/ttya, /dev/ttyb and
28 /dev/ttyc on Solaris.
29
30 · a single port name (/dev/ttyS5, COM4...).
31
32 · a list of port names separated with comas :
33 "/dev/ttyS0,/dev/ttyS2,/dev/ttyS4" or "COM1,COM3"...
34
35 The returned array can be used in a call to nutscan_scan_eaton_serial
36 to get the serial device on a system.
37
39 The nutscan_get_serial_ports_list() function returns NULL if an error
40 occured (invalid port range) or a pointer to a nll terminated array of
41 string on success.
42
44 nutscan_scan_usb(3), nutscan_scan_xml_http(3), nutscan_scan_nut(3),
45 nutscan_scan_avahi(3), nutscan_scan_ipmi(3), nutscan_scan_snmp(3),
46 nutscan_scan_eaton_serial(3), nutscan_display_parsable(3),
47 nutscan_display_ups_conf(3)
48
49
50
51Network UPS Tools 2.7.3. 03/02/2016 NUTSCAN_GET_SERIAL_P(3)