mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-30 08:24:11 +01:00
OP-958: only report the number of device we actually open successfully.
Limitation: only one (1) or zero (0) for now.
This commit is contained in:
parent
854d976a7d
commit
74cc1315b4
@ -171,6 +171,8 @@ int opHID_hidapi::open(int max, int vid, int pid, int usage_page, int usage)
|
|||||||
|
|
||||||
if (devices_found) {
|
if (devices_found) {
|
||||||
|
|
||||||
|
devices_found = 0;
|
||||||
|
|
||||||
// Go through the list until we can open one
|
// Go through the list until we can open one
|
||||||
// WARNING: for now this prevent to have device chained
|
// WARNING: for now this prevent to have device chained
|
||||||
tmp_device_ptr = current_device_ptr;
|
tmp_device_ptr = current_device_ptr;
|
||||||
@ -186,7 +188,10 @@ int opHID_hidapi::open(int max, int vid, int pid, int usage_page, int usage)
|
|||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if (handle)
|
if (handle)
|
||||||
|
{
|
||||||
|
devices_found = 1 ;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
tmp_device_ptr = tmp_device_ptr->next;
|
tmp_device_ptr = tmp_device_ptr->next;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user