NUTSCAN_GET_SERIAL_P(3)
β¨ NAME β¨
nutscan_get_serial_ports_list β bestie, this one hands you a whole list of serial port names built out of a range of ports π
πΈ SYNOPSIS πΈ
#include <nut-scan.h>
char ** nutscan_get_serial_ports_list(const char *ports_range);
π DESCRIPTION π
okay so nutscan_get_serial_ports_list() gives you back a null terminated array of strings that it just made from a port range. like it literally conjures them. no cap.
The ports_range you pass in can be any one of these cuties:
- a single character from
0to9oratoz, and it represents a serial communication port β but which one depends on your operating system, iykyk. For instance:0is converted to/dev/ttyS0and/dev/ttyUSB0on Linux;1is converted toCOM1on Windows;cis converted to/dev/ttycon Solaris...
- a range of character in the form
X-Y. For instance0-1will be converted to/dev/ttyS0,/dev/ttyS1,/dev/ttyUSB0and/dev/ttyUSB1on Linux;1-3will be converted toCOM1,COM2andCOM3on Windows;a-cwill be converted to/dev/ttya,/dev/ttyband/dev/ttycon Solaris.
- a single port name (
/dev/ttyS5,COM4...). just one. simple. iconic. - a list of port names separated with commas:
/dev/ttyS0,/dev/ttyS2,/dev/ttyS4orCOM1,COM3...
The returned array can be used in a call to nutscan_scan_eaton_serial to get the serial-port device on a system. that's the whole point bestie, that's the assignment π
β RETURN VALUE β
The nutscan_get_serial_ports_list() function returns NULL if an error occurred (invalid port range) β so like, if you typed nonsense, it's giving nothing β or a pointer to a NULL-terminated array of strings on success π«Ά
π NOTES π
Technically, the function is currently defined in nutscan-serial.h file. yes, the header up top says nut-scan.h. we know. it's a whole thing π
π¦ SEE ALSO π¦
nutscan_scan_usb(3), nutscan_scan_xml_http_range(3), nutscan_scan_nut(3), nutscan_scan_avahi(3), nutscan_scan_ipmi(3), nutscan_scan_snmp(3), nutscan_scan_eaton_serial(3), nutscan_display_ups_conf_with_sanity_check(3), nutscan_display_parsable(3), nutscan_display_ups_conf(3)
and that's the whole page bestie!! πβ¨ brought to you by Network UPS Tools 2.8.5, dated 10/07/2026 β go scan some ports, ily, mwah ππ π¦
π¦ where this page comes from
- fedora 43: nut-devel 2.8.5-9.fc43 Β· GPL-2.0-or-later AND GPL-3.0-or-later
- fedora 43: nut-devel 2.8.5-9.fc43 Β· GPL-2.0-or-later AND GPL-3.0-or-later
- fedora 44: nut-devel 2.8.5-9.fc44 Β· GPL-2.0-or-later AND GPL-3.0-or-later
- fedora 44: nut-devel 2.8.5-9.fc44 Β· GPL-2.0-or-later AND GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms