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:
@@ -506,8 +506,9 @@ func runAccelStreamer(link *managedSerial, hub *accelStreamHub, dash *wsHub, ctl
|
||||
}
|
||||
|
||||
if wantAccel {
|
||||
clients := make([]AccelClientSample, 0, len(cache.GetAccel()))
|
||||
for _, s := range cache.GetAccel() {
|
||||
samples := accelSamplesFromCacheStatus(cache)
|
||||
clients := make([]AccelClientSample, 0, len(samples))
|
||||
for _, s := range samples {
|
||||
clients = append(clients, AccelClientSample{
|
||||
ClientID: s.GetClientId(),
|
||||
Valid: s.GetValid(),
|
||||
@@ -525,8 +526,9 @@ func runAccelStreamer(link *managedSerial, hub *accelStreamHub, dash *wsHub, ctl
|
||||
})
|
||||
}
|
||||
if wantTap {
|
||||
fresh := make([]TapClientEvent, 0, len(cache.GetTaps()))
|
||||
for _, e := range cache.GetTaps() {
|
||||
events := tapEventsFromCacheStatus(cache)
|
||||
fresh := make([]TapClientEvent, 0, len(events))
|
||||
for _, e := range events {
|
||||
if !e.GetValid() {
|
||||
continue
|
||||
}
|
||||
@@ -537,13 +539,13 @@ func runAccelStreamer(link *managedSerial, hub *accelStreamHub, dash *wsHub, ctl
|
||||
AgeMs: e.GetAgeMs(),
|
||||
})
|
||||
}
|
||||
events := hub.ingestTapEvents(fresh)
|
||||
if len(events) > 0 {
|
||||
visible := hub.ingestTapEvents(fresh)
|
||||
if len(visible) > 0 {
|
||||
hub.deliverTap(TapStreamMessage{
|
||||
Type: "tap",
|
||||
T: now,
|
||||
Success: true,
|
||||
Events: events,
|
||||
Events: visible,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user