6 #include "../usb/usb-device.h"
22 int timeout_ms = 5000,
23 bool require_response =
true) = 0;
36 auto intfs =
_device->get_interfaces();
37 auto it = std::find_if(intfs.begin(), intfs.end(),
38 [](
const rs_usb_interface&
i) { return i->get_class() == RS2_USB_CLASS_VENDOR_SPECIFIC; });
39 if (
it == intfs.end())
40 throw std::runtime_error(
"can't find VENDOR_SPECIFIC interface of device: " +
_device->get_info().id);
44 std::vector<uint8_t> output;
45 if (
const auto&
m =
_device->open(hwm->get_number()))
55 throw std::runtime_error(
"command transfer failed to execute bulk transfer, error: " +
usb_status_to_string.at(sts));
61 throw std::runtime_error(
"command transfer failed to execute bulk transfer, error: " +
usb_status_to_string.at(sts));
63 output.resize(transfered_count);
68 s <<
"access failed for " << std::hex <<
_device->get_info().vid <<
":"
69 <<
_device->get_info().pid <<
" uid: " <<
_device->get_info().id << std::dec;
70 throw std::runtime_error(
s.str().c_str());