Skip to content

Implement support for serial port KISS TNCs#9

Merged
thombles merged 2 commits into
thombles:masterfrom
dpogue:serial
Apr 5, 2026
Merged

Implement support for serial port KISS TNCs#9
thombles merged 2 commits into
thombles:masterfrom
dpogue:serial

Conversation

@dpogue
Copy link
Copy Markdown
Contributor

@dpogue dpogue commented Apr 4, 2026

(Disclaimer: This is my first time ever working in Rust, and while this appears to work it feels like there's a lot of repeated code and I am not experienced enough with Rust to know how to improve that)

This adds a new TNC implementation for KISS TNC over serial port, relying on the serialport-rs crate to do the heavy lifting. In theory, this should support serial ports on both Linux and Windows, but I was only able to test Linux.

I've gated this behind a serial feature so the new dependency is optional.

The address format for serial port KISS TNCs is tnc:serialkiss:<device path>:<baud rate>.

  • Linux example: tnc:serialkiss:/dev/ttyUSB0:1200
  • Windows example: tnc:serialkiss:COM3:9600

Copy link
Copy Markdown
Owner

@thombles thombles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing! Thanks for this. The repetition you've had to do is largely my fault - I built this package when I was a Rust beginner and it could use some reorganising. For how it currently is, though, this PR is looking great.

  • Out of curiosity, with what KISS serial device have you tried this?
  • You could remove the roadmap entry in the readme "Support for serial KISS TNCs (physical, TNC-Pi, Dire Wolf pseudo-tty)"
  • There's one minor error to fix, see below

Comment thread ax25_tnc/src/tnc.rs Outdated
),
Self::InvalidBaud { input, .. } => write!(
f,
"Supplied baud '{}' should be a number from 0 to 65535",
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy-paste error here. We don't need to be too precise, it's fine to say "this should be number like 4800 or 9600"

@thombles
Copy link
Copy Markdown
Owner

thombles commented Apr 5, 2026

Alas: there's a new clippy lint that's causing a CI failure in code you didn't touch. It's a minor fix - feel free to do it yourself or leave it to me before merge

@dpogue
Copy link
Copy Markdown
Contributor Author

dpogue commented Apr 5, 2026

Thanks for the review!

I've been testing this locally with a PK-88 TNC in kiss mode, and I was able to pick up and decode APRS packets correctly.

@thombles thombles merged commit 4ca3745 into thombles:master Apr 5, 2026
2 checks passed
@thombles
Copy link
Copy Markdown
Owner

thombles commented Apr 5, 2026

v0.4.0 is out with these changes. Thanks again!

@dpogue dpogue deleted the serial branch April 5, 2026 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants