aboutsummaryrefslogtreecommitdiffstats
path: root/tests/soft_uart/soft_uart_test.ok
blob: dcd7ceb4f059b25dcfc6235aca18f8667bd7a9c7 (plain)
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
Executing test_rx
======== testing 8-N-1 (no data)
test_rx_exec() @ 0: flush the Rx buffer
test_rx_exec() @ 6: flush the Rx buffer
test_rx_exec() @ 12: flush the Rx buffer
======== testing 8-N-1 (fill up flush)
suart_rx_cb(flags=00): de ad be ef 
suart_rx_cb(flags=00): 00 aa 55 ff 
test_rx_exec() @ 101: flush the Rx buffer
======== testing 8-N-1 (HELLO)
test_rx_exec() @ 18: flush the Rx buffer
suart_rx_cb(flags=00): 48 
test_rx_exec() @ 31: flush the Rx buffer
suart_rx_cb(flags=00): 45 
test_rx_exec() @ 57: flush the Rx buffer
suart_rx_cb(flags=00): 4c 
test_rx_exec() @ 70: flush the Rx buffer
suart_rx_cb(flags=00): 4c 
test_rx_exec() @ 96: flush the Rx buffer
suart_rx_cb(flags=00): 4f 
======== testing 8-N-1 (framing errors)
suart_rx_cb(flags=01): 00 
suart_rx_cb(flags=01): aa 
test_rx_exec() @ 41: flush the Rx buffer
suart_rx_cb(flags=00): ff 
======== testing 8-N-2 (HELLO)
test_rx_exec() @ 20: flush the Rx buffer
test_rx_exec() @ 22: flush the Rx buffer
suart_rx_cb(flags=00): 48 
test_rx_exec() @ 35: flush the Rx buffer
test_rx_exec() @ 37: flush the Rx buffer
suart_rx_cb(flags=00): 45 
test_rx_exec() @ 65: flush the Rx buffer
test_rx_exec() @ 67: flush the Rx buffer
suart_rx_cb(flags=00): 4c 
test_rx_exec() @ 80: flush the Rx buffer
test_rx_exec() @ 82: flush the Rx buffer
suart_rx_cb(flags=00): 4c 
test_rx_exec() @ 110: flush the Rx buffer
test_rx_exec() @ 112: flush the Rx buffer
suart_rx_cb(flags=00): 4f 
======== testing 8-N-2 (framing errors)
suart_rx_cb(flags=01): 00 
suart_rx_cb(flags=01): aa 
suart_rx_cb(flags=01): 55 
test_rx_exec() @ 57: flush the Rx buffer
suart_rx_cb(flags=00): ff 
======== testing 8-E-1 (invalid parity)
suart_rx_cb(flags=02): 00 
suart_rx_cb(flags=02): 01 
suart_rx_cb(flags=02): ff 
test_rx_exec() @ 49: flush the Rx buffer
======== testing 8-E-1 (valid parity)
test_rx_exec() @ 63: flush the Rx buffer
suart_rx_cb(flags=00): 00 ff aa 55 
test_rx_exec() @ 120: flush the Rx buffer
suart_rx_cb(flags=00): 80 e0 f8 fe 
======== testing 8-O-1 (invalid parity)
suart_rx_cb(flags=02): 00 
suart_rx_cb(flags=02): 01 
suart_rx_cb(flags=02): ff 
test_rx_exec() @ 42: flush the Rx buffer
======== testing 8-O-1 (valid parity)
test_rx_exec() @ 63: flush the Rx buffer
suart_rx_cb(flags=00): 00 ff aa 55 
test_rx_exec() @ 120: flush the Rx buffer
suart_rx_cb(flags=00): 80 e0 f8 fe 

Executing test_rx_flush
calling osmo_soft_uart_flush_rx() while Rx disabled
enabling the receiver
calling osmo_soft_uart_flush_rx() while Rx enabled, but no data
testing corner case: manual flushing during a parity error (8-E-1)
test_rx_exec() @ 47: flush the Rx buffer
suart_rx_cb(flags=02): aa 55 
suart_rx_cb(flags=02): ff 

