Matter smart home protocol implementation for OCaml
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.

+7 -7
+1 -1
lib/discovery.ml
··· 180 180 | 4996 -> "Apple" 181 181 | 4937 -> "Google" 182 182 | 4939 -> "Amazon" 183 - | _ -> Printf.sprintf "Vendor(%d)" vp.vendor_id 183 + | _ -> Fmt.str "Vendor(%d)" vp.vendor_id 184 184 in 185 185 Fmt.pf ppf "%s (VID=%d, PID=%d)" vendor_name vp.vendor_id vp.product_id 186 186
+3 -3
lib/msg.ml
··· 513 513 Fmt.pf ppf "Message{session=%d, counter=%ld, src=%s, dst=%s}" hdr.session_id 514 514 hdr.message_counter 515 515 (match hdr.source_node_id with 516 - | Some id -> Printf.sprintf "%016Lx" id 516 + | Some id -> Fmt.str "%016Lx" id 517 517 | None -> "-") 518 518 (match hdr.destination with 519 519 | No_destination -> "-" 520 - | Node_id id -> Printf.sprintf "node:%016Lx" id 521 - | Group_id id -> Printf.sprintf "group:%d" id) 520 + | Node_id id -> Fmt.str "node:%016Lx" id 521 + | Group_id id -> Fmt.str "group:%d" id) 522 522 523 523 let pp_protocol_header ppf phdr = 524 524 Fmt.pf ppf "Protocol{proto=%04x, opcode=%02x, exchange=%d}" phdr.protocol_id
+2 -2
lib/session.ml
··· 164 164 if proto_hdr.protocol_opcode <> Msg.Secure_channel.pase_pake2 then 165 165 Error 166 166 (`Msg 167 - (Printf.sprintf "Expected PAKE2, got opcode %d" 167 + (Fmt.str "Expected PAKE2, got opcode %d" 168 168 proto_hdr.protocol_opcode)) 169 169 else 170 170 let payload = ··· 197 197 else 198 198 Error 199 199 (`Msg 200 - (Printf.sprintf "Expected StatusReport, got opcode %d" 200 + (Fmt.str "Expected StatusReport, got opcode %d" 201 201 proto_hdr.protocol_opcode)))) 202 202 203 203 let install_session_keys conn ke =
+1 -1
lib/tlv.ml
··· 334 334 (* List *) 335 335 let* elems, off = decode_container data offset in 336 336 Ok (List elems, off) 337 - | _ -> Error (Printf.sprintf "Unknown type code: %d" type_code) 337 + | _ -> Error (Fmt.str "Unknown type code: %d" type_code) 338 338 339 339 and decode_container data offset = 340 340 let rec loop acc offset =