From 571e747e170cd80ef935f4b51fffb3b51c9a3a05 Mon Sep 17 00:00:00 2001 From: dmitri-mcguckin Date: Tue, 9 Jan 2024 19:24:53 -0800 Subject: [PATCH 1/2] oresat_configs/__main__.py --- .gitignore | 5 +++++ oresat_configs/scripts/gen_xtce.py | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/.gitignore b/.gitignore index 403149c..169ad13 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,8 @@ +# Custom +**/*.xtce +**/*.dcf +**/*.dbc + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] diff --git a/oresat_configs/scripts/gen_xtce.py b/oresat_configs/scripts/gen_xtce.py index 0d775fe..5b5dbbf 100644 --- a/oresat_configs/scripts/gen_xtce.py +++ b/oresat_configs/scripts/gen_xtce.py @@ -258,6 +258,16 @@ def write_xtce(config: OreSatConfig, dir_path: str = "."): fixed_value.text = str(len(obj.default) * 8) para_set = ET.SubElement(tm_meta, "ParameterSet") + # Hard-code the AX.25 headers as a U16 + ET.SubElement( + para_set, + "Parameter", + attrib={ + "name": "ax25_header", + "parameterTypeRef": "uint16_type", + "shortDescription": "AX.25 Header" + }, + ) for obj in config.beacon_def: ET.SubElement( para_set, @@ -278,6 +288,13 @@ def write_xtce(config: OreSatConfig, dir_path: str = "."): }, ) entry_list = ET.SubElement(seq_cont, "EntryList") + ET.SubElement( + entry_list, + "ParameterRefEntry", + attrib={ + "parameterRef": "ax25_header" + }, + ) for obj in config.beacon_def: ET.SubElement( entry_list, From e9bed807a3d87c0779c37c879b6918d1d09b2532 Mon Sep 17 00:00:00 2001 From: dmitri-mcguckin Date: Tue, 9 Jan 2024 20:52:32 -0800 Subject: [PATCH 2/2] AX.25 parameter is 128 bis (16 bytes) not 16 bits --- oresat_configs/scripts/gen_xtce.py | 34 +++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/oresat_configs/scripts/gen_xtce.py b/oresat_configs/scripts/gen_xtce.py index 5b5dbbf..dea803d 100644 --- a/oresat_configs/scripts/gen_xtce.py +++ b/oresat_configs/scripts/gen_xtce.py @@ -113,6 +113,33 @@ def write_xtce(config: OreSatConfig, dir_path: str = "."): tm_meta = ET.SubElement(root, "TelemetryMetaData") tm_meta_para = ET.SubElement(tm_meta, "ParameterTypeSet") + # Hard-code the 128b type for the AX.25 parameter + uint128_type = ET.SubElement( + tm_meta_para, + "BinaryParameterType", + attrib={ + "name": "b128_type", + "shortDescription": "128 bitfield", + }, + ) + ET.SubElement(uint128_type, "UnitSet") + bin_data_enc = ET.SubElement( + uint128_type, + "BinaryDataEncoding", + attrib={ + "bitOrder": "leastSignificantBitFirst" + } + ) + bin_data_enc_size = ET.SubElement( + bin_data_enc, + "SizeInBits", + ) + bin_data_enc_size_fixed = ET.SubElement( + bin_data_enc_size, + "FixedValue", + ) + bin_data_enc_size_fixed.text = "128" + para_type = ET.SubElement( tm_meta_para, "AbsoluteTimeParameterType", @@ -153,7 +180,7 @@ def write_xtce(config: OreSatConfig, dir_path: str = "."): ) unit_set = ET.SubElement(para_type, "UnitSet") dt_len = DT_LEN[obj.data_type] # Length of the data type - # Integer-type encoding for enums + # Integer-type encoding for Integers int_dt_enc = ET.SubElement( para_type, "IntegerDataEncoding", @@ -258,13 +285,14 @@ def write_xtce(config: OreSatConfig, dir_path: str = "."): fixed_value.text = str(len(obj.default) * 8) para_set = ET.SubElement(tm_meta, "ParameterSet") - # Hard-code the AX.25 headers as a U16 + + # Hard-code the AX.25 headers as a Binary128 type ET.SubElement( para_set, "Parameter", attrib={ "name": "ax25_header", - "parameterTypeRef": "uint16_type", + "parameterTypeRef": "b128_type", "shortDescription": "AX.25 Header" }, )