CCSDS USLP (Unified Space Link Protocol) Transfer Frame- unified TM/TC/AOS
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.

+31 -11
+24 -11
README.md
··· 7 7 8 8 ## Installation 9 9 10 + Install with opam: 11 + 12 + ```sh 13 + $ opam install uslp 10 14 ``` 11 - opam install uslp 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 uslp 12 23 ``` 13 24 14 25 ## Usage ··· 16 27 ```ocaml 17 28 (* Decode a USLP frame *) 18 29 let () = 19 - let buf = (* ... frame bytes ... *) in 20 - match Uslp.decode buf with 30 + 31 + let buf = "" 32 + match Uslp.decode buf with 21 33 | Error e -> Printf.printf "Error: %a\n" Uslp.pp_error e 22 34 | Ok frame -> 23 35 Printf.printf "SCID: %d, VCID: %d, MAP: %d\n" ··· 27 39 28 40 (* Create and encode a USLP frame *) 29 41 let () = 30 - let scid = Uslp.scid_exn 1000 in 31 - let vcid = Uslp.vcid_exn 5 in 32 - let map_id = Uslp.map_id_exn 3 in 33 - let frame = Uslp.v ~scid ~vcid ~map_id ~vcfc:12345 ~vcfc_len:2 "payload" in 34 - let encoded = Uslp.encode ~fecf:Uslp.Crc16 frame in 35 - Printf.printf "Encoded: %d bytes\n" (String.length encoded) 42 + 43 + let scid = Uslp.scid_exn 1000 44 + let vcid = Uslp.vcid_exn 5 45 + let map_id = Uslp.map_id_exn 3 46 + let frame = Uslp.v ~scid ~vcid ~map_id ~vcfc:12345 ~vcfc_len:2 "payload" 47 + let encoded = Uslp.encode ~fecf:Uslp.Crc16 frame Printf.printf "Encoded: %d bytes\n" (String.length encoded) 36 48 37 49 (* Decode with VCFC and CRC-32 *) 38 50 let () = 39 - let buf = (* ... *) in 40 - match Uslp.decode ~vcfc_len:2 ~expect_fecf:Uslp.Crc32 buf with 51 + 52 + let buf = "" 53 + match Uslp.decode ~vcfc_len:2 ~expect_fecf:Uslp.Crc32 buf with 41 54 | Error e -> Printf.printf "Error: %a\n" Uslp.pp_error e 42 55 | Ok frame -> Printf.printf "VCFC: %d\n" frame.header.vcfc 43 56 ```
+4
dune
··· 1 1 (env 2 2 (dev 3 3 (flags :standard %{dune-warnings}))) 4 + 5 + (mdx 6 + (files README.md) 7 + (libraries uslp))
+2
dune-project
··· 1 1 (lang dune 3.21) 2 + (using mdx 0.4) 2 3 3 4 (name uslp) 4 5 ··· 25 26 (fmt (>= 0.1)) 26 27 (wire (>= 0.1)) 27 28 (alcotest :with-test) 29 + (mdx :with-test) 28 30 (alcobar :with-test)))
+1
uslp.opam
··· 17 17 "fmt" {>= "0.1"} 18 18 "wire" {>= "0.1"} 19 19 "alcotest" {with-test} 20 + "mdx" {with-test} 20 21 "alcobar" {with-test} 21 22 "odoc" {with-doc} 22 23 ]