From 7f54fe7f1054302b3571cbce92d92b05cff66173 Mon Sep 17 00:00:00 2001 From: ryanpdx Date: Sun, 12 Nov 2023 07:58:59 -0800 Subject: [PATCH] add ax.25 response obj and minor fixes This allows the configs to be backwards compatible with oresat0. oresat0 has both c-bits set to 0, all future oresats will have one have one ax.25 c-bit set to 1 and the other set to 0. --- docs/scripts/gen_beacon_rst.py | 9 ++++++--- oresat_configs/_yaml_to_od.py | 2 +- oresat_configs/base/c3.yaml | 9 ++++++++- oresat_configs/oresat0/beacon.yaml | 3 ++- oresat_configs/oresat0_5/beacon.yaml | 3 ++- oresat_configs/oresat1/beacon.yaml | 3 ++- 6 files changed, 21 insertions(+), 8 deletions(-) diff --git a/docs/scripts/gen_beacon_rst.py b/docs/scripts/gen_beacon_rst.py index 2a01d9f..ded7bb1 100644 --- a/docs/scripts/gen_beacon_rst.py +++ b/docs/scripts/gen_beacon_rst.py @@ -55,12 +55,15 @@ def gen_beacon_rst(config: OreSatConfig, file_path: str, url: str): dest_callsign = dest_callsign + " " * (6 - len(dest_callsign)) dest_ssid = c3_od["beacon"]["dest_ssid"].value command = c3_od["beacon"]["command"].value - reversed_bits = 0b0110_0000 + response = c3_od["beacon"]["response"].value control = c3_od["beacon"]["control"].value pid = c3_od["beacon"]["pid"].value - dest_ssid = (dest_ssid << 1) | (int(not command) << 7) | reversed_bits - src_ssid = (src_ssid << 1) | (int(command) << 7) | reversed_bits | 1 + reserved_bits = 0b0110_0000 + end_of_addresses = 0b1 + + dest_ssid = (dest_ssid << 1) | (int(command) << 7) | reserved_bits + src_ssid = (src_ssid << 1) | (int(response) << 7) | reserved_bits | end_of_addresses header_line = ( "+------------------+-----------------------------------+-----------+---------------------" diff --git a/oresat_configs/_yaml_to_od.py b/oresat_configs/_yaml_to_od.py index 3cdd3e3..93e21d1 100644 --- a/oresat_configs/_yaml_to_od.py +++ b/oresat_configs/_yaml_to_od.py @@ -674,9 +674,9 @@ def _gen_od_db(oresat_id: OreSatId, beacon_def: dict, configs: dict) -> dict: od["beacon"]["dest_ssid"].default = beacon_def["ax25"]["dest_ssid"] od["beacon"]["src_callsign"].default = beacon_def["ax25"]["src_callsign"] od["beacon"]["src_ssid"].default = beacon_def["ax25"]["src_ssid"] - od["beacon"]["src_ssid"].default = beacon_def["ax25"]["src_ssid"] od["beacon"]["control"].default = beacon_def["ax25"]["control"] od["beacon"]["command"].default = beacon_def["ax25"]["command"] + od["beacon"]["response"].default = beacon_def["ax25"]["response"] od["beacon"]["pid"].default = beacon_def["ax25"]["pid"] od["flight_mode"].access_type = "ro" diff --git a/oresat_configs/base/c3.yaml b/oresat_configs/base/c3.yaml index 869bea6..dc05df6 100644 --- a/oresat_configs/base/c3.yaml +++ b/oresat_configs/base/c3.yaml @@ -430,7 +430,14 @@ objects: - subindex: 0xc name: command data_type: bool - description: defines the ax.25 header source and destination command bit values + description: the ax.25 header destination c-bit value + access_type: const + # default set via beacon.yaml file + + - subindex: 0xd + name: response + data_type: bool + description: the ax.25 header source c-bit value access_type: const # default set via beacon.yaml file diff --git a/oresat_configs/oresat0/beacon.yaml b/oresat_configs/oresat0/beacon.yaml index 790622a..2eee22f 100644 --- a/oresat_configs/oresat0/beacon.yaml +++ b/oresat_configs/oresat0/beacon.yaml @@ -6,7 +6,8 @@ ax25: src_ssid: 0 control: 0x3 # ui-frame pid: 0xf0 # no L3 protocol - command: true + command: false + response: false fields: # c3 - [beacon, start_chars] diff --git a/oresat_configs/oresat0_5/beacon.yaml b/oresat_configs/oresat0_5/beacon.yaml index 158e6f6..90f271b 100644 --- a/oresat_configs/oresat0_5/beacon.yaml +++ b/oresat_configs/oresat0_5/beacon.yaml @@ -6,7 +6,8 @@ ax25: src_ssid: 11 # balloons, aircraft, spacecraft, etc control: 0x3 # ui-frame pid: 0xf0 # no L3 protocol - command: true + command: false + response: true fields: # c3 - [beacon, start_chars] diff --git a/oresat_configs/oresat1/beacon.yaml b/oresat_configs/oresat1/beacon.yaml index 785c219..51b7d94 100644 --- a/oresat_configs/oresat1/beacon.yaml +++ b/oresat_configs/oresat1/beacon.yaml @@ -6,7 +6,8 @@ ax25: src_ssid: 11 # balloons, aircraft, spacecraft, etc control: 0x3 # ui-frame pid: 0xf0 # no L3 protocol - command: true + command: false + response: true fields: - [beacon, start_chars] - [satellite_id]