mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-25 18:35:17 +00:00
libusb: check result of scan_for_bt_endpoints
This commit is contained in:
parent
696b00c829
commit
6fc6dfec01
@ -967,7 +967,11 @@ static int usb_open(void){
|
||||
}
|
||||
|
||||
dev = libusb_get_device(aHandle);
|
||||
scan_for_bt_endpoints(dev);
|
||||
r = scan_for_bt_endpoints(dev);
|
||||
if (r < 0){
|
||||
usb_close();
|
||||
return -1;
|
||||
}
|
||||
|
||||
#else
|
||||
// Scan system for an appropriate devices
|
||||
@ -993,9 +997,18 @@ static int usb_open(void){
|
||||
if (!handle) continue;
|
||||
|
||||
r = prepare_device(handle);
|
||||
if (r < 0) continue;
|
||||
if (r < 0) {
|
||||
handle = NULL;
|
||||
continue;
|
||||
}
|
||||
|
||||
dev = devs[i];
|
||||
r = scan_for_bt_endpoints(dev);
|
||||
if (r < 0) {
|
||||
handle = NULL;
|
||||
continue;
|
||||
}
|
||||
|
||||
libusb_state = LIB_USB_INTERFACE_CLAIMED;
|
||||
break;
|
||||
};
|
||||
@ -1019,9 +1032,18 @@ static int usb_open(void){
|
||||
if (!handle) continue;
|
||||
|
||||
r = prepare_device(handle);
|
||||
if (r < 0) continue;
|
||||
if (r < 0) {
|
||||
handle = NULL;
|
||||
continue;
|
||||
}
|
||||
|
||||
dev = devs[deviceIndex];
|
||||
r = scan_for_bt_endpoints(dev);
|
||||
if (r < 0) {
|
||||
handle = NULL;
|
||||
continue;
|
||||
}
|
||||
|
||||
libusb_state = LIB_USB_INTERFACE_CLAIMED;
|
||||
break;
|
||||
}
|
||||
@ -1034,8 +1056,6 @@ static int usb_open(void){
|
||||
return -1;
|
||||
}
|
||||
|
||||
scan_for_bt_endpoints(dev);
|
||||
|
||||
#endif
|
||||
|
||||
// allocate transfer handlers
|
||||
|
Loading…
x
Reference in New Issue
Block a user