Executing test_tx_rx
======== testing 8-N-1
suart_tx_cb(len=4/4): de ad be ef 
suart_rx_cb(flags=00): de ad be ef 
test_tx_rx_exec_one(n_bits_total=40): 0011110111 0101101011 0011111011 0111101111
suart_tx_cb(len=4/4): 00 aa 55 ff 
suart_rx_cb(flags=00): 00 aa 55 ff 
test_tx_rx_exec_one(n_bits_total=40): 0000000001 0010101011 0101010101 0111111111
suart_tx_cb(len=4/4): 01 02 04 08 
suart_rx_cb(flags=00): 01 02 04 08 
test_tx_rx_exec_one(n_bits_total=40): 0100000001 0010000001 0001000001 0000100001
suart_tx_cb(len=4/4): 10 20 40 80 
suart_rx_cb(flags=00): 10 20 40 80 
test_tx_rx_exec_one(n_bits_total=40): 0000010001 0000001001 0000000101 0000000011
suart_tx_cb(len=0/4): 
test_tx_rx_exec_one(n_bits_total=40): 1111111111 1111111111 1111111111 1111111111
======== testing 8-N-2
suart_tx_cb(len=4/4): de ad be ef 
suart_rx_cb(flags=00): de ad be ef 
test_tx_rx_exec_one(n_bits_total=44): 00111101111 01011010111 00111110111 01111011111
suart_tx_cb(len=4/4): 00 aa 55 ff 
suart_rx_cb(flags=00): 00 aa 55 ff 
test_tx_rx_exec_one(n_bits_total=44): 00000000011 00101010111 01010101011 01111111111
suart_tx_cb(len=4/4): 01 02 04 08 
suart_rx_cb(flags=00): 01 02 04 08 
test_tx_rx_exec_one(n_bits_total=44): 01000000011 00100000011 00010000011 00001000011
suart_tx_cb(len=4/4): 10 20 40 80 
suart_rx_cb(flags=00): 10 20 40 80 
test_tx_rx_exec_one(n_bits_total=44): 00000100011 00000010011 00000001011 00000000111
suart_tx_cb(len=0/4): 
test_tx_rx_exec_one(n_bits_total=44): 11111111111 11111111111 11111111111 11111111111
======== testing 8-E-1
suart_tx_cb(len=4/4): de ad be ef 
suart_rx_cb(flags=00): de ad be ef 
test_tx_rx_exec_one(n_bits_total=44): 00111101101 01011010111 00111110101 01111011111
suart_tx_cb(len=4/4): 00 aa 55 ff 
suart_rx_cb(flags=00): 00 aa 55 ff 
test_tx_rx_exec_one(n_bits_total=44): 00000000001 00101010101 01010101001 01111111101
suart_tx_cb(len=4/4): 01 02 04 08 
suart_rx_cb(flags=00): 01 02 04 08 
test_tx_rx_exec_one(n_bits_total=44): 01000000011 00100000011 00010000011 00001000011
suart_tx_cb(len=4/4): 10 20 40 80 
suart_rx_cb(flags=00): 10 20 40 80 
test_tx_rx_exec_one(n_bits_total=44): 00000100011 00000010011 00000001011 00000000111
suart_tx_cb(len=0/4): 
test_tx_rx_exec_one(n_bits_total=44): 11111111111 11111111111 11111111111 11111111111
======== testing 8-O-1
suart_tx_cb(len=4/4): de ad be ef 
suart_rx_cb(flags=00): de ad be ef 
test_tx_rx_exec_one(n_bits_total=44): 00111101111 01011010101 00111110111 01111011101
suart_tx_cb(len=4/4): 00 aa 55 ff 
suart_rx_cb(flags=00): 00 aa 55 ff 
test_tx_rx_exec_one(n_bits_total=44): 00000000011 00101010111 01010101011 01111111111
suart_tx_cb(len=4/4): 01 02 04 08 
suart_rx_cb(flags=00): 01 02 04 08 
test_tx_rx_exec_one(n_bits_total=44): 01000000001 00100000001 00010000001 00001000001
suart_tx_cb(len=4/4): 10 20 40 80 
suart_rx_cb(flags=00): 10 20 40 80 
test_tx_rx_exec_one(n_bits_total=44): 00000100001 00000010001 00000001001 00000000101
suart_tx_cb(len=0/4): 
test_tx_rx_exec_one(n_bits_total=44): 11111111111 11111111111 11111111111 11111111111
======== testing 8-M-1
suart_tx_cb(len=4/4): de ad be ef 
suart_rx_cb(flags=00): de ad be ef 
test_tx_rx_exec_one(n_bits_total=44): 00111101111 01011010111 00111110111 01111011111
suart_tx_cb(len=4/4): 00 aa 55 ff 
suart_rx_cb(flags=00): 00 aa 55 ff 
test_tx_rx_exec_one(n_bits_total=44): 00000000011 00101010111 01010101011 01111111111
suart_tx_cb(len=4/4): 01 02 04 08 
suart_rx_cb(flags=00): 01 02 04 08 
test_tx_rx_exec_one(n_bits_total=44): 01000000011 00100000011 00010000011 00001000011
suart_tx_cb(len=4/4): 10 20 40 80 
suart_rx_cb(flags=00): 10 20 40 80 
test_tx_rx_exec_one(n_bits_total=44): 00000100011 00000010011 00000001011 00000000111
suart_tx_cb(len=0/4): 
test_tx_rx_exec_one(n_bits_total=44): 11111111111 11111111111 11111111111 11111111111
======== testing 8-S-1
suart_tx_cb(len=4/4): de ad be ef 
suart_rx_cb(flags=00): de ad be ef 
test_tx_rx_exec_one(n_bits_total=44): 00111101101 01011010101 00111110101 01111011101
suart_tx_cb(len=4/4): 00 aa 55 ff 
suart_rx_cb(flags=00): 00 aa 55 ff 
test_tx_rx_exec_one(n_bits_total=44): 00000000001 00101010101 01010101001 01111111101
suart_tx_cb(len=4/4): 01 02 04 08 
suart_rx_cb(flags=00): 01 02 04 08 
test_tx_rx_exec_one(n_bits_total=44): 01000000001 00100000001 00010000001 00001000001
suart_tx_cb(len=4/4): 10 20 40 80 
suart_rx_cb(flags=00): 10 20 40 80 
test_tx_rx_exec_one(n_bits_total=44): 00000100001 00000010001 00000001001 00000000101
suart_tx_cb(len=0/4): 
test_tx_rx_exec_one(n_bits_total=44): 11111111111 11111111111 11111111111 11111111111
======== testing 6-N-1
suart_tx_cb(len=4/4): de ad be ef 
suart_rx_cb(flags=00): 1e 2d 3e 2f 
test_tx_rx_exec_one(n_bits_total=32): 00111101 01011011 00111111 01111011
suart_tx_cb(len=4/4): 00 aa 55 ff 
suart_rx_cb(flags=00): 00 2a 15 3f 
test_tx_rx_exec_one(n_bits_total=32): 00000001 00101011 01010101 01111111
suart_tx_cb(len=4/4): 01 02 04 08 
suart_rx_cb(flags=00): 01 02 04 08 
test_tx_rx_exec_one(n_bits_total=32): 01000001 00100001 00010001 00001001
suart_tx_cb(len=4/4): 10 20 40 80 
suart_rx_cb(flags=00): 10 20 00 00 
test_tx_rx_exec_one(n_bits_total=32): 00000101 00000011 00000001 00000001
suart_tx_cb(len=0/4): 
test_tx_rx_exec_one(n_bits_total=32): 11111111 11111111 11111111 11111111

