Skip to content

Commit 6afa88f

Browse files
committed
Merge pull request #80 from christiankerl/fix_device_identification
fix device identification
2 parents 9380f51 + 508137c commit 6afa88f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/protonect/src/libfreenect2.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ struct PrintBusAndDevice
107107

108108
std::ostream &operator<<(std::ostream &out, const PrintBusAndDevice& dev)
109109
{
110-
out << "@" << int(libusb_get_bus_number(dev.dev_)) << ":" << int(libusb_get_port_number(dev.dev_));
110+
out << "@" << int(libusb_get_bus_number(dev.dev_)) << ":" << int(libusb_get_device_address(dev.dev_));
111111
return out;
112112
}
113113

@@ -351,12 +351,12 @@ bool Freenect2DeviceImpl::isSameUsbDevice(libusb_device* other)
351351
if(state_ != Closed && usb_device_ != 0)
352352
{
353353
unsigned char bus = libusb_get_bus_number(usb_device_);
354-
unsigned char port = libusb_get_port_number(usb_device_);
354+
unsigned char address = libusb_get_device_address(usb_device_);
355355

356356
unsigned char other_bus = libusb_get_bus_number(other);
357-
unsigned char other_port = libusb_get_port_number(other);
357+
unsigned char other_address = libusb_get_device_address(other);
358358

359-
result = (bus == other_bus) && (port == other_port);
359+
result = (bus == other_bus) && (address == other_address);
360360
}
361361

362362
return result;

0 commit comments

Comments
 (0)