Commit Graph

8 Commits

Author SHA1 Message Date
portersky 974b33e827 chore: rename targets and add ENABLE_TESTING option
Rename library targets from celrs_* to cel* (celcrsf, celserial,
cellogger, cellog) and add cel:: namespace aliases. Add cel::cel
umbrella target that links all core libraries.

Add ENABLE_TESTING option (default ON) to gate Unity/CMock fetch
and test targets for downstream consumers.
2026-06-15 00:39:25 +02:00
portersky 8c4045e2a4 feat: implement cel_crsf_param_write
Fire-and-forget parameter write. Builds CRSF PARAM_WRITE frame
and sends it over the serial port.
2026-06-14 21:55:15 +02:00
portersky 5d18258330 feat: implement cel_crsf_param_parse
Parse PARAM_ENTRY payload into cel_crsf_param struct. Handles
TEXT_SELECT with options string and UINT8/INT8 with min/max/default/
value fields. Respects hidden flag (bit 7 of type byte). Truncates
name and options to buffer limits.
2026-06-14 21:50:12 +02:00
portersky eaaaf710a2 feat: implement port find/probe and add platform description
Implement cel_serial_find_elrs_port() which enumerates serial ports
and matches descriptions against ELRS-related keywords (CP210, CH340,
FTDI, etc.). Implement cel_serial_open_probe() to try multiple baud
rates in order.

Add cel_serial_platform_get_description() for Windows (SetupAPI)
and POSIX (sysfs fallback). Wire setupapi into the Windows build.
Update serial tests with CMock expectations for the new functions.
2026-06-14 21:39:18 +02:00
portersky 34dd25fecb feat: implement telemetry parser
cel_crsf_telemetry_parse() decodes link stats, battery, heartbeat,
and airspeed frames. Updated cel_telem_battery and cel_telem_airspeed
structs to use uint16_t values matching CRSF protocol format.
2026-06-14 21:02:23 +02:00
portersky a846b063f9 feat: implement frame parse and streaming reader
cel_crsf_frame_parse() parses ELRS USB format frames:
  [addr][length][type][payload...][crc]

cel_crsf_stream_* provides incremental parsing from a byte
stream: skips invalid sync bytes, discards bad CRC frames,
buffers partial frames across feed calls.
2026-06-14 20:51:57 +02:00
portersky 2761bcb16c refactor: mock serial platform backend in test_serial
test_serial mocked log_write.h, which serial.c never calls.
Split celrs_serial into celrs_serial (platform-agnostic logic)
and celrs_serial_platform (real Win/POSIX backend), matching
the celrs_logger/celrs_log_write split.

test_serial now mocks celrs/platform/serial_internal.h and
links only celrs_serial, so the list-ports tests verify the
max_ports clamping and pass-through logic without hitting the
real registry or /dev.
2026-06-14 20:18:17 +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