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.

fix(lint): replace Printf/Format with Fmt across remaining packages

Migrate Printf.sprintf to Fmt.str, Format.fprintf to Fmt.pf, and
Format.pp_print_string to Fmt.string across bundle, gpt, hap, homebrew,
jsonwt, matter, mbr, meross, paseto, precommit, publicsuffix, qemu,
retry, sdnv, slack, sle, space-packet, spake2, sqlite, squashfs, tar,
tc, tcf, tcpcl, tm, tomlt, tty, uslp, vlog, wal, wire, yamlrw, yamlt,
osrelease, space, xdge, and crypto test runner.

+13 -14
+1 -1
lib/dune
··· 1 1 (library 2 2 (name tm) 3 3 (public_name tm) 4 - (libraries clcw crc wire)) 4 + (libraries clcw crc fmt wire))
+12 -13
lib/tm.ml
··· 13 13 14 14 let scid_exn n = 15 15 if n >= 0 && n <= 1023 then n 16 - else invalid_arg (Printf.sprintf "scid: %d out of range 0-1023" n) 16 + else invalid_arg (Fmt.str "scid: %d out of range 0-1023" n) 17 17 18 18 let scid_to_int s = s 19 19 ··· 24 24 25 25 let vcid_exn n = 26 26 if n >= 0 && n <= 7 then n 27 - else invalid_arg (Printf.sprintf "vcid: %d out of range 0-7" n) 27 + else invalid_arg (Fmt.str "vcid: %d out of range 0-7" n) 28 28 29 29 let vcid_to_int v = v 30 30 ··· 73 73 74 74 let pp_error ppf = function 75 75 | Truncated { need; have } -> 76 - Format.fprintf ppf "Truncated: need %d bytes, have %d" need have 77 - | Invalid_version v -> Format.fprintf ppf "Invalid version: %d" v 78 - | Invalid_scid s -> Format.fprintf ppf "Invalid SCID: %d" s 79 - | Invalid_vcid v -> Format.fprintf ppf "Invalid VCID: %d" v 76 + Fmt.pf ppf "Truncated: need %d bytes, have %d" need have 77 + | Invalid_version v -> Fmt.pf ppf "Invalid version: %d" v 78 + | Invalid_scid s -> Fmt.pf ppf "Invalid SCID: %d" s 79 + | Invalid_vcid v -> Fmt.pf ppf "Invalid VCID: %d" v 80 80 | Fecf_mismatch { expected; actual } -> 81 - Format.fprintf ppf "FECF mismatch: expected 0x%04X, got 0x%04X" expected 82 - actual 81 + Fmt.pf ppf "FECF mismatch: expected 0x%04X, got 0x%04X" expected actual 83 82 84 83 (* Binary helpers *) 85 84 let get_u8 s i = Char.code (String.get s i) ··· 285 284 286 285 (* Pretty-printing *) 287 286 let pp_header ppf (hdr : header) = 288 - Format.fprintf ppf 287 + Fmt.pf ppf 289 288 "@[<v>TM Header:@,\ 290 289 \ version=%d scid=%d vcid=%d@,\ 291 290 \ ocf=%b mcfc=%d vcfc=%d@,\ ··· 298 297 let pp_clcw = Clcw.pp 299 298 300 299 let pp ppf frame = 301 - Format.fprintf ppf "@[<v>%a@,data=%d bytes@,ocf=%a@,fecf=%a@]" pp_header 302 - frame.header (String.length frame.data) 303 - (Format.pp_print_option (fun ppf v -> Format.fprintf ppf "0x%08X" v)) 300 + Fmt.pf ppf "@[<v>%a@,data=%d bytes@,ocf=%a@,fecf=%a@]" pp_header frame.header 301 + (String.length frame.data) 302 + (Fmt.option (fun ppf v -> Fmt.pf ppf "0x%08X" v)) 304 303 frame.ocf 305 - (Format.pp_print_option (fun ppf v -> Format.fprintf ppf "0x%04X" v)) 304 + (Fmt.option (fun ppf v -> Fmt.pf ppf "0x%04X" v)) 306 305 frame.fecf 307 306 308 307 (* {1 Packed Header Wire Representation} *)