-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path6_2fsk_fec_decode.sh
executable file
·39 lines (30 loc) · 1.19 KB
/
6_2fsk_fec_decode.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
# Wisun 2-FSK RSC/NRNSC decode test scripts
# qianfan Zhao <[email protected]>
sequence=1
fec_test () {
local expected=$1
local decode
shift 1
printf "urh_wisun_fsk fec decode test ${sequence}... "
decode=$(./urh_wisun_fsk.debug "$@")
if [ X"${decode}" != X"${expected}" ] ; then
printf "\nE: ${expected}\nR: ${decode}\n"
printf "failed\n"
return 1
else
printf "pass\n"
fi
let sequence++
}
# Sequence 1
# Ref: test/2_nrnsc_encode.sh
fec_test "00000000000001110100000000000000010101100101110100101001111110100010100000001011" \
--nrnsc --decode \
"1111111111111111111111111100011010000100001111111111111111111111110010110111100111111011101010000100111011010011011001010110000100000010110100001111111100101110" \
|| exit $?
# Sequence 2
# Ref: test/3_rsc_encode.sh
fec_test "00001000000001110100000000000000010101100101110100101001111110100010100001001011" \
--rsc --decode \
"0000-0000-1110-1000-0010-1000-0001-1111-0011-1010-0000-1010-0000-1010-0000-1010-0011-0011-1001-0100-0001-0001-0101-0011-0000-1110-0110-1001-1101-0101-1110-1100-1010-1110-1100-1010-0011-0000-1110-0101" \
|| exit $?