Commit 07a8982d authored by Luc Rajer's avatar Luc Rajer
Browse files

Unknown VCID catched earlier

parent 39afa44a
......@@ -14,15 +14,15 @@ try:
except ImportError:
LOGGER.error("crcmod package not installed!")
sys.exit(1)
#TODO: Remove this from core and into tmtc_globals
TRANSFER_FRAME_VERSION_NUMBER = 0b1100
SPACECRAFT_ID = 0xAFFE
SPACECRAFT_ID = 0xAB1E
# The datazone length for each possible VCID needs to be defined
VCID_LENGTH = dict([(3, 119), (0, 7)])
VCID_LENGTH = dict([(3, 1991), (0, 23)])
# VCID and MAP ID of Tm and Tc
VCID_TMTC = 3
MAP_ID_TMTC = 2
MAP_ID_TMTC = 0b1010
TFDZ_PROTOCOL_PUS = 0
TFZD_PACKETS_SPANNING_FRAMES = 0
......@@ -177,7 +177,11 @@ class USLPTransferFramePrimaryHeader:
self.virtual_channel_id = vcId
self.multiplexer_access_point_id = mapId
self.truncated_flag = truncFlag
self.data_zone_size = VCID_LENGTH[vcId]
if vcId in VCID_LENGTH:
self.data_zone_size = VCID_LENGTH[vcId]
else:
LOGGER.error("USLP Frame with unknown VCID received")
self.data_zone_size = 0
@classmethod
def from_bytearray(cls, bytes_array: bytearray):
transfer_frame_version_number = (bytes_array[0] & 0b11110000) >> 4
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment