CCSDS File Delivery Protocol (CCSDS 727.0-B-5) for space file transfer
0
fork

Configure Feed

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

fix(lint): replace Printf/Format with Fmt in block and bpsec

+23 -27
+23 -27
lib/cfdp.ml
··· 529 529 { continuation; segment_metadata; offset; data } 530 530 531 531 let pp_file_data fmt fd = 532 - Format.fprintf fmt "{offset=%Ld; len=%d}" fd.offset (Bytes.length fd.data) 532 + Fmt.pf fmt "{offset=%Ld; len=%d}" fd.offset (Bytes.length fd.data) 533 533 534 534 (* {1 Complete PDU} *) 535 535 ··· 543 543 | Keep_alive of keep_alive 544 544 545 545 let pp_directive fmt = function 546 - | Eof e -> Format.fprintf fmt "EOF %a" pp_eof e 547 - | Finished f -> Format.fprintf fmt "Finished %a" pp_finished f 548 - | Ack a -> Format.fprintf fmt "ACK %a" pp_ack a 549 - | Metadata m -> Format.fprintf fmt "Metadata %a" pp_metadata m 550 - | Nak n -> Format.fprintf fmt "NAK %a" pp_nak n 551 - | Prompt p -> Format.fprintf fmt "Prompt %a" pp_prompt p 552 - | Keep_alive k -> Format.fprintf fmt "Keep_alive %a" pp_keep_alive k 546 + | Eof e -> Fmt.pf fmt "EOF %a" pp_eof e 547 + | Finished f -> Fmt.pf fmt "Finished %a" pp_finished f 548 + | Ack a -> Fmt.pf fmt "ACK %a" pp_ack a 549 + | Metadata m -> Fmt.pf fmt "Metadata %a" pp_metadata m 550 + | Nak n -> Fmt.pf fmt "NAK %a" pp_nak n 551 + | Prompt p -> Fmt.pf fmt "Prompt %a" pp_prompt p 552 + | Keep_alive k -> Fmt.pf fmt "Keep_alive %a" pp_keep_alive k 553 553 554 554 type pdu = 555 555 | Pdu_directive of header * directive ··· 557 557 558 558 let pp_pdu fmt = function 559 559 | Pdu_directive (h, d) -> 560 - Format.fprintf fmt "Directive[%a] %a" pp_header h pp_directive d 560 + Fmt.pf fmt "Directive[%a] %a" pp_header h pp_directive d 561 561 | Pdu_file_data (h, fd) -> 562 - Format.fprintf fmt "FileData[%a] %a" pp_header h pp_file_data fd 562 + Fmt.pf fmt "FileData[%a] %a" pp_header h pp_file_data fd 563 563 564 564 (* {1 Errors} *) 565 565 ··· 576 576 577 577 let pp_error fmt = function 578 578 | Truncated { need; have } -> 579 - Format.fprintf fmt "Truncated: need %d bytes, have %d" need have 580 - | Invalid_version v -> Format.fprintf fmt "Invalid version: %d (expected 1)" v 581 - | Invalid_pdu_type t -> Format.fprintf fmt "Invalid PDU type: %d" t 582 - | Invalid_directive_code c -> 583 - Format.fprintf fmt "Invalid directive code: 0x%02x" c 584 - | Invalid_condition_code c -> 585 - Format.fprintf fmt "Invalid condition code: 0x%x" c 586 - | Invalid_checksum_type t -> Format.fprintf fmt "Invalid checksum type: %d" t 579 + Fmt.pf fmt "Truncated: need %d bytes, have %d" need have 580 + | Invalid_version v -> Fmt.pf fmt "Invalid version: %d (expected 1)" v 581 + | Invalid_pdu_type t -> Fmt.pf fmt "Invalid PDU type: %d" t 582 + | Invalid_directive_code c -> Fmt.pf fmt "Invalid directive code: 0x%02x" c 583 + | Invalid_condition_code c -> Fmt.pf fmt "Invalid condition code: 0x%x" c 584 + | Invalid_checksum_type t -> Fmt.pf fmt "Invalid checksum type: %d" t 587 585 | Crc_mismatch { expected; actual } -> 588 - Format.fprintf fmt "CRC mismatch: expected 0x%04x, got 0x%04x" expected 589 - actual 590 - | Invalid_format s -> Format.fprintf fmt "Invalid format: %s" s 586 + Fmt.pf fmt "CRC mismatch: expected 0x%04x, got 0x%04x" expected actual 587 + | Invalid_format s -> Fmt.pf fmt "Invalid format: %s" s 591 588 | Entity_id_overflow -> 592 - Format.fprintf fmt "Entity ID >= 2^63 exceeds int64 representation" 589 + Fmt.pf fmt "Entity ID >= 2^63 exceeds int64 representation" 593 590 594 591 (* {1 Encoding} *) 595 592 ··· 1363 1360 let filenames t = (t.source_filename, t.dest_filename) 1364 1361 1365 1362 let pp fmt t = 1366 - Format.fprintf fmt "Sender1{state=%s; tid=%a; dest=%a; file=%s->%s}" 1363 + Fmt.pf fmt "Sender1{state=%s; tid=%a; dest=%a; file=%s->%s}" 1367 1364 (match t.state with 1368 1365 | S1_idle -> "Idle" 1369 1366 | S2_sending -> "Sending" ··· 1546 1543 let pending_retransmits t = t.nak_pending 1547 1544 1548 1545 let pp fmt t = 1549 - Format.fprintf fmt 1550 - "Sender2{state=%s; tid=%a; dest=%a; file=%s->%s; pending=%d}" 1546 + Fmt.pf fmt "Sender2{state=%s; tid=%a; dest=%a; file=%s->%s; pending=%d}" 1551 1547 (match t.state with 1552 1548 | S1_idle -> "Idle" 1553 1549 | S2_sending -> "Sending" ··· 1711 1707 | _ -> (t, []) 1712 1708 1713 1709 let pp fmt t = 1714 - Format.fprintf fmt 1710 + Fmt.pf fmt 1715 1711 "Receiver1{state=%s; tid=%a; entity=%a; size=%Ld/%Ld; csum=0x%08lx}" 1716 1712 (match t.state with 1717 1713 | R1_idle -> "Idle" ··· 1991 1987 | _ -> (t, []) 1992 1988 1993 1989 let pp fmt t = 1994 - Format.fprintf fmt 1990 + Fmt.pf fmt 1995 1991 "Receiver2{state=%s; tid=%a; entity=%a; size=%Ld/%Ld; csum=0x%08lx; \ 1996 1992 gaps=%d}" 1997 1993 (match t.state with