Executing test_tx_rx_pull_n
======== pulling 32 bits (1 at a time)
suart_tx_cb(len=1/1): 55 
suart_tx_cb(len=1/1): 55 
suart_tx_cb(len=1/1): 55 
suart_tx_cb(len=1/1): 55 
01010101010101010101010101010101
======== feeding 32 bits into the receiver
suart_rx_cb(flags=00): 55 55 55 

Executing test_tx_rx_pull_n
======== pulling 32 bits (2 at a time)
suart_tx_cb(len=1/1): 55 
suart_tx_cb(len=1/1): 55 
suart_tx_cb(len=1/1): 55 
suart_tx_cb(len=1/1): 55 
01010101010101010101010101010101
======== feeding 32 bits into the receiver
suart_rx_cb(flags=00): 55 55 55 

Executing test_tx_rx_pull_n
======== pulling 32 bits (4 at a time)
suart_tx_cb(len=1/1): 55 
suart_tx_cb(len=1/1): 55 
suart_tx_cb(len=1/1): 55 
01010101011101010101011101010101
======== feeding 32 bits into the receiver
suart_rx_cb(flags=00): 55 55 

Executing test_tx_rx_pull_n
======== pulling 32 bits (8 at a time)
suart_tx_cb(len=1/1): 55 
suart_tx_cb(len=1/1): 55 
01010101011111110101010101111111
======== feeding 32 bits into the receiver
suart_rx_cb(flags=00): 55 55 

