formaty/formats/ccsds.toml

57 lines
1.5 KiB
TOML
Raw Normal View History

# Consultative Committee for Space Data Systems (CCSDS) Space Packet Defenition
# Primary Header + Raw Payload
# Ref: https://public.ccsds.org/Pubs/133x0b2e1.pdfa
#
# Example Packet:
# [0x12, 0x01, 0xc0, 0x00, 0x00, 0x05, 0x01, 0x02, 0x03, 0x04, 0x05]
#
# Output:
# Version Number: 0
# Packet Type: 1
# Secondary Header Flag: 0
# APID: 0x201
# Sequence Flags: 3
# Packet Sequence Count: 0
# Data Length: 5
# Data: [1, 2, 3, 4, 5]
# CCSDS packet w/ primary header + payload
[[formats]]
name = "ccsds"
bit_flip = false
[[formats.fields]]
name = "Version Number"
2022-04-06 02:45:58 +00:00
field_type = {type = "UInt", bit_width = 3, endianness = "BigEndian"}
[[formats.fields]]
name = "Packet Type"
2022-04-06 02:45:58 +00:00
field_type = {type = "UInt", bit_width = 1, endianness = "BigEndian"}
[[formats.fields]]
name = "Secondary Header Flag"
2022-04-06 02:45:58 +00:00
field_type = {type = "UInt", bit_width = 1, endianness = "BigEndian"}
[[formats.fields]]
name = "APID"
print_type = {print = "Base", base = 16}
2022-04-06 02:45:58 +00:00
field_type = {type = "UInt", bit_width = 11, endianness = "BigEndian"}
[[formats.fields]]
name = "Sequence Flags"
2022-04-06 02:45:58 +00:00
field_type = {type = "UInt", bit_width = 2, endianness = "BigEndian"}
[[formats.fields]]
name = "Packet Sequence Count"
2022-04-06 02:45:58 +00:00
field_type = {type = "UInt", bit_width = 14, endianness = "BigEndian"}
[[formats.fields]]
name = "Data Length"
2024-04-30 02:25:32 +00:00
field_type = {type = "UInt", bit_width = 16, 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"}