easycom
A Rust library implementing the Easycom antenna rotator control protocol, a variant of the Yaesu GS-232A/B standard.
Works on std targets (desktop, server) and no_std targets (embedded firmware).
Features
- Encode and decode all standard Easycom commands
- Optional XOR checksum support
- Incremental
Parserfor byte-at-a-time UART feeds - Generic
Transporttrait — plug in serial, TCP, or any I/O channel - Echo suppression and keep-alive (
?) handling no_stdcompatible with a fixed-size stack buffer
Quick start
Add to Cargo.toml:
[]
= "0.1"
Query position over TCP
use ;
use ;
use TcpStream;
;
Send rotator to home position over serial
use ;
// (SerialTransport setup omitted — see examples/serial_home.rs)
session.send.unwrap;
session.send.unwrap;
Commands
| Variant | Wire frame | Description |
|---|---|---|
Azimuth(az) |
Annn\r |
Set azimuth (0–360°) |
Elevation(el) |
Ennn\r |
Set elevation (0–180°) |
AzimuthElevation { az, el } |
Wnnn nnn\r |
Set both simultaneously |
QueryPosition |
C\r |
Query current position |
QueryStatus |
GS\r |
Query device status |
Stop |
S\r |
Stop all movement |
KeepAlive |
?\r |
Keep-alive ping |
Offset { az, el } |
O±nnn±nnn\r |
Relative move |
Feature flags
| Flag | Default | Description |
|---|---|---|
std |
yes | Enables Vec-based API and MockTransport |
alloc |
no | Heap support without full std |
Disable default features for no_std:
[]
= { = "0.1", = false }
Examples
# Send rotator to home via serial
# Poll position from a TCP adapter every 5 seconds
# Interactive CLI (TCP or serial)
Publishing to crates.io
- Update
authors,repository, andhomepageinCargo.toml - Log in:
cargo login - Dry run:
cargo publish --dry-run - Publish:
cargo publish
License
MIT — see LICENSE