Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Commit

Permalink
feat: [linux] expose devnum and busnum
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Haase authored and MadLittleMods committed Jan 20, 2022
1 parent a0a2199 commit 2f82eb2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/detection_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ static ListResultItem_t* GetProperties(struct udev_device* dev, ListResultItem_t
}
item->vendorId = strtol(udev_device_get_sysattr_value(dev,"idVendor"), NULL, 16);
item->productId = strtol(udev_device_get_sysattr_value(dev,"idProduct"), NULL, 16);
item->deviceAddress = 0;
item->locationId = 0;
item->deviceAddress = strtol(udev_device_get_sysattr_value(dev,"devnum"), NULL, 10);
item->locationId = strtol(udev_device_get_sysattr_value(dev,"busnum"), NULL, 10);

return item;
}
Expand Down Expand Up @@ -317,8 +317,8 @@ static void BuildInitialDeviceList() {
if(udev_device_get_sysattr_value(dev,"serial") != NULL) {
item->deviceParams.serialNumber = udev_device_get_sysattr_value(dev, "serial");
}
item->deviceParams.deviceAddress = 0;
item->deviceParams.locationId = 0;
item->deviceParams.deviceAddress = strtol(udev_device_get_sysattr_value(dev,"devnum"), NULL, 10);
item->deviceParams.locationId = strtol(udev_device_get_sysattr_value(dev,"busnum"), NULL, 10);

item->deviceState = DeviceState_Connect;

Expand Down

0 comments on commit 2f82eb2

Please sign in to comment.