Move UART command handlers into main/cmd/ for clearer layout.
Add cmd/ to CMake include paths and update documentation paths. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+16
-16
@@ -203,20 +203,20 @@ Host and master speak nanopb-encoded `UartMessage` inside UART frames (byte 0 =
|
||||
|
||||
| ID | Name | Status |
|
||||
|----|------|--------|
|
||||
| 3 | `VERSION` | Implemented (`cmd_version.c`) |
|
||||
| 4 | `CLIENT_INFO` | Implemented (`cmd_client_info.c`) — slave list from registry |
|
||||
| 3 | `VERSION` | Implemented (`cmd/cmd_version.c`) |
|
||||
| 4 | `CLIENT_INFO` | Implemented (`cmd/cmd_client_info.c`) — slave list from registry |
|
||||
| 5 | `CLIENT_INPUT` | Planned |
|
||||
| 6 | `ACCEL_DEADZONE` | Implemented (`cmd_accel_deadzone.c`) — get/set accel filter LSB |
|
||||
| 7 | `ESPNOW_UNICAST_TEST` | Implemented (`cmd_espnow_unicast_test.c`) |
|
||||
| 8 | `LED_RING` | Implemented (`cmd_led_ring.c`) — ring progress bar (0–100 %, RGB, intensity) |
|
||||
| 16 | `OTA_START` | Implemented (`cmd_ota.c`) — begin UART OTA on inactive slot |
|
||||
| 6 | `ACCEL_DEADZONE` | Implemented (`cmd/cmd_accel_deadzone.c`) — get/set accel filter LSB |
|
||||
| 7 | `ESPNOW_UNICAST_TEST` | Implemented (`cmd/cmd_espnow_unicast_test.c`) |
|
||||
| 8 | `LED_RING` | Implemented (`cmd/cmd_led_ring.c`) — ring progress bar (0–100 %, RGB, intensity) |
|
||||
| 16 | `OTA_START` | Implemented (`cmd/cmd_ota.c`) — begin UART OTA on inactive slot |
|
||||
| 17 | `OTA_PAYLOAD` | Implemented — up to 200 B per frame; device buffers 4 KiB |
|
||||
| 18 | `OTA_END` | Implemented — flush, `esp_ota_end`, push image to slaves via ESP-NOW, set boot |
|
||||
| 19 | `OTA_STATUS` | Device → host (prepare/ready/block ACK/success/failed) |
|
||||
| 20 | `OTA_START_ESPNOW` | Implemented — re-distribute staged image to slaves only |
|
||||
| 21 | `OTA_SLAVE_PROGRESS` | Implemented (`cmd_ota_slave_progress.c`) — query per-slave ESP-NOW OTA progress |
|
||||
| 22 | `FIND_ME` | Implemented (`cmd_espnow_find_me.c`) — `client_id=0` local ring, `>0` ESP-NOW to slave |
|
||||
| 23 | `RESTART` | Implemented (`cmd_restart.c`) — `client_id=0` reboot master, `>0` ESP-NOW reboot slave |
|
||||
| 21 | `OTA_SLAVE_PROGRESS` | Implemented (`cmd/cmd_ota_slave_progress.c`) — query per-slave ESP-NOW OTA progress |
|
||||
| 22 | `FIND_ME` | Implemented (`cmd/cmd_espnow_find_me.c`) — `client_id=0` local ring, `>0` ESP-NOW to slave |
|
||||
| 23 | `RESTART` | Implemented (`cmd/cmd_restart.c`) — `client_id=0` reboot master, `>0` ESP-NOW reboot slave |
|
||||
|
||||
Regenerate C code:
|
||||
|
||||
@@ -264,7 +264,7 @@ During OTA the LED ring shows progress at ~5 % brightness: **blue** while the im
|
||||
|
||||
`OTA_START_ESPNOW` (type `20`): re-run ESP-NOW distribution from the last staged image without a new UART upload (no-op if nothing staged).
|
||||
|
||||
Implementation: `ota_uart.c` (4 KiB buffer, `esp_ota_write`), `ota_espnow.c`, `cmd_ota.c`.
|
||||
Implementation: `ota_uart.c` (4 KiB buffer, `esp_ota_write`), `ota_espnow.c`, `cmd/cmd_ota.c`.
|
||||
|
||||
Host upload:
|
||||
|
||||
@@ -446,19 +446,19 @@ Target: ESP32-S3. Close serial monitor on the UART adapter port before running `
|
||||
| `esp_now_comm.c/h` | WiFi, ESP-NOW, discover / slave info / OTA send |
|
||||
| `ota_uart.c/h` | Shared 4 KiB OTA flash buffer (UART + ESP-NOW) |
|
||||
| `ota_espnow.c/h` | Master: distribute staged image to slaves |
|
||||
| `cmd_ota.c/h` | UART OTA command handlers (master only) |
|
||||
| `cmd/cmd_ota.c/h` | UART OTA command handlers (master only) |
|
||||
| `uart.c/h` | Framed UART RX/TX |
|
||||
| `uart_proto.c/h` | Encode/send `UartMessage` |
|
||||
| `cmd_handler.c/h` | Command queue and dispatch |
|
||||
| `cmd/cmd_handler.c/h` | Command queue and dispatch |
|
||||
| `uart_cmd.c/h` | Shared UART decode/send helpers for handlers |
|
||||
| `cmd_version.c/h` | VERSION handler |
|
||||
| `cmd_client_info.c/h` | CLIENT_INFO handler |
|
||||
| `cmd/cmd_version.c/h` | VERSION handler |
|
||||
| `cmd/cmd_client_info.c/h` | CLIENT_INFO handler |
|
||||
| `client_registry.c/h` | Registered slave table |
|
||||
| `bosch456.c/h` | BMA456H I2C driver, accel poll, tap INT, deadzone filter |
|
||||
| `board_input.c/h` | Taster GPIO12, LiPo ADC on GPIO1 / GPIO12 |
|
||||
| `pod_settings.c/h` | NVS persistence (accel deadzone, …) |
|
||||
| `led_ring.c/h` | LED ring (digit display, progress bar) |
|
||||
| `cmd_led_ring.c` | UART `LED_RING` progress command |
|
||||
| `cmd/cmd_led_ring.c` | UART `LED_RING` progress command |
|
||||
| `proto/uart_messages.proto` | UART protocol schema |
|
||||
| `proto/esp_now_messages.proto` | ESP-NOW protocol schema |
|
||||
| `esp_now_proto.c/h` | Encode/decode `EspNowMessage` |
|
||||
@@ -475,7 +475,7 @@ Short checklist:
|
||||
|
||||
1. Add or extend messages in `uart_messages.proto` (and `esp_now_messages.proto` if slaves are involved); run `make proto_generate` and `make gotool-proto`.
|
||||
2. Implement device logic in a shared module (e.g. `led_ring.c`), not only in the UART handler.
|
||||
3. Create `cmd_*.c`, register with `uart_cmd_register()`; decode with `uart_cmd_decode()` / `UART_CMD_REQ()`; reply with `uart_cmd_init_response()` + `uart_cmd_send()`.
|
||||
3. Create `cmd/cmd_*.c`, register with `uart_cmd_register()`; decode with `uart_cmd_decode()` / `UART_CMD_REQ()`; reply with `uart_cmd_init_response()` + `uart_cmd_send()`.
|
||||
4. Master → slave: `esp_now_comm_send_*()` + slave branch in `espnow_recv_cb`.
|
||||
5. Extend `goTool` (CLI, optional `/api/…` and web UI).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user