CCSDS Command Link Control Word (CLCW) for spacecraft command
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

OCaml 74.2%
Java 11.3%
Roff 2.9%
PHP 2.7%
Dune 1.9%
Shell 0.6%
Other 6.4%
77 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#

Install with opam:

$ opam install clcw

If opam cannot find the package, it may not yet be released in the public opam-repository. Add the overlay repository, then install it:

$ opam repo add samoht https://tangled.org/gazagnaire.org/opam-overlay.git
$ opam update
$ opam install clcw

Usage#

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

(* Encode a CLCW *)
let () =
  let clcw = Clcw.v ~vcid:10 ~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