Astro~/0.3
** CLI / astro cop * PAGE 13 / 22
** Astro * CLI
** /cli/cop

astro cop

COP-1, build and read the Communications Link Control Word.

Build and read the Communications Link Control Word (CCSDS 232.1-B-2).

The CLCW is the part of COP-1 that travels on the wire. FARM-1 on the spacecraft generates it, and it comes back in a telemetry frame's Operational Control Field, where it tells FOP-1 on the ground what the receiver has accepted and whether it can take more.

FOP-1 and FARM-1 themselves are state machines driven by a session, not by a single invocation, so there is nothing here for them. Use the library.

Subcommands

CommandDescription
astro cop clcw-encodeBuild a CLCW from fields
astro cop clcw-decodeDecode a CLCW

astro cop clcw-encode

Construct a four-octet CLCW, ready to go in a telemetry frame's OCF.

COP In Effect is set to 01 for COP-1 (table 4-1) rather than offered as a flag, because it is the only procedure this package implements.

astro cop clcw-encode [flags]

Flags

FlagDefaultDescription
--scid0Spacecraft ID, for the text summary only
--vcid0Virtual Channel ID this CLCW reports on (0-63)
--report-value0Next frame sequence number the receiver expects, N(R)
--waitfalseSet the Wait flag: the receiver has no buffer
--retransmitfalseSet the Retransmit flag
--lockoutfalseSet the Lockout flag
--no-rffalseSet the No RF Available flag
--no-bit-lockfalseSet the No Bit Lock flag
--farm-b-counter0FARM-B counter (2 bits)
--formathexOutput format: text or hex

Examples

# A nominal CLCW
astro cop clcw-encode --vcid 0 --report-value 7

# The receiver has no buffer
astro cop clcw-encode --vcid 0 --report-value 7 --wait

# Straight into a frame's OCF
astro tm encode --scid 42 --vcid 0 --data 0102 \
  --ocf "$(astro cop clcw-encode --vcid 0 --report-value 7)"

astro cop clcw-decode

Decode a four-octet CLCW and print its fields. This is what you want when a frame's OCF is not saying what you expected: it shows every flag that decides how FOP-1 will react.

astro cop clcw-decode [file] [flags]

Flags

FlagDefaultDescription
--inputhexInput format: hex or bin
--formattextOutput format: text or json

Examples

astro cop clcw-decode --input hex < ocf.hex

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