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:
@@ -44,32 +44,6 @@ func runTapNotify(sp *serialPort, args []string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func runTapSnapshot(sp *serialPort, args []string) error {
|
||||
fs := flag.NewFlagSet("tap", flag.ExitOnError)
|
||||
clientID := fs.Uint("client", 0, "client id (0 = all slaves with tap notify)")
|
||||
if err := fs.Parse(args); err != nil {
|
||||
return err
|
||||
}
|
||||
return runTapSnapshotForClient(sp, uint32(*clientID))
|
||||
}
|
||||
|
||||
func runTapSnapshotForClient(sp *serialPort, clientID uint32) error {
|
||||
r, err := sp.readTapSnapshot(clientID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
events := r.GetEvents()
|
||||
if len(events) == 0 {
|
||||
fmt.Println("no tap events (none pending or older than 16 ms)")
|
||||
return nil
|
||||
}
|
||||
for _, e := range events {
|
||||
fmt.Printf("client %d: %s (age %d ms)\n",
|
||||
e.GetClientId(), tapKindLabel(e.GetKind()), e.GetAgeMs())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func tapKindLabel(k pb.TapKind) string {
|
||||
switch k {
|
||||
case pb.TapKind_TAP_SINGLE:
|
||||
|
||||
Reference in New Issue
Block a user