Skip to content

Commit 20ed6a8

Browse files
committed
chore: add error message if v4l2-ctl errors out
Signed-off-by: Stephan Wendel <[email protected]>
1 parent a5a36e5 commit 20ed6a8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

libs/v4l2_control.sh

+4-3
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,11 @@ function v4l2_control {
4444
valueless="$(echo "${param}" | cut -d "=" -f1)"
4545
opt_avail="$(v4l2-ctl -d "${device}" -L | \
4646
grep -c "${valueless}" || true)"
47-
if [ "${opt_avail}" -eq "0" ]; then
48-
log_msg "Parameter '${param}' not available for '${device}'. Skipped."
47+
if [[ "${opt_avail}" -eq "0" ]]; then
48+
v4c_log_msg "Parameter '${param}' not available for '${device}'. Skipped."
4949
else
50-
v4l2-ctl -d "${device}" -c "${param}" 2> /dev/null
50+
v4l2-ctl -d "${device}" -c "${param}" 2> /dev/null ||
51+
v4c_log_msg "Failed to set parameter: '${param}' ..."
5152
fi
5253
done
5354
if [[ "${CROWSNEST_LOG_LEVEL}" == "debug" ]]; then

0 commit comments

Comments
 (0)