CCSDS Synchronization and Channel Coding (131.0-B, 231.0-B)
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.

+42 -14
+33 -14
README.md
··· 49 49 `ocaml-viterbi`, `ocaml-turbo`, `ocaml-ldpc`). This package provides the 50 50 CCSDS-specific parameterizations. 51 51 52 + ## Installation 53 + 54 + Install with opam: 55 + 56 + ```sh 57 + opam install scc scc-eio 58 + ``` 59 + 60 + If opam cannot find the packages, they may not yet be released in the public 61 + `opam-repository`. Add the overlay repository, then install them: 62 + 63 + ```sh 64 + opam repo add samoht https://tangled.org/gazagnaire.org/opam-overlay.git 65 + opam update 66 + opam install scc scc-eio 67 + ``` 68 + 52 69 ## Usage 53 70 54 71 ```ocaml ··· 56 73 let cltu = Scc.Sync.Cltu.encode tc_frame 57 74 58 75 (* TM downlink: randomize + RS encode + convolutional encode *) 59 - let r = Scc.Coding.Randomizer.create () in 60 - Scc.Coding.Randomizer.apply r frame 0 (Bytes.length frame); 61 - let codeword = Scc.Coding.Reed_solomon.encode ~interleave:I5 frame in 76 + let r = Scc.Coding.Randomizer.create () 77 + let () = Scc.Coding.Randomizer.apply r frame 0 (Bytes.length frame) 78 + let codeword = Scc.Coding.Reed_solomon.encode ~interleave:I5 frame 62 79 let coded = Scc.Coding.Convolutional.encode codeword 63 80 64 81 (* Stream parsing: extract CLTUs from raw bytes *) 65 - let state = ref (Scc.Sync.Cltu_sync.init ()) in 66 - let new_state, result = Scc.Sync.Cltu_sync.feed !state raw_bytes in 67 - state := new_state 82 + let state = ref (Scc.Sync.Cltu_sync.init ()) 83 + let () = 84 + let new_state, result = Scc.Sync.Cltu_sync.feed !state raw_bytes in 85 + state := new_state; 86 + ignore result 68 87 ``` 69 88 70 89 ## Eio Transport (`scc-eio`) ··· 72 91 The `scc-eio` package provides Eio flow-based send/recv: 73 92 74 93 ```ocaml 75 - (* Receive CLTU-framed TC from a raw byte stream *) 76 - match Scc_eio.Cltu.recv flow with 77 - | Ok frame -> process_tc frame 78 - | Error `Closed -> () 79 - | Error (`Transport e) -> log_error e 80 - 81 - (* Send ASM-framed TM *) 82 - Scc_eio.Asm.send flow tm_frame 94 + let () = 95 + (* Receive CLTU-framed TC from a raw byte stream *) 96 + (match Scc_eio.Cltu.recv flow with 97 + | Ok frame -> process_tc frame 98 + | Error `Closed -> () 99 + | Error (`Transport e) -> log_error e); 100 + (* Send ASM-framed TM *) 101 + Scc_eio.Asm.send flow tm_frame 83 102 ```
+4
dune
··· 1 1 (env 2 2 (dev 3 3 (flags :standard %{dune-warnings}))) 4 + 5 + (mdx 6 + (files README.md) 7 + (libraries scc scc-eio))
+3
dune-project
··· 1 1 (lang dune 3.21) 2 + (using mdx 0.4) 2 3 (name scc) 3 4 (generate_opam_files true) 4 5 (license ISC) ··· 23 24 (fmt (>= 0.9)) 24 25 (logs (>= 0.7)) 25 26 (alcotest :with-test) 27 + (mdx :with-test) 26 28 (alcobar :with-test))) 27 29 28 30 (package ··· 36 38 (bytesrw-eio (>= 0.1)) 37 39 (cstruct (>= 6.0)) 38 40 (fmt (>= 0.9)) 41 + (mdx :with-test) 39 42 (logs (>= 0.7))))
+1
scc-eio.opam
··· 15 15 "bytesrw-eio" {>= "0.1"} 16 16 "cstruct" {>= "6.0"} 17 17 "fmt" {>= "0.9"} 18 + "mdx" {with-test} 18 19 "logs" {>= "0.7"} 19 20 "odoc" {with-doc} 20 21 ]
+1
scc.opam
··· 19 19 "fmt" {>= "0.9"} 20 20 "logs" {>= "0.7"} 21 21 "alcotest" {with-test} 22 + "mdx" {with-test} 22 23 "alcobar" {with-test} 23 24 "odoc" {with-doc} 24 25 ]