Astro~/0.3
** CLI / astro cadu * PAGE 08 / 22
** Astro * CLI
** /cli/cadu

astro cadu

Channel Access Data Units, wrap, unwrap, inspect, sync.

Channel Access Data Unit operations: wrap, unwrap, inspect, and sync CADUs (CCSDS 131.0-B-5).

Subcommands

CommandDescription
astro cadu wrapWrap a TM frame into a CADU (prepend ASM, optionally randomize)
astro cadu unwrapStrip ASM and optionally de-randomize to extract TM frame
astro cadu inspectAnnotated CADU breakdown with ASM validation and hex dump
astro cadu syncScan a byte stream for ASM markers and extract aligned CADUs
astro cadu genGenerate synthetic CADUs

astro cadu wrap

Prepend the Attached Sync Marker (0x1ACFFC1D) and optionally apply CCSDS pseudo-randomization to produce a CADU.

astro cadu wrap [file] [flags]

Flags

FlagDefaultDescription
--inputhexInput format: hex or bin
--formathexOutput format: text, json, or hex
--randomizefalseApply CCSDS pseudo-randomization

Examples

# Wrap a TM frame
astro tm encode --scid 26 --vcid 1 --data 0102030405 | astro cadu wrap --input hex

# Wrap with randomization
astro tm encode --scid 26 --vcid 1 --data 0102030405 | astro cadu wrap --input hex --randomize

astro cadu unwrap

Strip the ASM and optionally de-randomize to extract TM Transfer Frame data.

astro cadu unwrap [file] [flags]

Flags

FlagDefaultDescription
--inputhexInput format: hex or bin
--formathexOutput format: text, json, or hex
--derandomizefalseApply CCSDS de-randomization

Examples

# Unwrap a CADU
astro cadu unwrap --input hex cadu.hex

# Unwrap with de-randomization
cat cadu.hex | astro cadu unwrap --input hex --derandomize

astro cadu inspect

Display an annotated breakdown of a CADU showing ASM validation, frame data hex dump, and full raw dump.

astro cadu inspect [file] [flags]

Flags

FlagDefaultDescription
--inputhexInput format: hex or bin

Examples

astro tm encode --scid 26 --vcid 1 --data 0102030405 | astro cadu wrap --input hex | astro cadu inspect --input hex

astro cadu sync

Scan a raw byte stream for CCSDS Attached Sync Markers (0x1ACFFC1D) and extract aligned CADUs of a given length.

A CADU stream carries no length field, so alignment is found by searching for the marker. Octets outside any CADU are skipped and counted rather than treated as an error: a capture normally begins part way through a frame, and there is noise between passes. Alignment is reacquired at the next marker, so junk in the middle costs only the frames it overwrote.

The scan is incremental, so it works on a live pipe and on a capture larger than memory.

astro cadu sync [file] [flags]

Flags

FlagDefaultDescription
--inputhexInput format: hex or bin
--formattextOutput format: text, json, or hex
--frame-len(required)Total CADU length in bytes including ASM

Examples

# Sync and extract CADUs from a binary capture
astro cadu sync --input bin --frame-len 1115 capture.bin

# Sync from hex with JSON output
astro cadu sync --input hex --frame-len 17 --format json stream.hex

astro cadu gen

Generate a stream of synthetic CADUs (an ASM followed by a TM frame) with incrementing counters and random data.

astro cadu gen [flags]

Flags

FlagDefaultDescription
--scid0Spacecraft ID (0-1023)
--vcid0Virtual Channel ID (0-7)
--count10Number of CADUs to generate
--data-size1024TM frame data field size in bytes
--randomizefalseApply CCSDS pseudo-randomization
--formatbinOutput format: bin or hex

Examples

# Generate 100 CADUs
astro cadu gen --scid 1 --vcid 0 --count 100 --data-size 1024

# Generate randomized CADUs and sync them back
astro cadu gen --scid 1 --count 10 --data-size 100 --format bin | astro cadu sync --input bin --frame-len 112

Piping

# Full TM chain: encode frame -> wrap CADU -> inspect
astro tm encode --scid 26 --vcid 1 --data 0102030405 | astro cadu wrap --input hex | astro cadu inspect --input hex

# Wrap -> Unwrap round-trip
astro tm encode --scid 26 --vcid 1 --data 0102030405 | astro cadu wrap --input hex | astro cadu unwrap --input hex

# Wrap with randomize -> Unwrap with derandomize
astro tm encode --scid 26 --vcid 1 --data 0102030405 | astro cadu wrap --input hex --randomize | astro cadu unwrap --input hex --derandomize

See also: the protocol page for the standard and the Go API, and the conformance statement for what is and is not implemented.