45 auto sts = libusb_open(device, &
_handle);
46 if(sts != LIBUSB_SUCCESS)
49 std::stringstream msg;
50 msg <<
"failed to open usb interface: " << (int)interface->get_number() <<
", error: " <<
usb_status_to_string.at(rs_sts);
52 throw std::runtime_error(msg.str());
56 for(
auto&&
i : interface->get_associated_interfaces())
66 libusb_release_interface(
_handle,
i->get_number());
70 libusb_device_handle*
get()
87 if (libusb_kernel_driver_active(
_handle, interface) == 1)
88 if (libusb_detach_kernel_driver(
_handle, interface) == 0)
89 LOG_DEBUG(
"handle_libusb - detach kernel driver");
91 auto sts = libusb_claim_interface(
_handle, interface);
92 if(sts != LIBUSB_SUCCESS)
std::string to_string(T value)