Add the number of the USB port in the DeviceDesc structure (#18)
This commit is contained in:
@@ -28,6 +28,7 @@ type DeviceDesc struct {
|
|||||||
Bus int // The bus on which the device was detected
|
Bus int // The bus on which the device was detected
|
||||||
Address int // The address of the device on the bus
|
Address int // The address of the device on the bus
|
||||||
Speed Speed // The negotiated operating speed for the device
|
Speed Speed // The negotiated operating speed for the device
|
||||||
|
Port int // The usb port on which the device was detected
|
||||||
|
|
||||||
// Version information
|
// Version information
|
||||||
Spec BCD // USB Specification Release Number
|
Spec BCD // USB Specification Release Number
|
||||||
|
@@ -29,6 +29,7 @@ var fakeDevices = []fakeDevice{
|
|||||||
devDesc: &DeviceDesc{
|
devDesc: &DeviceDesc{
|
||||||
Bus: 1,
|
Bus: 1,
|
||||||
Address: 1,
|
Address: 1,
|
||||||
|
Port: 1,
|
||||||
Spec: Version(2, 0),
|
Spec: Version(2, 0),
|
||||||
Device: Version(1, 0),
|
Device: Version(1, 0),
|
||||||
Vendor: ID(0x9999),
|
Vendor: ID(0x9999),
|
||||||
@@ -72,6 +73,7 @@ var fakeDevices = []fakeDevice{
|
|||||||
devDesc: &DeviceDesc{
|
devDesc: &DeviceDesc{
|
||||||
Bus: 1,
|
Bus: 1,
|
||||||
Address: 2,
|
Address: 2,
|
||||||
|
Port: 2,
|
||||||
Spec: Version(2, 0),
|
Spec: Version(2, 0),
|
||||||
Device: Version(1, 3),
|
Device: Version(1, 3),
|
||||||
Vendor: ID(0x8888),
|
Vendor: ID(0x8888),
|
||||||
@@ -179,6 +181,7 @@ var fakeDevices = []fakeDevice{
|
|||||||
devDesc: &DeviceDesc{
|
devDesc: &DeviceDesc{
|
||||||
Bus: 1,
|
Bus: 1,
|
||||||
Address: 3,
|
Address: 3,
|
||||||
|
Port: 3,
|
||||||
Spec: Version(2, 0),
|
Spec: Version(2, 0),
|
||||||
Device: Version(1, 0),
|
Device: Version(1, 0),
|
||||||
Vendor: ID(0x1111),
|
Vendor: ID(0x1111),
|
||||||
|
@@ -230,6 +230,7 @@ func (libusbImpl) getDeviceDesc(d *libusbDevice) (*DeviceDesc, error) {
|
|||||||
dev := &DeviceDesc{
|
dev := &DeviceDesc{
|
||||||
Bus: int(C.libusb_get_bus_number((*C.libusb_device)(d))),
|
Bus: int(C.libusb_get_bus_number((*C.libusb_device)(d))),
|
||||||
Address: int(C.libusb_get_device_address((*C.libusb_device)(d))),
|
Address: int(C.libusb_get_device_address((*C.libusb_device)(d))),
|
||||||
|
Port: int(C.libusb_get_port_number((*C.libusb_device)(d))),
|
||||||
Speed: Speed(C.libusb_get_device_speed((*C.libusb_device)(d))),
|
Speed: Speed(C.libusb_get_device_speed((*C.libusb_device)(d))),
|
||||||
Spec: BCD(desc.bcdUSB),
|
Spec: BCD(desc.bcdUSB),
|
||||||
Device: BCD(desc.bcdDevice),
|
Device: BCD(desc.bcdDevice),
|
||||||
|
Reference in New Issue
Block a user