Bug fix, open the correct device in hackrf_device_list_open

This commit is contained in:
Heikki Hannikainen
2015-02-24 01:25:58 +02:00
committed by Heikki Hannikainen
parent d10dd1945c
commit 893fef3fcf

View File

@ -485,7 +485,9 @@ int ADDCALL hackrf_device_list_open(hackrf_device_list_t *list, int idx, hackrf_
return HACKRF_ERROR_INVALID_PARAM;
}
if( libusb_open(list->usb_devices[idx], &usb_device) != 0 ) {
int i = list->usb_device_index[idx];
if( libusb_open(list->usb_devices[i], &usb_device) != 0 ) {
usb_device = NULL;
return HACKRF_ERROR_LIBUSB;
}