2021-10-09 16:57:34 +00:00
|
|
|
# Consultative Committee for Space Data Systems (CCSDS) Space Packet Defenition
|
|
|
|
# Primary Header + Raw Payload
|
|
|
|
# Ref: https://public.ccsds.org/Pubs/133x0b2e1.pdfa
|
|
|
|
#
|
|
|
|
# Example Packet:
|
2022-04-09 17:25:09 +00:00
|
|
|
# [0xe0, 0xa1, 0xc0, 0x00, 0x00, 0x05, 0x01, 0x02, 0x03, 0x04, 0x05]
|
2021-10-09 16:57:34 +00:00
|
|
|
|
2022-04-09 18:34:15 +00:00
|
|
|
# CCSDS packet w/ primary header + payload
|
2021-10-09 16:57:34 +00:00
|
|
|
[[formats]]
|
|
|
|
name = "ccsds"
|
2022-04-09 17:25:09 +00:00
|
|
|
bit_flip = false
|
2021-10-09 16:57:34 +00:00
|
|
|
|
|
|
|
[[formats.fields]]
|
|
|
|
name = "Version Number"
|
2022-04-09 17:25:09 +00:00
|
|
|
bit_flip = true
|
2022-04-06 02:45:58 +00:00
|
|
|
field_type = {type = "UInt", bit_width = 3, endianness = "BigEndian"}
|
2021-10-09 16:57:34 +00:00
|
|
|
|
|
|
|
[[formats.fields]]
|
|
|
|
name = "Packet Type"
|
2022-04-09 17:25:09 +00:00
|
|
|
bit_flip = true
|
2022-04-06 02:45:58 +00:00
|
|
|
field_type = {type = "UInt", bit_width = 1, endianness = "BigEndian"}
|
2021-10-09 16:57:34 +00:00
|
|
|
|
|
|
|
[[formats.fields]]
|
|
|
|
name = "Secondary Header Flag"
|
2022-04-09 17:25:09 +00:00
|
|
|
bit_flip = true
|
2022-04-06 02:45:58 +00:00
|
|
|
field_type = {type = "UInt", bit_width = 1, endianness = "BigEndian"}
|
2021-10-09 16:57:34 +00:00
|
|
|
|
|
|
|
[[formats.fields]]
|
|
|
|
name = "APID"
|
2022-04-09 17:25:09 +00:00
|
|
|
bit_flip = true
|
2022-04-06 02:45:58 +00:00
|
|
|
field_type = {type = "UInt", bit_width = 11, endianness = "BigEndian"}
|
2021-10-09 16:57:34 +00:00
|
|
|
|
|
|
|
[[formats.fields]]
|
2022-04-09 17:25:09 +00:00
|
|
|
name = "Sequence Flags"
|
|
|
|
bit_flip = true
|
2022-04-06 02:45:58 +00:00
|
|
|
field_type = {type = "UInt", bit_width = 2, endianness = "BigEndian"}
|
2021-10-09 16:57:34 +00:00
|
|
|
|
|
|
|
[[formats.fields]]
|
|
|
|
name = "Packet Sequence Count"
|
2022-04-09 17:25:09 +00:00
|
|
|
bit_flip = true
|
2022-04-06 02:45:58 +00:00
|
|
|
field_type = {type = "UInt", bit_width = 14, endianness = "BigEndian"}
|
2021-10-09 16:57:34 +00:00
|
|
|
|
|
|
|
[[formats.fields]]
|
|
|
|
name = "Data Length"
|
2022-04-06 02:45:58 +00:00
|
|
|
field_type = {type = "UInt", bit_width = 16, endianness = "BigEndian"}
|
2021-10-09 16:57:34 +00:00
|
|
|
|
|
|
|
[[formats.fields]]
|
|
|
|
name = "Data"
|
|
|
|
# Allow payloads up to the max size that can be specfied in "Data Length"
|
2022-04-09 17:25:09 +00:00
|
|
|
field_type = {type = "Bytes", max_len = 65535, endianness = "BigEndian"}
|
2022-04-09 18:34:15 +00:00
|
|
|
|
|
|
|
# CCSDS packet w/ primary header + secondary header + payload
|
|
|
|
[[formats]]
|
|
|
|
name = "ccsds_sec"
|
|
|
|
bit_flip = false
|
|
|
|
|
|
|
|
[[formats.fields]]
|
|
|
|
name = "Version Number"
|
|
|
|
bit_flip = true
|
|
|
|
field_type = {type = "UInt", bit_width = 3, endianness = "BigEndian"}
|
|
|
|
|
|
|
|
[[formats.fields]]
|
|
|
|
name = "Packet Type"
|
|
|
|
bit_flip = true
|
|
|
|
field_type = {type = "UInt", bit_width = 1, endianness = "BigEndian"}
|
|
|
|
|
|
|
|
[[formats.fields]]
|
|
|
|
name = "Secondary Header Flag"
|
|
|
|
bit_flip = true
|
|
|
|
field_type = {type = "UInt", bit_width = 1, endianness = "BigEndian"}
|
|
|
|
|
|
|
|
[[formats.fields]]
|
|
|
|
name = "APID"
|
|
|
|
bit_flip = true
|
|
|
|
field_type = {type = "UInt", bit_width = 11, endianness = "BigEndian"}
|
|
|
|
|
|
|
|
[[formats.fields]]
|
|
|
|
name = "Sequence Flags"
|
|
|
|
bit_flip = true
|
|
|
|
field_type = {type = "UInt", bit_width = 2, endianness = "BigEndian"}
|
|
|
|
|
|
|
|
[[formats.fields]]
|
|
|
|
name = "Packet Sequence Count"
|
|
|
|
bit_flip = true
|
|
|
|
field_type = {type = "UInt", bit_width = 14, endianness = "BigEndian"}
|
|
|
|
|
|
|
|
[[formats.fields]]
|
|
|
|
name = "Data Length"
|
|
|
|
field_type = {type = "UInt", bit_width = 16, endianness = "BigEndian"}
|
|
|
|
|
|
|
|
[[formats.fields]]
|
|
|
|
name = "Secondary header"
|
|
|
|
field_type = {type = "Bytes", max_len = 8, endianness = "BigEndian"}
|
|
|
|
|
|
|
|
[[formats.fields]]
|
|
|
|
name = "data"
|
|
|
|
# allow payloads up to the max size that can be specfied in "data length"
|
|
|
|
field_type = {type = "Bytes", max_len = 65535, endianness = "BigEndian"}
|