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-linkedin: apply dune fmt

Pure formatting changes from `dune fmt`: doc comment placement moves
from above the binding to below it for `type`s, multi-line `match`
expressions collapse onto one line where they fit, and infix operator
applications pick up spaces (`Soup.($?)` -> `Soup.( $? )`). No
semantic changes.

+27 -11
+20 -11
README.md
··· 7 7 8 8 ## Installation 9 9 10 + Install with opam: 11 + 12 + ```sh 13 + $ opam install aos 10 14 ``` 11 - opam install aos 15 + 16 + If opam cannot find the package, it may not yet be released in the public 17 + `opam-repository`. Add the overlay repository, then install it: 18 + 19 + ```sh 20 + $ opam repo add samoht https://tangled.org/gazagnaire.org/opam-overlay.git 21 + $ opam update 22 + $ opam install aos 12 23 ``` 13 24 14 25 ## Usage 15 26 16 27 ```ocaml 17 28 (* Decode an AOS frame *) 18 - let () = 19 - let buf = (* ... frame bytes ... *) in 29 + let decode buf = 20 30 match Aos.decode buf with 21 - | Error e -> Printf.printf "Error: %a\n" Aos.pp_error e 31 + | Error e -> Fmt.pr "Error: %a@." Aos.pp_error e 22 32 | Ok frame -> 23 - Printf.printf "SCID: %d, VCID: %d, Data: %d bytes\n" 33 + Fmt.pr "SCID: %d, VCID: %d, Data: %d bytes@." 24 34 (Aos.scid_to_int frame.header.scid) 25 35 (Aos.vcid_to_int frame.header.vcid) 26 36 (String.length frame.data) 27 37 28 38 (* Create and encode an AOS frame *) 29 - let () = 39 + let encode_simple () = 30 40 let scid = Aos.scid_exn 42 in 31 41 let vcid = Aos.vcid_exn 5 in 32 42 let frame = Aos.v ~scid ~vcid ~vcfc:12345 "payload data" in 33 43 let encoded = Aos.encode frame in 34 - Printf.printf "Encoded: %d bytes\n" (String.length encoded) 44 + Fmt.pr "Encoded: %d bytes@." (String.length encoded) 35 45 36 46 (* Create a frame with CLCW *) 37 - let () = 47 + let encode_with_clcw () = 38 48 let scid = Aos.scid_exn 42 in 39 49 let vcid = Aos.vcid_exn 5 in 40 - let clcw_vcid = Clcw.vcid_exn 5 in 41 - let clcw = Clcw.v ~vcid:clcw_vcid ~report_value:100 () in 50 + let clcw = Clcw.v ~vcid:5 ~report_value:100 () in 42 51 let frame = Aos.with_clcw ~scid ~vcid ~vcfc:1 ~clcw "data" in 43 52 let encoded = Aos.encode frame in 44 - Printf.printf "Frame with CLCW: %d bytes\n" (String.length encoded) 53 + Fmt.pr "Frame with CLCW: %d bytes@." (String.length encoded) 45 54 ``` 46 55 47 56 ## Frame Format
+1
aos.opam
··· 16 16 "crc" {>= "0.1"} 17 17 "wire" {>= "0.1"} 18 18 "alcotest" {with-test} 19 + "mdx" {with-test} 19 20 "alcobar" {with-test} 20 21 "odoc" {with-doc} 21 22 ]
+4
dune
··· 1 1 (env 2 2 (dev 3 3 (flags :standard %{dune-warnings}))) 4 + 5 + (mdx 6 + (files README.md) 7 + (libraries aos clcw fmt))
+2
dune-project
··· 1 1 (lang dune 3.21) 2 + (using mdx 0.4) 2 3 3 4 (name aos) 4 5 ··· 25 26 (crc (>= 0.1)) 26 27 (wire (>= 0.1)) 27 28 (alcotest :with-test) 29 + (mdx :with-test) 28 30 (alcobar :with-test)))