CCSDS Proximity-1 Space Link Protocol (211.0-B)
0
fork

Configure Feed

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

C 49.1%
OCaml 39.3%
PHP 2.9%
Roff 2.2%
Dune 1.6%
Other 4.9%
27 1 0

Clone this repository

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

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

Download tar.gz
README.md

proximity1#

CCSDS Proximity-1 Space Link Protocol for OCaml.

Proximity-1 is a short-range data-link protocol for space-to-space relay — the classic use case is a Mars orbiter talking to a surface rover. proximity1 encodes and decodes Transfer Frames (a 7-byte header plus variable-length data) per CCSDS 211.0-B-5, with support for Data, Ack, and Expedited frame types.

Installation#

Install with opam:

$ opam install proximity1

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 proximity1

Usage#

Round-trip a Data frame through the wire format:

# let frame =
    { Proximity1.version = 0;
      scid = 42;
      frame_type = Proximity1.Data;
      sequence_count = 100;
      data = "telemetry" } in
  let wire = Proximity1.encode frame in
  match Proximity1.decode wire with
  | Ok f -> Proximity1.equal f frame
  | Error _ -> false
- : bool = true

The header is a fixed 7 bytes:

# let frame =
    { Proximity1.version = 0;
      scid = 1;
      frame_type = Proximity1.Ack;
      sequence_count = 7;
      data = "" } in
  String.length (Proximity1.encode frame) - Proximity1.header_size
- : int = 0

decode reports a truncated buffer or an unknown frame type explicitly, so the caller can distinguish "need more bytes" from "unrecognized traffic":

# Proximity1.decode "short"
- : (Proximity1.t, [ `Invalid_frame_type of int | `Truncated ]) result =
Error `Truncated

Licence#

ISC