devel/libusb

devel/libusb might be a platform independant method for accessing the APC USB. But we can't seem to get it to do anything. Even the test program refuses to output anything useful. On both FreeBSD -stable and -current, we get nothing:

[dan@polo:~/APC-UPS-USB/libusb/work/libusb-0.1.7] $ sudo tests/testlibusb
bus/device  idVendor/idProduct

Adding debugging code to bsd.c shows this:

$ sudo tests/testlibusb
usb_set_debug: Setting debugging level to 999 (on)
usb_os_find_busses: Found /dev/usb0
OPENING /dev/usb0
found device uhub0
usb_os_find_devices: couldn't open device /dev/uhub0: No such file or directory
device filename is /dev/uhub0
we got an error: 9
usb_os_find_devices: Found /dev/uhub0 on /dev/usb0
found device uhid0
device filename is /dev/uhid0
we got an error: 22
usb_os_find_devices: Found /dev/uhid0 on /dev/usb0
bus/device  idVendor/idProduct
This call
if (ioctl(dfd, USB_GET_DEVICE_DESC, &dev->descriptor) < 0) {
is failing. Why? We don't know. We have sent email to the libusb development list.

Right now, it looks like devel/libusb may not be the way to go.