AX.25 Amateur Radio Link-Layer Protocol
0
fork

Configure Feed

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

irmin: value-oriented Heap + Schema + Cursor with 4 backends

+4 -7
+4 -7
lib/ax25.ml
··· 437 437 if off >= len then Error (Truncated { need = off + 1; have = len }) 438 438 else 439 439 let control = 440 - Result.get_ok 441 - (Wire.decode_bytes control_typ (Bytes.sub data off 1)) 440 + Result.get_ok (Wire.decode_bytes control_typ (Bytes.sub data off 1)) 442 441 in 443 442 let off = off + 1 in 444 443 (* PID (only for I and UI frames) *) 445 444 let pid, off = 446 445 match control with 447 - | UI | I _ when off < len -> 446 + | (UI | I _) when off < len -> 448 447 let p = 449 - Result.get_ok 450 - (Wire.decode_bytes pid_typ (Bytes.sub data off 1)) 448 + Result.get_ok (Wire.decode_bytes pid_typ (Bytes.sub data off 1)) 451 449 in 452 450 (Some p, off + 1) 453 451 | UI | I _ -> (None, off) ··· 479 477 let frame_data = Bytes.sub data 0 (len - 2) in 480 478 let fcs_expected = crc_ccitt frame_data in 481 479 let fcs_actual = 482 - Result.get_ok 483 - (Wire.decode_bytes fcs_typ (Bytes.sub data (len - 2) 2)) 480 + Result.get_ok (Wire.decode_bytes fcs_typ (Bytes.sub data (len - 2) 2)) 484 481 in 485 482 if fcs_expected <> fcs_actual then 486 483 Error (Invalid_fcs { expected = fcs_expected; actual = fcs_actual })