Skip to content

Commit

Permalink
chore: add error message if v4l2-ctl errors out
Browse files Browse the repository at this point in the history
Signed-off-by: Stephan Wendel <[email protected]>
  • Loading branch information
KwadFan committed Feb 24, 2023
1 parent a5a36e5 commit 20ed6a8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions libs/v4l2_control.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ function v4l2_control {
valueless="$(echo "${param}" | cut -d "=" -f1)"
opt_avail="$(v4l2-ctl -d "${device}" -L | \
grep -c "${valueless}" || true)"
if [ "${opt_avail}" -eq "0" ]; then
log_msg "Parameter '${param}' not available for '${device}'. Skipped."
if [[ "${opt_avail}" -eq "0" ]]; then
v4c_log_msg "Parameter '${param}' not available for '${device}'. Skipped."
else
v4l2-ctl -d "${device}" -c "${param}" 2> /dev/null
v4l2-ctl -d "${device}" -c "${param}" 2> /dev/null ||
v4c_log_msg "Failed to set parameter: '${param}' ..."
fi
done
if [[ "${CROWSNEST_LOG_LEVEL}" == "debug" ]]; then
Expand Down

0 comments on commit 20ed6a8

Please sign in to comment.