mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-22 02:32:36 +01:00
hid/ds4: add logging for PID and VID
This commit is contained in:
parent
92ae57c9ee
commit
da6d1d359c
@ -571,6 +571,7 @@ void ds4_pad_handler::check_add_device(hid_device* hidDevice, std::string_view p
|
||||
{
|
||||
hw_version = read_u32(&buf[35]);
|
||||
fw_version = read_u32(&buf[41]);
|
||||
ds4_log.notice("check_add_device: Got firmware version: hw_version: 0x%x, fw_version: 0x%x", hw_version, fw_version);
|
||||
}
|
||||
|
||||
if (hid_set_nonblocking(hidDevice, 1) == -1)
|
||||
|
@ -134,7 +134,11 @@ void hid_pad_handler<Device>::enumerate_devices()
|
||||
hid_device_info* head = dev_info;
|
||||
while (dev_info)
|
||||
{
|
||||
ensure(dev_info->path != nullptr);
|
||||
if (!dev_info->path)
|
||||
{
|
||||
hid_log.error("Skipping enumeration of device with empty path.");
|
||||
continue;
|
||||
}
|
||||
device_paths.insert(dev_info->path);
|
||||
serials[dev_info->path] = dev_info->serial_number ? std::wstring_view(dev_info->serial_number) : std::wstring_view{};
|
||||
dev_info = dev_info->next;
|
||||
@ -188,6 +192,15 @@ void hid_pad_handler<Device>::update_devices()
|
||||
hid_device* dev = hid_open_path(path.c_str());
|
||||
if (dev)
|
||||
{
|
||||
if (const hid_device_info* info = hid_get_device_info(dev))
|
||||
{
|
||||
hid_log.notice("%s adding device: vid=0x%x, pid=0x%x, serial='%s', path='%s'", m_type, info->vendor_id, info->product_id, m_enumerated_serials[path].data(), path);
|
||||
}
|
||||
else
|
||||
{
|
||||
hid_log.warning("%s adding device: vid=N/A, pid=N/A, serial='%s', path='%s'", m_type, m_enumerated_serials[path].data(), path);
|
||||
}
|
||||
|
||||
check_add_device(dev, path, m_enumerated_serials[path]);
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user