2020-12-15 17:13:56 +00:00
|
|
|
# TESTS
|
|
|
|
|
2020-12-16 17:50:27 +00:00
|
|
|
### TEST_RX.py
|
|
|
|
|
2020-12-22 12:00:19 +00:00
|
|
|
Receive string "HALLO" with a lot of debugging output
|
|
|
|
```
|
|
|
|
./TEST_TX.py | ./TEST_RX.py
|
|
|
|
```
|
|
|
|
Output should be:
|
|
|
|
```
|
|
|
|
SYNC
|
|
|
|
INPUT PARSER: 1760
|
|
|
|
INPUT LENGTH: 1760
|
|
|
|
BUFFER LENGTH: 1848
|
|
|
|
MODULATION LENGTH: 924
|
|
|
|
SYNC
|
|
|
|
b'HALLO\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x15S'
|
|
|
|
INPUT PARSER: 1760
|
|
|
|
INPUT LENGTH: 1760
|
|
|
|
BUFFER LENGTH: 1848
|
|
|
|
MODULATION LENGTH: 924
|
|
|
|
SYNC
|
|
|
|
INPUT PARSER: 1760
|
|
|
|
```
|
2020-12-15 17:13:56 +00:00
|
|
|
|
2020-12-15 17:15:56 +00:00
|
|
|
### TEST_TX.py
|
|
|
|
|
2020-12-22 12:00:19 +00:00
|
|
|
Send string "HALLO"
|
2020-12-15 17:14:54 +00:00
|
|
|
```
|
2020-12-15 17:13:56 +00:00
|
|
|
./TEST_TX.py | ./freedv_data_raw_rx DATAC3 - - | hexdump -C
|
2020-12-15 17:14:54 +00:00
|
|
|
```
|
2020-12-15 17:13:56 +00:00
|
|
|
Output should be:
|
2020-12-15 17:14:54 +00:00
|
|
|
```
|
2020-12-15 17:13:56 +00:00
|
|
|
payload bytes_per_modem_frame: 30
|
|
|
|
00000000 54 45 53 54 00 00 00 00 00 00 00 00 00 00 00 00 |TEST............|
|
|
|
|
modem bufs processed: 22 output bytes: 30 output_frames: 1
|
|
|
|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |..............|
|
|
|
|
0000001e
|
2020-12-15 17:14:54 +00:00
|
|
|
```
|
2020-12-15 17:13:56 +00:00
|
|
|
|
|
|
|
|
2020-12-15 17:15:56 +00:00
|
|
|
### Checksum comparison FREEDV vs CRCENGINE
|
|
|
|
```
|
2020-12-15 11:43:30 +00:00
|
|
|
|
|
|
|
###################### CHECKSUM COMPARISON FREEDV VS CRCENGINE ########
|
2020-12-15 11:20:44 +00:00
|
|
|
#https://crccalc.com
|
|
|
|
|
|
|
|
teststring = b'TEST'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# freedv crc16 checksum
|
|
|
|
crctest2 = c_ushort(self.c_lib.freedv_gen_crc16(teststring, len(teststring)))
|
|
|
|
print("FREEDV2: " + str(crctest2.value) + " = " + hex(crctest2.value))
|
|
|
|
|
|
|
|
|
|
|
|
#Python crc16 checksum
|
|
|
|
crc_algorithm = crcengine.new('crc16-ccitt-false') #load crc16 library
|
|
|
|
crctest3 = crc_algorithm(teststring)
|
|
|
|
print("CRCENGINE: " + str(crctest3) + " = " + hex(crctest3))
|
|
|
|
|
|
|
|
|
|
|
|
#######################################################################
|
2020-12-15 17:15:56 +00:00
|
|
|
```
|