CCSDS AOS (Advanced Orbiting Systems) Transfer Frame for satellite downlinks
0
fork

Configure Feed

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

OCaml 73.4%
Java 16.9%
PHP 2.2%
Roff 1.5%
Dune 1.3%
Shell 0.3%
Other 4.4%
71 1 0

Clone this repository

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

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

Download tar.gz
README.md

ocaml-aos#

CCSDS AOS (Advanced Orbiting Systems) Transfer Frame parser and encoder.

AOS frames are defined in CCSDS 732.0-B-4 and used for high-rate downlinks from satellites.

Installation#

Install with opam:

$ opam install aos

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 aos

Usage#

(* Decode an AOS frame *)
let decode buf =
  match Aos.decode buf with
  | Error e -> Fmt.pr "Error: %a@." Aos.pp_error e
  | Ok frame ->
      Fmt.pr "SCID: %d, VCID: %d, Data: %d bytes@."
        (Aos.scid_to_int frame.header.scid)
        (Aos.vcid_to_int frame.header.vcid)
        (String.length frame.data)

(* Create and encode an AOS frame *)
let encode_simple () =
  let scid = Aos.scid_exn 42 in
  let vcid = Aos.vcid_exn 5 in
  let frame = Aos.v ~scid ~vcid ~vcfc:12345 "payload data" in
  let encoded = Aos.encode frame in
  Fmt.pr "Encoded: %d bytes@." (String.length encoded)

(* Create a frame with CLCW *)
let encode_with_clcw () =
  let scid = Aos.scid_exn 42 in
  let vcid = Aos.vcid_exn 5 in
  let clcw = Clcw.v ~vcid:5 ~report_value:100 () in
  let frame = Aos.with_clcw ~scid ~vcid ~vcfc:1 ~clcw "data" in
  let encoded = Aos.encode frame in
  Fmt.pr "Frame with CLCW: %d bytes@." (String.length encoded)

Frame Format#

Primary header (6 bytes):
  Byte 0-1: TFVN(2b) | SCID(8b) | VCID(6b)
  Byte 2-4: VC Frame Count (24b)
  Byte 5:   RF(1b) | SF(1b) | spare(2b) | VFCC(4b)

Optional insert zone (variable)
Data field (variable)
Optional OCF (4 bytes) - Contains CLCW
Optional FECF (2 bytes) - CRC-16-CCITT

Licence#

MIT