-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path7_2fsk_coded_packet_decode.sh
executable file
·107 lines (94 loc) · 4.44 KB
/
7_2fsk_coded_packet_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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# Wisun 2-FSK coded packet decode test scripts.
# qianfan Zhao <[email protected]>
sequence=1
coded_packet_decode_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: 5_2fsk_packet_encode.sh Section 6 (coded1)
# Data whitening: Disabled
# FEC: NRNSC
# Interleaving: Enabled
coded_packet_decode_test \
"aaaaaaaa-b4c6-e000-02006a-ba945f14" \
"--packet" "--decode" \
"--nrnsc" \
"--interleaving" \
"--human" "--hexo" \
"0101-0101-0101-0101-0101-0101-0101-0101-0110-0011-0010-1101-1011-1111-0111-1111-0011-1111-1111-1111-1111-1100-1111-1101-1111-1100-1111-0010-0011-0111-1010-1010-1011-1100-1011-0111-0101-1110-0001-0011-1010-0100-0101-1101-1011-0010-1111-0000-1011-0100-0011-1100" \
|| exit $?
# Sequence 2
# ref: 5_2fsk_packet_encode.sh Section 7 (code0)
# Data whitening: Enabled
# FEC: RSC
# Interleaving: Enabled
coded_packet_decode_test \
"aaaaaaaa-72f6-e010-02006a-ba945f14" \
"--packet" "--decode" \
"--rsc" \
"--interleaving" \
"--human" "--hexo" \
"0101-0101-0101-0101-0101-0101-0101-0101-0110-1111-0100-1110-1100-0000-1110-1000-0110-1000-0000-1100-1010-0101-1101-1010-1011-0000-0110-1111-1001-0000-1001-1100-0001-1111-1110-0110-1010-1010-0100-1100-1010-0000-1110-1001-1001-1001-1001-1111-0001-0010-1001-1011" \
|| exit $?
# Sequence 3
# sending from Silicon Labs RAILtest demo based on EFR32FG25.
#
# Setting:
# Radio profile: Wi-SUN FAN1.1 Profile
# Wi-SUN Regulatory Domain: NA
# Wi-SUN PHY Operating Mode ID: 18
# Wi-SUN Channel Plan ID: 1
#
# The binary stream are capture with HackRF, demodulated with URH.
seq3_inputs="0010101010101010101010101010101010101010101010101010101010101010101101111010011100111001101110011001110111111001100001111110100001011101001011111111001111110001100010111001001101111110000110000011101001101011010000111100000001111101100000011"
coded_packet_decode_test \
"aaaaaaaaaaaaaaaa-72f6-6010-1122-687d28f2" \
"--packet" "--decode" \
"--nrnsc" \
"--interleaving" \
"--human" "--hexo" \
"${seq3_inputs}" \
|| exit $?
# Sequence 4
# similar to seq3, but add some garbage in the tail
coded_packet_decode_test \
"aaaaaaaaaaaaaaaa-72f6-6010-1122-687d28f2" \
"--packet" "--decode" \
"--nrnsc" \
"--interleaving" \
"--human" "--hexo" \
"${seq3_inputs}01100110" \
|| exit $?
# Sequence 5
# similar to seq3, but send 3bytes data
coded_packet_decode_test \
"aaaaaaaaaaaaaaaa-72f6-e010-112233-58184306" \
"--packet" "--decode" \
"--nrnsc" \
"--interleaving" \
"--human" "--hexo" \
"00000000000001010101010101010101010101010101010101010101010101010101010101010110111101001110101100110111001100111011111100110000111111010011101110010101111000001100101011010011110111100001000011001000100011101100000110011001111010101001000100110010100111111" \
|| exit $?
# Sequence 6
# Data whitening: Disabled
# FEC: Diabled
# Interleaving: Enabled
#
# garbages both in the head and tail.
coded_packet_decode_test \
"010101010101010101010101010101010101010101010101010101010101010110010000010011100000100000110110100000001100011101001101001101100111011100010111100110100111111111111111000010001101111100001100101000001010100010000000000000000100000010000000000000000000000011111100110110000000010100010000000100011111111111111111001001100100000010000000100000000000000000000000101000000010000000000000000000000000000000000000110001000001000010100000010001101000011001000110100001100100011010000110010001101000011000011001010000111010101100001111" \
"--packet" "--decode" \
"000000000000001010101010101010101010101010101010101010101010101010101010101011001000001001110000010000011011010001111101101111111111001011001001101001000111111010010110100010100001110011111111001110001000101110011011111000010000001010101001111011110100000110111011011011001110001100011111001101101110100100100001110010111010011011100000110000010011010110000000110011001010100110011110101101001001001101111110010110101000001100110011001101111111010000101110100101010001010110111010011101000001000000000110000010100111110000100101110011010110011111111111" \
|| exit $?