diff --git a/CMakeLists.txt b/CMakeLists.txt index 3397989..257c4e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,6 +59,13 @@ enable_testing() ) set_tests_properties(test_horus_binary PROPERTIES PASS_REGULAR_EXPRESSION "1C9A9545") + add_test(NAME test_horus_binary_v2 + COMMAND sh -c "cd ${CMAKE_CURRENT_BINARY_DIR}/src; + sox -t raw -r 8000 -e signed-integer -b 16 -c 1 ${CMAKE_CURRENT_SOURCE_DIR}/samples/horus_v2_100bd.raw -r 48000 -t raw - | + ./horus_demod -m binary - -" + ) + set_tests_properties(test_horus_binary_v2 PROPERTIES PASS_REGULAR_EXPRESSION "0102030405060708091DBB") + add_test(NAME test_horus_rtty_7n1 COMMAND sh -c "cd ${CMAKE_CURRENT_BINARY_DIR}/src; sox ${CMAKE_CURRENT_SOURCE_DIR}/samples/rtty_7n1.wav -r 48000 -t raw - | diff --git a/custom_field_list.json b/custom_field_list.json index 882ef3d..098dfb7 100644 --- a/custom_field_list.json +++ b/custom_field_list.json @@ -29,7 +29,7 @@ ["test_field 6", "none"], ["test_field 7", "none"], ["test_field 8", "none"], - ["test_field 9", "none"], + ["test_field 9", "none"] ] } } \ No newline at end of file diff --git a/horusdemodlib/__init__.py b/horusdemodlib/__init__.py index f4bd716..3ced358 100755 --- a/horusdemodlib/__init__.py +++ b/horusdemodlib/__init__.py @@ -1 +1 @@ -__version__ = "0.1.21" +__version__ = "0.2.1" diff --git a/horusdemodlib/decoder.py b/horusdemodlib/decoder.py index 49229ef..60b2770 100644 --- a/horusdemodlib/decoder.py +++ b/horusdemodlib/decoder.py @@ -269,7 +269,7 @@ if __name__ == "__main__": parser = argparse.ArgumentParser(description="Project Horus Binary Telemetry Decoder", formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument("--test", action="store_true", default=False, help="Run unit tests.") parser.add_argument("--update", action="store_true", default=False, help="Download latest payload ID and custom fields files before continuing.") - parser.add_argument("--decode", type=str, default=None, help="Attempt to decode a hexadecial packet.") + parser.add_argument("--decode", type=str, default=None, help="Attempt to decode a hexadecial packet supplied as an argument.") parser.add_argument("-v", "--verbose", action="store_true", default=False, help="Verbose output (set logging level to DEBUG)") args = parser.parse_args() @@ -284,8 +284,14 @@ if __name__ == "__main__": ) if args.update: + # Download latest list from github. init_payload_id_list() init_custom_field_list() + else: + # Use whatever is available in the current directory + logging.info("Using existing payload/custom-field files.") + init_payload_id_list(nodownload=True) + init_custom_field_list(nodownload=True) if args.decode is not None: try: @@ -303,7 +309,7 @@ if __name__ == "__main__": ['horus_binary_v1', b'\x01\x12\x00\x00\x00\x23\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x1C\x9A\x95\x45', 'error'], ['horus_binary_v2_16byte', b'\x01\x12\x02\x00\x02\xbc\xeb!AR\x10\x00\xff\x00\xe1\x7e', ''], # id seq_no HH MM SS lat lon alt spd sat tmp bat custom data -----------------------| crc16 - ['horus_binary_v2_32byte', b'\xFF\xFF\x12\x00\x00\x00\x23\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe8\x82', ''] + ['horus_binary_v2_32byte', b'\x00\x01\x02\x00\x0C\x22\x38\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\xB4\xC6', ''] ] for _test in tests: diff --git a/horusdemodlib/payloads.py b/horusdemodlib/payloads.py index ae88469..c0f86f0 100644 --- a/horusdemodlib/payloads.py +++ b/horusdemodlib/payloads.py @@ -32,7 +32,7 @@ HORUS_CUSTOM_FIELDS = { ["test_int_field", "none"] ] }, - "4FSKTEST32": { + "4FSKTEST-V2": { "struct": " horus_get_max_ascii_out_len(hstates)){ + return 0; + } hstates->crc_ok = crc_ok; diff --git a/src/horus_gen_test_bits.c b/src/horus_gen_test_bits.c index 408aa67..50de9ae 100644 --- a/src/horus_gen_test_bits.c +++ b/src/horus_gen_test_bits.c @@ -145,7 +145,7 @@ int main(int argc,char *argv[]) { /* all zeros is nastiest sequence for demod before scrambling */ while(framecnt > 0){ memset(&input_payload, 0, nbytes); - input_payload.PayloadID = 257; + input_payload.PayloadID = 256; input_payload.Hours = 12; input_payload.Minutes = 34; input_payload.Seconds = 56;