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.

irmin: add Schema.kinded for content-based dispatch (IPLD kinded unions)

+26 -8
+9 -8
fuzz/fuzz_tm.ml
··· 5 5 6 6 (** Fuzz tests for TM frames (CCSDS 132.0-B-3). 7 7 8 - Properties tested: 9 - 1. No crashes on arbitrary input (decode, header, pp) 10 - 2. Roundtrip: encode then decode recovers the same value 11 - 3. FECF detects single-bit corruption 12 - 4. CLCW integration through OCF 13 - 5. Spec invariants: field widths, FHP constants, frame counters *) 8 + Properties tested: 1. No crashes on arbitrary input (decode, header, pp) 2. 9 + Roundtrip: encode then decode recovers the same value 3. FECF detects 10 + single-bit corruption 4. CLCW integration through OCF 5. Spec invariants: 11 + field widths, FHP constants, frame counters *) 14 12 15 13 open Alcobar 16 14 ··· 86 84 Tm.decode ~frame_len:(String.length encoded) ~expect_ocf:false encoded 87 85 with 88 86 | Ok decoded -> 89 - check_eq ~pp:Fmt.int (String.length decoded.data) (String.length data) 87 + check_eq ~pp:Fmt.int 88 + (String.length decoded.data) 89 + (String.length data) 90 90 | Error _ -> fail "decode failed for valid frame") 91 91 | _ -> () 92 92 ··· 128 128 let bit = bit_pos / (len - 2) mod 8 in 129 129 let bytes = Bytes.of_string encoded in 130 130 let old_byte = Bytes.get bytes byte_pos in 131 - Bytes.set bytes byte_pos (Char.chr (Char.code old_byte lxor (1 lsl bit))); 131 + Bytes.set bytes byte_pos 132 + (Char.chr (Char.code old_byte lxor (1 lsl bit))); 132 133 match Tm.decode ~frame_len:len (Bytes.to_string bytes) with 133 134 | Error (Tm.Fecf_mismatch _) -> () 134 135 | Error _ -> ()
+7
lib/tm.ml
··· 536 536 let header ?(version = 0) ?(ocf_flag = true) ?(sec_hdr = false) 537 537 ?(sync_flag = false) ?(pkt_order = false) ?(seg_len_id = 3) 538 538 ?(first_hdr_ptr = 0) ~scid ~vcid ~mcfc ~vcfc () : header = 539 + (* CCSDS 132.0-B-3 spec constraints *) 540 + if (not sync_flag) && pkt_order then 541 + invalid_arg "Tm.header: pkt_order requires sync_flag (CCSDS 132.0-B-3)"; 542 + if (not sync_flag) && seg_len_id <> 3 then 543 + invalid_arg 544 + "Tm.header: seg_len_id must be 3 when sync_flag is false (CCSDS \ 545 + 132.0-B-3)"; 539 546 { 540 547 version; 541 548 scid;
+6
test/interop/dariol83/scripts/generate.java
··· 140 140 builder.setSegmentLengthIdentifier(v.segLenId); 141 141 142 142 if (v.idle) { 143 + // setIdle() only sets FHP=0x7FE; data must still be filled. 144 + // Fill with 0xFF (idle pattern per CCSDS 132.0-B-3). 143 145 builder.setIdle(); 146 + int free = builder.getFreeUserDataLength(); 147 + byte[] idleData = new byte[free]; 148 + java.util.Arrays.fill(idleData, (byte) 0xFF); 149 + builder.addData(idleData); 144 150 } else { 145 151 // Fill the data field completely — TM frames have fixed length 146 152 int freeSpace = builder.getFreeUserDataLength();
+4
test/interop/dariol83/traces/vectors.csv
··· 7 7 sync_flag,16,77,4,0,100,200,0,1,0,3,2047,42424242000000000000,,0,0,04d864c85fff42424242000000000000 8 8 pkt_order_flag,16,10,1,0,50,75,0,1,1,3,2047,99990000000000000000,,0,0,00a2324b7fff99990000000000000000 9 9 max_scid_vcid,22,1023,7,1,255,255,0,1,1,0,2047,abcdef01000000000000,00000000,1,1,3fffffff67ffabcdef010000000000000000000018bf 10 + idle_frame,20,1023,7,0,255,255,0,0,0,3,2046,ffffffffffffffffffffffffffff,,0,0,3ffeffff1ffeffffffffffffffffffffffffffff 11 + large_frame,200,300,2,1,1,1,0,0,0,3,2047,0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,abcd1234,1,1,12c501011fff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000abcd1234ad3b 12 + seg_len_zero,16,10,1,0,50,75,0,1,0,0,2047,99999900000000000000,,0,0,00a2324b47ff99999900000000000000 13 + frame_counts,22,42,3,1,137,42,0,0,0,3,2047,01020304050000000000,0104002a,1,1,02a7892a1fff010203040500000000000104002ac931