From ee0b9de38bc059df52452ec3be10af8d90ccc93b Mon Sep 17 00:00:00 2001 From: Joe Tretter Date: Sun, 4 Sep 2022 16:14:38 -0500 Subject: [PATCH] implementation of the receiving side --- .gitignore | 3 +++ Decoder/adjustpic.html | 13 +++++++++++++ Decoder/combineChunks.sh | 15 +++++++++++++++ Decoder/decodeAllFiles.sh | 12 ++++++------ Decoder/decodeSingleFile.sh | 0 5 files changed, 37 insertions(+), 6 deletions(-) create mode 100644 .gitignore create mode 100644 Decoder/adjustpic.html create mode 100755 Decoder/combineChunks.sh mode change 100644 => 100755 Decoder/decodeAllFiles.sh mode change 100644 => 100755 Decoder/decodeSingleFile.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7925756 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +Decoder/a.png +Decoder/chunks/ +Decoder/output.dat diff --git a/Decoder/adjustpic.html b/Decoder/adjustpic.html new file mode 100644 index 0000000..73b16c5 --- /dev/null +++ b/Decoder/adjustpic.html @@ -0,0 +1,13 @@ + + + + Adjust picture + + + + + + + diff --git a/Decoder/combineChunks.sh b/Decoder/combineChunks.sh new file mode 100755 index 0000000..151b7cd --- /dev/null +++ b/Decoder/combineChunks.sh @@ -0,0 +1,15 @@ +#!/bin/bash +rm output.dat +currFN=0 +echo "processing chunks " +while /bin/true; do + if [ ! -f chunks/${currFN}.chunk ] ; then + echo chunk $currFN is missing! + exit 1 + else + echo -n $currFN/ + fi + cat chunks/${currFN}.chunk >> output.dat + let currFN=$currFN+1 +done + diff --git a/Decoder/decodeAllFiles.sh b/Decoder/decodeAllFiles.sh old mode 100644 new mode 100755 index c253aa1..307caec --- a/Decoder/decodeAllFiles.sh +++ b/Decoder/decodeAllFiles.sh @@ -1,11 +1,11 @@ #/bin/bash -ls input/ | sort | while read f;do -dta=$(zbarimg --raw --nodbus input/$f) +while /bin/true;do +fswebcam -q -r 800x800 a.png +#dta=$(fswebcam -q -r 1280x720 - | zbarimg -q --raw --nodbus -) +dta=$(zbarimg -q --raw --nodbus a.png) chunkNum=${dta/|*/} chunkData=${dta/*|/} -echo ${chunkNum} - - -# >> output.dat +echo received: ${chunkNum} +echo $chunkData | base64 -d > chunks/${chunkNum}.chunk done diff --git a/Decoder/decodeSingleFile.sh b/Decoder/decodeSingleFile.sh old mode 100644 new mode 100755