debug: log raw SPE status frame on change (to verify CSV field alignment on real hw)

This commit is contained in:
2026-07-21 00:54:13 +02:00
parent 56affa4bed
commit 42a6b9c76a
+9
View File
@@ -25,6 +25,8 @@ import (
"time" "time"
"go.bug.st/serial" "go.bug.st/serial"
"hamlog/internal/applog"
) )
const ( const (
@@ -77,6 +79,7 @@ type Client struct {
statusMu sync.RWMutex statusMu sync.RWMutex
status Status status Status
lastRaw string // last raw status payload logged (log only on change)
stop chan struct{} stop chan struct{}
running bool running bool
@@ -268,6 +271,12 @@ func (c *Client) decodeCSV(payload string) {
c.statusMu.Lock() c.statusMu.Lock()
defer c.statusMu.Unlock() defer c.statusMu.Unlock()
// Log the raw status frame ONCE per change, so field alignment can be verified
// against real hardware (the doc's 19-field layout may differ per firmware).
if payload != c.lastRaw {
c.lastRaw = payload
applog.Printf("spe: status raw=%q fields=%d", payload, len(f))
}
c.status.Connected = true c.status.Connected = true
c.status.LastError = "" c.status.LastError = ""
c.status.Model = get(0) c.status.Model = get(0)