Add BMA456 tap detection with ESP-NOW notify and host snapshot API.

Slaves forward configured tap kinds to the master; goTool exposes CLI, dashboard, REST, and WebSocket with separate notify vs receive and 2s display cache.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-29 20:42:57 +02:00
co-authored by Cursor
parent 3cb0b5bbe9
commit a8d4d42920
34 changed files with 3138 additions and 241 deletions
+5 -3
View File
@@ -38,20 +38,22 @@ func runServe(portName string, baud int, args []string) error {
hub := newWSHub()
streamCtl := newAccelStreamCtl()
tapCtl := newTapNotifyCtl()
stop := make(chan struct{})
defer close(stop)
go runPoller(link, portName, hub, streamCtl, *interval, stop)
go runPoller(link, portName, hub, streamCtl, tapCtl, *interval, stop)
go runBatteryPoller(link, hub, 5*time.Second, stop)
go runAccelDashboardPoller(link, hub, *accelInterval, stop)
go runTapDashboardPoller(link, hub, *accelInterval, stop)
var apiSrv *http.Server
if *apiAddr != "" {
apiSrv = runAPIServer(portName, link, *apiAddr, *accelInterval, hub, streamCtl, stop)
apiSrv = runAPIServer(portName, link, *apiAddr, *accelInterval, hub, streamCtl, tapCtl, stop)
defer shutdownAPIServer(apiSrv)
}
mux := http.NewServeMux()
mountServeAPI(mux, link, hub, streamCtl)
mountServeAPI(mux, link, hub, streamCtl, tapCtl)
mux.HandleFunc("/ws", func(w http.ResponseWriter, r *http.Request) {
conn, err := wsUpgrader.Upgrade(w, r, nil)
if err != nil {