Add goTool clients subcommand for CLIENT_INFO query.
Refactor into version/clients subcommands with shared serial framing to list registered slaves from the master over UART. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+17
-2
@@ -9,7 +9,8 @@ Full system documentation (roles, ESP-NOW, framing, protobuf): [`../main/README.
|
||||
```bash
|
||||
cd goTool
|
||||
go mod tidy
|
||||
go run . -port /dev/ttyUSB0
|
||||
go run . -port /dev/ttyUSB0 version
|
||||
go run . -port /dev/ttyUSB0 clients
|
||||
```
|
||||
|
||||
| Flag | Default | Description |
|
||||
@@ -17,7 +18,21 @@ go run . -port /dev/ttyUSB0
|
||||
| `-port` | (required) | Serial port on master UART (GPIO2/3 adapter) |
|
||||
| `-baud` | `921600` | Must match firmware `UART_BAUD_RATE` |
|
||||
|
||||
Implements the VERSION command (`MessageType` = 3): sends framed `03`, decodes protobuf `UartMessage.version_response`.
|
||||
### Commands
|
||||
|
||||
| Command | UART payload | Description |
|
||||
|---------|--------------|-------------|
|
||||
| `version` | `0x03` | Prints `version` and `git_hash` from firmware |
|
||||
| `clients` | `0x04` | Lists slaves registered on the master via ESP-NOW |
|
||||
|
||||
`clients` requires slaves to have responded to master discover broadcasts first.
|
||||
|
||||
Example output:
|
||||
|
||||
```
|
||||
clients (2):
|
||||
[0] id=42 mac=aabbccddeeff ver=1 available=true used=false last_ping=12345 last_success_ping=12345
|
||||
```
|
||||
|
||||
## Regenerate protobuf
|
||||
|
||||
|
||||
Reference in New Issue
Block a user