forked from merbanan/rtl_433_tests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rtl_433_test.sh
executable file
·40 lines (32 loc) · 1.18 KB
/
rtl_433_test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
## Your git project directory
PRJDIR=~/Projects
## Test command
CMD="$PRJDIR/rtl_433/build/src/rtl_433 -G -q -r" # Enable all decoders, Quiet mode
## Find all data files (sort for consistency between runs)
DATAFILES=$(find $PRJDIR/rtl_433_tests -iname "*.cu8" | sort)
## Custom filters for debug
#FILTER="-e current_cost -e danfoss -e ec3k -e efergy_e2_classic -e emontx -e fineoffset_wh25 -e oil_watchman -e steelmate-TPMS" # FSK files
#FILTER="-e emontx" # A single sensor
#DATAFILES=$(printf -- '%s\n' "${DATAFILES[@]}" | grep $FILTER)
## Run though all test data
for FILE in $DATAFILES
do
# in case of very bad samples, check if they require specific level to pass
# use only in emergency
LEVEL_FILE="$(dirname "$FILE")/level"
if [[ -r "$LEVEL_FILE" ]] ; then
LEVEL="-l $(cat "$LEVEL_FILE")"
else
LEVEL=
fi
# Add a "samplerate" file in case of non-standard samplerate
SAMPLERATE_FILE="$(dirname "$FILE")/samplerate"
if [[ -r "$SAMPLERATE_FILE" ]] ; then
SAMPLERATE="-s $(cat "$SAMPLERATE_FILE")"
else
SAMPLERATE=
fi
# $CMD $FILE $SAMPLERATE -l 0 # Auto level
$CMD $FILE $SAMPLERATE $LEVEL
done