AX25 - AX.25 Amateur Radio Link-Layer Protocol#
Pure OCaml implementation of the AX.25 Link Access Protocol for amateur radio packet communications.
Supports:
- Callsign parsing and validation (with SSID 0-15)
- Address encoding/decoding with digipeater support
- Control field types: I, RR, RNR, REJ, UI, SABM, DISC, UA, DM, FRMR
- Protocol identifiers: No_layer3, IP, ARP, FlexNet, NET/ROM
- CRC-16-CCITT frame check sequence
- HDLC framing with bit stuffing
- KISS TNC protocol framing
Installation#
opam install ax25 will install this library.
Usage#
open Ax25
(* Create a UI frame *)
let src = callsign_exn ~call:"N0CALL" ~ssid:1
let dst = callsign_exn ~call:"CQ" ~ssid:0
let frame = ui_frame ~src ~dst (Bytes.of_string "Hello!")
(* Encode for transmission *)
let encoded = kiss_encode frame
(* Decode received frame *)
match kiss_decode data with
| Ok frame -> Format.printf "%a@." pp frame
| Error e -> Format.printf "Error: %a@." pp_error e