Skip to content

Commit

Permalink
drivers/apc_modbus.c: _apc_modbus_usb_callback(): import USB device d…
Browse files Browse the repository at this point in the history
…etail printout from libusb1.c [#2609]

Signed-off-by: Jim Klimov <[email protected]>
  • Loading branch information
jimklimov committed Jan 29, 2025
1 parent c0a45c0 commit fbf6594
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions drivers/apc_modbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -1718,12 +1718,26 @@ static int _apc_modbus_usb_callback(const modbus_usb_device_t *device)

_apc_modbus_usb_lib_to_nut(device, &usbdevice);

upsdebugx(2, "- VendorID: %04x", usbdevice.VendorID);
upsdebugx(2, "- ProductID: %04x", usbdevice.ProductID);
upsdebugx(2, "- Manufacturer: %s", usbdevice.Vendor ? usbdevice.Vendor : "unknown");
upsdebugx(2, "- Product: %s", usbdevice.Product ? usbdevice.Product : "unknown");
upsdebugx(2, "- Serial Number: %s", usbdevice.Serial ? usbdevice.Serial : "unknown");
upsdebugx(2, "- Bus: %s", usbdevice.Bus ? usbdevice.Bus : "unknown");
#if (defined WITH_USB_BUSPORT) && (WITH_USB_BUSPORT)
upsdebugx(2, "- Bus Port: %s", usbdevice.BusPort ? usbdevice.BusPort : "unknown");
#endif
upsdebugx(2, "- Device: %s", usbdevice.Device ? usbdevice.Device : "unknown");
upsdebugx(2, "- Device release number: %04x", usbdevice.bcdDevice);

upsdebugx(2, "Trying to match device");
current_matcher = best_matcher;
upsdebugx(5, "%s: current_matcher=%p", __func__, (void*)current_matcher);
while (current_matcher != NULL) {
int ret = current_matcher->match_function(&usbdevice, current_matcher->privdata);
upsdebugx(5, "%s: Tried matcher %p returned %d", __func__, (void*)current_matcher, ret);
if (ret == 1) {
/* known good hit */
break;
}

Expand Down

0 comments on commit fbf6594

Please sign in to comment.