mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 03:25:16 +00:00
DS3: fix report size check.
The Report size seems to be generic here, so let's only check if anything got returned at all.
This commit is contained in:
parent
2a1e3b2b77
commit
7235647e67
1 changed files with 2 additions and 2 deletions
|
@ -279,13 +279,13 @@ void ds3_pad_handler::check_add_device(hid_device* hidDevice, std::string_view p
|
|||
buf[0] = 0xF2;
|
||||
|
||||
int res = hid_get_feature_report(hidDevice, buf.data(), buf.size());
|
||||
if (res != static_cast<int>(buf.size()) || buf[0] != 0xF2)
|
||||
if (res <= 0 || buf[0] != 0xF2)
|
||||
{
|
||||
ds3_log.warning("check_add_device: hid_get_feature_report 0xF2 failed! Trying again with 0x0. (result=%d, buf[0]=0x%x, error=%s)", res, buf[0], hid_error(hidDevice));
|
||||
buf = {};
|
||||
buf[0] = 0x0;
|
||||
res = hid_get_feature_report(hidDevice, buf.data(), buf.size());
|
||||
if (res != static_cast<int>(buf.size()) || buf[0] != 0x0)
|
||||
if (res <= 0 || buf[0] != 0x0)
|
||||
{
|
||||
ds3_log.error("check_add_device: hid_get_feature_report 0x0 failed! result=%d, buf[0]=0x%x, error=%s", res, buf[0], hid_error(hidDevice));
|
||||
hid_close(hidDevice);
|
||||
|
|
Loading…
Add table
Reference in a new issue