MCPcopy Create free account
hub / github.com/cgevans/tiny2 / query_ctrl

Method query_ctrl

src/usbio.rs:103–126  ·  view source on GitHub ↗
(&self, id: u32)

Source from the content-addressed store, hash-verified

101 }
102
103 fn query_ctrl(&self, id: u32) -> Result<V4l2CtrlRange, Errno> {
104 let dev = &self.0;
105 let mut qctrl = v4l2_queryctrl {
106 id,
107 ..Default::default()
108 };
109
110 unsafe {
111 match vidioc_queryctrl(dev.as_raw_fd(), &mut qctrl) {
112 Ok(_) => {
113 if qctrl.flags & V4L2_CTRL_FLAG_DISABLED != 0 {
114 return Err(errno::Errno(22)); // EINVAL
115 }
116 Ok(V4l2CtrlRange {
117 minimum: qctrl.minimum,
118 maximum: qctrl.maximum,
119 step: qctrl.step,
120 default_value: qctrl.default_value,
121 })
122 }
123 _ => Err(errno::Errno(errno())),
124 }
125 }
126 }
127}
128
129pub(crate) fn open_camera(hint: &str) -> Result<CameraHandle, crate::Error> {

Callers 3

query_pan_rangeMethod · 0.80
query_tilt_rangeMethod · 0.80
query_zoom_rangeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected