KISS is a super simple framing technique for packet radio TNCs.
Simplistically, a KISS TNC can be commanded to send an AX.25 frame out of its first (or only) port by prefixing it with 0xC0 0x00. See http://www.symek.com/g/smack.html
As well as KISS over serial, BPQ can do KISS over TCP or UDP. I assume the Linux kernel can too.
FreeDV (codec2) has a data transmission API. Codec2 ships with a pair of minimalistic demo programs for transmitting and receiving arbitrary data through FreeDV via stdin/out. The transmit program takes data on stdin and outputs audio bytes to stdout. The receive program takes audio bytes on stdin and outputs the original data on stdout.
Source of the two programs:
https://github.com/drowe67/codec2/blob/master/demo/freedv_datac1_tx.c
https://github.com/drowe67/codec2/blob/master/demo/freedv_datac1_rx.c
As a proof of concept, a simple-ish wrapper program could be created which:
- accepts a TCP or UDP connection from BPQ (or kissattach / kernel)
- watches for KISS frames and removes the framing
- runs the AX.25 frame through the transmit program
- keys up the radio (hamlib), waits for some configurable TX delay
- sends the audio bytes to the sound card
- wait for some configurable periodm, unkey the radio
Similar on receive, though the receive program would need to be continuously listening to audio for frames (and outputting them to the application/driver) rather than working on pre-chopped up chunks of audio bytes.
Once the concept is proven, libcodec2 could be interfaced directly instead of using the intermediate programs.
For proving the concept, the radios and ptts could be eliminated and just use two sound cards connected back to back instead.
One thing that would need implementing would be some form of carrier detect so that the modem doesn't start to transmit while there's an incoming signal. That might need some kind of change inside libcodec2 itself.