Skip to content

Commit

Permalink
add ax.25 response obj and minor fixes
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ryanpdx committed Nov 12, 2023
1 parent abb4e76 commit 7f54fe7
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 8 deletions.
9 changes: 6 additions & 3 deletions docs/scripts/gen_beacon_rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
"+------------------+-----------------------------------+-----------+---------------------"
Expand Down
2 changes: 1 addition & 1 deletion oresat_configs/_yaml_to_od.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
9 changes: 8 additions & 1 deletion oresat_configs/base/c3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion oresat_configs/oresat0/beacon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
3 changes: 2 additions & 1 deletion oresat_configs/oresat0_5/beacon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
3 changes: 2 additions & 1 deletion oresat_configs/oresat1/beacon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 7f54fe7

Please sign in to comment.