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#
Install with opam:
$ opam install ax25
If opam cannot find the package, it may not yet be released in the public
opam-repository. Add the overlay repository, then install it:
$ opam repo add samoht https://tangled.org/gazagnaire.org/opam-overlay.git
$ opam update
$ opam install ax25
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 *)
let () =
match kiss_decode encoded with
| Ok frame -> Format.printf "%a@." pp frame
| Error e -> Format.printf "Error: %a@." pp_error e