CCSDS TM Transfer Frames (CCSDS 132.0-B-3)
0
fork

Configure Feed

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

tm: revert find_clcw rename — name collision with clcw constructor

+11 -11
+6 -6
README.md
··· 30 30 let scid = Tm.scid_exn 100 in 31 31 let vcid = Tm.vcid_exn 2 in 32 32 let data = String.make 1103 '\x00' in 33 - let frame = Tm.make ~scid ~vcid ~mcfc:1 ~vcfc:2 data in 33 + let frame = Tm.v ~scid ~vcid ~mcfc:1 ~vcfc:2 data in 34 34 35 35 (* Encode to bytes *) 36 36 let bytes = Tm.encode frame in ··· 45 45 46 46 ```ocaml 47 47 (* Extract CLCW from frame OCF *) 48 - match Tm.get_clcw frame with 49 - | Ok clcw -> 48 + match Tm.clcw frame with 49 + | None -> print_endline "No OCF present" 50 + | Some (Error _e) -> print_endline "Invalid CLCW in OCF" 51 + | Some (Ok clcw) -> 50 52 Printf.printf "Report value (N(R)): %d\n" clcw.report_value; 51 53 if clcw.flags.lockout then print_endline "FARM-1 in lockout!" 52 - | Error `No_ocf -> print_endline "No OCF present" 53 - | Error (`Invalid_vcid _) -> print_endline "Invalid VCID in CLCW" 54 54 55 55 (* Create a CLCW *) 56 - let clcw = Tm.make_clcw ~vcid ~report_value:42 ~lockout:false () in 56 + let clcw = Tm.clcw ~vcid ~report_value:42 ~lockout:false () in 57 57 let ocf_word = Tm.encode_clcw clcw in 58 58 ``` 59 59
+1 -1
fuzz/fuzz_tm.ml
··· 167 167 match Tm.decode ~frame_len:(String.length encoded) encoded with 168 168 | Error e -> fail (Fmt.str "decode: %a" Tm.pp_error e) 169 169 | Ok decoded -> ( 170 - match Tm.clcw decoded with 170 + match Tm.find_clcw decoded with 171 171 | None -> fail "no CLCW in decoded frame" 172 172 | Some (Error e) -> fail (Fmt.str "CLCW: %a" Clcw.pp_error e) 173 173 | Some (Ok clcw') ->
+1 -1
lib/tm.ml
··· 529 529 let decode_clcw word = Clcw.decode word 530 530 let encode_clcw clcw = Clcw.encode clcw 531 531 532 - let clcw frame = 532 + let find_clcw frame = 533 533 match frame.ocf with None -> None | Some word -> Some (Clcw.decode word) 534 534 535 535 (* Constructors *)
+3 -3
lib/tm.mli
··· 176 176 val encode_clcw : Clcw.t -> int 177 177 (** [encode_clcw clcw] encodes a CLCW to a 32-bit word. *) 178 178 179 - val clcw : t -> (Clcw.t, Clcw.error) result option 180 - (** [clcw frame] extracts and decodes the CLCW from the frame's OCF if 181 - present. Returns [None] if no OCF. *) 179 + val find_clcw : t -> (Clcw.t, Clcw.error) result option 180 + (** [find_clcw frame] extracts and decodes the CLCW from the frame's OCF if present. 181 + Returns [None] if no OCF. *) 182 182 183 183 (** {1 Constructors} *) 184 184