ocaml-sle#
Pure OCaml implementation of CCSDS Space Link Extension (SLE) protocols for ground station communication.
Features#
- RAF - Return All Frames (downlink telemetry)
- RCF - Return Channel Frames (filtered downlink)
- FCLTU - Forward CLTU (uplink telecommands)
- TML - Transport Mapping Layer framing
- ISP1 - Authentication
Installation#
opam install sle sle-eio
Usage#
The sle package provides a pure functional state machine with no I/O effects.
The sle-eio package wraps it with Eio for TCP communication.
Eio_main.run @@ fun env ->
Eio.Switch.run @@ fun sw ->
let config = Sle_eio.default_config ~host:"sle-provider.example.com" ~port:5100 in
match Sle_eio.connect ~sw ~net:(Eio.Stdenv.net env) ~clock:(Eio.Stdenv.clock env) config with
| Error e -> Fmt.epr "Connection failed: %a@." Sle_eio.pp_error e
| Ok client ->
match Sle_eio.bind client ~initiator_id:"user" ~responder_port_id:"RAF"
~service_type:Sle.Bind.Raf_all ~version:5
~service_instance_id:"sagr=1.spack=..." with
| Error e -> Fmt.epr "Bind failed: %a@." Sle_eio.pp_error e
| Ok _version ->
match Sle_eio.start_raf client ~start_time:None ~stop_time:None
~requested_quality:Sle.Common.Good with
| Error e -> Fmt.epr "Start failed: %a@." Sle_eio.pp_error e
| Ok () ->
(* Receive frames *)
let rec loop () =
match Sle_eio.recv_frame client with
| Error Sle_eio.Closed -> ()
| Error e -> Fmt.epr "Error: %a@." Sle_eio.pp_error e
| Ok frame ->
process_frame frame.data;
loop ()
in
loop ()
References#
- CCSDS 913.1-B-2 - Space Link Extension Services
Licence#
ISC