Skip to content

Commit

Permalink
named value for fetching global APID
Browse files Browse the repository at this point in the history
  • Loading branch information
robamu committed May 24, 2022
1 parent 5648911 commit 9ee7922
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [unreleased]

## [v0.8.1]

- Named value for fetching global APID

## [v0.8.0]

- Update `PusServices` enumeration
Expand Down
2 changes: 1 addition & 1 deletion spacepackets/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.8.0"
__version__ = "0.8.1"
3 changes: 3 additions & 0 deletions spacepackets/ecss/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
from .definitions import DEFAULT_MAX_TC_DATA_SIZE


FETCH_GLOBAL_APID = -1


class PusVersion(enum.IntEnum):
# ESA PSS-07-101. Not supported by this package!
ESA_PUS = 0
Expand Down
3 changes: 2 additions & 1 deletion spacepackets/ecss/tc.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
PusVersion,
get_pus_tc_version,
get_max_tc_packet_size,
FETCH_GLOBAL_APID,
)


Expand Down Expand Up @@ -168,7 +169,7 @@ def __init__(
source_id: int = 0,
pus_version: PusVersion = PusVersion.GLOBAL_CONFIG,
ack_flags: int = 0b1111,
apid: int = -1,
apid: int = FETCH_GLOBAL_APID,
):
"""Initiate a PUS telecommand from the given parameters. The raw byte representation
can then be retrieved with the :py:meth:`pack` function.
Expand Down
9 changes: 7 additions & 2 deletions spacepackets/ecss/tm.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@
PacketTypes,
)
from spacepackets.ccsds.time import CdsShortTimestamp, read_p_field
from spacepackets.ecss.conf import get_pus_tm_version, PusVersion, get_default_tm_apid
from spacepackets.ecss.conf import (
get_pus_tm_version,
PusVersion,
get_default_tm_apid,
FETCH_GLOBAL_APID,
)


def get_service_from_raw_pus_packet(raw_bytearray: bytearray) -> int:
Expand Down Expand Up @@ -43,7 +48,7 @@ def __init__(
time: CdsShortTimestamp = None,
ssc: int = 0,
source_data: bytearray = bytearray([]),
apid: int = -1,
apid: int = FETCH_GLOBAL_APID,
message_counter: int = 0,
space_time_ref: int = 0b0000,
destination_id: int = 0,
Expand Down

0 comments on commit 9ee7922

Please sign in to comment.