Commit Graph

8 Commits

Author SHA1 Message Date
portersky 1db5fdb374 feat: dashboard-style telemetry output
Replace line-by-line telemetry dump with in-place dashboard showing:
- Status indicator (LIVE/STALE/NO SIGNAL)
- LINK: RSSI1, RSSI2, LQ, SNR, power, mode with color coding
- BATT: voltage, current, capacity, percentage
- IMU: pitch, roll, yaw in degrees
- MODE: flight mode name
- Frame counts footer

Add ATTITUDE (0x1E) and FLIGHT_MODE (0x21) telemetry parsing.
Dashboard redraws every 100ms with ANSI cursor control.
2026-06-14 23:05:24 +02:00
portersky d2331229eb fix: improve telemetry tool connection reliability
Add baud rate probing (921600/400000/420000), auto-detect ELRS
ports, verify module responds to CRSF ping before telemetry loop,
and increase RC send rate to 50 Hz to match Python reference.
2026-06-14 22:52:40 +02:00
portersky 4f0c62d41a feat: implement telemetry read loop
Telemetry tool now:
- Reads raw bytes from serial port
- Parses frames incrementally via cel_crsf_stream
- Decodes link stats, battery, heartbeat, airspeed
- Sends RC frames periodically to keep link alive
- Handles Ctrl+C gracefully via signal handler
2026-06-14 21:04:17 +02:00
portersky dde27ab566 refactor: remove unused legacy frame format code
The old [0xC8][dest][src][type][size][payload][crc] format was never
used with real hardware. Remove cel_crsf_frame_legacy, *_legacy()
functions, and update tests/tools accordingly.
2026-06-14 20:49:45 +02:00
portersky df3d399610 feat: adopt ELRS USB CRSF frame format, add skeleton modules
Switch CRC from CCITT (0x07) to DVB-S2 (0xD5) to match ELRS.
Adopt ELRS USB frame format: [addr][length][type][payload][crc].
Update frame type constants to match current ELRS protocol values.

New skeleton modules (stub implementations with TODO comments):
  - crsf_telemetry.h/.c: telemetry decoders (GPS, battery, link..)
  - crsf_stream.h/.c: incremental streaming frame reader
  - crsf_param.h/.c: parameter protocol (read/write/set_power)

Retained old frame format as *_legacy functions for backward
compatibility with existing telemetry tool and tests.

Add cel_serial_find_elrs_port() and cel_serial_open_probe()
stubs to serial module for port auto-detection and baud probing.
2026-06-14 20:47:56 +02:00
portersky a1ea02771c refactor: make cel_serial_read non-blocking
Drop timeout_ms; read now returns immediately with whatever
data is available (0 if none), so callers don't block the rest
of their loop waiting on serial I/O.

telemetry's poll loop now sleeps interval_ms itself between
empty reads via a small sleep_ms helper.
2026-06-14 20:29:47 +02:00
portersky a0868cd3b7 feat: add serial port listing and CLI flags
Implement cel_serial_list_ports/cel_serial_free_ports with
platform backends: Windows reads HKLM\HARDWARE\DEVICEMAP\
SERIALCOMM (fast, single registry read), POSIX scans /dev for
ttyUSB*/ttyACM*.

telemetry tool gains --list, --port, and --baudrate flags;
baud rate was previously hardcoded to 400000. Rename the
tool_telemetry CMake target to telemetry.

Fix test_free_ports_zero_count, which passed a stack array to
cel_serial_free_ports (which calls free() on it), corrupting
the heap.
2026-06-14 20:13:57 +02:00
portersky cd7d411332 Inital commit
CI / macOS (push) Has been cancelled
CI / Windows / Clang (push) Has been cancelled
2026-06-14 19:50:16 +02:00