formaty/formats/ccsds.toml
Joey Hines 6daf3a55f2
Added examples and better error reporting
+ The field that errors is now reported
+ The formats/ dir contains all predefined formats
  + Includes CCSDS packet for now
+ There appears to be an issue with bit formatting, the APID field is not being parsed correctly (upper 8 bits is not being factored in
2021-10-09 10:57:34 -06:00

44 lines
1.0 KiB
TOML

# Consultative Committee for Space Data Systems (CCSDS) Space Packet Defenition
# Primary Header + Raw Payload
# Ref: https://public.ccsds.org/Pubs/133x0b2e1.pdfa
#
# Example Packet:
# [0x08, 0x55, 0xc0, 0x00, 0x00, 0x05, 0x01, 0x02, 0x03, 0x04, 0x05]
[[formats]]
name = "ccsds"
[[formats.fields]]
name = "Version Number"
field_type = {type = "UInt", bit_width = 3}
[[formats.fields]]
name = "Packet Type"
field_type = {type = "UInt", bit_width = 1}
[[formats.fields]]
name = "Secondary Header Flag"
field_type = {type = "UInt", bit_width = 1}
[[formats.fields]]
name = "APID"
field_type = {type = "UInt", bit_width = 11}
[[formats.fields]]
name = "Sequency Flags"
field_type = {type = "UInt", bit_width = 2}
[[formats.fields]]
name = "Packet Sequence Count"
field_type = {type = "UInt", bit_width = 14}
[[formats.fields]]
name = "Data Length"
field_type = {type = "UInt", bit_width = 16}
[[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}