1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-29 07:24:13 +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:
Mathieu Rondonneau 2013-05-28 12:59:46 -07:00
parent 854d976a7d
commit 74cc1315b4

View File

@ -171,6 +171,8 @@ int opHID_hidapi::open(int max, int vid, int pid, int usage_page, int usage)
if (devices_found) {
devices_found = 0;
// Go through the list until we can open one
// WARNING: for now this prevent to have device chained
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);
if (handle)
{
devices_found = 1 ;
break;
}
tmp_device_ptr = tmp_device_ptr->next;
}