mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-02 16:32:55 +00:00
Log warnings when LibusbUtils::GetDeviceList fails
This commit is contained in:
parent
91a7c4bdf2
commit
15cbb5c8f9
6 changed files with 25 additions and 13 deletions
|
@ -11,6 +11,7 @@
|
|||
#endif
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
#include "Core/LibusbUtils.h"
|
||||
|
||||
// Because opening and getting the device name from devices is slow, especially on Windows
|
||||
|
@ -45,13 +46,15 @@ std::map<std::pair<u16, u16>, std::string> GetInsertedDevices()
|
|||
if (!context.IsValid())
|
||||
return devices;
|
||||
|
||||
context.GetDeviceList([&](libusb_device* device) {
|
||||
const int ret = context.GetDeviceList([&](libusb_device* device) {
|
||||
libusb_device_descriptor descr;
|
||||
libusb_get_device_descriptor(device, &descr);
|
||||
const std::pair<u16, u16> vid_pid{descr.idVendor, descr.idProduct};
|
||||
devices[vid_pid] = GetDeviceName(vid_pid);
|
||||
return true;
|
||||
});
|
||||
if (ret != LIBUSB_SUCCESS)
|
||||
WARN_LOG_FMT(COMMON, "GetDeviceList failed: {}", LibusbUtils::ErrorWrap(ret));
|
||||
#endif
|
||||
|
||||
return devices;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue