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.
This commit is contained in:
2026-06-14 20:13:57 +02:00
parent cd7d411332
commit a0868cd3b7
9 changed files with 195 additions and 27 deletions
+4 -4
View File
@@ -1,4 +1,4 @@
add_executable(tool_telemetry telemetry.c)
target_include_directories(tool_telemetry PRIVATE "${CMAKE_SOURCE_DIR}")
target_compile_features(tool_telemetry PRIVATE c_std_23)
target_link_libraries(tool_telemetry PRIVATE celrs_crsf celrs_serial celrs_logger celrs_log_write)
add_executable(telemetry telemetry.c)
target_include_directories(telemetry PRIVATE "${CMAKE_SOURCE_DIR}")
target_compile_features(telemetry PRIVATE c_std_23)
target_link_libraries(telemetry PRIVATE celrs_crsf celrs_serial celrs_logger celrs_log_write)