Add BLE host transport selectable via DIP8 alongside UART.
Master can speak the same framed protobuf protocol over NimBLE or UART; goTool gains -ble, ble-rtt, and ble-stream timing checks for ESP-NOW coexistence. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,201 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"tinygo.org/x/bluetooth"
|
||||
|
||||
pb "powerpod/gotool/pb"
|
||||
uartframe "powerpod/gotool/uart"
|
||||
)
|
||||
|
||||
const (
|
||||
bleServiceUUID = "6e400001-b5a3-f393-e0a9-e50e24dcca9e"
|
||||
bleCharUUID = "6e400002-b5a3-f393-e0a9-e50e24dcca9e"
|
||||
bleDefaultName = "Powerpod"
|
||||
)
|
||||
|
||||
type bleLink struct {
|
||||
device bluetooth.Device
|
||||
char bluetooth.DeviceCharacteristic
|
||||
mu sync.Mutex
|
||||
parser *uartframe.Parser
|
||||
respCh chan []byte
|
||||
streamCh chan []byte
|
||||
quiet bool
|
||||
}
|
||||
|
||||
func openBLE(name string, settle time.Duration) (*bleLink, error) {
|
||||
if name == "" {
|
||||
name = bleDefaultName
|
||||
}
|
||||
adapter := bluetooth.DefaultAdapter
|
||||
if err := adapter.Enable(); err != nil {
|
||||
return nil, fmt.Errorf("enable bluetooth adapter: %w (check BlueZ / permissions)", err)
|
||||
}
|
||||
|
||||
svcUUID, err := bluetooth.ParseUUID(bleServiceUUID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
chrUUID, err := bluetooth.ParseUUID(bleCharUUID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
log.Printf("BLE scanning for %q…", name)
|
||||
var foundAddr bluetooth.Address
|
||||
var found bool
|
||||
go func() {
|
||||
time.Sleep(15 * time.Second)
|
||||
_ = adapter.StopScan()
|
||||
}()
|
||||
err = adapter.Scan(func(a *bluetooth.Adapter, result bluetooth.ScanResult) {
|
||||
if result.LocalName() != name {
|
||||
return
|
||||
}
|
||||
foundAddr = result.Address
|
||||
found = true
|
||||
_ = a.StopScan()
|
||||
})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("scan: %w", err)
|
||||
}
|
||||
if !found {
|
||||
return nil, fmt.Errorf("device %q not found (check DIP8=BLE and advertising)", name)
|
||||
}
|
||||
|
||||
log.Printf("BLE connecting…")
|
||||
device, err := adapter.Connect(foundAddr, bluetooth.ConnectionParams{})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("connect: %w", err)
|
||||
}
|
||||
|
||||
services, err := device.DiscoverServices([]bluetooth.UUID{svcUUID})
|
||||
if err != nil || len(services) == 0 {
|
||||
_ = device.Disconnect()
|
||||
return nil, fmt.Errorf("discover service: %v", err)
|
||||
}
|
||||
chars, err := services[0].DiscoverCharacteristics([]bluetooth.UUID{chrUUID})
|
||||
if err != nil || len(chars) == 0 {
|
||||
_ = device.Disconnect()
|
||||
return nil, fmt.Errorf("discover characteristic: %v", err)
|
||||
}
|
||||
char := chars[0]
|
||||
|
||||
if mtu, err := char.GetMTU(); err == nil {
|
||||
log.Printf("BLE ATT MTU=%d", mtu)
|
||||
if mtu < 203 {
|
||||
log.Printf("warning: MTU %d < 203 — large frames/stream ticks may fail", mtu)
|
||||
}
|
||||
}
|
||||
|
||||
link := &bleLink{
|
||||
device: device,
|
||||
char: char,
|
||||
parser: uartframe.NewParser(),
|
||||
respCh: make(chan []byte, 8),
|
||||
streamCh: make(chan []byte, 64),
|
||||
}
|
||||
|
||||
if err := char.EnableNotifications(func(buf []byte) {
|
||||
link.onNotify(buf)
|
||||
}); err != nil {
|
||||
_ = device.Disconnect()
|
||||
return nil, fmt.Errorf("enable notifications: %w (CCCD required before commands)", err)
|
||||
}
|
||||
|
||||
if settle <= 0 {
|
||||
settle = time.Second
|
||||
}
|
||||
log.Printf("BLE connected; settling %v…", settle)
|
||||
time.Sleep(settle)
|
||||
|
||||
return link, nil
|
||||
}
|
||||
|
||||
func (b *bleLink) onNotify(buf []byte) {
|
||||
for _, by := range buf {
|
||||
payload, ok, err := b.parser.Feed(by)
|
||||
if err != nil || !ok {
|
||||
continue
|
||||
}
|
||||
if len(payload) == 0 {
|
||||
continue
|
||||
}
|
||||
if payload[0] == byte(pb.MessageType_BLE_STREAM_TICK) {
|
||||
select {
|
||||
case b.streamCh <- payload:
|
||||
default:
|
||||
}
|
||||
continue
|
||||
}
|
||||
select {
|
||||
case b.respCh <- payload:
|
||||
default:
|
||||
log.Printf("BLE: response channel full, dropping frame type=0x%02x", payload[0])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (b *bleLink) Close() error {
|
||||
return b.device.Disconnect()
|
||||
}
|
||||
|
||||
func (b *bleLink) exchange(cmdID byte, cmdName string) ([]byte, error) {
|
||||
return b.exchangePayload([]byte{cmdID}, cmdName)
|
||||
}
|
||||
|
||||
func (b *bleLink) exchangePayload(payload []byte, cmdName string) ([]byte, error) {
|
||||
b.mu.Lock()
|
||||
defer b.mu.Unlock()
|
||||
|
||||
frame, err := uartframe.EncodeFrame(payload)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("encode frame: %w", err)
|
||||
}
|
||||
if !b.quiet {
|
||||
log.Printf("BLE sending %s (%d bytes)", cmdName, len(frame))
|
||||
}
|
||||
|
||||
for {
|
||||
select {
|
||||
case <-b.respCh:
|
||||
default:
|
||||
goto sent
|
||||
}
|
||||
}
|
||||
sent:
|
||||
if _, err := b.char.WriteWithoutResponse(frame); err != nil {
|
||||
return nil, fmt.Errorf("BLE write: %w (check DIP8=BLE)", err)
|
||||
}
|
||||
|
||||
timer := time.NewTimer(readTimeout)
|
||||
defer timer.Stop()
|
||||
select {
|
||||
case resp := <-b.respCh:
|
||||
if !b.quiet {
|
||||
log.Printf("BLE response (%d bytes)", len(resp))
|
||||
}
|
||||
return resp, nil
|
||||
case <-timer.C:
|
||||
return nil, fmt.Errorf("BLE read timeout for %s (check DIP8=BLE / -ble)", cmdName)
|
||||
}
|
||||
}
|
||||
|
||||
func (b *bleLink) NextStreamTick(timeout time.Duration) ([]byte, error) {
|
||||
if timeout <= 0 {
|
||||
timeout = 5 * time.Second
|
||||
}
|
||||
timer := time.NewTimer(timeout)
|
||||
defer timer.Stop()
|
||||
select {
|
||||
case p := <-b.streamCh:
|
||||
return p, nil
|
||||
case <-timer.C:
|
||||
return nil, fmt.Errorf("BLE stream tick timeout")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
|
||||
pb "powerpod/gotool/pb"
|
||||
)
|
||||
|
||||
func runAccelStreamCmd(h hostConn, args []string) error {
|
||||
fs := flag.NewFlagSet("accel-stream", flag.ExitOnError)
|
||||
clientID := fs.Uint("client", 0, "slave client id (0 with -all)")
|
||||
all := fs.Bool("all", false, "all registered clients")
|
||||
enable := fs.Bool("enable", true, "enable stream")
|
||||
disable := fs.Bool("disable", false, "disable stream")
|
||||
period := fs.Uint("period", 0, "BLE push period_ms 8–16 (0=leave/default)")
|
||||
if err := fs.Parse(args); err != nil {
|
||||
return err
|
||||
}
|
||||
on := *enable
|
||||
if *disable {
|
||||
on = false
|
||||
}
|
||||
if !*all && *clientID == 0 {
|
||||
return fmt.Errorf("need -client ID or -all")
|
||||
}
|
||||
req := &pb.AccelStreamRequest{
|
||||
Write: true,
|
||||
Enable: on,
|
||||
PeriodMs: uint32(*period),
|
||||
}
|
||||
if *all {
|
||||
req.AllClients = true
|
||||
} else {
|
||||
req.ClientId = uint32(*clientID)
|
||||
}
|
||||
r, err := hostAccelStream(h, req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Printf("accel-stream: success=%v enabled=%v client_id=%d slaves_updated=%d\n",
|
||||
r.GetSuccess(), r.GetEnabled(), r.GetClientId(), r.GetSlavesUpdated())
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"math"
|
||||
"sort"
|
||||
"time"
|
||||
)
|
||||
|
||||
func runBleRtt(h hostConn, args []string) error {
|
||||
fs := flag.NewFlagSet("ble-rtt", flag.ExitOnError)
|
||||
count := fs.Int("count", 50, "number of measured VERSION round-trips")
|
||||
settle := fs.Float64("settle", 0, "extra settle seconds before measurement (0 = already settled on connect)")
|
||||
warmup := fs.Int("warmup", 5, "discarded warm-up round-trips")
|
||||
if err := fs.Parse(args); err != nil {
|
||||
return err
|
||||
}
|
||||
if *count < 1 {
|
||||
return fmt.Errorf("--count must be >= 1")
|
||||
}
|
||||
if *warmup < 0 {
|
||||
return fmt.Errorf("--warmup must be >= 0")
|
||||
}
|
||||
|
||||
if *settle > 0 {
|
||||
fmt.Printf("settling %.1fs…\n", *settle)
|
||||
time.Sleep(time.Duration(*settle * float64(time.Second)))
|
||||
}
|
||||
|
||||
total := *warmup + *count
|
||||
samples := make([]float64, 0, *count)
|
||||
for i := 0; i < total; i++ {
|
||||
t0 := time.Now()
|
||||
if _, err := hostGetVersion(h); err != nil {
|
||||
return fmt.Errorf("VERSION round-trip %d: %w", i, err)
|
||||
}
|
||||
ms := float64(time.Since(t0).Microseconds()) / 1000.0
|
||||
if i >= *warmup {
|
||||
samples = append(samples, ms)
|
||||
}
|
||||
}
|
||||
|
||||
sort.Float64s(samples)
|
||||
fmt.Printf("ble-rtt (VERSION): n=%d warmup=%d\n", len(samples), *warmup)
|
||||
fmt.Printf(" min=%.3f median=%.3f mean=%.3f max=%.3f ms\n",
|
||||
samples[0], percentile(samples, 0.5), mean(samples), samples[len(samples)-1])
|
||||
return nil
|
||||
}
|
||||
|
||||
func mean(v []float64) float64 {
|
||||
if len(v) == 0 {
|
||||
return math.NaN()
|
||||
}
|
||||
var s float64
|
||||
for _, x := range v {
|
||||
s += x
|
||||
}
|
||||
return s / float64(len(v))
|
||||
}
|
||||
|
||||
func percentile(sorted []float64, p float64) float64 {
|
||||
if len(sorted) == 0 {
|
||||
return math.NaN()
|
||||
}
|
||||
if len(sorted) == 1 {
|
||||
return sorted[0]
|
||||
}
|
||||
idx := p * float64(len(sorted)-1)
|
||||
lo := int(idx)
|
||||
hi := lo + 1
|
||||
if hi >= len(sorted) {
|
||||
return sorted[lo]
|
||||
}
|
||||
frac := idx - float64(lo)
|
||||
return sorted[lo]*(1-frac) + sorted[hi]*frac
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"math"
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
pb "powerpod/gotool/pb"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
func runBleStream(h hostConn, args []string) error {
|
||||
fs := flag.NewFlagSet("ble-stream", flag.ExitOnError)
|
||||
clientID := fs.Uint("client", 0, "slave client id (0 = all_clients)")
|
||||
periodMs := fs.Uint("period", 16, "BLE push period_ms (8–16)")
|
||||
count := fs.Int("count", 50, "number of BleStreamTick samples")
|
||||
tolMs := fs.Float64("tol", 2.0, "tolerance ms around period for window_ok")
|
||||
duration := fs.Float64("timeout", 15.0, "max seconds waiting for ticks")
|
||||
if err := fs.Parse(args); err != nil {
|
||||
return err
|
||||
}
|
||||
if *periodMs < 8 || *periodMs > 16 {
|
||||
return fmt.Errorf("--period must be 8..16")
|
||||
}
|
||||
if *count < 2 {
|
||||
return fmt.Errorf("--count must be >= 2")
|
||||
}
|
||||
|
||||
sc, ok := h.(hostStreamConn)
|
||||
if !ok {
|
||||
return fmt.Errorf("ble-stream requires -ble (UART has no push ticks)")
|
||||
}
|
||||
|
||||
req := &pb.AccelStreamRequest{
|
||||
Write: true,
|
||||
Enable: true,
|
||||
PeriodMs: uint32(*periodMs),
|
||||
}
|
||||
if *clientID == 0 {
|
||||
req.AllClients = true
|
||||
} else {
|
||||
req.ClientId = uint32(*clientID)
|
||||
}
|
||||
resp, err := hostAccelStream(h, req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !resp.GetSuccess() {
|
||||
return fmt.Errorf("accel stream enable failed")
|
||||
}
|
||||
fmt.Printf("accel stream on; period_ms=%d; collecting %d ticks…\n", *periodMs, *count)
|
||||
|
||||
type sample struct {
|
||||
espUs uint64
|
||||
pcT float64
|
||||
}
|
||||
samples := make([]sample, 0, *count)
|
||||
deadline := time.Now().Add(time.Duration(*duration * float64(time.Second)))
|
||||
|
||||
for len(samples) < *count {
|
||||
remain := time.Until(deadline)
|
||||
if remain <= 0 {
|
||||
break
|
||||
}
|
||||
payload, err := sc.NextStreamTick(remain)
|
||||
if err != nil {
|
||||
break
|
||||
}
|
||||
pcT := time.Now().UnixMicro()
|
||||
var msg pb.UartMessage
|
||||
if err := proto.Unmarshal(payload[1:], &msg); err != nil {
|
||||
continue
|
||||
}
|
||||
tick := msg.GetBleStreamTick()
|
||||
if tick == nil {
|
||||
continue
|
||||
}
|
||||
samples = append(samples, sample{espUs: tick.GetEspTimestampUs(), pcT: float64(pcT)})
|
||||
}
|
||||
|
||||
// Best-effort disable
|
||||
off := &pb.AccelStreamRequest{Write: true, Enable: false, AllClients: req.AllClients, ClientId: req.ClientId}
|
||||
_, _ = hostAccelStream(h, off)
|
||||
|
||||
if len(samples) < 2 {
|
||||
return fmt.Errorf("need >=2 ticks, got %d (is stream running / DIP8=BLE?)", len(samples))
|
||||
}
|
||||
|
||||
var dT, dR, extra []float64
|
||||
esp0 := samples[0].espUs
|
||||
pc0 := samples[0].pcT
|
||||
for i := 1; i < len(samples); i++ {
|
||||
dT = append(dT, float64(samples[i].espUs-samples[i-1].espUs)/1000.0)
|
||||
dR = append(dR, (samples[i].pcT-samples[i-1].pcT)/1000.0)
|
||||
relEsp := float64(samples[i].espUs-esp0) / 1000.0
|
||||
relPc := (samples[i].pcT - pc0) / 1000.0
|
||||
extra = append(extra, relPc-relEsp)
|
||||
}
|
||||
|
||||
period := float64(*periodMs)
|
||||
outCount := 0
|
||||
for _, dt := range dT {
|
||||
if math.Abs(dt-period) > *tolMs {
|
||||
outCount++
|
||||
}
|
||||
}
|
||||
windowOK := outCount*2 <= len(dT) // majority inside tolerance
|
||||
|
||||
fmt.Printf("received=%d/%d period_ms=%d tol=±%.1f ms\n", len(samples), *count, *periodMs, *tolMs)
|
||||
printStat("dT ESP inter-depart", dT)
|
||||
printStat("dR PC inter-arrive", dR)
|
||||
printStat("extra vs first", extra)
|
||||
fmt.Printf("outside_tol=%d/%d window_ok=%s\n", outCount, len(dT), map[bool]string{true: "yes", false: "no"}[windowOK])
|
||||
return nil
|
||||
}
|
||||
|
||||
func printStat(name string, v []float64) {
|
||||
if len(v) == 0 {
|
||||
fmt.Printf("%s: (none)\n", name)
|
||||
return
|
||||
}
|
||||
s := append([]float64(nil), v...)
|
||||
sort.Float64s(s)
|
||||
fmt.Printf("%s: n=%d min=%.3f median=%.3f mean=%.3f max=%.3f ms\n",
|
||||
name, len(s), s[0], percentile(s, 0.5), mean(s), s[len(s)-1])
|
||||
}
|
||||
@@ -6,9 +6,19 @@ require (
|
||||
github.com/gorilla/websocket v1.5.3
|
||||
go.bug.st/serial v1.6.4
|
||||
google.golang.org/protobuf v1.36.11
|
||||
tinygo.org/x/bluetooth v0.13.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/creack/goselect v0.1.2 // indirect
|
||||
github.com/go-ole/go-ole v1.2.6 // indirect
|
||||
github.com/godbus/dbus/v5 v5.1.0 // indirect
|
||||
github.com/saltosystems/winrt-go v0.0.0-20240509164145-4f7860a3bd2b // indirect
|
||||
github.com/sirupsen/logrus v1.9.3 // indirect
|
||||
github.com/soypat/cyw43439 v0.0.0-20250505012923-830110c8f4af // indirect
|
||||
github.com/soypat/seqs v0.0.0-20250124201400-0d65bc7c1710 // indirect
|
||||
github.com/tinygo-org/cbgo v0.0.4 // indirect
|
||||
github.com/tinygo-org/pio v0.2.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20241204233417-43b7b7cde48d // indirect
|
||||
golang.org/x/sys v0.19.0 // indirect
|
||||
)
|
||||
|
||||
@@ -1,20 +1,51 @@
|
||||
github.com/creack/goselect v0.1.2 h1:2DNy14+JPjRBgPzAd1thbQp4BSIihxcBf0IXhQXDRa0=
|
||||
github.com/creack/goselect v0.1.2/go.mod h1:a/NhLweNvqIYMuxcMOuWY516Cimucms3DglDzQP3hKY=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
|
||||
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
|
||||
github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk=
|
||||
github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
|
||||
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/saltosystems/winrt-go v0.0.0-20240509164145-4f7860a3bd2b h1:du3zG5fd8snsFN6RBoLA7fpaYV9ZQIsyH9snlk2Zvik=
|
||||
github.com/saltosystems/winrt-go v0.0.0-20240509164145-4f7860a3bd2b/go.mod h1:CIltaIm7qaANUIvzr0Vmz71lmQMAIbGJ7cvgzX7FMfA=
|
||||
github.com/sirupsen/logrus v1.5.0/go.mod h1:+F7Ogzej0PZc/94MaYx/nvG9jOFMD2osvC3s+Squfpo=
|
||||
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
|
||||
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
|
||||
github.com/soypat/cyw43439 v0.0.0-20250505012923-830110c8f4af h1:ZfFq94aH/BCSWWKd9RPUgdHOdgGKCnfl2VdvU9UksTA=
|
||||
github.com/soypat/cyw43439 v0.0.0-20250505012923-830110c8f4af/go.mod h1:MUaGO5m6X7xrkHrPDmnaxCEcuCCFN/0ZFh9oie+exbU=
|
||||
github.com/soypat/seqs v0.0.0-20250124201400-0d65bc7c1710 h1:Y9fBuiR/urFY/m76+SAZTxk2xAOS2n85f+H1CugajeA=
|
||||
github.com/soypat/seqs v0.0.0-20250124201400-0d65bc7c1710/go.mod h1:oCVCNGCHMKoBj97Zp9znLbQ1nHxpkmOY9X+UAGzOxc8=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/tinygo-org/cbgo v0.0.4 h1:3D76CRYbH03Rudi8sEgs/YO0x3JIMdyq8jlQtk/44fU=
|
||||
github.com/tinygo-org/cbgo v0.0.4/go.mod h1:7+HgWIHd4nbAz0ESjGlJ1/v9LDU1Ox8MGzP9mah/fLk=
|
||||
github.com/tinygo-org/pio v0.2.0 h1:vo3xa6xDZ2rVtxrks/KcTZHF3qq4lyWOntvEvl2pOhU=
|
||||
github.com/tinygo-org/pio v0.2.0/go.mod h1:LU7Dw00NJ+N86QkeTGjMLNkYcEYMor6wTDpTCu0EaH8=
|
||||
go.bug.st/serial v1.6.4 h1:7FmqNPgVp3pu2Jz5PoPtbZ9jJO5gnEnZIvnI1lzve8A=
|
||||
go.bug.st/serial v1.6.4/go.mod h1:nofMJxTeNVny/m6+KaafC6vJGj3miwQZ6vW4BZUGJPI=
|
||||
golang.org/x/exp v0.0.0-20241204233417-43b7b7cde48d h1:0olWaB5pg3+oychR51GUVCEsGkeCU/2JxjBgIo4f3M0=
|
||||
golang.org/x/exp v0.0.0-20241204233417-43b7b7cde48d/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c=
|
||||
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
|
||||
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
|
||||
google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
tinygo.org/x/bluetooth v0.13.0 h1:3pkTMcfqv71HoAxG4DBTm2n+1bm6Nqqz8eoHjSW9+5g=
|
||||
tinygo.org/x/bluetooth v0.13.0/go.mod h1:YnyJRVX09i+wkFeHpXut0b+qHq+T2WwKBRRiF/scANA=
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
pb "powerpod/gotool/pb"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
// hostConn is the UART or BLE host transport used by CLI commands.
|
||||
type hostConn interface {
|
||||
exchangePayload(payload []byte, cmdName string) ([]byte, error)
|
||||
exchange(cmdID byte, cmdName string) ([]byte, error)
|
||||
Close() error
|
||||
}
|
||||
|
||||
// optional stream source (BLE only)
|
||||
type hostStreamConn interface {
|
||||
hostConn
|
||||
// NextStreamTick waits for a BLE_STREAM_TICK payload (type byte + protobuf).
|
||||
NextStreamTick(timeout time.Duration) ([]byte, error)
|
||||
}
|
||||
|
||||
func hostGetVersion(h hostConn) (*pb.VersionResponse, error) {
|
||||
payload, err := h.exchange(byte(pb.MessageType_VERSION), "VERSION")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return decodeVersionPayload(payload)
|
||||
}
|
||||
|
||||
func hostListClients(h hostConn) ([]*pb.ClientInfo, error) {
|
||||
payload, err := h.exchange(byte(pb.MessageType_CLIENT_INFO), "CLIENT_INFO")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return decodeClientsPayload(payload)
|
||||
}
|
||||
|
||||
func hostReadCacheStatus(h hostConn) (*pb.CacheStatusResponse, error) {
|
||||
payload, err := h.exchange(byte(pb.MessageType_CACHE_STATUS), "CACHE_STATUS")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return decodeCacheStatusPayload(payload)
|
||||
}
|
||||
|
||||
func hostAccelStream(h hostConn, req *pb.AccelStreamRequest) (*pb.AccelStreamResponse, error) {
|
||||
msg := &pb.UartMessage{
|
||||
Type: pb.MessageType_ACCEL_STREAM,
|
||||
Payload: &pb.UartMessage_AccelStreamRequest{
|
||||
AccelStreamRequest: req,
|
||||
},
|
||||
}
|
||||
body, err := proto.Marshal(msg)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("encode: %w", err)
|
||||
}
|
||||
payload := append([]byte{byte(pb.MessageType_ACCEL_STREAM)}, body...)
|
||||
respPayload, err := h.exchangePayload(payload, "ACCEL_STREAM")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var respMsg pb.UartMessage
|
||||
if err := proto.Unmarshal(respPayload[1:], &respMsg); err != nil {
|
||||
return nil, fmt.Errorf("decode: %w", err)
|
||||
}
|
||||
r := respMsg.GetAccelStreamResponse()
|
||||
if r == nil {
|
||||
return nil, fmt.Errorf("missing accel_stream_response")
|
||||
}
|
||||
return r, nil
|
||||
}
|
||||
|
||||
func hostEchoPing(h hostConn, clientID uint32) (*EchoPingResult, error) {
|
||||
t0 := time.Now()
|
||||
timestampUs := uint64(t0.UnixMicro())
|
||||
req := &pb.EspNowEchoPingRequest{
|
||||
ClientId: clientID,
|
||||
TimestampUs: timestampUs,
|
||||
}
|
||||
msg := &pb.UartMessage{
|
||||
Type: pb.MessageType_ESPNOW_ECHO_PING,
|
||||
Payload: &pb.UartMessage_EspnowEchoPingRequest{
|
||||
EspnowEchoPingRequest: req,
|
||||
},
|
||||
}
|
||||
body, err := proto.Marshal(msg)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("encode: %w", err)
|
||||
}
|
||||
payload := append([]byte{byte(pb.MessageType_ESPNOW_ECHO_PING)}, body...)
|
||||
respPayload, err := h.exchangePayload(payload, "ESPNOW_ECHO_PING")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
rttMs := float64(time.Since(t0).Microseconds()) / 1000.0
|
||||
|
||||
var respMsg pb.UartMessage
|
||||
if err := proto.Unmarshal(respPayload[1:], &respMsg); err != nil {
|
||||
return nil, fmt.Errorf("decode: %w", err)
|
||||
}
|
||||
r := respMsg.GetEspnowEchoPingResponse()
|
||||
if r == nil {
|
||||
return nil, fmt.Errorf("missing espnow_echo_ping_response")
|
||||
}
|
||||
if !r.GetSuccess() {
|
||||
return &EchoPingResult{
|
||||
Success: false,
|
||||
ClientID: r.GetClientId(),
|
||||
RttMs: rttMs,
|
||||
}, nil
|
||||
}
|
||||
if r.GetTimestampUs() != timestampUs {
|
||||
return nil, fmt.Errorf("timestamp mismatch: sent %d got %d", timestampUs, r.GetTimestampUs())
|
||||
}
|
||||
return &EchoPingResult{
|
||||
Success: true,
|
||||
ClientID: r.GetClientId(),
|
||||
TimestampUs: r.GetTimestampUs(),
|
||||
RttMs: rttMs,
|
||||
EspRttUs: r.GetEspRttUs(),
|
||||
}, nil
|
||||
}
|
||||
+178
-19
@@ -5,12 +5,14 @@ import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"time"
|
||||
)
|
||||
|
||||
const defaultBaud = 921600
|
||||
|
||||
func usage() {
|
||||
fmt.Fprintf(os.Stderr, "usage: gotool [-port /dev/ttyUSB0] <command>\n")
|
||||
fmt.Fprintf(os.Stderr, "usage: gotool [-port /dev/ttyUSB0 | -ble] <command>\n")
|
||||
fmt.Fprintf(os.Stderr, " DIP8 on master: 0=UART (-port), 1=BLE (-ble); reboot after DIP change\n")
|
||||
fmt.Fprintf(os.Stderr, " test uses uart.master from bench config when -port is omitted\n\n")
|
||||
fmt.Fprintf(os.Stderr, "commands:\n")
|
||||
fmt.Fprintf(os.Stderr, " version firmware version and git hash\n")
|
||||
@@ -18,12 +20,15 @@ func usage() {
|
||||
fmt.Fprintf(os.Stderr, " deadzone get/set accelerometer deadzone (LSB)\n")
|
||||
fmt.Fprintf(os.Stderr, " tap-config get/set BMA456 tap detection parameters\n")
|
||||
fmt.Fprintf(os.Stderr, " tap-notify get/set which tap kinds notify via ESP-NOW\n")
|
||||
fmt.Fprintf(os.Stderr, " cache-status subscribed accel + tap cache (one UART round-trip)\n")
|
||||
fmt.Fprintf(os.Stderr, " cache-status subscribed accel + tap cache (one round-trip)\n")
|
||||
fmt.Fprintf(os.Stderr, " accel-stream enable/disable ESP-NOW accel stream (+ BLE period)\n")
|
||||
fmt.Fprintf(os.Stderr, " unicast-test send ESP-NOW unicast test to one slave\n")
|
||||
fmt.Fprintf(os.Stderr, " echo-ping ESP-NOW timestamp echo round-trip to one slave\n")
|
||||
fmt.Fprintf(os.Stderr, " ble-rtt Host↔Master RTT via VERSION (N samples)\n")
|
||||
fmt.Fprintf(os.Stderr, " ble-stream enable stream + measure BleStreamTick window\n")
|
||||
fmt.Fprintf(os.Stderr, " test run automated scenario (see testdata/)\n")
|
||||
fmt.Fprintf(os.Stderr, " serve web dashboard (Bootstrap + WebSocket)\n")
|
||||
fmt.Fprintf(os.Stderr, " ota UART OTA upload (A/B partitions)\n")
|
||||
fmt.Fprintf(os.Stderr, " serve web dashboard (UART only)\n")
|
||||
fmt.Fprintf(os.Stderr, " ota UART OTA upload (A/B partitions; UART host only)\n")
|
||||
fmt.Fprintf(os.Stderr, " ota-progress query per-slave ESP-NOW OTA progress on master\n")
|
||||
fmt.Fprintf(os.Stderr, " led-ring set LED ring progress bar (0–100%%, rgb, intensity)\n")
|
||||
fmt.Fprintf(os.Stderr, " find-me blink LED ring red/green/blue (3× each, full brightness)\n")
|
||||
@@ -33,8 +38,11 @@ func usage() {
|
||||
}
|
||||
|
||||
func main() {
|
||||
portName := flag.String("port", "", "serial port (e.g. /dev/ttyUSB0)")
|
||||
portName := flag.String("port", "", "serial port (e.g. /dev/ttyUSB0); XOR with -ble")
|
||||
baud := flag.Int("baud", defaultBaud, "UART baud rate")
|
||||
useBLE := flag.Bool("ble", false, "use BLE host transport (DIP8=1); XOR with -port")
|
||||
bleName := flag.String("ble-name", bleDefaultName, "BLE advertised name")
|
||||
bleSettle := flag.Float64("ble-settle", 1.0, "seconds to settle after BLE connect")
|
||||
flag.Parse()
|
||||
|
||||
if flag.NArg() < 1 {
|
||||
@@ -47,55 +55,133 @@ func main() {
|
||||
var runErr error
|
||||
switch cmd {
|
||||
case "test", "autotest":
|
||||
if *useBLE {
|
||||
runErr = fmt.Errorf("autotest requires -port (UART)")
|
||||
break
|
||||
}
|
||||
runErr = runTest(*portName, *baud, flag.Args()[1:])
|
||||
case "serve", "web", "dashboard":
|
||||
if *useBLE {
|
||||
fmt.Fprintf(os.Stderr, "serve requires -port (UART only in this release)\n")
|
||||
os.Exit(2)
|
||||
}
|
||||
if *portName == "" {
|
||||
fmt.Fprintf(os.Stderr, "command %q requires -port\n\n", cmd)
|
||||
usage()
|
||||
os.Exit(2)
|
||||
}
|
||||
runErr = runServe(*portName, *baud, flag.Args()[1:])
|
||||
case "version", "clients", "client-info", "deadzone", "accel-deadzone", "tap-config", "tap_config", "tap-notify", "tap_notify", "cache-status", "cache_status", "unicast-test", "unicast_test", "echo-ping", "echo_ping", "led-ring", "led_ring", "find-me", "find_me", "restart", "log-level", "log_level", "ota", "ota-progress", "ota_progress":
|
||||
if *portName == "" {
|
||||
fmt.Fprintf(os.Stderr, "command %q requires -port\n\n", cmd)
|
||||
case "version", "clients", "client-info", "deadzone", "accel-deadzone", "tap-config", "tap_config", "tap-notify", "tap_notify", "cache-status", "cache_status", "accel-stream", "accel_stream", "unicast-test", "unicast_test", "echo-ping", "echo_ping", "ble-rtt", "ble_rtt", "ble-stream", "ble_stream", "led-ring", "led_ring", "find-me", "find_me", "restart", "log-level", "log_level", "ota", "ota-progress", "ota_progress":
|
||||
if *useBLE && *portName != "" {
|
||||
fmt.Fprintf(os.Stderr, "use either -port or -ble, not both\n")
|
||||
os.Exit(2)
|
||||
}
|
||||
if !*useBLE && *portName == "" {
|
||||
fmt.Fprintf(os.Stderr, "command %q requires -port or -ble\n\n", cmd)
|
||||
usage()
|
||||
os.Exit(2)
|
||||
}
|
||||
sp, err := openSerial(*portName, *baud)
|
||||
if err != nil {
|
||||
log.Fatalf("open serial: %v", err)
|
||||
if cmd == "ota" || cmd == "ota-progress" || cmd == "ota_progress" {
|
||||
if *useBLE {
|
||||
fmt.Fprintf(os.Stderr, "OTA requires UART host (DIP8=0, -port)\n")
|
||||
os.Exit(2)
|
||||
}
|
||||
}
|
||||
registerShutdown(func() { _ = sp.Close() })
|
||||
|
||||
var h hostConn
|
||||
if *useBLE {
|
||||
bl, err := openBLE(*bleName, time.Duration(*bleSettle*float64(time.Second)))
|
||||
if err != nil {
|
||||
log.Fatalf("open BLE: %v", err)
|
||||
}
|
||||
h = bl
|
||||
} else {
|
||||
sp, err := openSerial(*portName, *baud)
|
||||
if err != nil {
|
||||
log.Fatalf("open serial: %v", err)
|
||||
}
|
||||
h = sp
|
||||
}
|
||||
registerShutdown(func() { _ = h.Close() })
|
||||
enableShutdownOnInterrupt()
|
||||
defer sp.Close()
|
||||
defer h.Close()
|
||||
|
||||
switch cmd {
|
||||
case "version":
|
||||
runErr = runVersion(sp)
|
||||
runErr = runVersionHost(h)
|
||||
case "clients", "client-info":
|
||||
runErr = runClients(sp)
|
||||
runErr = runClientsHost(h)
|
||||
case "cache-status", "cache_status":
|
||||
runErr = runCacheStatusHost(h)
|
||||
case "accel-stream", "accel_stream":
|
||||
runErr = runAccelStreamCmd(h, flag.Args()[1:])
|
||||
case "echo-ping", "echo_ping":
|
||||
runErr = runEchoPingHost(h, flag.Args()[1:])
|
||||
case "ble-rtt", "ble_rtt":
|
||||
runErr = runBleRtt(h, flag.Args()[1:])
|
||||
case "ble-stream", "ble_stream":
|
||||
runErr = runBleStream(h, flag.Args()[1:])
|
||||
case "deadzone", "accel-deadzone":
|
||||
sp, ok := h.(*serialPort)
|
||||
if !ok {
|
||||
runErr = fmt.Errorf("%s over BLE not wired yet; use -port", cmd)
|
||||
break
|
||||
}
|
||||
runErr = runDeadzone(sp, flag.Args()[1:])
|
||||
case "tap-config", "tap_config":
|
||||
sp, ok := h.(*serialPort)
|
||||
if !ok {
|
||||
runErr = fmt.Errorf("%s over BLE not wired yet; use -port", cmd)
|
||||
break
|
||||
}
|
||||
runErr = runTapConfig(sp, flag.Args()[1:])
|
||||
case "tap-notify", "tap_notify":
|
||||
sp, ok := h.(*serialPort)
|
||||
if !ok {
|
||||
runErr = fmt.Errorf("%s over BLE not wired yet; use -port", cmd)
|
||||
break
|
||||
}
|
||||
runErr = runTapNotify(sp, flag.Args()[1:])
|
||||
case "cache-status", "cache_status":
|
||||
runErr = runCacheStatus(sp)
|
||||
case "unicast-test", "unicast_test":
|
||||
sp, ok := h.(*serialPort)
|
||||
if !ok {
|
||||
runErr = fmt.Errorf("%s over BLE not wired yet; use -port", cmd)
|
||||
break
|
||||
}
|
||||
runErr = runUnicastTest(sp, flag.Args()[1:])
|
||||
case "echo-ping", "echo_ping":
|
||||
runErr = runEchoPing(sp, flag.Args()[1:])
|
||||
case "led-ring", "led_ring":
|
||||
sp, ok := h.(*serialPort)
|
||||
if !ok {
|
||||
runErr = fmt.Errorf("%s over BLE not wired yet; use -port", cmd)
|
||||
break
|
||||
}
|
||||
runErr = runLedRing(sp, flag.Args()[1:])
|
||||
case "find-me", "find_me":
|
||||
sp, ok := h.(*serialPort)
|
||||
if !ok {
|
||||
runErr = fmt.Errorf("%s over BLE not wired yet; use -port", cmd)
|
||||
break
|
||||
}
|
||||
runErr = runFindMe(sp, flag.Args()[1:])
|
||||
case "restart":
|
||||
sp, ok := h.(*serialPort)
|
||||
if !ok {
|
||||
runErr = fmt.Errorf("%s over BLE not wired yet; use -port", cmd)
|
||||
break
|
||||
}
|
||||
runErr = runRestart(sp, flag.Args()[1:])
|
||||
case "log-level", "log_level":
|
||||
sp, ok := h.(*serialPort)
|
||||
if !ok {
|
||||
runErr = fmt.Errorf("%s over BLE not wired yet; use -port", cmd)
|
||||
break
|
||||
}
|
||||
runErr = runLogLevel(sp, flag.Args()[1:])
|
||||
case "ota":
|
||||
sp := h.(*serialPort)
|
||||
runErr = runOTA(sp, flag.Args()[1:])
|
||||
case "ota-progress", "ota_progress":
|
||||
sp := h.(*serialPort)
|
||||
runErr = runOtaProgress(sp, flag.Args()[1:])
|
||||
}
|
||||
default:
|
||||
@@ -108,3 +194,76 @@ func main() {
|
||||
log.Fatal(runErr)
|
||||
}
|
||||
}
|
||||
|
||||
func runVersionHost(h hostConn) error {
|
||||
ver, err := hostGetVersion(h)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Printf("version: %d\n", ver.GetVersion())
|
||||
fmt.Printf("git_hash: %s\n", ver.GetGitHash())
|
||||
return nil
|
||||
}
|
||||
|
||||
func runClientsHost(h hostConn) error {
|
||||
clients, err := hostListClients(h)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(clients) == 0 {
|
||||
fmt.Println("no clients registered")
|
||||
return nil
|
||||
}
|
||||
fmt.Printf("clients (%d):\n", len(clients))
|
||||
for i, c := range clients {
|
||||
fmt.Printf(" [%d] id=%d ver=%d available=%v used=%v\n",
|
||||
i, c.GetId(), c.GetVersion(), c.GetAvailable(), c.GetUsed())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func runCacheStatusHost(h hostConn) error {
|
||||
r, err := hostReadCacheStatus(h)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
clients := r.GetClients()
|
||||
if len(clients) == 0 {
|
||||
fmt.Println("(no slaves with accel stream or tap notify enabled)")
|
||||
return nil
|
||||
}
|
||||
for _, c := range clients {
|
||||
id := c.GetClientId()
|
||||
if a := c.GetAccel(); a != nil {
|
||||
if !a.GetValid() {
|
||||
fmt.Printf("client %d accel: no sample yet\n", id)
|
||||
} else {
|
||||
fmt.Printf("client %d accel: x=%d y=%d z=%d (age %d ms)\n",
|
||||
id, a.GetX(), a.GetY(), a.GetZ(), a.GetAgeMs())
|
||||
}
|
||||
}
|
||||
if t := c.GetTap(); t != nil {
|
||||
fmt.Printf("client %d tap: %s (age %d ms)\n",
|
||||
id, tapKindLabel(t.GetKind()), t.GetAgeMs())
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func runEchoPingHost(h hostConn, args []string) error {
|
||||
fs := flag.NewFlagSet("echo-ping", flag.ExitOnError)
|
||||
clientID := fs.Uint("client", 0, "slave client id from `clients`")
|
||||
if err := fs.Parse(args); err != nil {
|
||||
return err
|
||||
}
|
||||
if *clientID == 0 {
|
||||
return fmt.Errorf("client id required (see `gotool clients`)")
|
||||
}
|
||||
r, err := hostEchoPing(h, uint32(*clientID))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Printf("echo ping: success=%v client_id=%d rtt_ms=%.3f (host↔master↔slave) esp_rtt_us=%d (ESP-NOW only)\n",
|
||||
r.Success, r.ClientID, r.RttMs, r.EspRttUs)
|
||||
return nil
|
||||
}
|
||||
|
||||
+230
-129
@@ -52,6 +52,8 @@ const (
|
||||
MessageType_SET_LOG_LEVEL MessageType = 31
|
||||
// * Host → master: get/set BMA456H multitap detection parameters.
|
||||
MessageType_TAP_CONFIG MessageType = 32
|
||||
// * Master → host (BLE only): periodic pushed cache snapshot with ESP timestamp.
|
||||
MessageType_BLE_STREAM_TICK MessageType = 33
|
||||
)
|
||||
|
||||
// Enum value maps for MessageType.
|
||||
@@ -81,6 +83,7 @@ var (
|
||||
30: "ESPNOW_ECHO_PING",
|
||||
31: "SET_LOG_LEVEL",
|
||||
32: "TAP_CONFIG",
|
||||
33: "BLE_STREAM_TICK",
|
||||
}
|
||||
MessageType_value = map[string]int32{
|
||||
"UNKNOWN": 0,
|
||||
@@ -107,6 +110,7 @@ var (
|
||||
"ESPNOW_ECHO_PING": 30,
|
||||
"SET_LOG_LEVEL": 31,
|
||||
"TAP_CONFIG": 32,
|
||||
"BLE_STREAM_TICK": 33,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -229,6 +233,7 @@ type UartMessage struct {
|
||||
// *UartMessage_SetLogLevelResponse
|
||||
// *UartMessage_TapConfigRequest
|
||||
// *UartMessage_TapConfigResponse
|
||||
// *UartMessage_BleStreamTick
|
||||
Payload isUartMessage_Payload `protobuf_oneof:"payload"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
@@ -593,6 +598,15 @@ func (x *UartMessage) GetTapConfigResponse() *TapConfigResponse {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *UartMessage) GetBleStreamTick() *BleStreamTick {
|
||||
if x != nil {
|
||||
if x, ok := x.Payload.(*UartMessage_BleStreamTick); ok {
|
||||
return x.BleStreamTick
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type isUartMessage_Payload interface {
|
||||
isUartMessage_Payload()
|
||||
}
|
||||
@@ -737,6 +751,10 @@ type UartMessage_TapConfigResponse struct {
|
||||
TapConfigResponse *TapConfigResponse `protobuf:"bytes,40,opt,name=tap_config_response,json=tapConfigResponse,proto3,oneof"`
|
||||
}
|
||||
|
||||
type UartMessage_BleStreamTick struct {
|
||||
BleStreamTick *BleStreamTick `protobuf:"bytes,41,opt,name=ble_stream_tick,json=bleStreamTick,proto3,oneof"`
|
||||
}
|
||||
|
||||
func (*UartMessage_AckPayload) isUartMessage_Payload() {}
|
||||
|
||||
func (*UartMessage_EchoPayload) isUartMessage_Payload() {}
|
||||
@@ -807,6 +825,8 @@ func (*UartMessage_TapConfigRequest) isUartMessage_Payload() {}
|
||||
|
||||
func (*UartMessage_TapConfigResponse) isUartMessage_Payload() {}
|
||||
|
||||
func (*UartMessage_BleStreamTick) isUartMessage_Payload() {}
|
||||
|
||||
type Ack struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
@@ -1371,12 +1391,14 @@ func (x *AccelDeadzoneResponse) GetSlavesUpdated() uint32 {
|
||||
|
||||
// Host → master: enable/disable slave accel ESP-NOW stream (~16 ms per slave).
|
||||
// write=false: read; write=true: apply. client_id 0 invalid for write (use >0 or all_clients).
|
||||
// period_ms (8–16): BLE host push interval for BleStreamTick; ignored on UART (default 16).
|
||||
type AccelStreamRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Write bool `protobuf:"varint,1,opt,name=write,proto3" json:"write,omitempty"`
|
||||
Enable bool `protobuf:"varint,2,opt,name=enable,proto3" json:"enable,omitempty"`
|
||||
ClientId uint32 `protobuf:"varint,3,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
|
||||
AllClients bool `protobuf:"varint,4,opt,name=all_clients,json=allClients,proto3" json:"all_clients,omitempty"`
|
||||
PeriodMs uint32 `protobuf:"varint,5,opt,name=period_ms,json=periodMs,proto3" json:"period_ms,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
@@ -1439,6 +1461,13 @@ func (x *AccelStreamRequest) GetAllClients() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *AccelStreamRequest) GetPeriodMs() uint32 {
|
||||
if x != nil {
|
||||
return x.PeriodMs
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type AccelStreamResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"`
|
||||
@@ -2333,6 +2362,67 @@ func (x *CacheStatusResponse) GetClients() []*CacheClientStatus {
|
||||
return nil
|
||||
}
|
||||
|
||||
// * Master → host over BLE notify: aggregated cache + ESP timer timestamp.
|
||||
type BleStreamTick struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
EspTimestampUs uint64 `protobuf:"varint,1,opt,name=esp_timestamp_us,json=espTimestampUs,proto3" json:"esp_timestamp_us,omitempty"`
|
||||
PeriodMs uint32 `protobuf:"varint,2,opt,name=period_ms,json=periodMs,proto3" json:"period_ms,omitempty"`
|
||||
Clients []*CacheClientStatus `protobuf:"bytes,3,rep,name=clients,proto3" json:"clients,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *BleStreamTick) Reset() {
|
||||
*x = BleStreamTick{}
|
||||
mi := &file_uart_messages_proto_msgTypes[25]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *BleStreamTick) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*BleStreamTick) ProtoMessage() {}
|
||||
|
||||
func (x *BleStreamTick) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_uart_messages_proto_msgTypes[25]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use BleStreamTick.ProtoReflect.Descriptor instead.
|
||||
func (*BleStreamTick) Descriptor() ([]byte, []int) {
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{25}
|
||||
}
|
||||
|
||||
func (x *BleStreamTick) GetEspTimestampUs() uint64 {
|
||||
if x != nil {
|
||||
return x.EspTimestampUs
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *BleStreamTick) GetPeriodMs() uint32 {
|
||||
if x != nil {
|
||||
return x.PeriodMs
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *BleStreamTick) GetClients() []*CacheClientStatus {
|
||||
if x != nil {
|
||||
return x.Clients
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type EspNowUnicastTestRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
ClientId uint32 `protobuf:"varint,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
|
||||
@@ -2343,7 +2433,7 @@ type EspNowUnicastTestRequest struct {
|
||||
|
||||
func (x *EspNowUnicastTestRequest) Reset() {
|
||||
*x = EspNowUnicastTestRequest{}
|
||||
mi := &file_uart_messages_proto_msgTypes[25]
|
||||
mi := &file_uart_messages_proto_msgTypes[26]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -2355,7 +2445,7 @@ func (x *EspNowUnicastTestRequest) String() string {
|
||||
func (*EspNowUnicastTestRequest) ProtoMessage() {}
|
||||
|
||||
func (x *EspNowUnicastTestRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_uart_messages_proto_msgTypes[25]
|
||||
mi := &file_uart_messages_proto_msgTypes[26]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -2368,7 +2458,7 @@ func (x *EspNowUnicastTestRequest) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use EspNowUnicastTestRequest.ProtoReflect.Descriptor instead.
|
||||
func (*EspNowUnicastTestRequest) Descriptor() ([]byte, []int) {
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{25}
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{26}
|
||||
}
|
||||
|
||||
func (x *EspNowUnicastTestRequest) GetClientId() uint32 {
|
||||
@@ -2395,7 +2485,7 @@ type EspNowUnicastTestResponse struct {
|
||||
|
||||
func (x *EspNowUnicastTestResponse) Reset() {
|
||||
*x = EspNowUnicastTestResponse{}
|
||||
mi := &file_uart_messages_proto_msgTypes[26]
|
||||
mi := &file_uart_messages_proto_msgTypes[27]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -2407,7 +2497,7 @@ func (x *EspNowUnicastTestResponse) String() string {
|
||||
func (*EspNowUnicastTestResponse) ProtoMessage() {}
|
||||
|
||||
func (x *EspNowUnicastTestResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_uart_messages_proto_msgTypes[26]
|
||||
mi := &file_uart_messages_proto_msgTypes[27]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -2420,7 +2510,7 @@ func (x *EspNowUnicastTestResponse) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use EspNowUnicastTestResponse.ProtoReflect.Descriptor instead.
|
||||
func (*EspNowUnicastTestResponse) Descriptor() ([]byte, []int) {
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{26}
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{27}
|
||||
}
|
||||
|
||||
func (x *EspNowUnicastTestResponse) GetSuccess() bool {
|
||||
@@ -2449,7 +2539,7 @@ type EspNowEchoPingRequest struct {
|
||||
|
||||
func (x *EspNowEchoPingRequest) Reset() {
|
||||
*x = EspNowEchoPingRequest{}
|
||||
mi := &file_uart_messages_proto_msgTypes[27]
|
||||
mi := &file_uart_messages_proto_msgTypes[28]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -2461,7 +2551,7 @@ func (x *EspNowEchoPingRequest) String() string {
|
||||
func (*EspNowEchoPingRequest) ProtoMessage() {}
|
||||
|
||||
func (x *EspNowEchoPingRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_uart_messages_proto_msgTypes[27]
|
||||
mi := &file_uart_messages_proto_msgTypes[28]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -2474,7 +2564,7 @@ func (x *EspNowEchoPingRequest) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use EspNowEchoPingRequest.ProtoReflect.Descriptor instead.
|
||||
func (*EspNowEchoPingRequest) Descriptor() ([]byte, []int) {
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{27}
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{28}
|
||||
}
|
||||
|
||||
func (x *EspNowEchoPingRequest) GetClientId() uint32 {
|
||||
@@ -2505,7 +2595,7 @@ type EspNowEchoPingResponse struct {
|
||||
|
||||
func (x *EspNowEchoPingResponse) Reset() {
|
||||
*x = EspNowEchoPingResponse{}
|
||||
mi := &file_uart_messages_proto_msgTypes[28]
|
||||
mi := &file_uart_messages_proto_msgTypes[29]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -2517,7 +2607,7 @@ func (x *EspNowEchoPingResponse) String() string {
|
||||
func (*EspNowEchoPingResponse) ProtoMessage() {}
|
||||
|
||||
func (x *EspNowEchoPingResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_uart_messages_proto_msgTypes[28]
|
||||
mi := &file_uart_messages_proto_msgTypes[29]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -2530,7 +2620,7 @@ func (x *EspNowEchoPingResponse) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use EspNowEchoPingResponse.ProtoReflect.Descriptor instead.
|
||||
func (*EspNowEchoPingResponse) Descriptor() ([]byte, []int) {
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{28}
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{29}
|
||||
}
|
||||
|
||||
func (x *EspNowEchoPingResponse) GetSuccess() bool {
|
||||
@@ -2591,7 +2681,7 @@ type LedRingProgressRequest struct {
|
||||
|
||||
func (x *LedRingProgressRequest) Reset() {
|
||||
*x = LedRingProgressRequest{}
|
||||
mi := &file_uart_messages_proto_msgTypes[29]
|
||||
mi := &file_uart_messages_proto_msgTypes[30]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -2603,7 +2693,7 @@ func (x *LedRingProgressRequest) String() string {
|
||||
func (*LedRingProgressRequest) ProtoMessage() {}
|
||||
|
||||
func (x *LedRingProgressRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_uart_messages_proto_msgTypes[29]
|
||||
mi := &file_uart_messages_proto_msgTypes[30]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -2616,7 +2706,7 @@ func (x *LedRingProgressRequest) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use LedRingProgressRequest.ProtoReflect.Descriptor instead.
|
||||
func (*LedRingProgressRequest) Descriptor() ([]byte, []int) {
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{29}
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{30}
|
||||
}
|
||||
|
||||
func (x *LedRingProgressRequest) GetMode() uint32 {
|
||||
@@ -2717,7 +2807,7 @@ type LedRingProgressResponse struct {
|
||||
|
||||
func (x *LedRingProgressResponse) Reset() {
|
||||
*x = LedRingProgressResponse{}
|
||||
mi := &file_uart_messages_proto_msgTypes[30]
|
||||
mi := &file_uart_messages_proto_msgTypes[31]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -2729,7 +2819,7 @@ func (x *LedRingProgressResponse) String() string {
|
||||
func (*LedRingProgressResponse) ProtoMessage() {}
|
||||
|
||||
func (x *LedRingProgressResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_uart_messages_proto_msgTypes[30]
|
||||
mi := &file_uart_messages_proto_msgTypes[31]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -2742,7 +2832,7 @@ func (x *LedRingProgressResponse) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use LedRingProgressResponse.ProtoReflect.Descriptor instead.
|
||||
func (*LedRingProgressResponse) Descriptor() ([]byte, []int) {
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{30}
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{31}
|
||||
}
|
||||
|
||||
func (x *LedRingProgressResponse) GetSuccess() bool {
|
||||
@@ -2797,7 +2887,7 @@ type EspNowFindMeRequest struct {
|
||||
|
||||
func (x *EspNowFindMeRequest) Reset() {
|
||||
*x = EspNowFindMeRequest{}
|
||||
mi := &file_uart_messages_proto_msgTypes[31]
|
||||
mi := &file_uart_messages_proto_msgTypes[32]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -2809,7 +2899,7 @@ func (x *EspNowFindMeRequest) String() string {
|
||||
func (*EspNowFindMeRequest) ProtoMessage() {}
|
||||
|
||||
func (x *EspNowFindMeRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_uart_messages_proto_msgTypes[31]
|
||||
mi := &file_uart_messages_proto_msgTypes[32]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -2822,7 +2912,7 @@ func (x *EspNowFindMeRequest) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use EspNowFindMeRequest.ProtoReflect.Descriptor instead.
|
||||
func (*EspNowFindMeRequest) Descriptor() ([]byte, []int) {
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{31}
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{32}
|
||||
}
|
||||
|
||||
func (x *EspNowFindMeRequest) GetClientId() uint32 {
|
||||
@@ -2842,7 +2932,7 @@ type EspNowFindMeResponse struct {
|
||||
|
||||
func (x *EspNowFindMeResponse) Reset() {
|
||||
*x = EspNowFindMeResponse{}
|
||||
mi := &file_uart_messages_proto_msgTypes[32]
|
||||
mi := &file_uart_messages_proto_msgTypes[33]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -2854,7 +2944,7 @@ func (x *EspNowFindMeResponse) String() string {
|
||||
func (*EspNowFindMeResponse) ProtoMessage() {}
|
||||
|
||||
func (x *EspNowFindMeResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_uart_messages_proto_msgTypes[32]
|
||||
mi := &file_uart_messages_proto_msgTypes[33]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -2867,7 +2957,7 @@ func (x *EspNowFindMeResponse) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use EspNowFindMeResponse.ProtoReflect.Descriptor instead.
|
||||
func (*EspNowFindMeResponse) Descriptor() ([]byte, []int) {
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{32}
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{33}
|
||||
}
|
||||
|
||||
func (x *EspNowFindMeResponse) GetSuccess() bool {
|
||||
@@ -2894,7 +2984,7 @@ type RestartRequest struct {
|
||||
|
||||
func (x *RestartRequest) Reset() {
|
||||
*x = RestartRequest{}
|
||||
mi := &file_uart_messages_proto_msgTypes[33]
|
||||
mi := &file_uart_messages_proto_msgTypes[34]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -2906,7 +2996,7 @@ func (x *RestartRequest) String() string {
|
||||
func (*RestartRequest) ProtoMessage() {}
|
||||
|
||||
func (x *RestartRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_uart_messages_proto_msgTypes[33]
|
||||
mi := &file_uart_messages_proto_msgTypes[34]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -2919,7 +3009,7 @@ func (x *RestartRequest) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use RestartRequest.ProtoReflect.Descriptor instead.
|
||||
func (*RestartRequest) Descriptor() ([]byte, []int) {
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{33}
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{34}
|
||||
}
|
||||
|
||||
func (x *RestartRequest) GetClientId() uint32 {
|
||||
@@ -2939,7 +3029,7 @@ type RestartResponse struct {
|
||||
|
||||
func (x *RestartResponse) Reset() {
|
||||
*x = RestartResponse{}
|
||||
mi := &file_uart_messages_proto_msgTypes[34]
|
||||
mi := &file_uart_messages_proto_msgTypes[35]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -2951,7 +3041,7 @@ func (x *RestartResponse) String() string {
|
||||
func (*RestartResponse) ProtoMessage() {}
|
||||
|
||||
func (x *RestartResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_uart_messages_proto_msgTypes[34]
|
||||
mi := &file_uart_messages_proto_msgTypes[35]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -2964,7 +3054,7 @@ func (x *RestartResponse) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use RestartResponse.ProtoReflect.Descriptor instead.
|
||||
func (*RestartResponse) Descriptor() ([]byte, []int) {
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{34}
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{35}
|
||||
}
|
||||
|
||||
func (x *RestartResponse) GetSuccess() bool {
|
||||
@@ -2993,7 +3083,7 @@ type SetLogLevelRequest struct {
|
||||
|
||||
func (x *SetLogLevelRequest) Reset() {
|
||||
*x = SetLogLevelRequest{}
|
||||
mi := &file_uart_messages_proto_msgTypes[35]
|
||||
mi := &file_uart_messages_proto_msgTypes[36]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -3005,7 +3095,7 @@ func (x *SetLogLevelRequest) String() string {
|
||||
func (*SetLogLevelRequest) ProtoMessage() {}
|
||||
|
||||
func (x *SetLogLevelRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_uart_messages_proto_msgTypes[35]
|
||||
mi := &file_uart_messages_proto_msgTypes[36]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -3018,7 +3108,7 @@ func (x *SetLogLevelRequest) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use SetLogLevelRequest.ProtoReflect.Descriptor instead.
|
||||
func (*SetLogLevelRequest) Descriptor() ([]byte, []int) {
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{35}
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{36}
|
||||
}
|
||||
|
||||
func (x *SetLogLevelRequest) GetWrite() bool {
|
||||
@@ -3045,7 +3135,7 @@ type SetLogLevelResponse struct {
|
||||
|
||||
func (x *SetLogLevelResponse) Reset() {
|
||||
*x = SetLogLevelResponse{}
|
||||
mi := &file_uart_messages_proto_msgTypes[36]
|
||||
mi := &file_uart_messages_proto_msgTypes[37]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -3057,7 +3147,7 @@ func (x *SetLogLevelResponse) String() string {
|
||||
func (*SetLogLevelResponse) ProtoMessage() {}
|
||||
|
||||
func (x *SetLogLevelResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_uart_messages_proto_msgTypes[36]
|
||||
mi := &file_uart_messages_proto_msgTypes[37]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -3070,7 +3160,7 @@ func (x *SetLogLevelResponse) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use SetLogLevelResponse.ProtoReflect.Descriptor instead.
|
||||
func (*SetLogLevelResponse) Descriptor() ([]byte, []int) {
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{36}
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{37}
|
||||
}
|
||||
|
||||
func (x *SetLogLevelResponse) GetSuccess() bool {
|
||||
@@ -3109,7 +3199,7 @@ type TapConfigRequest struct {
|
||||
|
||||
func (x *TapConfigRequest) Reset() {
|
||||
*x = TapConfigRequest{}
|
||||
mi := &file_uart_messages_proto_msgTypes[37]
|
||||
mi := &file_uart_messages_proto_msgTypes[38]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -3121,7 +3211,7 @@ func (x *TapConfigRequest) String() string {
|
||||
func (*TapConfigRequest) ProtoMessage() {}
|
||||
|
||||
func (x *TapConfigRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_uart_messages_proto_msgTypes[37]
|
||||
mi := &file_uart_messages_proto_msgTypes[38]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -3134,7 +3224,7 @@ func (x *TapConfigRequest) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use TapConfigRequest.ProtoReflect.Descriptor instead.
|
||||
func (*TapConfigRequest) Descriptor() ([]byte, []int) {
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{37}
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{38}
|
||||
}
|
||||
|
||||
func (x *TapConfigRequest) GetWrite() bool {
|
||||
@@ -3241,7 +3331,7 @@ type TapConfigResponse struct {
|
||||
|
||||
func (x *TapConfigResponse) Reset() {
|
||||
*x = TapConfigResponse{}
|
||||
mi := &file_uart_messages_proto_msgTypes[38]
|
||||
mi := &file_uart_messages_proto_msgTypes[39]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -3253,7 +3343,7 @@ func (x *TapConfigResponse) String() string {
|
||||
func (*TapConfigResponse) ProtoMessage() {}
|
||||
|
||||
func (x *TapConfigResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_uart_messages_proto_msgTypes[38]
|
||||
mi := &file_uart_messages_proto_msgTypes[39]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -3266,7 +3356,7 @@ func (x *TapConfigResponse) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use TapConfigResponse.ProtoReflect.Descriptor instead.
|
||||
func (*TapConfigResponse) Descriptor() ([]byte, []int) {
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{38}
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{39}
|
||||
}
|
||||
|
||||
func (x *TapConfigResponse) GetClientId() uint32 {
|
||||
@@ -3363,7 +3453,7 @@ type OtaStartPayload struct {
|
||||
|
||||
func (x *OtaStartPayload) Reset() {
|
||||
*x = OtaStartPayload{}
|
||||
mi := &file_uart_messages_proto_msgTypes[39]
|
||||
mi := &file_uart_messages_proto_msgTypes[40]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -3375,7 +3465,7 @@ func (x *OtaStartPayload) String() string {
|
||||
func (*OtaStartPayload) ProtoMessage() {}
|
||||
|
||||
func (x *OtaStartPayload) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_uart_messages_proto_msgTypes[39]
|
||||
mi := &file_uart_messages_proto_msgTypes[40]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -3388,7 +3478,7 @@ func (x *OtaStartPayload) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use OtaStartPayload.ProtoReflect.Descriptor instead.
|
||||
func (*OtaStartPayload) Descriptor() ([]byte, []int) {
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{39}
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{40}
|
||||
}
|
||||
|
||||
func (x *OtaStartPayload) GetTotalSize() uint32 {
|
||||
@@ -3409,7 +3499,7 @@ type OtaPayload struct {
|
||||
|
||||
func (x *OtaPayload) Reset() {
|
||||
*x = OtaPayload{}
|
||||
mi := &file_uart_messages_proto_msgTypes[40]
|
||||
mi := &file_uart_messages_proto_msgTypes[41]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -3421,7 +3511,7 @@ func (x *OtaPayload) String() string {
|
||||
func (*OtaPayload) ProtoMessage() {}
|
||||
|
||||
func (x *OtaPayload) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_uart_messages_proto_msgTypes[40]
|
||||
mi := &file_uart_messages_proto_msgTypes[41]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -3434,7 +3524,7 @@ func (x *OtaPayload) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use OtaPayload.ProtoReflect.Descriptor instead.
|
||||
func (*OtaPayload) Descriptor() ([]byte, []int) {
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{40}
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{41}
|
||||
}
|
||||
|
||||
func (x *OtaPayload) GetSeq() uint32 {
|
||||
@@ -3460,7 +3550,7 @@ type OtaEndPayload struct {
|
||||
|
||||
func (x *OtaEndPayload) Reset() {
|
||||
*x = OtaEndPayload{}
|
||||
mi := &file_uart_messages_proto_msgTypes[41]
|
||||
mi := &file_uart_messages_proto_msgTypes[42]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -3472,7 +3562,7 @@ func (x *OtaEndPayload) String() string {
|
||||
func (*OtaEndPayload) ProtoMessage() {}
|
||||
|
||||
func (x *OtaEndPayload) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_uart_messages_proto_msgTypes[41]
|
||||
mi := &file_uart_messages_proto_msgTypes[42]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -3485,7 +3575,7 @@ func (x *OtaEndPayload) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use OtaEndPayload.ProtoReflect.Descriptor instead.
|
||||
func (*OtaEndPayload) Descriptor() ([]byte, []int) {
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{41}
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{42}
|
||||
}
|
||||
|
||||
// Device → host status (also used as ACK after each 4 KiB written).
|
||||
@@ -3502,7 +3592,7 @@ type OtaStatusPayload struct {
|
||||
|
||||
func (x *OtaStatusPayload) Reset() {
|
||||
*x = OtaStatusPayload{}
|
||||
mi := &file_uart_messages_proto_msgTypes[42]
|
||||
mi := &file_uart_messages_proto_msgTypes[43]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -3514,7 +3604,7 @@ func (x *OtaStatusPayload) String() string {
|
||||
func (*OtaStatusPayload) ProtoMessage() {}
|
||||
|
||||
func (x *OtaStatusPayload) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_uart_messages_proto_msgTypes[42]
|
||||
mi := &file_uart_messages_proto_msgTypes[43]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -3527,7 +3617,7 @@ func (x *OtaStatusPayload) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use OtaStatusPayload.ProtoReflect.Descriptor instead.
|
||||
func (*OtaStatusPayload) Descriptor() ([]byte, []int) {
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{42}
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{43}
|
||||
}
|
||||
|
||||
func (x *OtaStatusPayload) GetStatus() uint32 {
|
||||
@@ -3568,7 +3658,7 @@ type OtaSlaveProgressRequest struct {
|
||||
|
||||
func (x *OtaSlaveProgressRequest) Reset() {
|
||||
*x = OtaSlaveProgressRequest{}
|
||||
mi := &file_uart_messages_proto_msgTypes[43]
|
||||
mi := &file_uart_messages_proto_msgTypes[44]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -3580,7 +3670,7 @@ func (x *OtaSlaveProgressRequest) String() string {
|
||||
func (*OtaSlaveProgressRequest) ProtoMessage() {}
|
||||
|
||||
func (x *OtaSlaveProgressRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_uart_messages_proto_msgTypes[43]
|
||||
mi := &file_uart_messages_proto_msgTypes[44]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -3593,7 +3683,7 @@ func (x *OtaSlaveProgressRequest) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use OtaSlaveProgressRequest.ProtoReflect.Descriptor instead.
|
||||
func (*OtaSlaveProgressRequest) Descriptor() ([]byte, []int) {
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{43}
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{44}
|
||||
}
|
||||
|
||||
func (x *OtaSlaveProgressRequest) GetClientId() uint32 {
|
||||
@@ -3617,7 +3707,7 @@ type OtaSlaveProgressEntry struct {
|
||||
|
||||
func (x *OtaSlaveProgressEntry) Reset() {
|
||||
*x = OtaSlaveProgressEntry{}
|
||||
mi := &file_uart_messages_proto_msgTypes[44]
|
||||
mi := &file_uart_messages_proto_msgTypes[45]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -3629,7 +3719,7 @@ func (x *OtaSlaveProgressEntry) String() string {
|
||||
func (*OtaSlaveProgressEntry) ProtoMessage() {}
|
||||
|
||||
func (x *OtaSlaveProgressEntry) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_uart_messages_proto_msgTypes[44]
|
||||
mi := &file_uart_messages_proto_msgTypes[45]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -3642,7 +3732,7 @@ func (x *OtaSlaveProgressEntry) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use OtaSlaveProgressEntry.ProtoReflect.Descriptor instead.
|
||||
func (*OtaSlaveProgressEntry) Descriptor() ([]byte, []int) {
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{44}
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{45}
|
||||
}
|
||||
|
||||
func (x *OtaSlaveProgressEntry) GetClientId() uint32 {
|
||||
@@ -3693,7 +3783,7 @@ type OtaSlaveProgressResponse struct {
|
||||
|
||||
func (x *OtaSlaveProgressResponse) Reset() {
|
||||
*x = OtaSlaveProgressResponse{}
|
||||
mi := &file_uart_messages_proto_msgTypes[45]
|
||||
mi := &file_uart_messages_proto_msgTypes[46]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -3705,7 +3795,7 @@ func (x *OtaSlaveProgressResponse) String() string {
|
||||
func (*OtaSlaveProgressResponse) ProtoMessage() {}
|
||||
|
||||
func (x *OtaSlaveProgressResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_uart_messages_proto_msgTypes[45]
|
||||
mi := &file_uart_messages_proto_msgTypes[46]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -3718,7 +3808,7 @@ func (x *OtaSlaveProgressResponse) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use OtaSlaveProgressResponse.ProtoReflect.Descriptor instead.
|
||||
func (*OtaSlaveProgressResponse) Descriptor() ([]byte, []int) {
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{45}
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{46}
|
||||
}
|
||||
|
||||
func (x *OtaSlaveProgressResponse) GetActive() bool {
|
||||
@@ -3760,7 +3850,7 @@ var File_uart_messages_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_uart_messages_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x13uart_messages.proto\x12\x04alox\x1a\fnanopb.proto\"\xd3\x15\n" +
|
||||
"\x13uart_messages.proto\x12\x04alox\x1a\fnanopb.proto\"\x92\x16\n" +
|
||||
"\vUartMessage\x12%\n" +
|
||||
"\x04type\x18\x01 \x01(\x0e2\x11.alox.MessageTypeR\x04type\x12,\n" +
|
||||
"\vack_payload\x18\x02 \x01(\v2\t.alox.AckH\x00R\n" +
|
||||
@@ -3801,7 +3891,8 @@ const file_uart_messages_proto_rawDesc = "" +
|
||||
"\x15set_log_level_request\x18% \x01(\v2\x18.alox.SetLogLevelRequestH\x00R\x12setLogLevelRequest\x12P\n" +
|
||||
"\x16set_log_level_response\x18& \x01(\v2\x19.alox.SetLogLevelResponseH\x00R\x13setLogLevelResponse\x12F\n" +
|
||||
"\x12tap_config_request\x18' \x01(\v2\x16.alox.TapConfigRequestH\x00R\x10tapConfigRequest\x12I\n" +
|
||||
"\x13tap_config_response\x18( \x01(\v2\x17.alox.TapConfigResponseH\x00R\x11tapConfigResponseB\t\n" +
|
||||
"\x13tap_config_response\x18( \x01(\v2\x17.alox.TapConfigResponseH\x00R\x11tapConfigResponse\x12=\n" +
|
||||
"\x0fble_stream_tick\x18) \x01(\v2\x13.alox.BleStreamTickH\x00R\rbleStreamTickB\t\n" +
|
||||
"\apayload\"\x05\n" +
|
||||
"\x03Ack\"!\n" +
|
||||
"\vEchoPayload\x12\x12\n" +
|
||||
@@ -3843,13 +3934,14 @@ const file_uart_messages_proto_rawDesc = "" +
|
||||
"\bdeadzone\x18\x01 \x01(\rR\bdeadzone\x12\x1b\n" +
|
||||
"\tclient_id\x18\x02 \x01(\rR\bclientId\x12\x18\n" +
|
||||
"\asuccess\x18\x03 \x01(\bR\asuccess\x12%\n" +
|
||||
"\x0eslaves_updated\x18\x04 \x01(\rR\rslavesUpdated\"\x80\x01\n" +
|
||||
"\x0eslaves_updated\x18\x04 \x01(\rR\rslavesUpdated\"\x9d\x01\n" +
|
||||
"\x12AccelStreamRequest\x12\x14\n" +
|
||||
"\x05write\x18\x01 \x01(\bR\x05write\x12\x16\n" +
|
||||
"\x06enable\x18\x02 \x01(\bR\x06enable\x12\x1b\n" +
|
||||
"\tclient_id\x18\x03 \x01(\rR\bclientId\x12\x1f\n" +
|
||||
"\vall_clients\x18\x04 \x01(\bR\n" +
|
||||
"allClients\"\x8d\x01\n" +
|
||||
"allClients\x12\x1b\n" +
|
||||
"\tperiod_ms\x18\x05 \x01(\rR\bperiodMs\"\x8d\x01\n" +
|
||||
"\x13AccelStreamResponse\x12\x18\n" +
|
||||
"\aenabled\x18\x01 \x01(\bR\aenabled\x12\x1b\n" +
|
||||
"\tclient_id\x18\x02 \x01(\rR\bclientId\x12\x18\n" +
|
||||
@@ -3915,7 +4007,11 @@ const file_uart_messages_proto_rawDesc = "" +
|
||||
"\x05accel\x18\x02 \x01(\v2\x16.alox.CacheClientAccelR\x05accel\x12&\n" +
|
||||
"\x03tap\x18\x03 \x01(\v2\x14.alox.CacheClientTapR\x03tap\"O\n" +
|
||||
"\x13CacheStatusResponse\x128\n" +
|
||||
"\aclients\x18\x01 \x03(\v2\x17.alox.CacheClientStatusB\x05\x92?\x02\x10\x10R\aclients\"I\n" +
|
||||
"\aclients\x18\x01 \x03(\v2\x17.alox.CacheClientStatusB\x05\x92?\x02\x10\x10R\aclients\"\x90\x01\n" +
|
||||
"\rBleStreamTick\x12(\n" +
|
||||
"\x10esp_timestamp_us\x18\x01 \x01(\x04R\x0eespTimestampUs\x12\x1b\n" +
|
||||
"\tperiod_ms\x18\x02 \x01(\rR\bperiodMs\x128\n" +
|
||||
"\aclients\x18\x03 \x03(\v2\x17.alox.CacheClientStatusB\x05\x92?\x02\x10\x10R\aclients\"I\n" +
|
||||
"\x18EspNowUnicastTestRequest\x12\x1b\n" +
|
||||
"\tclient_id\x18\x01 \x01(\rR\bclientId\x12\x10\n" +
|
||||
"\x03seq\x18\x02 \x01(\rR\x03seq\"G\n" +
|
||||
@@ -4032,7 +4128,7 @@ const file_uart_messages_proto_rawDesc = "" +
|
||||
"\x0faggregate_bytes\x18\x03 \x01(\rR\x0eaggregateBytes\x12\x1f\n" +
|
||||
"\vslave_count\x18\x04 \x01(\rR\n" +
|
||||
"slaveCount\x12:\n" +
|
||||
"\x06slaves\x18\x05 \x03(\v2\x1b.alox.OtaSlaveProgressEntryB\x05\x92?\x02\x10\x10R\x06slaves*\xaa\x03\n" +
|
||||
"\x06slaves\x18\x05 \x03(\v2\x1b.alox.OtaSlaveProgressEntryB\x05\x92?\x02\x10\x10R\x06slaves*\xbf\x03\n" +
|
||||
"\vMessageType\x12\v\n" +
|
||||
"\aUNKNOWN\x10\x00\x12\a\n" +
|
||||
"\x03ACK\x10\x01\x12\b\n" +
|
||||
@@ -4060,7 +4156,8 @@ const file_uart_messages_proto_rawDesc = "" +
|
||||
"\x10ESPNOW_ECHO_PING\x10\x1e\x12\x11\n" +
|
||||
"\rSET_LOG_LEVEL\x10\x1f\x12\x0e\n" +
|
||||
"\n" +
|
||||
"TAP_CONFIG\x10 \"\x04\b\x18\x10\x18\"\x04\b\x1c\x10\x1c*G\n" +
|
||||
"TAP_CONFIG\x10 \x12\x13\n" +
|
||||
"\x0fBLE_STREAM_TICK\x10!\"\x04\b\x18\x10\x18\"\x04\b\x1c\x10\x1c*G\n" +
|
||||
"\aTapKind\x12\f\n" +
|
||||
"\bTAP_NONE\x10\x00\x12\x0e\n" +
|
||||
"\n" +
|
||||
@@ -4083,7 +4180,7 @@ func file_uart_messages_proto_rawDescGZIP() []byte {
|
||||
}
|
||||
|
||||
var file_uart_messages_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
|
||||
var file_uart_messages_proto_msgTypes = make([]protoimpl.MessageInfo, 46)
|
||||
var file_uart_messages_proto_msgTypes = make([]protoimpl.MessageInfo, 47)
|
||||
var file_uart_messages_proto_goTypes = []any{
|
||||
(MessageType)(0), // 0: alox.MessageType
|
||||
(TapKind)(0), // 1: alox.TapKind
|
||||
@@ -4112,27 +4209,28 @@ var file_uart_messages_proto_goTypes = []any{
|
||||
(*CacheClientTap)(nil), // 24: alox.CacheClientTap
|
||||
(*CacheClientStatus)(nil), // 25: alox.CacheClientStatus
|
||||
(*CacheStatusResponse)(nil), // 26: alox.CacheStatusResponse
|
||||
(*EspNowUnicastTestRequest)(nil), // 27: alox.EspNowUnicastTestRequest
|
||||
(*EspNowUnicastTestResponse)(nil), // 28: alox.EspNowUnicastTestResponse
|
||||
(*EspNowEchoPingRequest)(nil), // 29: alox.EspNowEchoPingRequest
|
||||
(*EspNowEchoPingResponse)(nil), // 30: alox.EspNowEchoPingResponse
|
||||
(*LedRingProgressRequest)(nil), // 31: alox.LedRingProgressRequest
|
||||
(*LedRingProgressResponse)(nil), // 32: alox.LedRingProgressResponse
|
||||
(*EspNowFindMeRequest)(nil), // 33: alox.EspNowFindMeRequest
|
||||
(*EspNowFindMeResponse)(nil), // 34: alox.EspNowFindMeResponse
|
||||
(*RestartRequest)(nil), // 35: alox.RestartRequest
|
||||
(*RestartResponse)(nil), // 36: alox.RestartResponse
|
||||
(*SetLogLevelRequest)(nil), // 37: alox.SetLogLevelRequest
|
||||
(*SetLogLevelResponse)(nil), // 38: alox.SetLogLevelResponse
|
||||
(*TapConfigRequest)(nil), // 39: alox.TapConfigRequest
|
||||
(*TapConfigResponse)(nil), // 40: alox.TapConfigResponse
|
||||
(*OtaStartPayload)(nil), // 41: alox.OtaStartPayload
|
||||
(*OtaPayload)(nil), // 42: alox.OtaPayload
|
||||
(*OtaEndPayload)(nil), // 43: alox.OtaEndPayload
|
||||
(*OtaStatusPayload)(nil), // 44: alox.OtaStatusPayload
|
||||
(*OtaSlaveProgressRequest)(nil), // 45: alox.OtaSlaveProgressRequest
|
||||
(*OtaSlaveProgressEntry)(nil), // 46: alox.OtaSlaveProgressEntry
|
||||
(*OtaSlaveProgressResponse)(nil), // 47: alox.OtaSlaveProgressResponse
|
||||
(*BleStreamTick)(nil), // 27: alox.BleStreamTick
|
||||
(*EspNowUnicastTestRequest)(nil), // 28: alox.EspNowUnicastTestRequest
|
||||
(*EspNowUnicastTestResponse)(nil), // 29: alox.EspNowUnicastTestResponse
|
||||
(*EspNowEchoPingRequest)(nil), // 30: alox.EspNowEchoPingRequest
|
||||
(*EspNowEchoPingResponse)(nil), // 31: alox.EspNowEchoPingResponse
|
||||
(*LedRingProgressRequest)(nil), // 32: alox.LedRingProgressRequest
|
||||
(*LedRingProgressResponse)(nil), // 33: alox.LedRingProgressResponse
|
||||
(*EspNowFindMeRequest)(nil), // 34: alox.EspNowFindMeRequest
|
||||
(*EspNowFindMeResponse)(nil), // 35: alox.EspNowFindMeResponse
|
||||
(*RestartRequest)(nil), // 36: alox.RestartRequest
|
||||
(*RestartResponse)(nil), // 37: alox.RestartResponse
|
||||
(*SetLogLevelRequest)(nil), // 38: alox.SetLogLevelRequest
|
||||
(*SetLogLevelResponse)(nil), // 39: alox.SetLogLevelResponse
|
||||
(*TapConfigRequest)(nil), // 40: alox.TapConfigRequest
|
||||
(*TapConfigResponse)(nil), // 41: alox.TapConfigResponse
|
||||
(*OtaStartPayload)(nil), // 42: alox.OtaStartPayload
|
||||
(*OtaPayload)(nil), // 43: alox.OtaPayload
|
||||
(*OtaEndPayload)(nil), // 44: alox.OtaEndPayload
|
||||
(*OtaStatusPayload)(nil), // 45: alox.OtaStatusPayload
|
||||
(*OtaSlaveProgressRequest)(nil), // 46: alox.OtaSlaveProgressRequest
|
||||
(*OtaSlaveProgressEntry)(nil), // 47: alox.OtaSlaveProgressEntry
|
||||
(*OtaSlaveProgressResponse)(nil), // 48: alox.OtaSlaveProgressResponse
|
||||
}
|
||||
var file_uart_messages_proto_depIdxs = []int32{
|
||||
0, // 0: alox.UartMessage.type:type_name -> alox.MessageType
|
||||
@@ -4141,22 +4239,22 @@ var file_uart_messages_proto_depIdxs = []int32{
|
||||
5, // 3: alox.UartMessage.version_response:type_name -> alox.VersionResponse
|
||||
7, // 4: alox.UartMessage.client_info_response:type_name -> alox.ClientInfoResponse
|
||||
9, // 5: alox.UartMessage.client_input_response:type_name -> alox.ClientInputResponse
|
||||
41, // 6: alox.UartMessage.ota_start:type_name -> alox.OtaStartPayload
|
||||
42, // 7: alox.UartMessage.ota_payload:type_name -> alox.OtaPayload
|
||||
43, // 8: alox.UartMessage.ota_end:type_name -> alox.OtaEndPayload
|
||||
44, // 9: alox.UartMessage.ota_status:type_name -> alox.OtaStatusPayload
|
||||
42, // 6: alox.UartMessage.ota_start:type_name -> alox.OtaStartPayload
|
||||
43, // 7: alox.UartMessage.ota_payload:type_name -> alox.OtaPayload
|
||||
44, // 8: alox.UartMessage.ota_end:type_name -> alox.OtaEndPayload
|
||||
45, // 9: alox.UartMessage.ota_status:type_name -> alox.OtaStatusPayload
|
||||
10, // 10: alox.UartMessage.accel_deadzone_request:type_name -> alox.AccelDeadzoneRequest
|
||||
11, // 11: alox.UartMessage.accel_deadzone_response:type_name -> alox.AccelDeadzoneResponse
|
||||
27, // 12: alox.UartMessage.espnow_unicast_test_request:type_name -> alox.EspNowUnicastTestRequest
|
||||
28, // 13: alox.UartMessage.espnow_unicast_test_response:type_name -> alox.EspNowUnicastTestResponse
|
||||
45, // 14: alox.UartMessage.ota_slave_progress_request:type_name -> alox.OtaSlaveProgressRequest
|
||||
47, // 15: alox.UartMessage.ota_slave_progress_response:type_name -> alox.OtaSlaveProgressResponse
|
||||
31, // 16: alox.UartMessage.led_ring_progress_request:type_name -> alox.LedRingProgressRequest
|
||||
32, // 17: alox.UartMessage.led_ring_progress_response:type_name -> alox.LedRingProgressResponse
|
||||
33, // 18: alox.UartMessage.espnow_find_me_request:type_name -> alox.EspNowFindMeRequest
|
||||
34, // 19: alox.UartMessage.espnow_find_me_response:type_name -> alox.EspNowFindMeResponse
|
||||
35, // 20: alox.UartMessage.restart_request:type_name -> alox.RestartRequest
|
||||
36, // 21: alox.UartMessage.restart_response:type_name -> alox.RestartResponse
|
||||
28, // 12: alox.UartMessage.espnow_unicast_test_request:type_name -> alox.EspNowUnicastTestRequest
|
||||
29, // 13: alox.UartMessage.espnow_unicast_test_response:type_name -> alox.EspNowUnicastTestResponse
|
||||
46, // 14: alox.UartMessage.ota_slave_progress_request:type_name -> alox.OtaSlaveProgressRequest
|
||||
48, // 15: alox.UartMessage.ota_slave_progress_response:type_name -> alox.OtaSlaveProgressResponse
|
||||
32, // 16: alox.UartMessage.led_ring_progress_request:type_name -> alox.LedRingProgressRequest
|
||||
33, // 17: alox.UartMessage.led_ring_progress_response:type_name -> alox.LedRingProgressResponse
|
||||
34, // 18: alox.UartMessage.espnow_find_me_request:type_name -> alox.EspNowFindMeRequest
|
||||
35, // 19: alox.UartMessage.espnow_find_me_response:type_name -> alox.EspNowFindMeResponse
|
||||
36, // 20: alox.UartMessage.restart_request:type_name -> alox.RestartRequest
|
||||
37, // 21: alox.UartMessage.restart_response:type_name -> alox.RestartResponse
|
||||
12, // 22: alox.UartMessage.accel_stream_request:type_name -> alox.AccelStreamRequest
|
||||
13, // 23: alox.UartMessage.accel_stream_response:type_name -> alox.AccelStreamResponse
|
||||
14, // 24: alox.UartMessage.battery_status_request:type_name -> alox.BatteryStatusRequest
|
||||
@@ -4165,28 +4263,30 @@ var file_uart_messages_proto_depIdxs = []int32{
|
||||
20, // 27: alox.UartMessage.tap_notify_response:type_name -> alox.TapNotifyResponse
|
||||
22, // 28: alox.UartMessage.cache_status_request:type_name -> alox.CacheStatusRequest
|
||||
26, // 29: alox.UartMessage.cache_status_response:type_name -> alox.CacheStatusResponse
|
||||
29, // 30: alox.UartMessage.espnow_echo_ping_request:type_name -> alox.EspNowEchoPingRequest
|
||||
30, // 31: alox.UartMessage.espnow_echo_ping_response:type_name -> alox.EspNowEchoPingResponse
|
||||
37, // 32: alox.UartMessage.set_log_level_request:type_name -> alox.SetLogLevelRequest
|
||||
38, // 33: alox.UartMessage.set_log_level_response:type_name -> alox.SetLogLevelResponse
|
||||
39, // 34: alox.UartMessage.tap_config_request:type_name -> alox.TapConfigRequest
|
||||
40, // 35: alox.UartMessage.tap_config_response:type_name -> alox.TapConfigResponse
|
||||
6, // 36: alox.ClientInfoResponse.clients:type_name -> alox.ClientInfo
|
||||
8, // 37: alox.ClientInputResponse.clients:type_name -> alox.ClientInput
|
||||
15, // 38: alox.BatterySample.lipo1:type_name -> alox.LipoReading
|
||||
15, // 39: alox.BatterySample.lipo2:type_name -> alox.LipoReading
|
||||
16, // 40: alox.BatteryStatusResponse.samples:type_name -> alox.BatterySample
|
||||
1, // 41: alox.TapEvent.kind:type_name -> alox.TapKind
|
||||
1, // 42: alox.CacheClientTap.kind:type_name -> alox.TapKind
|
||||
23, // 43: alox.CacheClientStatus.accel:type_name -> alox.CacheClientAccel
|
||||
24, // 44: alox.CacheClientStatus.tap:type_name -> alox.CacheClientTap
|
||||
25, // 45: alox.CacheStatusResponse.clients:type_name -> alox.CacheClientStatus
|
||||
46, // 46: alox.OtaSlaveProgressResponse.slaves:type_name -> alox.OtaSlaveProgressEntry
|
||||
47, // [47:47] is the sub-list for method output_type
|
||||
47, // [47:47] is the sub-list for method input_type
|
||||
47, // [47:47] is the sub-list for extension type_name
|
||||
47, // [47:47] is the sub-list for extension extendee
|
||||
0, // [0:47] is the sub-list for field type_name
|
||||
30, // 30: alox.UartMessage.espnow_echo_ping_request:type_name -> alox.EspNowEchoPingRequest
|
||||
31, // 31: alox.UartMessage.espnow_echo_ping_response:type_name -> alox.EspNowEchoPingResponse
|
||||
38, // 32: alox.UartMessage.set_log_level_request:type_name -> alox.SetLogLevelRequest
|
||||
39, // 33: alox.UartMessage.set_log_level_response:type_name -> alox.SetLogLevelResponse
|
||||
40, // 34: alox.UartMessage.tap_config_request:type_name -> alox.TapConfigRequest
|
||||
41, // 35: alox.UartMessage.tap_config_response:type_name -> alox.TapConfigResponse
|
||||
27, // 36: alox.UartMessage.ble_stream_tick:type_name -> alox.BleStreamTick
|
||||
6, // 37: alox.ClientInfoResponse.clients:type_name -> alox.ClientInfo
|
||||
8, // 38: alox.ClientInputResponse.clients:type_name -> alox.ClientInput
|
||||
15, // 39: alox.BatterySample.lipo1:type_name -> alox.LipoReading
|
||||
15, // 40: alox.BatterySample.lipo2:type_name -> alox.LipoReading
|
||||
16, // 41: alox.BatteryStatusResponse.samples:type_name -> alox.BatterySample
|
||||
1, // 42: alox.TapEvent.kind:type_name -> alox.TapKind
|
||||
1, // 43: alox.CacheClientTap.kind:type_name -> alox.TapKind
|
||||
23, // 44: alox.CacheClientStatus.accel:type_name -> alox.CacheClientAccel
|
||||
24, // 45: alox.CacheClientStatus.tap:type_name -> alox.CacheClientTap
|
||||
25, // 46: alox.CacheStatusResponse.clients:type_name -> alox.CacheClientStatus
|
||||
25, // 47: alox.BleStreamTick.clients:type_name -> alox.CacheClientStatus
|
||||
47, // 48: alox.OtaSlaveProgressResponse.slaves:type_name -> alox.OtaSlaveProgressEntry
|
||||
49, // [49:49] is the sub-list for method output_type
|
||||
49, // [49:49] is the sub-list for method input_type
|
||||
49, // [49:49] is the sub-list for extension type_name
|
||||
49, // [49:49] is the sub-list for extension extendee
|
||||
0, // [0:49] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_uart_messages_proto_init() }
|
||||
@@ -4230,6 +4330,7 @@ func file_uart_messages_proto_init() {
|
||||
(*UartMessage_SetLogLevelResponse)(nil),
|
||||
(*UartMessage_TapConfigRequest)(nil),
|
||||
(*UartMessage_TapConfigResponse)(nil),
|
||||
(*UartMessage_BleStreamTick)(nil),
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
@@ -4237,7 +4338,7 @@ func file_uart_messages_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_uart_messages_proto_rawDesc), len(file_uart_messages_proto_rawDesc)),
|
||||
NumEnums: 2,
|
||||
NumMessages: 46,
|
||||
NumMessages: 47,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user