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.

chore: extract shared CRC to ocaml-crc and update dependencies

Replace inline CRC-16/32 implementations in aos, bundle, cfdp, pid1, tc,
tm, uslp with shared ocaml-crc dependency. Fix ocaml-crc test formatting.

+4 -22
+1
dune-project
··· 20 20 Field (FECF/CRC-16), and CLCW (Command Link Control Word) for COP-1.") 21 21 (depends 22 22 (ocaml (>= 4.14)) 23 + (crc (>= 0.1)) 23 24 (wire (>= 0.1)) 24 25 (alcotest :with-test) 25 26 (crowbar :with-test)))
+1 -1
lib/dune
··· 1 1 (library 2 2 (name tm) 3 3 (public_name tm) 4 - (libraries clcw wire)) 4 + (libraries clcw crc wire))
+1 -21
lib/tm.ml
··· 108 108 set_u8 b (i + 2) (v lsr 8); 109 109 set_u8 b (i + 3) v 110 110 111 - (* CRC-16-CCITT computation *) 112 - let crc16_ccitt_table = 113 - let table = Array.make 256 0 in 114 - for i = 0 to 255 do 115 - let crc = ref (i lsl 8) in 116 - for _ = 0 to 7 do 117 - if !crc land 0x8000 <> 0 then crc := (!crc lsl 1) lxor 0x1021 118 - else crc := !crc lsl 1 119 - done; 120 - table.(i) <- !crc land 0xFFFF 121 - done; 122 - table 123 - 124 - let compute_fecf data = 125 - let crc = ref 0xFFFF in 126 - for i = 0 to String.length data - 1 do 127 - let byte = Char.code data.[i] in 128 - let idx = (!crc lsr 8) lxor byte land 0xFF in 129 - crc := (!crc lsl 8) lxor crc16_ccitt_table.(idx) land 0xFFFF 130 - done; 131 - !crc 111 + let compute_fecf = Crc.crc16_ccitt 132 112 133 113 (* Header decoding *) 134 114 let decode_header buf =
+1
tm.opam
··· 11 11 depends: [ 12 12 "dune" {>= "3.21"} 13 13 "ocaml" {>= "4.14"} 14 + "crc" {>= "0.1"} 14 15 "wire" {>= "0.1"} 15 16 "alcotest" {with-test} 16 17 "crowbar" {with-test}