Implement support for serial port KISS TNCs#9
Conversation
thombles
left a comment
There was a problem hiding this comment.
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
| ), | ||
| Self::InvalidBaud { input, .. } => write!( | ||
| f, | ||
| "Supplied baud '{}' should be a number from 0 to 65535", |
There was a problem hiding this comment.
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"
|
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 |
|
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. |
|
v0.4.0 is out with these changes. Thanks again! |
(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-rscrate 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
serialfeature so the new dependency is optional.The address format for serial port KISS TNCs is
tnc:serialkiss:<device path>:<baud rate>.tnc:serialkiss:/dev/ttyUSB0:1200tnc:serialkiss:COM3:9600