From 3cf2d4e7afb180799746d67a0a9b047690170a1b Mon Sep 17 00:00:00 2001 From: DJ2LS <75909252+DJ2LS@users.noreply.github.com> Date: Tue, 15 Dec 2020 12:06:49 +0100 Subject: [PATCH] Add files via upload --- test/TEST_TX.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/test/TEST_TX.py b/test/TEST_TX.py index 6e141fc5..78f40ccd 100644 --- a/test/TEST_TX.py +++ b/test/TEST_TX.py @@ -69,16 +69,21 @@ class FreeDV(): ###################### CHECKSUM COMPARISON FREEDV VS CRCENGINE ######## #https://crccalc.com - teststring = b'test' + teststring = b'123456789' - #FreeDV crc16 checksum -> c_int16 == c_short - crctest = c_ushort(self.c_lib.freedv_gen_crc16(teststring, 30)) - print(crctest.value) #7450 + + # freedv crc16 checksum + crctest2 = c_ushort(self.c_lib.freedv_gen_crc16(teststring, len(teststring))) + print("FREEDV2: " + str(crctest2.value) + " = " + hex(crctest2.value)) #7450 + + #Python crc16 checksum crc_algorithm = crcengine.new('crc16-ccitt-false') #load crc16 library - crctest2 = crc_algorithm(teststring) - print(crctest2) #8134 + crctest3 = crc_algorithm(teststring) + print("CRCENGINE: " + str(crctest3) + " = " + hex(crctest3)) #8134 + + ####################################################################### @@ -128,4 +133,4 @@ class FreeDV(): -main() \ No newline at end of file +main()