debug: log raw SPE status frame on change (to verify CSV field alignment on real hw)
This commit is contained in:
@@ -25,6 +25,8 @@ import (
|
||||
"time"
|
||||
|
||||
"go.bug.st/serial"
|
||||
|
||||
"hamlog/internal/applog"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -77,6 +79,7 @@ type Client struct {
|
||||
|
||||
statusMu sync.RWMutex
|
||||
status Status
|
||||
lastRaw string // last raw status payload logged (log only on change)
|
||||
|
||||
stop chan struct{}
|
||||
running bool
|
||||
@@ -268,6 +271,12 @@ func (c *Client) decodeCSV(payload string) {
|
||||
|
||||
c.statusMu.Lock()
|
||||
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.LastError = ""
|
||||
c.status.Model = get(0)
|
||||
|
||||
Reference in New Issue
Block a user