'\" t
.\" Title: nutscan_scan_usb
.\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
.\" Generator: DocBook XSL Stylesheets vsnapshot
.\" Date: 06/21/2026
.\" Manual: NUT Manual
.\" Source: Network UPS Tools 2.8.5
.\" Language: English
.\"
.TH "NUTSCAN_SCAN_USB" "3" "06/21/2026" "Network UPS Tools 2\&.8\&.5" "NUT Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
nutscan_scan_usb \- Scan NUT compatible USB devices\&.
.SH "SYNOPSIS"
.sp
.nf
#include
nutscan_device_t * nutscan_scan_usb(nutscan_usb_t * scanopts);
.fi
.if n \{\
.sp
.\}
.RS 4
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBNote\fR
.ps -1
.br
.sp
Before libnutscan version 2\&.5\&.0 there was no argument:
.sp
.nf
nutscan_device_t * nutscan_scan_usb(void);
.fi
.sp
After the API update to have an argument, equivalent default activity can be achieved by passing NULL value for the argument\&.
.sp .5v
.RE
.SH "DESCRIPTION"
.sp
The \fBnutscan_scan_usb()\fR function tries to detect NUT compatible USB devices\&.
.sp
The scanopts argument contains toggles about values that would be reported into the generated device section\&. Currently they regard physical link details which can change over time (e\&.g\&. USB re\-enumeration due to software or hardware re\-connections); see nut\-scan\&.h for current details:
.sp
.if n \{\
.RS 4
.\}
.nf
/* USB scan options structure */
typedef struct nutscan_usb {
/* Hardware link related values below are not reliable for run\-time
* matching (they can change over time) but can be useful if e\&.g\&.
* "serial" is not available or unique */
int report_bus;
int report_busport;
int report_device;
/* The value is not currently used for device matching, but might be
* used later, and it is available from discovery */
int report_bcdDevice;
} nutscan_usb_t;
.fi
.if n \{\
.RE
.\}
.sp
You MUST call \fBnutscan_init\fR(3) before using this function\&.
.SH "RETURN VALUE"
.sp
The \fBnutscan_scan_usb()\fR function returns a pointer to a nutscan_device_t structure containing all found devices or NULL if an error occurs or no device is found\&.
.SH "SEE ALSO"
.sp
\fBnutscan_init\fR(3), \fBnutscan_scan_snmp\fR(3), \fBnutscan_scan_xml_http_range\fR(3), \fBnutscan_scan_nut\fR(3), \fBnutscan_scan_avahi\fR(3), \fBnutscan_scan_ipmi\fR(3), \fBnutscan_display_sanity_check\fR(3), \fBnutscan_display_sanity_check_serial\fR(3), \fBnutscan_display_ups_conf_with_sanity_check\fR(3), \fBnutscan_display_ups_conf\fR(3), \fBnutscan_display_parsable\fR(3), \fBnutscan_new_device\fR(3), \fBnutscan_free_device\fR(3), \fBnutscan_add_option_to_device\fR(3), \fBnutscan_add_device_to_device\fR(3), \fBnutscan_scan_eaton_serial\fR(3)