CCSDS Command Link Control Word (CLCW) for spacecraft command
OCaml 66.1%
C 26.5%
Dune 1.3%
PHP 1.2%
Roff 0.9%
Other 4.0%
43 1 0

Clone this repository

https://tangled.org/gazagnaire.org/ocaml-clcw https://tangled.org/did:plc:jhift2vwcxhou52p3sewcrpx/ocaml-clcw
git@git.recoil.org:gazagnaire.org/ocaml-clcw git@git.recoil.org:did:plc:jhift2vwcxhou52p3sewcrpx/ocaml-clcw

For self-hosted knots, clone URLs may differ based on your setup.

Download tar.gz
README.md

ocaml-clcw#

CCSDS Command Link Control Word (CLCW) parser and encoder.

The CLCW is a 32-bit word defined in CCSDS 232.1-B-2, carried in the Operational Control Field (OCF) of TM and AOS Transfer Frames. It provides feedback from the receiving spacecraft to the ground about the state of the command link.

Installation#

opam install clcw

Usage#

(* Decode a CLCW word *)
let () =
  let word = 0x01280032 in
  match Clcw.decode word with
  | Error e -> Printf.printf "Error: %a\n" Clcw.pp_error e
  | Ok clcw -> Printf.printf "CLCW: %a\n" Clcw.pp clcw

(* Encode a CLCW *)
let () =
  let vcid = Clcw.vcid_exn 10 in
  let clcw = Clcw.v ~vcid ~report_value:50 ~lockout:true () in
  let word = Clcw.encode clcw in
  Printf.printf "Encoded: 0x%08X\n" word

CLCW Format#

Bit 0:      Control Word Type (0=CLCW)
Bits 1-2:   CLCW Version Number
Bits 3-5:   Status Field
Bits 6-7:   COP in Effect
Bits 8-13:  Virtual Channel ID
Bits 14-15: Reserved (spare)
Bit 16:     No RF Available
Bit 17:     No Bit Lock
Bit 18:     Lockout
Bit 19:     Wait
Bit 20:     Retransmit
Bits 21-22: FARM-B Counter
Bit 23:     Reserved (spare)
Bits 24-31: Report Value N(R)

Licence#

MIT