47 if (!dev.
set_pu(_id, static_cast<int32_t>(value)))
55 return static_cast<float>(_ep.invoke_powered(
59 if (!dev.
get_pu(_id, value))
62 return static_cast<float>(
value);
68 auto uvc_range = _ep.invoke_powered(
76 auto min = *(
reinterpret_cast<int32_t*
>(uvc_range.min.data()));
77 auto max = *(
reinterpret_cast<int32_t*
>(uvc_range.max.data()));
78 auto step = *(
reinterpret_cast<int32_t*
>(uvc_range.step.data()));
79 auto def = *(
reinterpret_cast<int32_t*
>(uvc_range.def.data()));
81 static_cast<float>(max),
82 static_cast<float>(step),
83 static_cast<float>(def)};
93 case RS2_OPTION_EXPOSURE:
return "Controls exposure time of color camera. Setting any value will disable auto exposure";
99 case RS2_OPTION_WHITE_BALANCE:
return "Controls white balance of color image. Setting any value will disable auto white balance";
103 case RS2_OPTION_AUTO_EXPOSURE_PRIORITY:
return "Restrict Auto-Exposure to enforce constant FPS rate. Turn ON to remove the restrictions (may result in FPS drop)";
104 default:
return _ep.get_option_name(_id);
110 return _uvc.invoke_powered([
this, &data, require_response]
113 std::vector<uint8_t>
result;
114 std::lock_guard<platform::uvc_device>
lock(dev);
124 std::copy(data.begin(), data.end(), transmit_buf.begin());
126 if (!dev.
set_xu(_xu, _ctrl, transmit_buf.data(),
static_cast<int>(transmit_buf.size())))
129 if (require_response)
132 if (!dev.
get_xu(_xu, _ctrl, result.data(),
static_cast<int>(result.size())))
137 result.resize(data_size);
145 if (
auto handler = _polling_error_handler.lock())
154 if(
auto handler = _polling_error_handler.lock() )
157 if( value <= std::numeric_limits< float >::epsilon() )
160 handler->start((
unsigned int )( value * 1000.
f ));
182 return "Enable / disable polling of camera internal errors";
189 return "Disable error polling";
193 return "Enable error polling";
199 std::vector<rs2_option> options;
200 for (
auto option : _options)
201 options.push_back(
option.first);
bool is_enabled() const override
static const textual_icon lock
const option_range _opt_range
virtual const char * get_description() const =0
void set(float value) override
option_range get_range() const override
const uint16_t HW_MONITOR_DATA_SIZE_OFFSET
float query() const override
option_range get_range() const override
float query() const override
virtual void create_snapshot(std::shared_ptr< option > &snapshot) const
void set(float value) override
virtual void enable_recording(std::function< void(const option &)> recording_action) override
virtual float query() const =0
std::vector< rs2_option > get_supported_options() const override
void set(float value) override
const char * get_description() const override
option_range get_range() const override
~polling_errors_disable()
std::function< void(const option &)> _recording_function
const char * get_value_description(float value) const override
std::vector< uint8_t > send_receive(const std::vector< uint8_t > &data, int, bool require_response) override
const uint16_t SIZE_OF_HW_MONITOR_HEADER
const uint16_t HW_MONITOR_BUFFER_SIZE
bool is_valid(float value) const
const char * get_description() const override
void copy(void *dst, void const *src, size_t size)
std::string to_string(T value)