powerpods/goTool/cmd_clients.go
simon d24b0cb5c3 Add goTool autotest with bench configs and UART scenarios.
JSON configs describe network and node MACs; scenarios run command
sequences with expect checks. Share UART client API across CLI and tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-18 23:36:28 +02:00

27 lines
580 B
Go

package main
import (
"encoding/hex"
"fmt"
)
func runClients(sp *serialPort) error {
clients, err := sp.listClients()
if err != nil {
return err
}
if len(clients) == 0 {
fmt.Println("no clients registered")
return nil
}
fmt.Printf("clients (%d):\n", len(clients))
for i, c := range clients {
mac := hex.EncodeToString(c.GetMac())
fmt.Printf(" [%d] id=%d mac=%s ver=%d available=%v used=%v last_ping=%d last_success_ping=%d\n",
i, c.GetId(), mac, c.GetVersion(), c.GetAvailable(), c.GetUsed(),
c.GetLastPing(), c.GetLastSuccessPing())
}
return nil
}