Executing test_tx_pull
pulling 25 bits (first time) out of the transmitter
suart_tx_cb(len=2/2): 42 42 
pulling 25 bits (second time) out of the transmitter
suart_tx_cb(len=2/2): 42 42 

Executing test_modem_status
initial status=0x00000000
de-asserting DCD, which was not asserted
asserting both RI and DCD, expecting the callback to be called twice
suart_status_change_cb(status=0x00000008)
suart_status_change_cb(status=0x0000000a)
de-asserting RI, expecting the callback to be called
suart_status_change_cb(status=0x00000002)
resetting to 0x00, expecting the callback to be called
suart_status_change_cb(status=0x00000000)

Executing test_flow_control_dtr_dsr
initial status=0x00000000
expecting osmo_soft_uart_tx_ubits() to yield nothing
expecting osmo_soft_uart_rx_ubits() to yield nothing
======== asserting both DTR and DSR
suart_status_change_cb(status=0x00000001)
suart_status_change_cb(status=0x00000005)
expecting osmo_soft_uart_tx_ubits() to yield 40 bits (requesting 40 bits)
suart_tx_cb(len=4/4): 42 42 42 42 
0010000101001000010100100001010010000101
expecting osmo_soft_uart_rx_ubits() to consume 40 bits and yield 4 chars
suart_rx_cb(flags=00): 42 42 42 42 
expecting osmo_soft_uart_tx_ubits() to yield 2 bits (requesting 2 bits)
suart_tx_cb(len=1/1): 42 
======== de-asserting DSR
suart_status_change_cb(status=0x00000001)
expecting osmo_soft_uart_tx_ubits() to yield 8 bits (requesting 40 bits)
expecting osmo_soft_uart_rx_ubits() to consume 40 bits and yield a pending char
suart_rx_cb(flags=00): 42 

Executing test_flow_control_rts_cts
initial status=0x00000000
expecting osmo_soft_uart_tx_ubits() to yield nothing
expecting osmo_soft_uart_rx_ubits() to yield nothing
======== asserting both CTS and RTS/RTR
suart_status_change_cb(status=0x00000020)
suart_status_change_cb(status=0x00000030)
expecting osmo_soft_uart_tx_ubits() to yield 40 bits (requesting 40 bits)
suart_tx_cb(len=4/4): 42 42 42 42 
0010000101001000010100100001010010000101
expecting osmo_soft_uart_rx_ubits() to consume 40 bits and yield 4 chars
suart_rx_cb(flags=00): 42 42 42 42 
expecting osmo_soft_uart_tx_ubits() to yield 2 bits (requesting 2 bits)
suart_tx_cb(len=1/1): 42 
======== de-asserting CTS
suart_status_change_cb(status=0x00000010)
expecting osmo_soft_uart_tx_ubits() to yield 8 bits (requesting 40 bits)
expecting osmo_soft_uart_rx_ubits() to consume 40 bits and yield a pending char
suart_rx_cb(flags=00): 42