====== Scan for USB devices ====== ===== Synopsis ===== usbscan ===== Examples ===== === Scan for all USB devices === #!ipxe :scan usbscan addr || goto scan_done echo Found USB device ${addr:hex} goto scan :scan_done ===== Description ===== Scan the USB bus, starting from the USB bus:dev address in the specified setting, and store the USB bus:dev address of the next device in the specified setting. If the specified setting is empty, then the scan will start from the first USB device. If no further USB devices exist, the command will fail silently with an error status. ===== Command status ===== ^ Success | A USB device was found, and the bus:dev address was stored in the setting | ^ Failure | No further USB devices were found | ===== See also ===== * ''[[:cmd:ifstat]]'' * ''[[:cmd:goto]]'' * [[:cfg|List of all iPXE settings]] * [[:cmd|List of all iPXE commands]] ===== Build options ===== This command is available only when the build option ''[[:buildcfg:USB_CMD]]'' is enabled. ===== Notes ===== You can use the USB bus:dev address to extract information from USB descriptors. For example, to list the vendor and device IDs of all USB devices: #!ipxe :scan usbscan addr || goto scan_done echo ${addr:hex}: ${usb/${addr}.0.2}:${usb/${addr}.2.2} goto scan :scan_done