v4l2-ctl -d /dev/v4l-subdev2 -c test_pattern=1

if [ -n "$1" ]; then
      times=$1
   else
      times=1
fi

for (( i=1; i <= $times; i++ ))
do
    echo
    echo "-----TEST TIMES: $i/$times------"
    v4l2-ctl --verbose -d /dev/video3 --set-fmt-video=width=1640,height=1232,pixelformat='RGGB' --stream-mmap=6 --stream-skip=1 --stream-to=/tmp/raw --stream-count=1 --stream-poll > v4l2_ctl_video0.log 2>v4l2_ctl_video0_error.log
    md5sum /tmp/raw
    rm /tmp/raw
done

echo "-----------$times times test done, please check the log file for result-----------"
