implementation of the receiving side

This commit is contained in:
Joe Tretter
2022-09-04 16:14:38 -05:00
parent 2255def7aa
commit ee0b9de38b
5 changed files with 37 additions and 6 deletions

3
.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
Decoder/a.png
Decoder/chunks/
Decoder/output.dat

13
Decoder/adjustpic.html Normal file
View File

@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<title>Adjust picture</title>
</head>
<body>
<img src=a.png>
<script>
window.setTimeout(_=>{window.location.reload()},1000);
</script>
</body>
</html>

15
Decoder/combineChunks.sh Executable file
View File

@@ -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

12
Decoder/decodeAllFiles.sh Normal file → Executable file
View File

@@ -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

0
Decoder/decodeSingleFile.sh Normal file → Executable file
View File