Unify cache polling on CACHE_STATUS and split API docs.

Replace separate accel/tap snapshot UART commands with one clients[] response
that omits unsubscribed fields; remove snapshot handlers and CLI commands.
Add goTool/docs for WebSocket streams and REST; tap-snapshot REST uses CACHE_STATUS.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-29 21:23:09 +02:00
co-authored by Cursor
parent a85d48320e
commit 31e539052a
25 changed files with 1243 additions and 1269 deletions
+17 -19
View File
@@ -9,26 +9,24 @@ func runCacheStatus(sp *serialPort) error {
if err != nil {
return err
}
accel := r.GetAccel()
if len(accel) == 0 {
fmt.Println("accel: (none — no slaves with accel stream enabled)")
} else {
for _, s := range accel {
if !s.GetValid() {
fmt.Printf("accel client %d: no sample yet\n", s.GetClientId())
continue
}
fmt.Printf("accel client %d: x=%d y=%d z=%d (age %d ms)\n",
s.GetClientId(), s.GetX(), s.GetY(), s.GetZ(), s.GetAgeMs())
}
clients := r.GetClients()
if len(clients) == 0 {
fmt.Println("(no slaves with accel stream or tap notify enabled)")
return nil
}
taps := r.GetTaps()
if len(taps) == 0 {
fmt.Println("tap: (none pending)")
} else {
for _, e := range taps {
fmt.Printf("tap client %d: %s (age %d ms)\n",
e.GetClientId(), tapKindLabel(e.GetKind()), e.GetAgeMs())
for _, c := range clients {
id := c.GetClientId()
if a := c.GetAccel(); a != nil {
if !a.GetValid() {
fmt.Printf("client %d accel: no sample yet\n", id)
} else {
fmt.Printf("client %d accel: x=%d y=%d z=%d (age %d ms)\n",
id, a.GetX(), a.GetY(), a.GetZ(), a.GetAgeMs())
}
}
if t := c.GetTap(); t != nil {
fmt.Printf("client %d tap: %s (age %d ms)\n",
id, tapKindLabel(t.GetKind()), t.GetAgeMs())
}
}
return nil