AX.25 Amateur Radio Link-Layer Protocol
OCaml 94.7%
Dune 0.2%
Other 5.1%
27 1 0

Clone this repository

https://tangled.org/gazagnaire.org/ocaml-ax25 https://tangled.org/did:plc:jhift2vwcxhou52p3sewcrpx/ocaml-ax25
git@git.recoil.org:gazagnaire.org/ocaml-ax25 git@git.recoil.org:did:plc:jhift2vwcxhou52p3sewcrpx/ocaml-ax25

For self-hosted knots, clone URLs may differ based on your setup.

Download tar.gz
README.md

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

Reference#