diff --git a/goTool/README.md b/goTool/README.md index 806e6f0..cfb0641 100644 --- a/goTool/README.md +++ b/goTool/README.md @@ -38,6 +38,7 @@ go run . -port /dev/ttyUSB0 clients | `find-me` | 22 | Locate pod (`-client 0` master, `>0` slave via ESP-NOW) | | `restart` | 23 | Reboot master or slave (`-client 0` / `>0`) | | `log-level` | `0x1f` | Get/set master ESP-IDF log level for tag `"*"` (`-set`, `-level` 0–5); output on UART0 debug, not host UART | +| `input-send-mode` | `0x23` | Get/set slave accel/tap ESP-NOW TX path (`-set -mode 0..3`, `-all` or `-client N`): best_effort/fast/wait/reliable | `clients` requires slaves to have responded to master discover broadcasts first. diff --git a/goTool/api_input_send_mode.go b/goTool/api_input_send_mode.go new file mode 100644 index 0000000..ca8d24b --- /dev/null +++ b/goTool/api_input_send_mode.go @@ -0,0 +1,100 @@ +package main + +import ( + "encoding/json" + "net/http" + + pb "powerpod/gotool/pb" +) + +type inputSendModeAPIResponse struct { + Success bool `json:"success"` + Mode uint32 `json:"mode"` + ModeName string `json:"mode_name"` + ClientID uint32 `json:"client_id,omitempty"` + SlavesUpdated uint32 `json:"slaves_updated,omitempty"` + Error string `json:"error,omitempty"` +} + +func inputSendModeName(mode pb.InputSendMode) string { + switch mode { + case pb.InputSendMode_INPUT_SEND_BEST_EFFORT: + return "best_effort" + case pb.InputSendMode_INPUT_SEND_FAST: + return "fast" + case pb.InputSendMode_INPUT_SEND_WAIT: + return "wait" + case pb.InputSendMode_INPUT_SEND_RELIABLE: + return "reliable" + default: + return "unknown" + } +} + +func mountInputSendModeAPI(mux *http.ServeMux, link *managedSerial) { + mux.HandleFunc("/api/input-send-mode", func(w http.ResponseWriter, r *http.Request) { + switch r.Method { + case http.MethodGet: + serveInputSendModeGet(w, link) + case http.MethodPut, http.MethodPost: + serveInputSendModePut(w, r, link) + default: + http.Error(w, "method not allowed", http.StatusMethodNotAllowed) + } + }) +} + +func serveInputSendModeGet(w http.ResponseWriter, link *managedSerial) { + resp, err := link.InputSendMode(&pb.InputSendModeRequest{Write: false}) + if err != nil { + writeJSON(w, http.StatusBadGateway, inputSendModeAPIResponse{Error: err.Error()}) + return + } + writeJSON(w, http.StatusOK, inputSendModeAPIResponse{ + Success: resp.GetSuccess(), + Mode: uint32(resp.GetMode()), + ModeName: inputSendModeName(resp.GetMode()), + }) +} + +func serveInputSendModePut(w http.ResponseWriter, r *http.Request, link *managedSerial) { + var body struct { + Mode uint32 `json:"mode"` + ClientID uint32 `json:"client_id"` + AllClients bool `json:"all_clients"` + } + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + writeJSON(w, http.StatusBadRequest, inputSendModeAPIResponse{Error: "invalid JSON"}) + return + } + if body.Mode > uint32(pb.InputSendMode_INPUT_SEND_RELIABLE) { + writeJSON(w, http.StatusBadRequest, inputSendModeAPIResponse{Error: "mode must be 0..3"}) + return + } + if !body.AllClients && body.ClientID == 0 { + // Dashboard default: apply to every registered slave. + body.AllClients = true + } + + resp, err := link.InputSendMode(&pb.InputSendModeRequest{ + Write: true, + Mode: pb.InputSendMode(body.Mode), + ClientId: body.ClientID, + AllClients: body.AllClients, + }) + if err != nil { + writeJSON(w, http.StatusBadGateway, inputSendModeAPIResponse{Error: err.Error()}) + return + } + status := http.StatusOK + if !resp.GetSuccess() { + status = http.StatusBadRequest + } + writeJSON(w, status, inputSendModeAPIResponse{ + Success: resp.GetSuccess(), + Mode: uint32(resp.GetMode()), + ModeName: inputSendModeName(resp.GetMode()), + ClientID: resp.GetClientId(), + SlavesUpdated: resp.GetSlavesUpdated(), + }) +} diff --git a/goTool/api_serve.go b/goTool/api_serve.go index 0089d05..63f3585 100644 --- a/goTool/api_serve.go +++ b/goTool/api_serve.go @@ -102,6 +102,7 @@ func mountServeAPI(mux *http.ServeMux, link *managedSerial, hub *wsHub, streamCt mountBleTestAPI(mux, link) mountLiveStreamAPI(mux, hub) mountAccelStreamAPI(mux, link, hub, streamCtl) + mountInputSendModeAPI(mux, link) mountTapAPI(mux, link, hub, tapCtl) mountTapConfigAPI(mux, link) mountLedRingAPI(mux, link) diff --git a/goTool/client_api.go b/goTool/client_api.go index a1d5057..bc24329 100644 --- a/goTool/client_api.go +++ b/goTool/client_api.go @@ -156,7 +156,7 @@ func (m *managedSerial) TapNotifyPoll(req *pb.TapNotifyRequest) (*pb.TapNotifyRe func (m *managedSerial) tapNotifyExchange(poll bool, req *pb.TapNotifyRequest) (*pb.TapNotifyResponse, error) { msg := &pb.UartMessage{ - Type: pb.MessageType_TAP_NOTIFY, + Type: pb.MessageType_TAP_NOTIFY, Payload: &pb.UartMessage_TapNotifyRequest{TapNotifyRequest: req}, } body, err := proto.Marshal(msg) @@ -216,7 +216,7 @@ func decodeCacheStatusPayload(payload []byte) (*pb.CacheStatusResponse, error) { func (m *managedSerial) accelStreamExchange(poll bool, req *pb.AccelStreamRequest) (*pb.AccelStreamResponse, error) { msg := &pb.UartMessage{ - Type: pb.MessageType_ACCEL_STREAM, + Type: pb.MessageType_ACCEL_STREAM, Payload: &pb.UartMessage_AccelStreamRequest{AccelStreamRequest: req}, } body, err := proto.Marshal(msg) @@ -262,7 +262,7 @@ func (m *managedSerial) TapConfigPoll(req *pb.TapConfigRequest) (*pb.TapConfigRe func (m *managedSerial) tapConfigExchange(poll bool, req *pb.TapConfigRequest) (*pb.TapConfigResponse, error) { msg := &pb.UartMessage{ - Type: pb.MessageType_TAP_CONFIG, + Type: pb.MessageType_TAP_CONFIG, Payload: &pb.UartMessage_TapConfigRequest{TapConfigRequest: req}, } body, err := proto.Marshal(msg) @@ -292,7 +292,7 @@ func (m *managedSerial) tapConfigExchange(poll bool, req *pb.TapConfigRequest) ( func (m *managedSerial) accelDeadzoneExchange(poll bool, req *pb.AccelDeadzoneRequest) (*pb.AccelDeadzoneResponse, error) { msg := &pb.UartMessage{ - Type: pb.MessageType_ACCEL_DEADZONE, + Type: pb.MessageType_ACCEL_DEADZONE, Payload: &pb.UartMessage_AccelDeadzoneRequest{AccelDeadzoneRequest: req}, } body, err := proto.Marshal(msg) @@ -606,6 +606,10 @@ func (m *managedSerial) SetLogLevel(write bool, level uint32) (*pb.SetLogLevelRe return hostSetLogLevel(m, write, level) } +func (m *managedSerial) InputSendMode(req *pb.InputSendModeRequest) (*pb.InputSendModeResponse, error) { + return hostInputSendMode(m, req) +} + func (m *managedSerial) Restart(clientID uint32) error { if err := hostRestart(m, clientID); err != nil { return err diff --git a/goTool/cmd_input_send_mode.go b/goTool/cmd_input_send_mode.go new file mode 100644 index 0000000..3f23f2e --- /dev/null +++ b/goTool/cmd_input_send_mode.go @@ -0,0 +1,42 @@ +package main + +import ( + "flag" + "fmt" + + pb "powerpod/gotool/pb" +) + +func runInputSendModeCmd(h hostConn, args []string) error { + fs := flag.NewFlagSet("input-send-mode", flag.ExitOnError) + write := fs.Bool("set", false, "write mode to slave(s)") + mode := fs.Uint("mode", 0, "0=best_effort 1=fast 2=wait 3=reliable") + clientID := fs.Uint("client", 0, "slave client_id (required unless -all)") + all := fs.Bool("all", false, "apply to every registered slave") + _ = fs.Parse(args) + + req := &pb.InputSendModeRequest{ + Write: *write, + Mode: pb.InputSendMode(*mode), + ClientId: uint32(*clientID), + AllClients: *all, + } + if *write && !*all && *clientID == 0 { + return fmt.Errorf("need -client N or -all when using -set") + } + if *write && *mode > uint(pb.InputSendMode_INPUT_SEND_RELIABLE) { + return fmt.Errorf("mode must be 0..3") + } + + r, err := hostInputSendMode(h, req) + if err != nil { + return err + } + fmt.Printf("input-send-mode: success=%v mode=%d (%s) client_id=%d slaves_updated=%d\n", + r.GetSuccess(), r.GetMode(), inputSendModeName(r.GetMode()), r.GetClientId(), + r.GetSlavesUpdated()) + if *write && !r.GetSuccess() { + return fmt.Errorf("input-send-mode rejected") + } + return nil +} diff --git a/goTool/docs/API_REST.md b/goTool/docs/API_REST.md index a5ebd28..3374286 100644 --- a/goTool/docs/API_REST.md +++ b/goTool/docs/API_REST.md @@ -400,6 +400,37 @@ go run . -port /dev/ttyUSB0 log-level -set -level 3 Dashboard: Master card → dropdown **ESP Log-Level** with **Lesen** / **Setzen**. +### Input send mode (slave accel/tap ESP-NOW TX path) + +Debug A/B for how slaves transmit `ACCEL_SAMPLE` / `TAP_EVENT`. Default on slaves is `best_effort` (0). Master remembers the last mode for GET; write pushes via ESP-NOW. + +```http +GET /api/input-send-mode +PUT /api/input-send-mode +Content-Type: application/json +{"mode": 2, "all_clients": true} +``` + +| `mode` | Path | +|--------|------| +| 0 | `best_effort` (fire-and-forget, quiet) | +| 1 | `fast` (fire-and-forget, logs failures) | +| 2 | `wait` (send-done + retries) | +| 3 | `reliable` (OTA-style retries; can stall high-rate accel) | + +```json +{"success": true, "mode": 2, "mode_name": "wait", "slaves_updated": 2} +``` + +**CLI:** + +```bash +go run . -port /dev/ttyUSB0 input-send-mode +go run . -port /dev/ttyUSB0 input-send-mode -set -mode 2 -all +``` + +Dashboard: ESP-NOW Slaves toolbar → **Input-Send** dropdown + **Setzen** / **Lesen**. + ### OTA (master host upload, UART or BLE) ```http @@ -455,5 +486,6 @@ Same as external API: | Unicast test | `POST /api/unicast-test` | | Echo ping | `POST /api/echo-ping` (per-slave latency; UI shows Host ms + ESP ms) | | Master log level | `GET` / `POST /api/log-level` or CLI `log-level` | +| Input-Send mode | `GET` / `PUT /api/input-send-mode` or CLI `input-send-mode` | | Tap notify S/D/T | `PUT /api/clients/{id}/tap-notify` | | Tap receive (UI) | Live stream + tap notify; see WebSocket doc for external API | diff --git a/goTool/host_conn.go b/goTool/host_conn.go index 9747ab1..3c6cffb 100644 --- a/goTool/host_conn.go +++ b/goTool/host_conn.go @@ -4,8 +4,8 @@ import ( "fmt" "time" - pb "powerpod/gotool/pb" "google.golang.org/protobuf/proto" + pb "powerpod/gotool/pb" ) // hostConn is the UART or BLE host transport used by CLI commands. @@ -160,6 +160,33 @@ func hostSetLogLevel(h hostConn, write bool, level uint32) (*pb.SetLogLevelRespo return r, nil } +func hostInputSendMode(h hostConn, req *pb.InputSendModeRequest) (*pb.InputSendModeResponse, error) { + msg := &pb.UartMessage{ + Type: pb.MessageType_INPUT_SEND_MODE, + Payload: &pb.UartMessage_InputSendModeRequest{ + InputSendModeRequest: req, + }, + } + body, err := proto.Marshal(msg) + if err != nil { + return nil, fmt.Errorf("encode: %w", err) + } + payload := append([]byte{byte(pb.MessageType_INPUT_SEND_MODE)}, body...) + respPayload, err := h.exchangePayload(payload, "INPUT_SEND_MODE") + 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.GetInputSendModeResponse() + if r == nil { + return nil, fmt.Errorf("missing input_send_mode_response") + } + return r, nil +} + func hostLedRing(h hostConn, req *pb.LedRingProgressRequest) (*pb.LedRingProgressResponse, error) { msg := &pb.UartMessage{ Type: pb.MessageType_LED_RING, diff --git a/goTool/main.go b/goTool/main.go index bd57556..5d02cf6 100644 --- a/goTool/main.go +++ b/goTool/main.go @@ -34,7 +34,8 @@ func usage() { 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") fmt.Fprintf(os.Stderr, " restart reboot master or slave (ESP-NOW)\n") - fmt.Fprintf(os.Stderr, " log-level get/set master ESP-IDF log level (global)\n\n") + fmt.Fprintf(os.Stderr, " log-level get/set master ESP-IDF log level (global)\n") + fmt.Fprintf(os.Stderr, " input-send-mode get/set slave accel/tap ESP-NOW send path\n\n") flag.PrintDefaults() } @@ -73,7 +74,7 @@ func main() { bleName: *bleName, settle: time.Duration(*bleSettle * float64(time.Second)), }, flag.Args()[1:]) - case "version", "clients", "client-info", "clients-reset-ids", "clients_reset_ids", "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": + case "version", "clients", "client-info", "clients-reset-ids", "clients_reset_ids", "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", "input-send-mode", "input_send_mode", "ota", "ota-progress", "ota_progress": if *useBLE && *portName != "" { fmt.Fprintf(os.Stderr, "use either -port or -ble, not both\n") os.Exit(2) @@ -179,6 +180,8 @@ func main() { break } runErr = runLogLevel(sp, flag.Args()[1:]) + case "input-send-mode", "input_send_mode": + runErr = runInputSendModeCmd(h, flag.Args()[1:]) case "ota": t, ok := h.(otaTransport) if !ok { diff --git a/goTool/pb/uart_messages.pb.go b/goTool/pb/uart_messages.pb.go index 73092cc..88d9564 100644 --- a/goTool/pb/uart_messages.pb.go +++ b/goTool/pb/uart_messages.pb.go @@ -44,7 +44,7 @@ const ( MessageType_ACCEL_STREAM MessageType = 25 MessageType_BATTERY_STATUS MessageType = 26 MessageType_TAP_NOTIFY MessageType = 27 - // * Combined cached accel + tap poll (one UART round-trip, ~16 ms cadence). + // * Combined cached accel + tap poll (one UART round-trip, ~10 ms cadence). MessageType_CACHE_STATUS MessageType = 29 // * Host → master → slave → master: timestamp echo round-trip (latency test). MessageType_ESPNOW_ECHO_PING MessageType = 30 @@ -58,6 +58,10 @@ const ( // Host → device: clear master client-id NVS map + live registry (and notify // online slaves), or on a slave clear local master/id binding only. MessageType_CLIENT_ID_MAP_RESET MessageType = 34 + // * + // Host → master: get/set slave ESP-NOW send path for accel/tap + // (best_effort / fast / wait / reliable). + MessageType_INPUT_SEND_MODE MessageType = 35 ) // Enum value maps for MessageType. @@ -89,6 +93,7 @@ var ( 32: "TAP_CONFIG", 33: "BLE_STREAM_TICK", 34: "CLIENT_ID_MAP_RESET", + 35: "INPUT_SEND_MODE", } MessageType_value = map[string]int32{ "UNKNOWN": 0, @@ -117,6 +122,7 @@ var ( "TAP_CONFIG": 32, "BLE_STREAM_TICK": 33, "CLIENT_ID_MAP_RESET": 34, + "INPUT_SEND_MODE": 35, } ) @@ -147,6 +153,61 @@ func (MessageType) EnumDescriptor() ([]byte, []int) { return file_uart_messages_proto_rawDescGZIP(), []int{0} } +// * +// Slave ESP-NOW TX path for ACCEL_SAMPLE / TAP_EVENT (debug A/B). +// Maps 1:1 to esp_now_core_send_*. +type InputSendMode int32 + +const ( + InputSendMode_INPUT_SEND_BEST_EFFORT InputSendMode = 0 + InputSendMode_INPUT_SEND_FAST InputSendMode = 1 + InputSendMode_INPUT_SEND_WAIT InputSendMode = 2 + InputSendMode_INPUT_SEND_RELIABLE InputSendMode = 3 +) + +// Enum value maps for InputSendMode. +var ( + InputSendMode_name = map[int32]string{ + 0: "INPUT_SEND_BEST_EFFORT", + 1: "INPUT_SEND_FAST", + 2: "INPUT_SEND_WAIT", + 3: "INPUT_SEND_RELIABLE", + } + InputSendMode_value = map[string]int32{ + "INPUT_SEND_BEST_EFFORT": 0, + "INPUT_SEND_FAST": 1, + "INPUT_SEND_WAIT": 2, + "INPUT_SEND_RELIABLE": 3, + } +) + +func (x InputSendMode) Enum() *InputSendMode { + p := new(InputSendMode) + *p = x + return p +} + +func (x InputSendMode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (InputSendMode) Descriptor() protoreflect.EnumDescriptor { + return file_uart_messages_proto_enumTypes[1].Descriptor() +} + +func (InputSendMode) Type() protoreflect.EnumType { + return &file_uart_messages_proto_enumTypes[1] +} + +func (x InputSendMode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use InputSendMode.Descriptor instead. +func (InputSendMode) EnumDescriptor() ([]byte, []int) { + return file_uart_messages_proto_rawDescGZIP(), []int{1} +} + type TapKind int32 const ( @@ -183,11 +244,11 @@ func (x TapKind) String() string { } func (TapKind) Descriptor() protoreflect.EnumDescriptor { - return file_uart_messages_proto_enumTypes[1].Descriptor() + return file_uart_messages_proto_enumTypes[2].Descriptor() } func (TapKind) Type() protoreflect.EnumType { - return &file_uart_messages_proto_enumTypes[1] + return &file_uart_messages_proto_enumTypes[2] } func (x TapKind) Number() protoreflect.EnumNumber { @@ -196,7 +257,7 @@ func (x TapKind) Number() protoreflect.EnumNumber { // Deprecated: Use TapKind.Descriptor instead. func (TapKind) EnumDescriptor() ([]byte, []int) { - return file_uart_messages_proto_rawDescGZIP(), []int{1} + return file_uart_messages_proto_rawDescGZIP(), []int{2} } type UartMessage struct { @@ -242,6 +303,8 @@ type UartMessage struct { // *UartMessage_BleStreamTick // *UartMessage_ClientIdMapResetRequest // *UartMessage_ClientIdMapResetResponse + // *UartMessage_InputSendModeRequest + // *UartMessage_InputSendModeResponse Payload isUartMessage_Payload `protobuf_oneof:"payload"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -633,6 +696,24 @@ func (x *UartMessage) GetClientIdMapResetResponse() *ClientIdMapResetResponse { return nil } +func (x *UartMessage) GetInputSendModeRequest() *InputSendModeRequest { + if x != nil { + if x, ok := x.Payload.(*UartMessage_InputSendModeRequest); ok { + return x.InputSendModeRequest + } + } + return nil +} + +func (x *UartMessage) GetInputSendModeResponse() *InputSendModeResponse { + if x != nil { + if x, ok := x.Payload.(*UartMessage_InputSendModeResponse); ok { + return x.InputSendModeResponse + } + } + return nil +} + type isUartMessage_Payload interface { isUartMessage_Payload() } @@ -789,6 +870,14 @@ type UartMessage_ClientIdMapResetResponse struct { ClientIdMapResetResponse *ClientIdMapResetResponse `protobuf:"bytes,43,opt,name=client_id_map_reset_response,json=clientIdMapResetResponse,proto3,oneof"` } +type UartMessage_InputSendModeRequest struct { + InputSendModeRequest *InputSendModeRequest `protobuf:"bytes,44,opt,name=input_send_mode_request,json=inputSendModeRequest,proto3,oneof"` +} + +type UartMessage_InputSendModeResponse struct { + InputSendModeResponse *InputSendModeResponse `protobuf:"bytes,45,opt,name=input_send_mode_response,json=inputSendModeResponse,proto3,oneof"` +} + func (*UartMessage_AckPayload) isUartMessage_Payload() {} func (*UartMessage_EchoPayload) isUartMessage_Payload() {} @@ -865,6 +954,10 @@ func (*UartMessage_ClientIdMapResetRequest) isUartMessage_Payload() {} func (*UartMessage_ClientIdMapResetResponse) isUartMessage_Payload() {} +func (*UartMessage_InputSendModeRequest) isUartMessage_Payload() {} + +func (*UartMessage_InputSendModeResponse) isUartMessage_Payload() {} + type Ack struct { state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields @@ -1427,9 +1520,9 @@ func (x *AccelDeadzoneResponse) GetSlavesUpdated() uint32 { return 0 } -// Host → master: enable/disable slave accel ESP-NOW stream (~16 ms per slave). +// Host → master: enable/disable slave accel ESP-NOW stream (~10 ms per slave, best-effort). // 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). +// period_ms (10–16): BLE host push interval for BleStreamTick; ignored on UART (default 10). type AccelStreamRequest struct { state protoimpl.MessageState `protogen:"open.v1"` Write bool `protobuf:"varint,1,opt,name=write,proto3" json:"write,omitempty"` @@ -1574,6 +1667,145 @@ func (x *AccelStreamResponse) GetSlavesUpdated() uint32 { return 0 } +// Host → master: get/set input send mode on slaves. +// write=false: return last mode remembered on master (client_id ignored). +// write=true: push mode via ESP-NOW (all_clients or one client_id). +type InputSendModeRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Write bool `protobuf:"varint,1,opt,name=write,proto3" json:"write,omitempty"` + Mode InputSendMode `protobuf:"varint,2,opt,name=mode,proto3,enum=alox.InputSendMode" json:"mode,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"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *InputSendModeRequest) Reset() { + *x = InputSendModeRequest{} + mi := &file_uart_messages_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InputSendModeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InputSendModeRequest) ProtoMessage() {} + +func (x *InputSendModeRequest) ProtoReflect() protoreflect.Message { + mi := &file_uart_messages_proto_msgTypes[12] + 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 InputSendModeRequest.ProtoReflect.Descriptor instead. +func (*InputSendModeRequest) Descriptor() ([]byte, []int) { + return file_uart_messages_proto_rawDescGZIP(), []int{12} +} + +func (x *InputSendModeRequest) GetWrite() bool { + if x != nil { + return x.Write + } + return false +} + +func (x *InputSendModeRequest) GetMode() InputSendMode { + if x != nil { + return x.Mode + } + return InputSendMode_INPUT_SEND_BEST_EFFORT +} + +func (x *InputSendModeRequest) GetClientId() uint32 { + if x != nil { + return x.ClientId + } + return 0 +} + +func (x *InputSendModeRequest) GetAllClients() bool { + if x != nil { + return x.AllClients + } + return false +} + +type InputSendModeResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Mode InputSendMode `protobuf:"varint,2,opt,name=mode,proto3,enum=alox.InputSendMode" json:"mode,omitempty"` + ClientId uint32 `protobuf:"varint,3,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + SlavesUpdated uint32 `protobuf:"varint,4,opt,name=slaves_updated,json=slavesUpdated,proto3" json:"slaves_updated,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *InputSendModeResponse) Reset() { + *x = InputSendModeResponse{} + mi := &file_uart_messages_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *InputSendModeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InputSendModeResponse) ProtoMessage() {} + +func (x *InputSendModeResponse) ProtoReflect() protoreflect.Message { + mi := &file_uart_messages_proto_msgTypes[13] + 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 InputSendModeResponse.ProtoReflect.Descriptor instead. +func (*InputSendModeResponse) Descriptor() ([]byte, []int) { + return file_uart_messages_proto_rawDescGZIP(), []int{13} +} + +func (x *InputSendModeResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +func (x *InputSendModeResponse) GetMode() InputSendMode { + if x != nil { + return x.Mode + } + return InputSendMode_INPUT_SEND_BEST_EFFORT +} + +func (x *InputSendModeResponse) GetClientId() uint32 { + if x != nil { + return x.ClientId + } + return 0 +} + +func (x *InputSendModeResponse) GetSlavesUpdated() uint32 { + if x != nil { + return x.SlavesUpdated + } + return 0 +} + // * Host → master: read LiPo ADC voltages (master local and/or slaves via ESP-NOW). type BatteryStatusRequest struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -1587,7 +1819,7 @@ type BatteryStatusRequest struct { func (x *BatteryStatusRequest) Reset() { *x = BatteryStatusRequest{} - mi := &file_uart_messages_proto_msgTypes[12] + mi := &file_uart_messages_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1599,7 +1831,7 @@ func (x *BatteryStatusRequest) String() string { func (*BatteryStatusRequest) ProtoMessage() {} func (x *BatteryStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_uart_messages_proto_msgTypes[12] + mi := &file_uart_messages_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1612,7 +1844,7 @@ func (x *BatteryStatusRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use BatteryStatusRequest.ProtoReflect.Descriptor instead. func (*BatteryStatusRequest) Descriptor() ([]byte, []int) { - return file_uart_messages_proto_rawDescGZIP(), []int{12} + return file_uart_messages_proto_rawDescGZIP(), []int{14} } func (x *BatteryStatusRequest) GetClientId() uint32 { @@ -1640,7 +1872,7 @@ type LipoReading struct { func (x *LipoReading) Reset() { *x = LipoReading{} - mi := &file_uart_messages_proto_msgTypes[13] + mi := &file_uart_messages_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1652,7 +1884,7 @@ func (x *LipoReading) String() string { func (*LipoReading) ProtoMessage() {} func (x *LipoReading) ProtoReflect() protoreflect.Message { - mi := &file_uart_messages_proto_msgTypes[13] + mi := &file_uart_messages_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1665,7 +1897,7 @@ func (x *LipoReading) ProtoReflect() protoreflect.Message { // Deprecated: Use LipoReading.ProtoReflect.Descriptor instead. func (*LipoReading) Descriptor() ([]byte, []int) { - return file_uart_messages_proto_rawDescGZIP(), []int{13} + return file_uart_messages_proto_rawDescGZIP(), []int{15} } func (x *LipoReading) GetValid() bool { @@ -1695,7 +1927,7 @@ type BatterySample struct { func (x *BatterySample) Reset() { *x = BatterySample{} - mi := &file_uart_messages_proto_msgTypes[14] + mi := &file_uart_messages_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1707,7 +1939,7 @@ func (x *BatterySample) String() string { func (*BatterySample) ProtoMessage() {} func (x *BatterySample) ProtoReflect() protoreflect.Message { - mi := &file_uart_messages_proto_msgTypes[14] + mi := &file_uart_messages_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1720,7 +1952,7 @@ func (x *BatterySample) ProtoReflect() protoreflect.Message { // Deprecated: Use BatterySample.ProtoReflect.Descriptor instead. func (*BatterySample) Descriptor() ([]byte, []int) { - return file_uart_messages_proto_rawDescGZIP(), []int{14} + return file_uart_messages_proto_rawDescGZIP(), []int{16} } func (x *BatterySample) GetClientId() uint32 { @@ -1761,7 +1993,7 @@ type BatteryStatusResponse struct { func (x *BatteryStatusResponse) Reset() { *x = BatteryStatusResponse{} - mi := &file_uart_messages_proto_msgTypes[15] + mi := &file_uart_messages_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1773,7 +2005,7 @@ func (x *BatteryStatusResponse) String() string { func (*BatteryStatusResponse) ProtoMessage() {} func (x *BatteryStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_uart_messages_proto_msgTypes[15] + mi := &file_uart_messages_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1786,7 +2018,7 @@ func (x *BatteryStatusResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use BatteryStatusResponse.ProtoReflect.Descriptor instead. func (*BatteryStatusResponse) Descriptor() ([]byte, []int) { - return file_uart_messages_proto_rawDescGZIP(), []int{15} + return file_uart_messages_proto_rawDescGZIP(), []int{17} } func (x *BatteryStatusResponse) GetSuccess() bool { @@ -1819,7 +2051,7 @@ type AccelSample struct { func (x *AccelSample) Reset() { *x = AccelSample{} - mi := &file_uart_messages_proto_msgTypes[16] + mi := &file_uart_messages_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1831,7 +2063,7 @@ func (x *AccelSample) String() string { func (*AccelSample) ProtoMessage() {} func (x *AccelSample) ProtoReflect() protoreflect.Message { - mi := &file_uart_messages_proto_msgTypes[16] + mi := &file_uart_messages_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1844,7 +2076,7 @@ func (x *AccelSample) ProtoReflect() protoreflect.Message { // Deprecated: Use AccelSample.ProtoReflect.Descriptor instead. func (*AccelSample) Descriptor() ([]byte, []int) { - return file_uart_messages_proto_rawDescGZIP(), []int{16} + return file_uart_messages_proto_rawDescGZIP(), []int{18} } func (x *AccelSample) GetClientId() uint32 { @@ -1904,7 +2136,7 @@ type TapNotifyRequest struct { func (x *TapNotifyRequest) Reset() { *x = TapNotifyRequest{} - mi := &file_uart_messages_proto_msgTypes[17] + mi := &file_uart_messages_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1916,7 +2148,7 @@ func (x *TapNotifyRequest) String() string { func (*TapNotifyRequest) ProtoMessage() {} func (x *TapNotifyRequest) ProtoReflect() protoreflect.Message { - mi := &file_uart_messages_proto_msgTypes[17] + mi := &file_uart_messages_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1929,7 +2161,7 @@ func (x *TapNotifyRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use TapNotifyRequest.ProtoReflect.Descriptor instead. func (*TapNotifyRequest) Descriptor() ([]byte, []int) { - return file_uart_messages_proto_rawDescGZIP(), []int{17} + return file_uart_messages_proto_rawDescGZIP(), []int{19} } func (x *TapNotifyRequest) GetWrite() bool { @@ -1988,7 +2220,7 @@ type TapNotifyResponse struct { func (x *TapNotifyResponse) Reset() { *x = TapNotifyResponse{} - mi := &file_uart_messages_proto_msgTypes[18] + mi := &file_uart_messages_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2000,7 +2232,7 @@ func (x *TapNotifyResponse) String() string { func (*TapNotifyResponse) ProtoMessage() {} func (x *TapNotifyResponse) ProtoReflect() protoreflect.Message { - mi := &file_uart_messages_proto_msgTypes[18] + mi := &file_uart_messages_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2013,7 +2245,7 @@ func (x *TapNotifyResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use TapNotifyResponse.ProtoReflect.Descriptor instead. func (*TapNotifyResponse) Descriptor() ([]byte, []int) { - return file_uart_messages_proto_rawDescGZIP(), []int{18} + return file_uart_messages_proto_rawDescGZIP(), []int{20} } func (x *TapNotifyResponse) GetClientId() uint32 { @@ -2071,7 +2303,7 @@ type TapEvent struct { func (x *TapEvent) Reset() { *x = TapEvent{} - mi := &file_uart_messages_proto_msgTypes[19] + mi := &file_uart_messages_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2083,7 +2315,7 @@ func (x *TapEvent) String() string { func (*TapEvent) ProtoMessage() {} func (x *TapEvent) ProtoReflect() protoreflect.Message { - mi := &file_uart_messages_proto_msgTypes[19] + mi := &file_uart_messages_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2096,7 +2328,7 @@ func (x *TapEvent) ProtoReflect() protoreflect.Message { // Deprecated: Use TapEvent.ProtoReflect.Descriptor instead. func (*TapEvent) Descriptor() ([]byte, []int) { - return file_uart_messages_proto_rawDescGZIP(), []int{19} + return file_uart_messages_proto_rawDescGZIP(), []int{21} } func (x *TapEvent) GetClientId() uint32 { @@ -2136,7 +2368,7 @@ type CacheStatusRequest struct { func (x *CacheStatusRequest) Reset() { *x = CacheStatusRequest{} - mi := &file_uart_messages_proto_msgTypes[20] + mi := &file_uart_messages_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2148,7 +2380,7 @@ func (x *CacheStatusRequest) String() string { func (*CacheStatusRequest) ProtoMessage() {} func (x *CacheStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_uart_messages_proto_msgTypes[20] + mi := &file_uart_messages_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2161,7 +2393,7 @@ func (x *CacheStatusRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CacheStatusRequest.ProtoReflect.Descriptor instead. func (*CacheStatusRequest) Descriptor() ([]byte, []int) { - return file_uart_messages_proto_rawDescGZIP(), []int{20} + return file_uart_messages_proto_rawDescGZIP(), []int{22} } // * Accel slice inside CACHE_STATUS (no client_id — use parent CacheClientStatus). @@ -2178,7 +2410,7 @@ type CacheClientAccel struct { func (x *CacheClientAccel) Reset() { *x = CacheClientAccel{} - mi := &file_uart_messages_proto_msgTypes[21] + mi := &file_uart_messages_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2190,7 +2422,7 @@ func (x *CacheClientAccel) String() string { func (*CacheClientAccel) ProtoMessage() {} func (x *CacheClientAccel) ProtoReflect() protoreflect.Message { - mi := &file_uart_messages_proto_msgTypes[21] + mi := &file_uart_messages_proto_msgTypes[23] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2203,7 +2435,7 @@ func (x *CacheClientAccel) ProtoReflect() protoreflect.Message { // Deprecated: Use CacheClientAccel.ProtoReflect.Descriptor instead. func (*CacheClientAccel) Descriptor() ([]byte, []int) { - return file_uart_messages_proto_rawDescGZIP(), []int{21} + return file_uart_messages_proto_rawDescGZIP(), []int{23} } func (x *CacheClientAccel) GetValid() bool { @@ -2252,7 +2484,7 @@ type CacheClientTap struct { func (x *CacheClientTap) Reset() { *x = CacheClientTap{} - mi := &file_uart_messages_proto_msgTypes[22] + mi := &file_uart_messages_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2264,7 +2496,7 @@ func (x *CacheClientTap) String() string { func (*CacheClientTap) ProtoMessage() {} func (x *CacheClientTap) ProtoReflect() protoreflect.Message { - mi := &file_uart_messages_proto_msgTypes[22] + mi := &file_uart_messages_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2277,7 +2509,7 @@ func (x *CacheClientTap) ProtoReflect() protoreflect.Message { // Deprecated: Use CacheClientTap.ProtoReflect.Descriptor instead. func (*CacheClientTap) Descriptor() ([]byte, []int) { - return file_uart_messages_proto_rawDescGZIP(), []int{22} + return file_uart_messages_proto_rawDescGZIP(), []int{24} } func (x *CacheClientTap) GetKind() TapKind { @@ -2306,7 +2538,7 @@ type CacheClientStatus struct { func (x *CacheClientStatus) Reset() { *x = CacheClientStatus{} - mi := &file_uart_messages_proto_msgTypes[23] + mi := &file_uart_messages_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2318,7 +2550,7 @@ func (x *CacheClientStatus) String() string { func (*CacheClientStatus) ProtoMessage() {} func (x *CacheClientStatus) ProtoReflect() protoreflect.Message { - mi := &file_uart_messages_proto_msgTypes[23] + mi := &file_uart_messages_proto_msgTypes[25] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2331,7 +2563,7 @@ func (x *CacheClientStatus) ProtoReflect() protoreflect.Message { // Deprecated: Use CacheClientStatus.ProtoReflect.Descriptor instead. func (*CacheClientStatus) Descriptor() ([]byte, []int) { - return file_uart_messages_proto_rawDescGZIP(), []int{23} + return file_uart_messages_proto_rawDescGZIP(), []int{25} } func (x *CacheClientStatus) GetClientId() uint32 { @@ -2365,7 +2597,7 @@ type CacheStatusResponse struct { func (x *CacheStatusResponse) Reset() { *x = CacheStatusResponse{} - mi := &file_uart_messages_proto_msgTypes[24] + mi := &file_uart_messages_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2377,7 +2609,7 @@ func (x *CacheStatusResponse) String() string { func (*CacheStatusResponse) ProtoMessage() {} func (x *CacheStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_uart_messages_proto_msgTypes[24] + mi := &file_uart_messages_proto_msgTypes[26] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2390,7 +2622,7 @@ func (x *CacheStatusResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CacheStatusResponse.ProtoReflect.Descriptor instead. func (*CacheStatusResponse) Descriptor() ([]byte, []int) { - return file_uart_messages_proto_rawDescGZIP(), []int{24} + return file_uart_messages_proto_rawDescGZIP(), []int{26} } func (x *CacheStatusResponse) GetClients() []*CacheClientStatus { @@ -2412,7 +2644,7 @@ type BleStreamTick struct { func (x *BleStreamTick) Reset() { *x = BleStreamTick{} - mi := &file_uart_messages_proto_msgTypes[25] + mi := &file_uart_messages_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2424,7 +2656,7 @@ func (x *BleStreamTick) String() string { func (*BleStreamTick) ProtoMessage() {} func (x *BleStreamTick) ProtoReflect() protoreflect.Message { - mi := &file_uart_messages_proto_msgTypes[25] + mi := &file_uart_messages_proto_msgTypes[27] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2437,7 +2669,7 @@ func (x *BleStreamTick) ProtoReflect() protoreflect.Message { // Deprecated: Use BleStreamTick.ProtoReflect.Descriptor instead. func (*BleStreamTick) Descriptor() ([]byte, []int) { - return file_uart_messages_proto_rawDescGZIP(), []int{25} + return file_uart_messages_proto_rawDescGZIP(), []int{27} } func (x *BleStreamTick) GetEspTimestampUs() uint64 { @@ -2471,7 +2703,7 @@ type EspNowUnicastTestRequest struct { func (x *EspNowUnicastTestRequest) Reset() { *x = EspNowUnicastTestRequest{} - mi := &file_uart_messages_proto_msgTypes[26] + mi := &file_uart_messages_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2483,7 +2715,7 @@ func (x *EspNowUnicastTestRequest) String() string { func (*EspNowUnicastTestRequest) ProtoMessage() {} func (x *EspNowUnicastTestRequest) ProtoReflect() protoreflect.Message { - mi := &file_uart_messages_proto_msgTypes[26] + mi := &file_uart_messages_proto_msgTypes[28] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2496,7 +2728,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{26} + return file_uart_messages_proto_rawDescGZIP(), []int{28} } func (x *EspNowUnicastTestRequest) GetClientId() uint32 { @@ -2523,7 +2755,7 @@ type EspNowUnicastTestResponse struct { func (x *EspNowUnicastTestResponse) Reset() { *x = EspNowUnicastTestResponse{} - mi := &file_uart_messages_proto_msgTypes[27] + mi := &file_uart_messages_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2535,7 +2767,7 @@ func (x *EspNowUnicastTestResponse) String() string { func (*EspNowUnicastTestResponse) ProtoMessage() {} func (x *EspNowUnicastTestResponse) ProtoReflect() protoreflect.Message { - mi := &file_uart_messages_proto_msgTypes[27] + mi := &file_uart_messages_proto_msgTypes[29] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2548,7 +2780,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{27} + return file_uart_messages_proto_rawDescGZIP(), []int{29} } func (x *EspNowUnicastTestResponse) GetSuccess() bool { @@ -2577,7 +2809,7 @@ type EspNowEchoPingRequest struct { func (x *EspNowEchoPingRequest) Reset() { *x = EspNowEchoPingRequest{} - mi := &file_uart_messages_proto_msgTypes[28] + mi := &file_uart_messages_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2589,7 +2821,7 @@ func (x *EspNowEchoPingRequest) String() string { func (*EspNowEchoPingRequest) ProtoMessage() {} func (x *EspNowEchoPingRequest) ProtoReflect() protoreflect.Message { - mi := &file_uart_messages_proto_msgTypes[28] + mi := &file_uart_messages_proto_msgTypes[30] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2602,7 +2834,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{28} + return file_uart_messages_proto_rawDescGZIP(), []int{30} } func (x *EspNowEchoPingRequest) GetClientId() uint32 { @@ -2633,7 +2865,7 @@ type EspNowEchoPingResponse struct { func (x *EspNowEchoPingResponse) Reset() { *x = EspNowEchoPingResponse{} - mi := &file_uart_messages_proto_msgTypes[29] + mi := &file_uart_messages_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2645,7 +2877,7 @@ func (x *EspNowEchoPingResponse) String() string { func (*EspNowEchoPingResponse) ProtoMessage() {} func (x *EspNowEchoPingResponse) ProtoReflect() protoreflect.Message { - mi := &file_uart_messages_proto_msgTypes[29] + mi := &file_uart_messages_proto_msgTypes[31] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2658,7 +2890,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{29} + return file_uart_messages_proto_rawDescGZIP(), []int{31} } func (x *EspNowEchoPingResponse) GetSuccess() bool { @@ -2719,7 +2951,7 @@ type LedRingProgressRequest struct { func (x *LedRingProgressRequest) Reset() { *x = LedRingProgressRequest{} - mi := &file_uart_messages_proto_msgTypes[30] + mi := &file_uart_messages_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2731,7 +2963,7 @@ func (x *LedRingProgressRequest) String() string { func (*LedRingProgressRequest) ProtoMessage() {} func (x *LedRingProgressRequest) ProtoReflect() protoreflect.Message { - mi := &file_uart_messages_proto_msgTypes[30] + mi := &file_uart_messages_proto_msgTypes[32] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2744,7 +2976,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{30} + return file_uart_messages_proto_rawDescGZIP(), []int{32} } func (x *LedRingProgressRequest) GetMode() uint32 { @@ -2845,7 +3077,7 @@ type LedRingProgressResponse struct { func (x *LedRingProgressResponse) Reset() { *x = LedRingProgressResponse{} - mi := &file_uart_messages_proto_msgTypes[31] + mi := &file_uart_messages_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2857,7 +3089,7 @@ func (x *LedRingProgressResponse) String() string { func (*LedRingProgressResponse) ProtoMessage() {} func (x *LedRingProgressResponse) ProtoReflect() protoreflect.Message { - mi := &file_uart_messages_proto_msgTypes[31] + mi := &file_uart_messages_proto_msgTypes[33] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2870,7 +3102,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{31} + return file_uart_messages_proto_rawDescGZIP(), []int{33} } func (x *LedRingProgressResponse) GetSuccess() bool { @@ -2925,7 +3157,7 @@ type EspNowFindMeRequest struct { func (x *EspNowFindMeRequest) Reset() { *x = EspNowFindMeRequest{} - mi := &file_uart_messages_proto_msgTypes[32] + mi := &file_uart_messages_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2937,7 +3169,7 @@ func (x *EspNowFindMeRequest) String() string { func (*EspNowFindMeRequest) ProtoMessage() {} func (x *EspNowFindMeRequest) ProtoReflect() protoreflect.Message { - mi := &file_uart_messages_proto_msgTypes[32] + mi := &file_uart_messages_proto_msgTypes[34] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2950,7 +3182,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{32} + return file_uart_messages_proto_rawDescGZIP(), []int{34} } func (x *EspNowFindMeRequest) GetClientId() uint32 { @@ -2970,7 +3202,7 @@ type EspNowFindMeResponse struct { func (x *EspNowFindMeResponse) Reset() { *x = EspNowFindMeResponse{} - mi := &file_uart_messages_proto_msgTypes[33] + mi := &file_uart_messages_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2982,7 +3214,7 @@ func (x *EspNowFindMeResponse) String() string { func (*EspNowFindMeResponse) ProtoMessage() {} func (x *EspNowFindMeResponse) ProtoReflect() protoreflect.Message { - mi := &file_uart_messages_proto_msgTypes[33] + mi := &file_uart_messages_proto_msgTypes[35] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2995,7 +3227,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{33} + return file_uart_messages_proto_rawDescGZIP(), []int{35} } func (x *EspNowFindMeResponse) GetSuccess() bool { @@ -3022,7 +3254,7 @@ type RestartRequest struct { func (x *RestartRequest) Reset() { *x = RestartRequest{} - mi := &file_uart_messages_proto_msgTypes[34] + mi := &file_uart_messages_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3034,7 +3266,7 @@ func (x *RestartRequest) String() string { func (*RestartRequest) ProtoMessage() {} func (x *RestartRequest) ProtoReflect() protoreflect.Message { - mi := &file_uart_messages_proto_msgTypes[34] + mi := &file_uart_messages_proto_msgTypes[36] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3047,7 +3279,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{34} + return file_uart_messages_proto_rawDescGZIP(), []int{36} } func (x *RestartRequest) GetClientId() uint32 { @@ -3067,7 +3299,7 @@ type RestartResponse struct { func (x *RestartResponse) Reset() { *x = RestartResponse{} - mi := &file_uart_messages_proto_msgTypes[35] + mi := &file_uart_messages_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3079,7 +3311,7 @@ func (x *RestartResponse) String() string { func (*RestartResponse) ProtoMessage() {} func (x *RestartResponse) ProtoReflect() protoreflect.Message { - mi := &file_uart_messages_proto_msgTypes[35] + mi := &file_uart_messages_proto_msgTypes[37] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3092,7 +3324,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{35} + return file_uart_messages_proto_rawDescGZIP(), []int{37} } func (x *RestartResponse) GetSuccess() bool { @@ -3118,7 +3350,7 @@ type ClientIdMapResetRequest struct { func (x *ClientIdMapResetRequest) Reset() { *x = ClientIdMapResetRequest{} - mi := &file_uart_messages_proto_msgTypes[36] + mi := &file_uart_messages_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3130,7 +3362,7 @@ func (x *ClientIdMapResetRequest) String() string { func (*ClientIdMapResetRequest) ProtoMessage() {} func (x *ClientIdMapResetRequest) ProtoReflect() protoreflect.Message { - mi := &file_uart_messages_proto_msgTypes[36] + mi := &file_uart_messages_proto_msgTypes[38] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3143,7 +3375,7 @@ func (x *ClientIdMapResetRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ClientIdMapResetRequest.ProtoReflect.Descriptor instead. func (*ClientIdMapResetRequest) Descriptor() ([]byte, []int) { - return file_uart_messages_proto_rawDescGZIP(), []int{36} + return file_uart_messages_proto_rawDescGZIP(), []int{38} } type ClientIdMapResetResponse struct { @@ -3155,7 +3387,7 @@ type ClientIdMapResetResponse struct { func (x *ClientIdMapResetResponse) Reset() { *x = ClientIdMapResetResponse{} - mi := &file_uart_messages_proto_msgTypes[37] + mi := &file_uart_messages_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3167,7 +3399,7 @@ func (x *ClientIdMapResetResponse) String() string { func (*ClientIdMapResetResponse) ProtoMessage() {} func (x *ClientIdMapResetResponse) ProtoReflect() protoreflect.Message { - mi := &file_uart_messages_proto_msgTypes[37] + mi := &file_uart_messages_proto_msgTypes[39] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3180,7 +3412,7 @@ func (x *ClientIdMapResetResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ClientIdMapResetResponse.ProtoReflect.Descriptor instead. func (*ClientIdMapResetResponse) Descriptor() ([]byte, []int) { - return file_uart_messages_proto_rawDescGZIP(), []int{37} + return file_uart_messages_proto_rawDescGZIP(), []int{39} } func (x *ClientIdMapResetResponse) GetSuccess() bool { @@ -3202,7 +3434,7 @@ type SetLogLevelRequest struct { func (x *SetLogLevelRequest) Reset() { *x = SetLogLevelRequest{} - mi := &file_uart_messages_proto_msgTypes[38] + mi := &file_uart_messages_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3214,7 +3446,7 @@ func (x *SetLogLevelRequest) String() string { func (*SetLogLevelRequest) ProtoMessage() {} func (x *SetLogLevelRequest) ProtoReflect() protoreflect.Message { - mi := &file_uart_messages_proto_msgTypes[38] + mi := &file_uart_messages_proto_msgTypes[40] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3227,7 +3459,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{38} + return file_uart_messages_proto_rawDescGZIP(), []int{40} } func (x *SetLogLevelRequest) GetWrite() bool { @@ -3254,7 +3486,7 @@ type SetLogLevelResponse struct { func (x *SetLogLevelResponse) Reset() { *x = SetLogLevelResponse{} - mi := &file_uart_messages_proto_msgTypes[39] + mi := &file_uart_messages_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3266,7 +3498,7 @@ func (x *SetLogLevelResponse) String() string { func (*SetLogLevelResponse) ProtoMessage() {} func (x *SetLogLevelResponse) ProtoReflect() protoreflect.Message { - mi := &file_uart_messages_proto_msgTypes[39] + mi := &file_uart_messages_proto_msgTypes[41] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3279,7 +3511,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{39} + return file_uart_messages_proto_rawDescGZIP(), []int{41} } func (x *SetLogLevelResponse) GetSuccess() bool { @@ -3318,7 +3550,7 @@ type TapConfigRequest struct { func (x *TapConfigRequest) Reset() { *x = TapConfigRequest{} - mi := &file_uart_messages_proto_msgTypes[40] + mi := &file_uart_messages_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3330,7 +3562,7 @@ func (x *TapConfigRequest) String() string { func (*TapConfigRequest) ProtoMessage() {} func (x *TapConfigRequest) ProtoReflect() protoreflect.Message { - mi := &file_uart_messages_proto_msgTypes[40] + mi := &file_uart_messages_proto_msgTypes[42] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3343,7 +3575,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{40} + return file_uart_messages_proto_rawDescGZIP(), []int{42} } func (x *TapConfigRequest) GetWrite() bool { @@ -3450,7 +3682,7 @@ type TapConfigResponse struct { func (x *TapConfigResponse) Reset() { *x = TapConfigResponse{} - mi := &file_uart_messages_proto_msgTypes[41] + mi := &file_uart_messages_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3462,7 +3694,7 @@ func (x *TapConfigResponse) String() string { func (*TapConfigResponse) ProtoMessage() {} func (x *TapConfigResponse) ProtoReflect() protoreflect.Message { - mi := &file_uart_messages_proto_msgTypes[41] + mi := &file_uart_messages_proto_msgTypes[43] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3475,7 +3707,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{41} + return file_uart_messages_proto_rawDescGZIP(), []int{43} } func (x *TapConfigResponse) GetClientId() uint32 { @@ -3562,7 +3794,7 @@ func (x *TapConfigResponse) GetEnableTriple() bool { return false } -// Host → device: begin UART OTA (erase inactive OTA slot; device replies OTA_STATUS). +// Host → device: begin host OTA over UART or BLE (erase inactive OTA slot; device replies OTA_STATUS). type OtaStartPayload struct { state protoimpl.MessageState `protogen:"open.v1"` TotalSize uint32 `protobuf:"varint,1,opt,name=total_size,json=totalSize,proto3" json:"total_size,omitempty"` @@ -3572,7 +3804,7 @@ type OtaStartPayload struct { func (x *OtaStartPayload) Reset() { *x = OtaStartPayload{} - mi := &file_uart_messages_proto_msgTypes[42] + mi := &file_uart_messages_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3584,7 +3816,7 @@ func (x *OtaStartPayload) String() string { func (*OtaStartPayload) ProtoMessage() {} func (x *OtaStartPayload) ProtoReflect() protoreflect.Message { - mi := &file_uart_messages_proto_msgTypes[42] + mi := &file_uart_messages_proto_msgTypes[44] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3597,7 +3829,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{42} + return file_uart_messages_proto_rawDescGZIP(), []int{44} } func (x *OtaStartPayload) GetTotalSize() uint32 { @@ -3618,7 +3850,7 @@ type OtaPayload struct { func (x *OtaPayload) Reset() { *x = OtaPayload{} - mi := &file_uart_messages_proto_msgTypes[43] + mi := &file_uart_messages_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3630,7 +3862,7 @@ func (x *OtaPayload) String() string { func (*OtaPayload) ProtoMessage() {} func (x *OtaPayload) ProtoReflect() protoreflect.Message { - mi := &file_uart_messages_proto_msgTypes[43] + mi := &file_uart_messages_proto_msgTypes[45] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3643,7 +3875,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{43} + return file_uart_messages_proto_rawDescGZIP(), []int{45} } func (x *OtaPayload) GetSeq() uint32 { @@ -3669,7 +3901,7 @@ type OtaEndPayload struct { func (x *OtaEndPayload) Reset() { *x = OtaEndPayload{} - mi := &file_uart_messages_proto_msgTypes[44] + mi := &file_uart_messages_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3681,7 +3913,7 @@ func (x *OtaEndPayload) String() string { func (*OtaEndPayload) ProtoMessage() {} func (x *OtaEndPayload) ProtoReflect() protoreflect.Message { - mi := &file_uart_messages_proto_msgTypes[44] + mi := &file_uart_messages_proto_msgTypes[46] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3694,7 +3926,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{44} + return file_uart_messages_proto_rawDescGZIP(), []int{46} } // Device → host status (also used as ACK after each 4 KiB written). @@ -3711,7 +3943,7 @@ type OtaStatusPayload struct { func (x *OtaStatusPayload) Reset() { *x = OtaStatusPayload{} - mi := &file_uart_messages_proto_msgTypes[45] + mi := &file_uart_messages_proto_msgTypes[47] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3723,7 +3955,7 @@ func (x *OtaStatusPayload) String() string { func (*OtaStatusPayload) ProtoMessage() {} func (x *OtaStatusPayload) ProtoReflect() protoreflect.Message { - mi := &file_uart_messages_proto_msgTypes[45] + mi := &file_uart_messages_proto_msgTypes[47] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3736,7 +3968,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{45} + return file_uart_messages_proto_rawDescGZIP(), []int{47} } func (x *OtaStatusPayload) GetStatus() uint32 { @@ -3777,7 +4009,7 @@ type OtaSlaveProgressRequest struct { func (x *OtaSlaveProgressRequest) Reset() { *x = OtaSlaveProgressRequest{} - mi := &file_uart_messages_proto_msgTypes[46] + mi := &file_uart_messages_proto_msgTypes[48] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3789,7 +4021,7 @@ func (x *OtaSlaveProgressRequest) String() string { func (*OtaSlaveProgressRequest) ProtoMessage() {} func (x *OtaSlaveProgressRequest) ProtoReflect() protoreflect.Message { - mi := &file_uart_messages_proto_msgTypes[46] + mi := &file_uart_messages_proto_msgTypes[48] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3802,7 +4034,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{46} + return file_uart_messages_proto_rawDescGZIP(), []int{48} } func (x *OtaSlaveProgressRequest) GetClientId() uint32 { @@ -3826,7 +4058,7 @@ type OtaSlaveProgressEntry struct { func (x *OtaSlaveProgressEntry) Reset() { *x = OtaSlaveProgressEntry{} - mi := &file_uart_messages_proto_msgTypes[47] + mi := &file_uart_messages_proto_msgTypes[49] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3838,7 +4070,7 @@ func (x *OtaSlaveProgressEntry) String() string { func (*OtaSlaveProgressEntry) ProtoMessage() {} func (x *OtaSlaveProgressEntry) ProtoReflect() protoreflect.Message { - mi := &file_uart_messages_proto_msgTypes[47] + mi := &file_uart_messages_proto_msgTypes[49] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3851,7 +4083,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{47} + return file_uart_messages_proto_rawDescGZIP(), []int{49} } func (x *OtaSlaveProgressEntry) GetClientId() uint32 { @@ -3902,7 +4134,7 @@ type OtaSlaveProgressResponse struct { func (x *OtaSlaveProgressResponse) Reset() { *x = OtaSlaveProgressResponse{} - mi := &file_uart_messages_proto_msgTypes[48] + mi := &file_uart_messages_proto_msgTypes[50] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3914,7 +4146,7 @@ func (x *OtaSlaveProgressResponse) String() string { func (*OtaSlaveProgressResponse) ProtoMessage() {} func (x *OtaSlaveProgressResponse) ProtoReflect() protoreflect.Message { - mi := &file_uart_messages_proto_msgTypes[48] + mi := &file_uart_messages_proto_msgTypes[50] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3927,7 +4159,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{48} + return file_uart_messages_proto_rawDescGZIP(), []int{50} } func (x *OtaSlaveProgressResponse) GetActive() bool { @@ -3969,7 +4201,7 @@ var File_uart_messages_proto protoreflect.FileDescriptor const file_uart_messages_proto_rawDesc = "" + "\n" + - "\x13uart_messages.proto\x12\x04alox\x1a\fnanopb.proto\"\xd3\x17\n" + + "\x13uart_messages.proto\x12\x04alox\x1a\fnanopb.proto\"\x80\x19\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" + @@ -4013,7 +4245,9 @@ const file_uart_messages_proto_rawDesc = "" + "\x13tap_config_response\x18( \x01(\v2\x17.alox.TapConfigResponseH\x00R\x11tapConfigResponse\x12=\n" + "\x0fble_stream_tick\x18) \x01(\v2\x13.alox.BleStreamTickH\x00R\rbleStreamTick\x12]\n" + "\x1bclient_id_map_reset_request\x18* \x01(\v2\x1d.alox.ClientIdMapResetRequestH\x00R\x17clientIdMapResetRequest\x12`\n" + - "\x1cclient_id_map_reset_response\x18+ \x01(\v2\x1e.alox.ClientIdMapResetResponseH\x00R\x18clientIdMapResetResponseB\t\n" + + "\x1cclient_id_map_reset_response\x18+ \x01(\v2\x1e.alox.ClientIdMapResetResponseH\x00R\x18clientIdMapResetResponse\x12S\n" + + "\x17input_send_mode_request\x18, \x01(\v2\x1a.alox.InputSendModeRequestH\x00R\x14inputSendModeRequest\x12V\n" + + "\x18input_send_mode_response\x18- \x01(\v2\x1b.alox.InputSendModeResponseH\x00R\x15inputSendModeResponseB\t\n" + "\apayload\"\x05\n" + "\x03Ack\"!\n" + "\vEchoPayload\x12\x12\n" + @@ -4067,6 +4301,17 @@ const file_uart_messages_proto_rawDesc = "" + "\aenabled\x18\x01 \x01(\bR\aenabled\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\"\x93\x01\n" + + "\x14InputSendModeRequest\x12\x14\n" + + "\x05write\x18\x01 \x01(\bR\x05write\x12'\n" + + "\x04mode\x18\x02 \x01(\x0e2\x13.alox.InputSendModeR\x04mode\x12\x1b\n" + + "\tclient_id\x18\x03 \x01(\rR\bclientId\x12\x1f\n" + + "\vall_clients\x18\x04 \x01(\bR\n" + + "allClients\"\x9e\x01\n" + + "\x15InputSendModeResponse\x12\x18\n" + + "\asuccess\x18\x01 \x01(\bR\asuccess\x12'\n" + + "\x04mode\x18\x02 \x01(\x0e2\x13.alox.InputSendModeR\x04mode\x12\x1b\n" + + "\tclient_id\x18\x03 \x01(\rR\bclientId\x12%\n" + "\x0eslaves_updated\x18\x04 \x01(\rR\rslavesUpdated\"T\n" + "\x14BatteryStatusRequest\x12\x1b\n" + "\tclient_id\x18\x01 \x01(\rR\bclientId\x12\x1f\n" + @@ -4252,7 +4497,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*\xd8\x03\n" + + "\x06slaves\x18\x05 \x03(\v2\x1b.alox.OtaSlaveProgressEntryB\x05\x92?\x02\x10\x10R\x06slaves*\xed\x03\n" + "\vMessageType\x12\v\n" + "\aUNKNOWN\x10\x00\x12\a\n" + "\x03ACK\x10\x01\x12\b\n" + @@ -4282,7 +4527,13 @@ const file_uart_messages_proto_rawDesc = "" + "\n" + "TAP_CONFIG\x10 \x12\x13\n" + "\x0fBLE_STREAM_TICK\x10!\x12\x17\n" + - "\x13CLIENT_ID_MAP_RESET\x10\"\"\x04\b\x18\x10\x18\"\x04\b\x1c\x10\x1c*G\n" + + "\x13CLIENT_ID_MAP_RESET\x10\"\x12\x13\n" + + "\x0fINPUT_SEND_MODE\x10#\"\x04\b\x18\x10\x18\"\x04\b\x1c\x10\x1c*n\n" + + "\rInputSendMode\x12\x1a\n" + + "\x16INPUT_SEND_BEST_EFFORT\x10\x00\x12\x13\n" + + "\x0fINPUT_SEND_FAST\x10\x01\x12\x13\n" + + "\x0fINPUT_SEND_WAIT\x10\x02\x12\x17\n" + + "\x13INPUT_SEND_RELIABLE\x10\x03*G\n" + "\aTapKind\x12\f\n" + "\bTAP_NONE\x10\x00\x12\x0e\n" + "\n" + @@ -4304,118 +4555,125 @@ func file_uart_messages_proto_rawDescGZIP() []byte { return file_uart_messages_proto_rawDescData } -var file_uart_messages_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_uart_messages_proto_msgTypes = make([]protoimpl.MessageInfo, 49) +var file_uart_messages_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_uart_messages_proto_msgTypes = make([]protoimpl.MessageInfo, 51) var file_uart_messages_proto_goTypes = []any{ (MessageType)(0), // 0: alox.MessageType - (TapKind)(0), // 1: alox.TapKind - (*UartMessage)(nil), // 2: alox.UartMessage - (*Ack)(nil), // 3: alox.Ack - (*EchoPayload)(nil), // 4: alox.EchoPayload - (*VersionResponse)(nil), // 5: alox.VersionResponse - (*ClientInfo)(nil), // 6: alox.ClientInfo - (*ClientInfoResponse)(nil), // 7: alox.ClientInfoResponse - (*ClientInput)(nil), // 8: alox.ClientInput - (*ClientInputResponse)(nil), // 9: alox.ClientInputResponse - (*AccelDeadzoneRequest)(nil), // 10: alox.AccelDeadzoneRequest - (*AccelDeadzoneResponse)(nil), // 11: alox.AccelDeadzoneResponse - (*AccelStreamRequest)(nil), // 12: alox.AccelStreamRequest - (*AccelStreamResponse)(nil), // 13: alox.AccelStreamResponse - (*BatteryStatusRequest)(nil), // 14: alox.BatteryStatusRequest - (*LipoReading)(nil), // 15: alox.LipoReading - (*BatterySample)(nil), // 16: alox.BatterySample - (*BatteryStatusResponse)(nil), // 17: alox.BatteryStatusResponse - (*AccelSample)(nil), // 18: alox.AccelSample - (*TapNotifyRequest)(nil), // 19: alox.TapNotifyRequest - (*TapNotifyResponse)(nil), // 20: alox.TapNotifyResponse - (*TapEvent)(nil), // 21: alox.TapEvent - (*CacheStatusRequest)(nil), // 22: alox.CacheStatusRequest - (*CacheClientAccel)(nil), // 23: alox.CacheClientAccel - (*CacheClientTap)(nil), // 24: alox.CacheClientTap - (*CacheClientStatus)(nil), // 25: alox.CacheClientStatus - (*CacheStatusResponse)(nil), // 26: alox.CacheStatusResponse - (*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 - (*ClientIdMapResetRequest)(nil), // 38: alox.ClientIdMapResetRequest - (*ClientIdMapResetResponse)(nil), // 39: alox.ClientIdMapResetResponse - (*SetLogLevelRequest)(nil), // 40: alox.SetLogLevelRequest - (*SetLogLevelResponse)(nil), // 41: alox.SetLogLevelResponse - (*TapConfigRequest)(nil), // 42: alox.TapConfigRequest - (*TapConfigResponse)(nil), // 43: alox.TapConfigResponse - (*OtaStartPayload)(nil), // 44: alox.OtaStartPayload - (*OtaPayload)(nil), // 45: alox.OtaPayload - (*OtaEndPayload)(nil), // 46: alox.OtaEndPayload - (*OtaStatusPayload)(nil), // 47: alox.OtaStatusPayload - (*OtaSlaveProgressRequest)(nil), // 48: alox.OtaSlaveProgressRequest - (*OtaSlaveProgressEntry)(nil), // 49: alox.OtaSlaveProgressEntry - (*OtaSlaveProgressResponse)(nil), // 50: alox.OtaSlaveProgressResponse + (InputSendMode)(0), // 1: alox.InputSendMode + (TapKind)(0), // 2: alox.TapKind + (*UartMessage)(nil), // 3: alox.UartMessage + (*Ack)(nil), // 4: alox.Ack + (*EchoPayload)(nil), // 5: alox.EchoPayload + (*VersionResponse)(nil), // 6: alox.VersionResponse + (*ClientInfo)(nil), // 7: alox.ClientInfo + (*ClientInfoResponse)(nil), // 8: alox.ClientInfoResponse + (*ClientInput)(nil), // 9: alox.ClientInput + (*ClientInputResponse)(nil), // 10: alox.ClientInputResponse + (*AccelDeadzoneRequest)(nil), // 11: alox.AccelDeadzoneRequest + (*AccelDeadzoneResponse)(nil), // 12: alox.AccelDeadzoneResponse + (*AccelStreamRequest)(nil), // 13: alox.AccelStreamRequest + (*AccelStreamResponse)(nil), // 14: alox.AccelStreamResponse + (*InputSendModeRequest)(nil), // 15: alox.InputSendModeRequest + (*InputSendModeResponse)(nil), // 16: alox.InputSendModeResponse + (*BatteryStatusRequest)(nil), // 17: alox.BatteryStatusRequest + (*LipoReading)(nil), // 18: alox.LipoReading + (*BatterySample)(nil), // 19: alox.BatterySample + (*BatteryStatusResponse)(nil), // 20: alox.BatteryStatusResponse + (*AccelSample)(nil), // 21: alox.AccelSample + (*TapNotifyRequest)(nil), // 22: alox.TapNotifyRequest + (*TapNotifyResponse)(nil), // 23: alox.TapNotifyResponse + (*TapEvent)(nil), // 24: alox.TapEvent + (*CacheStatusRequest)(nil), // 25: alox.CacheStatusRequest + (*CacheClientAccel)(nil), // 26: alox.CacheClientAccel + (*CacheClientTap)(nil), // 27: alox.CacheClientTap + (*CacheClientStatus)(nil), // 28: alox.CacheClientStatus + (*CacheStatusResponse)(nil), // 29: alox.CacheStatusResponse + (*BleStreamTick)(nil), // 30: alox.BleStreamTick + (*EspNowUnicastTestRequest)(nil), // 31: alox.EspNowUnicastTestRequest + (*EspNowUnicastTestResponse)(nil), // 32: alox.EspNowUnicastTestResponse + (*EspNowEchoPingRequest)(nil), // 33: alox.EspNowEchoPingRequest + (*EspNowEchoPingResponse)(nil), // 34: alox.EspNowEchoPingResponse + (*LedRingProgressRequest)(nil), // 35: alox.LedRingProgressRequest + (*LedRingProgressResponse)(nil), // 36: alox.LedRingProgressResponse + (*EspNowFindMeRequest)(nil), // 37: alox.EspNowFindMeRequest + (*EspNowFindMeResponse)(nil), // 38: alox.EspNowFindMeResponse + (*RestartRequest)(nil), // 39: alox.RestartRequest + (*RestartResponse)(nil), // 40: alox.RestartResponse + (*ClientIdMapResetRequest)(nil), // 41: alox.ClientIdMapResetRequest + (*ClientIdMapResetResponse)(nil), // 42: alox.ClientIdMapResetResponse + (*SetLogLevelRequest)(nil), // 43: alox.SetLogLevelRequest + (*SetLogLevelResponse)(nil), // 44: alox.SetLogLevelResponse + (*TapConfigRequest)(nil), // 45: alox.TapConfigRequest + (*TapConfigResponse)(nil), // 46: alox.TapConfigResponse + (*OtaStartPayload)(nil), // 47: alox.OtaStartPayload + (*OtaPayload)(nil), // 48: alox.OtaPayload + (*OtaEndPayload)(nil), // 49: alox.OtaEndPayload + (*OtaStatusPayload)(nil), // 50: alox.OtaStatusPayload + (*OtaSlaveProgressRequest)(nil), // 51: alox.OtaSlaveProgressRequest + (*OtaSlaveProgressEntry)(nil), // 52: alox.OtaSlaveProgressEntry + (*OtaSlaveProgressResponse)(nil), // 53: alox.OtaSlaveProgressResponse } var file_uart_messages_proto_depIdxs = []int32{ 0, // 0: alox.UartMessage.type:type_name -> alox.MessageType - 3, // 1: alox.UartMessage.ack_payload:type_name -> alox.Ack - 4, // 2: alox.UartMessage.echo_payload:type_name -> alox.EchoPayload - 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 - 44, // 6: alox.UartMessage.ota_start:type_name -> alox.OtaStartPayload - 45, // 7: alox.UartMessage.ota_payload:type_name -> alox.OtaPayload - 46, // 8: alox.UartMessage.ota_end:type_name -> alox.OtaEndPayload - 47, // 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 - 28, // 12: alox.UartMessage.espnow_unicast_test_request:type_name -> alox.EspNowUnicastTestRequest - 29, // 13: alox.UartMessage.espnow_unicast_test_response:type_name -> alox.EspNowUnicastTestResponse - 48, // 14: alox.UartMessage.ota_slave_progress_request:type_name -> alox.OtaSlaveProgressRequest - 50, // 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 - 17, // 25: alox.UartMessage.battery_status_response:type_name -> alox.BatteryStatusResponse - 19, // 26: alox.UartMessage.tap_notify_request:type_name -> alox.TapNotifyRequest - 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 - 30, // 30: alox.UartMessage.espnow_echo_ping_request:type_name -> alox.EspNowEchoPingRequest - 31, // 31: alox.UartMessage.espnow_echo_ping_response:type_name -> alox.EspNowEchoPingResponse - 40, // 32: alox.UartMessage.set_log_level_request:type_name -> alox.SetLogLevelRequest - 41, // 33: alox.UartMessage.set_log_level_response:type_name -> alox.SetLogLevelResponse - 42, // 34: alox.UartMessage.tap_config_request:type_name -> alox.TapConfigRequest - 43, // 35: alox.UartMessage.tap_config_response:type_name -> alox.TapConfigResponse - 27, // 36: alox.UartMessage.ble_stream_tick:type_name -> alox.BleStreamTick - 38, // 37: alox.UartMessage.client_id_map_reset_request:type_name -> alox.ClientIdMapResetRequest - 39, // 38: alox.UartMessage.client_id_map_reset_response:type_name -> alox.ClientIdMapResetResponse - 6, // 39: alox.ClientInfoResponse.clients:type_name -> alox.ClientInfo - 8, // 40: alox.ClientInputResponse.clients:type_name -> alox.ClientInput - 15, // 41: alox.BatterySample.lipo1:type_name -> alox.LipoReading - 15, // 42: alox.BatterySample.lipo2:type_name -> alox.LipoReading - 16, // 43: alox.BatteryStatusResponse.samples:type_name -> alox.BatterySample - 1, // 44: alox.TapEvent.kind:type_name -> alox.TapKind - 1, // 45: alox.CacheClientTap.kind:type_name -> alox.TapKind - 23, // 46: alox.CacheClientStatus.accel:type_name -> alox.CacheClientAccel - 24, // 47: alox.CacheClientStatus.tap:type_name -> alox.CacheClientTap - 25, // 48: alox.CacheStatusResponse.clients:type_name -> alox.CacheClientStatus - 25, // 49: alox.BleStreamTick.clients:type_name -> alox.CacheClientStatus - 49, // 50: alox.OtaSlaveProgressResponse.slaves:type_name -> alox.OtaSlaveProgressEntry - 51, // [51:51] is the sub-list for method output_type - 51, // [51:51] is the sub-list for method input_type - 51, // [51:51] is the sub-list for extension type_name - 51, // [51:51] is the sub-list for extension extendee - 0, // [0:51] is the sub-list for field type_name + 4, // 1: alox.UartMessage.ack_payload:type_name -> alox.Ack + 5, // 2: alox.UartMessage.echo_payload:type_name -> alox.EchoPayload + 6, // 3: alox.UartMessage.version_response:type_name -> alox.VersionResponse + 8, // 4: alox.UartMessage.client_info_response:type_name -> alox.ClientInfoResponse + 10, // 5: alox.UartMessage.client_input_response:type_name -> alox.ClientInputResponse + 47, // 6: alox.UartMessage.ota_start:type_name -> alox.OtaStartPayload + 48, // 7: alox.UartMessage.ota_payload:type_name -> alox.OtaPayload + 49, // 8: alox.UartMessage.ota_end:type_name -> alox.OtaEndPayload + 50, // 9: alox.UartMessage.ota_status:type_name -> alox.OtaStatusPayload + 11, // 10: alox.UartMessage.accel_deadzone_request:type_name -> alox.AccelDeadzoneRequest + 12, // 11: alox.UartMessage.accel_deadzone_response:type_name -> alox.AccelDeadzoneResponse + 31, // 12: alox.UartMessage.espnow_unicast_test_request:type_name -> alox.EspNowUnicastTestRequest + 32, // 13: alox.UartMessage.espnow_unicast_test_response:type_name -> alox.EspNowUnicastTestResponse + 51, // 14: alox.UartMessage.ota_slave_progress_request:type_name -> alox.OtaSlaveProgressRequest + 53, // 15: alox.UartMessage.ota_slave_progress_response:type_name -> alox.OtaSlaveProgressResponse + 35, // 16: alox.UartMessage.led_ring_progress_request:type_name -> alox.LedRingProgressRequest + 36, // 17: alox.UartMessage.led_ring_progress_response:type_name -> alox.LedRingProgressResponse + 37, // 18: alox.UartMessage.espnow_find_me_request:type_name -> alox.EspNowFindMeRequest + 38, // 19: alox.UartMessage.espnow_find_me_response:type_name -> alox.EspNowFindMeResponse + 39, // 20: alox.UartMessage.restart_request:type_name -> alox.RestartRequest + 40, // 21: alox.UartMessage.restart_response:type_name -> alox.RestartResponse + 13, // 22: alox.UartMessage.accel_stream_request:type_name -> alox.AccelStreamRequest + 14, // 23: alox.UartMessage.accel_stream_response:type_name -> alox.AccelStreamResponse + 17, // 24: alox.UartMessage.battery_status_request:type_name -> alox.BatteryStatusRequest + 20, // 25: alox.UartMessage.battery_status_response:type_name -> alox.BatteryStatusResponse + 22, // 26: alox.UartMessage.tap_notify_request:type_name -> alox.TapNotifyRequest + 23, // 27: alox.UartMessage.tap_notify_response:type_name -> alox.TapNotifyResponse + 25, // 28: alox.UartMessage.cache_status_request:type_name -> alox.CacheStatusRequest + 29, // 29: alox.UartMessage.cache_status_response:type_name -> alox.CacheStatusResponse + 33, // 30: alox.UartMessage.espnow_echo_ping_request:type_name -> alox.EspNowEchoPingRequest + 34, // 31: alox.UartMessage.espnow_echo_ping_response:type_name -> alox.EspNowEchoPingResponse + 43, // 32: alox.UartMessage.set_log_level_request:type_name -> alox.SetLogLevelRequest + 44, // 33: alox.UartMessage.set_log_level_response:type_name -> alox.SetLogLevelResponse + 45, // 34: alox.UartMessage.tap_config_request:type_name -> alox.TapConfigRequest + 46, // 35: alox.UartMessage.tap_config_response:type_name -> alox.TapConfigResponse + 30, // 36: alox.UartMessage.ble_stream_tick:type_name -> alox.BleStreamTick + 41, // 37: alox.UartMessage.client_id_map_reset_request:type_name -> alox.ClientIdMapResetRequest + 42, // 38: alox.UartMessage.client_id_map_reset_response:type_name -> alox.ClientIdMapResetResponse + 15, // 39: alox.UartMessage.input_send_mode_request:type_name -> alox.InputSendModeRequest + 16, // 40: alox.UartMessage.input_send_mode_response:type_name -> alox.InputSendModeResponse + 7, // 41: alox.ClientInfoResponse.clients:type_name -> alox.ClientInfo + 9, // 42: alox.ClientInputResponse.clients:type_name -> alox.ClientInput + 1, // 43: alox.InputSendModeRequest.mode:type_name -> alox.InputSendMode + 1, // 44: alox.InputSendModeResponse.mode:type_name -> alox.InputSendMode + 18, // 45: alox.BatterySample.lipo1:type_name -> alox.LipoReading + 18, // 46: alox.BatterySample.lipo2:type_name -> alox.LipoReading + 19, // 47: alox.BatteryStatusResponse.samples:type_name -> alox.BatterySample + 2, // 48: alox.TapEvent.kind:type_name -> alox.TapKind + 2, // 49: alox.CacheClientTap.kind:type_name -> alox.TapKind + 26, // 50: alox.CacheClientStatus.accel:type_name -> alox.CacheClientAccel + 27, // 51: alox.CacheClientStatus.tap:type_name -> alox.CacheClientTap + 28, // 52: alox.CacheStatusResponse.clients:type_name -> alox.CacheClientStatus + 28, // 53: alox.BleStreamTick.clients:type_name -> alox.CacheClientStatus + 52, // 54: alox.OtaSlaveProgressResponse.slaves:type_name -> alox.OtaSlaveProgressEntry + 55, // [55:55] is the sub-list for method output_type + 55, // [55:55] is the sub-list for method input_type + 55, // [55:55] is the sub-list for extension type_name + 55, // [55:55] is the sub-list for extension extendee + 0, // [0:55] is the sub-list for field type_name } func init() { file_uart_messages_proto_init() } @@ -4462,14 +4720,16 @@ func file_uart_messages_proto_init() { (*UartMessage_BleStreamTick)(nil), (*UartMessage_ClientIdMapResetRequest)(nil), (*UartMessage_ClientIdMapResetResponse)(nil), + (*UartMessage_InputSendModeRequest)(nil), + (*UartMessage_InputSendModeResponse)(nil), } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_uart_messages_proto_rawDesc), len(file_uart_messages_proto_rawDesc)), - NumEnums: 2, - NumMessages: 49, + NumEnums: 3, + NumMessages: 51, NumExtensions: 0, NumServices: 0, }, diff --git a/goTool/webui/index.html b/goTool/webui/index.html index d6853b9..891efd7 100644 --- a/goTool/webui/index.html +++ b/goTool/webui/index.html @@ -553,6 +553,8 @@ Live-Stream: UART ≈ CACHE_STATUS-Poll (~16 ms); BLE ≈ BLE_STREAM_TICK-Push. Pro Slave Accel aktiviert den ESP-NOW-Stream; Tap-Notify (S/D/T) steuert die Tap-Arten auf dem Slave. + Input-Send wählt den ESP-NOW-TX-Pfad für Accel/Tap auf den Slaves + (best_effort Default; wait/reliable blockieren länger).

+ Tap alle Slaves: @@ -913,6 +937,7 @@ masterDz: 100, masterDzSeeded: false, masterLogLevel: 0, + inputSendMode: 0, masterTapCfg: { tap_sens_thres: 5, max_gest_dur: 100, @@ -1796,6 +1821,52 @@ this.busy = false; } }, + formatInputSendMode(mode) { + const labels = ['best_effort', 'fast', 'wait', 'reliable']; + if (mode == null || mode < 0 || mode > 3) return '—'; + return labels[mode]; + }, + async readInputSendMode() { + this.busy = true; + try { + const r = await fetch('/api/input-send-mode'); + const data = await r.json(); + if (!r.ok || !data.success) { + this.flash(data.error || 'Input-Send lesen fehlgeschlagen', false); + return; + } + this.inputSendMode = data.mode ?? 0; + this.flash(`Input-Send: ${data.mode_name || this.formatInputSendMode(data.mode)}`, true); + } catch (e) { + this.flash(String(e), false); + } finally { + this.busy = false; + } + }, + async setInputSendMode(mode) { + this.busy = true; + try { + const r = await fetch('/api/input-send-mode', { + method: 'PUT', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ mode, all_clients: true }) + }); + const data = await r.json(); + if (!r.ok || !data.success) { + this.flash(data.error || 'Input-Send setzen fehlgeschlagen', false); + return; + } + this.inputSendMode = data.mode ?? mode; + this.flash( + `Input-Send ${data.mode_name || this.formatInputSendMode(data.mode)} → ${data.slaves_updated || 0} Slaves`, + true + ); + } catch (e) { + this.flash(String(e), false); + } finally { + this.busy = false; + } + }, patchClientAccelStream(clientId, enabled) { const clients = (this.state.clients || []).map((c) => { if (c.id !== clientId) return c; diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index 84aa29b..6ed829e 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -22,6 +22,7 @@ idf_component_register( "cmd/cmd_client_info.c" "cmd/cmd_accel_deadzone.c" "cmd/cmd_accel_stream.c" + "cmd/cmd_input_send_mode.c" "cmd/cmd_tap_notify.c" "cmd/cmd_tap_config.c" "cmd/cmd_cache_status.c" diff --git a/main/README.md b/main/README.md index 4dc8be3..57ea8c5 100644 --- a/main/README.md +++ b/main/README.md @@ -124,7 +124,8 @@ Schema: `proto/esp_now_messages.proto`. Encode/decode: `esp_now_proto.c`. The ES | `ESPNOW_UNICAST_TEST` | Master → slave | `EspNowUnicastTest` (`seq`) | | `ESPNOW_FIND_ME` | Master → slave | `EspNowFindMe` (`client_id` filter) — LED locate sequence | | `ESPNOW_RESTART` | Master → slave | `EspNowRestart` (`client_id` filter) — reboot slave | -| `ESPNOW_ACCEL_SAMPLE` | Slave → master | `EspNowAccelSample` (`slave_id`, `x`, `y`, `z` raw LSB) — ~every 8 ms, best-effort | +| `ESPNOW_ACCEL_SAMPLE` | Slave → master | `EspNowAccelSample` (`slave_id`, `x`, `y`, `z` raw LSB) — ~every 10 ms; TX path via `INPUT_SEND_MODE` (default best-effort) | +| `ESPNOW_SET_INPUT_SEND_MODE` | Master → slave | `EspNowInputSendMode` (`mode` 0..3 = best_effort/fast/wait/reliable) | | `ESPNOW_SET_TAP_NOTIFY` | Master → slave | `EspNowTapNotify` (`client_id`, `single`, `double_tap`, `triple`) — which tap kinds to forward | | `ESPNOW_TAP_EVENT` | Slave → master | `EspNowTapEvent` (`client_id`, `kind`) — on BMA456 tap interrupt if notify enabled | | `ESPNOW_BATTERY_REPORT` | Slave → master | `EspNowBatteryReport` (`client_id`, `lipo1/2` mV) — ~every 30 s; cached in `client_registry` | @@ -233,6 +234,7 @@ Host and master speak nanopb-encoded `UartMessage` inside UART frames (byte 0 = | 22 | `FIND_ME` | Implemented (`cmd/cmd_espnow_find_me.c`) — `client_id=0` local ring, `>0` ESP-NOW to slave | | 23 | `RESTART` | Implemented (`cmd/cmd_restart.c`) — `client_id=0` reboot master, `>0` ESP-NOW reboot slave | | 25 | `ACCEL_STREAM` | Implemented — enable/disable slave ESP-NOW accel stream to master | +| 35 | `INPUT_SEND_MODE` | Implemented — get/set slave accel/tap ESP-NOW send path (best_effort/fast/wait/reliable) | | 27 | `TAP_NOTIFY` | Implemented (`cmd/cmd_tap_notify.c`) — get/set which tap kinds notify via ESP-NOW | | 29 | `CACHE_STATUS` | Implemented (`cmd/cmd_cache_status.c`) — subscribed accel + tap cache (one UART round-trip) | | 30 | `ESPNOW_ECHO_PING` | Implemented (`cmd/cmd_espnow_echo_ping.c`) — ESP-NOW timestamp echo (latency test) | diff --git a/main/cmd/cmd_handler.c b/main/cmd/cmd_handler.c index 8560997..22d660e 100644 --- a/main/cmd/cmd_handler.c +++ b/main/cmd/cmd_handler.c @@ -63,6 +63,10 @@ static const char *message_type_name(uint16_t id) { return "SET_LOG_LEVEL"; case alox_MessageType_TAP_CONFIG: return "TAP_CONFIG"; + case alox_MessageType_CLIENT_ID_MAP_RESET: + return "CLIENT_ID_MAP_RESET"; + case alox_MessageType_INPUT_SEND_MODE: + return "INPUT_SEND_MODE"; default: return "UNKNOWN"; } diff --git a/main/cmd/cmd_input_send_mode.c b/main/cmd/cmd_input_send_mode.c new file mode 100644 index 0000000..88693e2 --- /dev/null +++ b/main/cmd/cmd_input_send_mode.c @@ -0,0 +1,109 @@ +#include "cmd_input_send_mode.h" +#include "client_registry.h" +#include "esp_log.h" +#include "esp_now_comm.h" +#include "uart_cmd.h" + +static const char *TAG = "[INPUT_SEND]"; + +/** Last mode pushed from host (GET returns this; slaves may lag until re-push). */ +static alox_InputSendMode s_mode = alox_InputSendMode_INPUT_SEND_BEST_EFFORT; + +static bool valid_mode(alox_InputSendMode mode) { + return mode <= alox_InputSendMode_INPUT_SEND_RELIABLE; +} + +static void reply(bool success, alox_InputSendMode mode, uint32_t client_id, + uint32_t slaves_updated) { + alox_UartMessage response; + uart_cmd_init_response(&response, alox_MessageType_INPUT_SEND_MODE, + alox_UartMessage_input_send_mode_response_tag); + response.payload.input_send_mode_response.success = success; + response.payload.input_send_mode_response.mode = mode; + response.payload.input_send_mode_response.client_id = client_id; + response.payload.input_send_mode_response.slaves_updated = slaves_updated; + uart_cmd_send(&response, TAG); +} + +static esp_err_t push_mode_to_slave(const client_info_t *client, + alox_InputSendMode mode) { + if (client == NULL) { + return ESP_ERR_INVALID_ARG; + } + return esp_now_comm_send_input_send_mode(client->mac, client->id, + (uint32_t)mode); +} + +static void handle_input_send_mode(const uint8_t *data, size_t len) { + alox_UartMessage uart_msg; + alox_InputSendModeRequest req = alox_InputSendModeRequest_init_zero; + + if (len > 0) { + if (uart_cmd_decode(data, len, &uart_msg) != ESP_OK) { + ESP_LOGW(TAG, "decode failed"); + reply(false, s_mode, 0, 0); + return; + } + const alox_InputSendModeRequest *req_ptr = + UART_CMD_REQ(&uart_msg, alox_UartMessage_input_send_mode_request_tag, + input_send_mode_request); + if (req_ptr == NULL) { + ESP_LOGW(TAG, "missing input_send_mode_request"); + reply(false, s_mode, 0, 0); + return; + } + req = *req_ptr; + } + + if (req.write) { + if (!valid_mode(req.mode)) { + ESP_LOGW(TAG, "invalid mode %lu", (unsigned long)req.mode); + reply(false, s_mode, req.client_id, 0); + return; + } + + if (req.all_clients) { + uint32_t sent = 0; + for (size_t i = 0; i < client_registry_count(); i++) { + const client_info_t *client = client_registry_at(i); + if (client == NULL) { + continue; + } + if (push_mode_to_slave(client, req.mode) == ESP_OK) { + sent++; + } + } + s_mode = req.mode; + ESP_LOGI(TAG, "input send mode %lu for %u slaves", + (unsigned long)req.mode, (unsigned)sent); + reply(sent > 0 || client_registry_count() == 0, req.mode, 0, sent); + return; + } + + if (req.client_id == 0) { + ESP_LOGW(TAG, "client_id required (or all_clients)"); + reply(false, req.mode, 0, 0); + return; + } + + const client_info_t *client = client_registry_find_by_id(req.client_id); + if (client == NULL) { + ESP_LOGW(TAG, "client id %lu not found", (unsigned long)req.client_id); + reply(false, req.mode, req.client_id, 0); + return; + } + + esp_err_t err = push_mode_to_slave(client, req.mode); + if (err == ESP_OK) { + s_mode = req.mode; + } + reply(err == ESP_OK, req.mode, req.client_id, err == ESP_OK ? 1u : 0u); + return; + } + + reply(true, s_mode, 0, 0); +} + +void cmd_input_send_mode_register(void) { + uart_cmd_register(alox_MessageType_INPUT_SEND_MODE, handle_input_send_mode); +} diff --git a/main/cmd/cmd_input_send_mode.h b/main/cmd/cmd_input_send_mode.h new file mode 100644 index 0000000..83603ef --- /dev/null +++ b/main/cmd/cmd_input_send_mode.h @@ -0,0 +1,6 @@ +#ifndef CMD_INPUT_SEND_MODE_H +#define CMD_INPUT_SEND_MODE_H + +void cmd_input_send_mode_register(void); + +#endif diff --git a/main/esp_now_comm.h b/main/esp_now_comm.h index a8abc5b..8504277 100644 --- a/main/esp_now_comm.h +++ b/main/esp_now_comm.h @@ -13,6 +13,10 @@ esp_err_t esp_now_comm_init(const app_config_t *config); esp_err_t esp_now_comm_send_accel_stream(const uint8_t mac[CLIENT_MAC_LEN], uint32_t client_id, bool enable); +/** Master: set accel/tap ESP-NOW send path on one slave (InputSendMode). */ +esp_err_t esp_now_comm_send_input_send_mode(const uint8_t mac[CLIENT_MAC_LEN], + uint32_t client_id, uint32_t mode); + /** Master: configure tap notify flags on one slave. */ esp_err_t esp_now_comm_send_tap_notify(const uint8_t mac[CLIENT_MAC_LEN], uint32_t client_id, bool single, diff --git a/main/esp_now_master.c b/main/esp_now_master.c index 0ed8d98..dc0cbb1 100644 --- a/main/esp_now_master.c +++ b/main/esp_now_master.c @@ -37,6 +37,16 @@ static esp_err_t send_accel_stream(const uint8_t *dest_mac, uint32_t client_id, return esp_now_core_send(dest_mac, &msg); } +static esp_err_t send_input_send_mode(const uint8_t *dest_mac, + uint32_t client_id, uint32_t mode) { + alox_EspNowMessage msg = alox_EspNowMessage_init_zero; + msg.type = alox_EspNowMessageType_ESPNOW_SET_INPUT_SEND_MODE; + msg.which_payload = alox_EspNowMessage_input_send_mode_tag; + msg.payload.input_send_mode.client_id = client_id; + msg.payload.input_send_mode.mode = mode; + return esp_now_core_send(dest_mac, &msg); +} + static esp_err_t send_accel_deadzone(const uint8_t *dest_mac, uint32_t client_id, uint32_t deadzone) { alox_EspNowMessage msg = alox_EspNowMessage_init_zero; @@ -446,6 +456,24 @@ esp_err_t esp_now_comm_send_accel_stream(const uint8_t mac[CLIENT_MAC_LEN], return err; } +esp_err_t esp_now_comm_send_input_send_mode(const uint8_t mac[CLIENT_MAC_LEN], + uint32_t client_id, uint32_t mode) { + if (mac == NULL || !esp_now_core_is_master()) { + return ESP_ERR_INVALID_STATE; + } + char mac_str[18]; + esp_now_core_mac_to_str(mac, mac_str, sizeof(mac_str)); + esp_err_t err = send_input_send_mode(mac, client_id, mode); + if (err == ESP_OK) { + ESP_LOGI(TAG, "unicast SET_INPUT_SEND_MODE to %s: mode=%lu client_id=%lu", + mac_str, (unsigned long)mode, (unsigned long)client_id); + } else { + ESP_LOGW(TAG, "unicast SET_INPUT_SEND_MODE to %s failed: %s", mac_str, + esp_err_to_name(err)); + } + return err; +} + esp_err_t esp_now_comm_send_tap_notify(const uint8_t mac[CLIENT_MAC_LEN], uint32_t client_id, bool single, bool double_tap, bool triple) { diff --git a/main/esp_now_slave.c b/main/esp_now_slave.c index a0c2e39..a81bd8b 100644 --- a/main/esp_now_slave.c +++ b/main/esp_now_slave.c @@ -24,9 +24,9 @@ /** While master or slave OTA is in progress (discover may be sparse). */ #define SLAVE_MASTER_OTA_GRACE_MS 300000u /** - * Best-effort gaming input cadence (loss OK; send_best_effort). - * Must be >= one FreeRTOS tick (CONFIG_FREERTOS_HZ=100 → 10 ms); shorter - * values become 0 ticks and assert in vTaskDelayUntil. + * Accel stream cadence. TX path is selectable (INPUT_SEND_MODE; default + * best_effort). Must be >= one FreeRTOS tick (CONFIG_FREERTOS_HZ=100 → 10 ms); + * shorter values become 0 ticks and assert in vTaskDelayUntil. */ #define ESPNOW_ACCEL_INTERVAL_MS 10 #define ESPNOW_BATTERY_INTERVAL_MS 30000 @@ -40,6 +40,9 @@ static bool s_accel_stream_enabled; static bool s_tap_notify_single; static bool s_tap_notify_double; static bool s_tap_notify_triple; +/** Accel/tap TX path; default matches historical best-effort gaming input. */ +static uint32_t s_input_send_mode = + (uint32_t)alox_InputSendMode_INPUT_SEND_BEST_EFFORT; static uint8_t s_master_mac[ESP_NOW_ETH_ALEN]; static uint32_t s_last_discover_ms; /** Logical id assigned by current/last master (0 = unbound). */ @@ -161,6 +164,21 @@ static void send_presence(const uint8_t *dest_mac, alox_EspNowMessageType type) esp_now_core_send(dest_mac, &msg); } +static esp_err_t send_input_message(const uint8_t *dest_mac, + const alox_EspNowMessage *msg) { + switch (s_input_send_mode) { + case (uint32_t)alox_InputSendMode_INPUT_SEND_FAST: + return esp_now_core_send_fast(dest_mac, msg); + case (uint32_t)alox_InputSendMode_INPUT_SEND_WAIT: + return esp_now_core_send_wait(dest_mac, msg); + case (uint32_t)alox_InputSendMode_INPUT_SEND_RELIABLE: + return esp_now_core_send_reliable(dest_mac, msg); + case (uint32_t)alox_InputSendMode_INPUT_SEND_BEST_EFFORT: + default: + return esp_now_core_send_best_effort(dest_mac, msg); + } +} + static esp_err_t send_accel_sample(const uint8_t *dest_mac, uint32_t slave_id, int16_t x, int16_t y, int16_t z) { alox_EspNowMessage msg = alox_EspNowMessage_init_zero; @@ -170,8 +188,7 @@ static esp_err_t send_accel_sample(const uint8_t *dest_mac, uint32_t slave_id, msg.payload.accel_sample.x = x; msg.payload.accel_sample.y = y; msg.payload.accel_sample.z = z; - /* Fire-and-forget: controller input prefers low latency over delivery. */ - return esp_now_core_send_best_effort(dest_mac, &msg); + return send_input_message(dest_mac, &msg); } static esp_err_t send_tap_event(const uint8_t *dest_mac, uint32_t slave_id, @@ -181,7 +198,7 @@ static esp_err_t send_tap_event(const uint8_t *dest_mac, uint32_t slave_id, msg.which_payload = alox_EspNowMessage_tap_event_tag; msg.payload.tap_event.slave_id = slave_id; msg.payload.tap_event.kind = kind; - return esp_now_core_send_best_effort(dest_mac, &msg); + return send_input_message(dest_mac, &msg); } static esp_err_t send_battery_report(const uint8_t *dest_mac, @@ -429,6 +446,43 @@ static void handle_accel_stream(const uint8_t *master_mac, cfg->enable ? "on" : "off", mac_str, (unsigned long)my_client_id()); } +static const char *input_send_mode_name(uint32_t mode) { + switch (mode) { + case (uint32_t)alox_InputSendMode_INPUT_SEND_BEST_EFFORT: + return "best_effort"; + case (uint32_t)alox_InputSendMode_INPUT_SEND_FAST: + return "fast"; + case (uint32_t)alox_InputSendMode_INPUT_SEND_WAIT: + return "wait"; + case (uint32_t)alox_InputSendMode_INPUT_SEND_RELIABLE: + return "reliable"; + default: + return "unknown"; + } +} + +static void handle_input_send_mode(const uint8_t *master_mac, + const alox_EspNowInputSendMode *cfg) { + if (!client_id_matches(cfg->client_id)) { + return; + } + if (s_joined && !esp_now_core_mac_equal(master_mac, s_master_mac)) { + return; + } + if (cfg->mode > (uint32_t)alox_InputSendMode_INPUT_SEND_RELIABLE) { + ESP_LOGW(TAG, "input send mode %lu invalid (id=%lu)", + (unsigned long)cfg->mode, (unsigned long)my_client_id()); + return; + } + s_input_send_mode = cfg->mode; + char mac_str[18]; + esp_now_core_mac_to_str(master_mac, mac_str, sizeof(mac_str)); + ESP_LOGI(TAG, "input send mode %s (%lu) from master %s (id=%lu)", + input_send_mode_name(s_input_send_mode), + (unsigned long)s_input_send_mode, mac_str, + (unsigned long)my_client_id()); +} + static void handle_tap_notify(const uint8_t *master_mac, const alox_EspNowTapNotify *cfg) { if (!client_id_matches(cfg->client_id)) { @@ -585,7 +639,7 @@ static void check_master_timeout(void) { static void accel_stream_task(void *param) { (void)param; - ESP_LOGI(TAG, "accel stream task (interval %u ms, best-effort)", + ESP_LOGI(TAG, "accel stream task (interval %u ms, mode selectable)", (unsigned)ESPNOW_ACCEL_INTERVAL_MS); TickType_t last_wake = xTaskGetTickCount(); @@ -733,6 +787,11 @@ void esp_now_slave_on_recv(const esp_now_recv_info_t *info, const uint8_t *data, handle_tap_notify(info->src_addr, &msg.payload.tap_notify); } break; + case alox_EspNowMessage_input_send_mode_tag: + if (from_joined_master(info->src_addr)) { + handle_input_send_mode(info->src_addr, &msg.payload.input_send_mode); + } + break; case alox_EspNowMessage_battery_query_tag: if (from_joined_master(info->src_addr)) { handle_battery_query(info->src_addr, &msg.payload.battery_query); diff --git a/main/powerpod.c b/main/powerpod.c index 1fb61d2..2536a47 100644 --- a/main/powerpod.c +++ b/main/powerpod.c @@ -2,6 +2,7 @@ #include "cmd_handler.h" #include "cmd_accel_deadzone.h" #include "cmd_accel_stream.h" +#include "cmd_input_send_mode.h" #include "cmd_tap_notify.h" #include "cmd_tap_config.h" #include "cmd_cache_status.h" @@ -221,6 +222,7 @@ void app_main(void) { cmd_client_info_register(); cmd_accel_deadzone_register(); cmd_accel_stream_register(); + cmd_input_send_mode_register(); cmd_tap_notify_register(); cmd_tap_config_register(); cmd_cache_status_register(); diff --git a/main/proto/esp_now_messages.pb.c b/main/proto/esp_now_messages.pb.c index 4b278c7..bf6b126 100644 --- a/main/proto/esp_now_messages.pb.c +++ b/main/proto/esp_now_messages.pb.c @@ -54,6 +54,9 @@ PB_BIND(alox_EspNowTapConfig, alox_EspNowTapConfig, AUTO) PB_BIND(alox_EspNowTapEvent, alox_EspNowTapEvent, AUTO) +PB_BIND(alox_EspNowInputSendMode, alox_EspNowInputSendMode, AUTO) + + PB_BIND(alox_EspNowBatteryReport, alox_EspNowBatteryReport, AUTO) diff --git a/main/proto/esp_now_messages.pb.h b/main/proto/esp_now_messages.pb.h index 8bb8553..8919f7f 100644 --- a/main/proto/esp_now_messages.pb.h +++ b/main/proto/esp_now_messages.pb.h @@ -36,7 +36,9 @@ typedef enum _alox_EspNowMessageType { /* * Master → slave: assigned logical client id after join/presence. */ alox_EspNowMessageType_ESPNOW_ASSIGN_ID = 22, /* * Master → slave: forget persisted master/id binding (debug reset). */ - alox_EspNowMessageType_ESPNOW_CLEAR_ID_BINDING = 23 + alox_EspNowMessageType_ESPNOW_CLEAR_ID_BINDING = 23, + /* * Master → slave: accel/tap ESP-NOW send path (best_effort/fast/wait/reliable). */ + alox_EspNowMessageType_ESPNOW_SET_INPUT_SEND_MODE = 24 } alox_EspNowMessageType; /* Struct definitions */ @@ -147,6 +149,14 @@ typedef struct _alox_EspNowTapEvent { uint32_t kind; } alox_EspNowTapEvent; +/* * + Master → slave: which esp_now_core_send_* path to use for ACCEL_SAMPLE / TAP_EVENT. + Values match uart InputSendMode (0=best_effort … 3=reliable). */ +typedef struct _alox_EspNowInputSendMode { + uint32_t client_id; /* 0 = all slaves; otherwise only matching slave_id applies */ + uint32_t mode; +} alox_EspNowInputSendMode; + /* * Slave → master: LiPo voltages (periodic ~30 s and on query). */ typedef struct _alox_EspNowBatteryReport { uint32_t client_id; @@ -221,6 +231,7 @@ typedef struct _alox_EspNowMessage { alox_EspNowTapConfig tap_config; alox_EspNowAssignId assign_id; alox_EspNowClearIdBinding clear_id_binding; + alox_EspNowInputSendMode input_send_mode; } payload; } alox_EspNowMessage; @@ -231,8 +242,9 @@ extern "C" { /* Helper constants for enums */ #define _alox_EspNowMessageType_MIN alox_EspNowMessageType_ESPNOW_UNKNOWN -#define _alox_EspNowMessageType_MAX alox_EspNowMessageType_ESPNOW_CLEAR_ID_BINDING -#define _alox_EspNowMessageType_ARRAYSIZE ((alox_EspNowMessageType)(alox_EspNowMessageType_ESPNOW_CLEAR_ID_BINDING+1)) +#define _alox_EspNowMessageType_MAX alox_EspNowMessageType_ESPNOW_SET_INPUT_SEND_MODE +#define _alox_EspNowMessageType_ARRAYSIZE ((alox_EspNowMessageType)(alox_EspNowMessageType_ESPNOW_SET_INPUT_SEND_MODE+1)) + @@ -276,6 +288,7 @@ extern "C" { #define alox_EspNowTapNotify_init_default {0, 0, 0, 0} #define alox_EspNowTapConfig_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0} #define alox_EspNowTapEvent_init_default {0, 0} +#define alox_EspNowInputSendMode_init_default {0, 0} #define alox_EspNowBatteryReport_init_default {0, 0, 0, 0, 0} #define alox_EspNowLedRing_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0} #define alox_EspNowOtaStart_init_default {0} @@ -299,6 +312,7 @@ extern "C" { #define alox_EspNowTapNotify_init_zero {0, 0, 0, 0} #define alox_EspNowTapConfig_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0} #define alox_EspNowTapEvent_init_zero {0, 0} +#define alox_EspNowInputSendMode_init_zero {0, 0} #define alox_EspNowBatteryReport_init_zero {0, 0, 0, 0, 0} #define alox_EspNowLedRing_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0} #define alox_EspNowOtaStart_init_zero {0} @@ -349,6 +363,8 @@ extern "C" { #define alox_EspNowTapConfig_enable_triple_tag 10 #define alox_EspNowTapEvent_slave_id_tag 1 #define alox_EspNowTapEvent_kind_tag 2 +#define alox_EspNowInputSendMode_client_id_tag 1 +#define alox_EspNowInputSendMode_mode_tag 2 #define alox_EspNowBatteryReport_client_id_tag 1 #define alox_EspNowBatteryReport_lipo1_valid_tag 2 #define alox_EspNowBatteryReport_lipo2_valid_tag 3 @@ -394,6 +410,7 @@ extern "C" { #define alox_EspNowMessage_tap_config_tag 22 #define alox_EspNowMessage_assign_id_tag 23 #define alox_EspNowMessage_clear_id_binding_tag 24 +#define alox_EspNowMessage_input_send_mode_tag 25 /* Struct field encoding specification for nanopb */ #define alox_EspNowUnicastTest_FIELDLIST(X, a) \ @@ -502,6 +519,12 @@ X(a, STATIC, SINGULAR, UINT32, kind, 2) #define alox_EspNowTapEvent_CALLBACK NULL #define alox_EspNowTapEvent_DEFAULT NULL +#define alox_EspNowInputSendMode_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UINT32, client_id, 1) \ +X(a, STATIC, SINGULAR, UINT32, mode, 2) +#define alox_EspNowInputSendMode_CALLBACK NULL +#define alox_EspNowInputSendMode_DEFAULT NULL + #define alox_EspNowBatteryReport_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UINT32, client_id, 1) \ X(a, STATIC, SINGULAR, BOOL, lipo1_valid, 2) \ @@ -572,7 +595,8 @@ X(a, STATIC, ONEOF, MESSAGE, (payload,echo_ping,payload.echo_ping), 20) \ X(a, STATIC, ONEOF, MESSAGE, (payload,echo_pong,payload.echo_pong), 21) \ X(a, STATIC, ONEOF, MESSAGE, (payload,tap_config,payload.tap_config), 22) \ X(a, STATIC, ONEOF, MESSAGE, (payload,assign_id,payload.assign_id), 23) \ -X(a, STATIC, ONEOF, MESSAGE, (payload,clear_id_binding,payload.clear_id_binding), 24) +X(a, STATIC, ONEOF, MESSAGE, (payload,clear_id_binding,payload.clear_id_binding), 24) \ +X(a, STATIC, ONEOF, MESSAGE, (payload,input_send_mode,payload.input_send_mode), 25) #define alox_EspNowMessage_CALLBACK NULL #define alox_EspNowMessage_DEFAULT NULL #define alox_EspNowMessage_payload_discover_MSGTYPE alox_EspNowDiscover @@ -598,6 +622,7 @@ X(a, STATIC, ONEOF, MESSAGE, (payload,clear_id_binding,payload.clear_id_bi #define alox_EspNowMessage_payload_tap_config_MSGTYPE alox_EspNowTapConfig #define alox_EspNowMessage_payload_assign_id_MSGTYPE alox_EspNowAssignId #define alox_EspNowMessage_payload_clear_id_binding_MSGTYPE alox_EspNowClearIdBinding +#define alox_EspNowMessage_payload_input_send_mode_MSGTYPE alox_EspNowInputSendMode extern const pb_msgdesc_t alox_EspNowUnicastTest_msg; extern const pb_msgdesc_t alox_EspNowEchoPing_msg; @@ -615,6 +640,7 @@ extern const pb_msgdesc_t alox_EspNowBatteryQuery_msg; extern const pb_msgdesc_t alox_EspNowTapNotify_msg; extern const pb_msgdesc_t alox_EspNowTapConfig_msg; extern const pb_msgdesc_t alox_EspNowTapEvent_msg; +extern const pb_msgdesc_t alox_EspNowInputSendMode_msg; extern const pb_msgdesc_t alox_EspNowBatteryReport_msg; extern const pb_msgdesc_t alox_EspNowLedRing_msg; extern const pb_msgdesc_t alox_EspNowOtaStart_msg; @@ -640,6 +666,7 @@ extern const pb_msgdesc_t alox_EspNowMessage_msg; #define alox_EspNowTapNotify_fields &alox_EspNowTapNotify_msg #define alox_EspNowTapConfig_fields &alox_EspNowTapConfig_msg #define alox_EspNowTapEvent_fields &alox_EspNowTapEvent_msg +#define alox_EspNowInputSendMode_fields &alox_EspNowInputSendMode_msg #define alox_EspNowBatteryReport_fields &alox_EspNowBatteryReport_msg #define alox_EspNowLedRing_fields &alox_EspNowLedRing_msg #define alox_EspNowOtaStart_fields &alox_EspNowOtaStart_msg @@ -663,6 +690,7 @@ extern const pb_msgdesc_t alox_EspNowMessage_msg; #define alox_EspNowEchoPing_size 22 #define alox_EspNowEchoPong_size 22 #define alox_EspNowFindMe_size 6 +#define alox_EspNowInputSendMode_size 12 #define alox_EspNowLedRing_size 60 #define alox_EspNowOtaEnd_size 0 #define alox_EspNowOtaPayload_size 209 diff --git a/main/proto/esp_now_messages.proto b/main/proto/esp_now_messages.proto index f827432..bc8b1ef 100644 --- a/main/proto/esp_now_messages.proto +++ b/main/proto/esp_now_messages.proto @@ -31,6 +31,8 @@ enum EspNowMessageType { ESPNOW_ASSIGN_ID = 22; /** Master → slave: forget persisted master/id binding (debug reset). */ ESPNOW_CLEAR_ID_BINDING = 23; + /** Master → slave: accel/tap ESP-NOW send path (best_effort/fast/wait/reliable). */ + ESPNOW_SET_INPUT_SEND_MODE = 24; } message EspNowUnicastTest { @@ -138,6 +140,15 @@ message EspNowTapEvent { uint32 kind = 2; } +/** + * Master → slave: which esp_now_core_send_* path to use for ACCEL_SAMPLE / TAP_EVENT. + * Values match uart InputSendMode (0=best_effort … 3=reliable). + */ +message EspNowInputSendMode { + uint32 client_id = 1; // 0 = all slaves; otherwise only matching slave_id applies + uint32 mode = 2; +} + /** Slave → master: LiPo voltages (periodic ~30 s and on query). */ message EspNowBatteryReport { uint32 client_id = 1; @@ -208,5 +219,6 @@ message EspNowMessage { EspNowTapConfig tap_config = 22; EspNowAssignId assign_id = 23; EspNowClearIdBinding clear_id_binding = 24; + EspNowInputSendMode input_send_mode = 25; } } diff --git a/main/proto/uart_messages.pb.c b/main/proto/uart_messages.pb.c index 7c2936b..ae4a237 100644 --- a/main/proto/uart_messages.pb.c +++ b/main/proto/uart_messages.pb.c @@ -42,6 +42,12 @@ PB_BIND(alox_AccelStreamRequest, alox_AccelStreamRequest, AUTO) PB_BIND(alox_AccelStreamResponse, alox_AccelStreamResponse, AUTO) +PB_BIND(alox_InputSendModeRequest, alox_InputSendModeRequest, AUTO) + + +PB_BIND(alox_InputSendModeResponse, alox_InputSendModeResponse, AUTO) + + PB_BIND(alox_BatteryStatusRequest, alox_BatteryStatusRequest, AUTO) @@ -158,3 +164,5 @@ PB_BIND(alox_OtaSlaveProgressResponse, alox_OtaSlaveProgressResponse, 2) + + diff --git a/main/proto/uart_messages.pb.h b/main/proto/uart_messages.pb.h index 41029d3..99fc0d9 100644 --- a/main/proto/uart_messages.pb.h +++ b/main/proto/uart_messages.pb.h @@ -44,9 +44,23 @@ typedef enum _alox_MessageType { /* * Host → device: clear master client-id NVS map + live registry (and notify online slaves), or on a slave clear local master/id binding only. */ - alox_MessageType_CLIENT_ID_MAP_RESET = 34 + alox_MessageType_CLIENT_ID_MAP_RESET = 34, + /* * + Host → master: get/set slave ESP-NOW send path for accel/tap + (best_effort / fast / wait / reliable). */ + alox_MessageType_INPUT_SEND_MODE = 35 } alox_MessageType; +/* * + Slave ESP-NOW TX path for ACCEL_SAMPLE / TAP_EVENT (debug A/B). + Maps 1:1 to esp_now_core_send_*. */ +typedef enum _alox_InputSendMode { + alox_InputSendMode_INPUT_SEND_BEST_EFFORT = 0, + alox_InputSendMode_INPUT_SEND_FAST = 1, + alox_InputSendMode_INPUT_SEND_WAIT = 2, + alox_InputSendMode_INPUT_SEND_RELIABLE = 3 +} alox_InputSendMode; + typedef enum _alox_TapKind { alox_TapKind_TAP_NONE = 0, alox_TapKind_TAP_SINGLE = 1, @@ -136,6 +150,23 @@ typedef struct _alox_AccelStreamResponse { uint32_t slaves_updated; } alox_AccelStreamResponse; +/* Host → master: get/set input send mode on slaves. + write=false: return last mode remembered on master (client_id ignored). + write=true: push mode via ESP-NOW (all_clients or one client_id). */ +typedef struct _alox_InputSendModeRequest { + bool write; + alox_InputSendMode mode; + uint32_t client_id; + bool all_clients; +} alox_InputSendModeRequest; + +typedef struct _alox_InputSendModeResponse { + bool success; + alox_InputSendMode mode; + uint32_t client_id; + uint32_t slaves_updated; +} alox_InputSendModeResponse; + /* * Host → master: read LiPo ADC voltages (master local and/or slaves via ESP-NOW). */ typedef struct _alox_BatteryStatusRequest { /* * 0 = master only; >0 = one slave; ignored when all_clients */ @@ -380,7 +411,7 @@ typedef struct _alox_TapConfigResponse { bool enable_triple; } alox_TapConfigResponse; -/* Host → device: begin UART OTA (erase inactive OTA slot; device replies OTA_STATUS). */ +/* Host → device: begin host OTA over UART or BLE (erase inactive OTA slot; device replies OTA_STATUS). */ typedef struct _alox_OtaStartPayload { uint32_t total_size; } alox_OtaStartPayload; @@ -471,6 +502,8 @@ typedef struct _alox_UartMessage { alox_BleStreamTick ble_stream_tick; alox_ClientIdMapResetRequest client_id_map_reset_request; alox_ClientIdMapResetResponse client_id_map_reset_response; + alox_InputSendModeRequest input_send_mode_request; + alox_InputSendModeResponse input_send_mode_response; } payload; } alox_UartMessage; @@ -481,8 +514,12 @@ extern "C" { /* Helper constants for enums */ #define _alox_MessageType_MIN alox_MessageType_UNKNOWN -#define _alox_MessageType_MAX alox_MessageType_CLIENT_ID_MAP_RESET -#define _alox_MessageType_ARRAYSIZE ((alox_MessageType)(alox_MessageType_CLIENT_ID_MAP_RESET+1)) +#define _alox_MessageType_MAX alox_MessageType_INPUT_SEND_MODE +#define _alox_MessageType_ARRAYSIZE ((alox_MessageType)(alox_MessageType_INPUT_SEND_MODE+1)) + +#define _alox_InputSendMode_MIN alox_InputSendMode_INPUT_SEND_BEST_EFFORT +#define _alox_InputSendMode_MAX alox_InputSendMode_INPUT_SEND_RELIABLE +#define _alox_InputSendMode_ARRAYSIZE ((alox_InputSendMode)(alox_InputSendMode_INPUT_SEND_RELIABLE+1)) #define _alox_TapKind_MIN alox_TapKind_TAP_NONE #define _alox_TapKind_MAX alox_TapKind_TAP_TRIPLE @@ -501,6 +538,10 @@ extern "C" { +#define alox_InputSendModeRequest_mode_ENUMTYPE alox_InputSendMode + +#define alox_InputSendModeResponse_mode_ENUMTYPE alox_InputSendMode + @@ -554,6 +595,8 @@ extern "C" { #define alox_AccelDeadzoneResponse_init_default {0, 0, 0, 0} #define alox_AccelStreamRequest_init_default {0, 0, 0, 0, 0} #define alox_AccelStreamResponse_init_default {0, 0, 0, 0} +#define alox_InputSendModeRequest_init_default {0, _alox_InputSendMode_MIN, 0, 0} +#define alox_InputSendModeResponse_init_default {0, _alox_InputSendMode_MIN, 0, 0} #define alox_BatteryStatusRequest_init_default {0, 0} #define alox_LipoReading_init_default {0, 0} #define alox_BatterySample_init_default {0, false, alox_LipoReading_init_default, false, alox_LipoReading_init_default, 0} @@ -603,6 +646,8 @@ extern "C" { #define alox_AccelDeadzoneResponse_init_zero {0, 0, 0, 0} #define alox_AccelStreamRequest_init_zero {0, 0, 0, 0, 0} #define alox_AccelStreamResponse_init_zero {0, 0, 0, 0} +#define alox_InputSendModeRequest_init_zero {0, _alox_InputSendMode_MIN, 0, 0} +#define alox_InputSendModeResponse_init_zero {0, _alox_InputSendMode_MIN, 0, 0} #define alox_BatteryStatusRequest_init_zero {0, 0} #define alox_LipoReading_init_zero {0, 0} #define alox_BatterySample_init_zero {0, false, alox_LipoReading_init_zero, false, alox_LipoReading_init_zero, 0} @@ -680,6 +725,14 @@ extern "C" { #define alox_AccelStreamResponse_client_id_tag 2 #define alox_AccelStreamResponse_success_tag 3 #define alox_AccelStreamResponse_slaves_updated_tag 4 +#define alox_InputSendModeRequest_write_tag 1 +#define alox_InputSendModeRequest_mode_tag 2 +#define alox_InputSendModeRequest_client_id_tag 3 +#define alox_InputSendModeRequest_all_clients_tag 4 +#define alox_InputSendModeResponse_success_tag 1 +#define alox_InputSendModeResponse_mode_tag 2 +#define alox_InputSendModeResponse_client_id_tag 3 +#define alox_InputSendModeResponse_slaves_updated_tag 4 #define alox_BatteryStatusRequest_client_id_tag 1 #define alox_BatteryStatusRequest_all_clients_tag 2 #define alox_LipoReading_valid_tag 1 @@ -846,6 +899,8 @@ extern "C" { #define alox_UartMessage_ble_stream_tick_tag 41 #define alox_UartMessage_client_id_map_reset_request_tag 42 #define alox_UartMessage_client_id_map_reset_response_tag 43 +#define alox_UartMessage_input_send_mode_request_tag 44 +#define alox_UartMessage_input_send_mode_response_tag 45 /* Struct field encoding specification for nanopb */ #define alox_UartMessage_FIELDLIST(X, a) \ @@ -887,7 +942,9 @@ X(a, STATIC, ONEOF, MESSAGE, (payload,tap_config_request,payload.tap_confi X(a, STATIC, ONEOF, MESSAGE, (payload,tap_config_response,payload.tap_config_response), 40) \ X(a, STATIC, ONEOF, MESSAGE, (payload,ble_stream_tick,payload.ble_stream_tick), 41) \ X(a, STATIC, ONEOF, MESSAGE, (payload,client_id_map_reset_request,payload.client_id_map_reset_request), 42) \ -X(a, STATIC, ONEOF, MESSAGE, (payload,client_id_map_reset_response,payload.client_id_map_reset_response), 43) +X(a, STATIC, ONEOF, MESSAGE, (payload,client_id_map_reset_response,payload.client_id_map_reset_response), 43) \ +X(a, STATIC, ONEOF, MESSAGE, (payload,input_send_mode_request,payload.input_send_mode_request), 44) \ +X(a, STATIC, ONEOF, MESSAGE, (payload,input_send_mode_response,payload.input_send_mode_response), 45) #define alox_UartMessage_CALLBACK NULL #define alox_UartMessage_DEFAULT NULL #define alox_UartMessage_payload_ack_payload_MSGTYPE alox_Ack @@ -928,6 +985,8 @@ X(a, STATIC, ONEOF, MESSAGE, (payload,client_id_map_reset_response,payload #define alox_UartMessage_payload_ble_stream_tick_MSGTYPE alox_BleStreamTick #define alox_UartMessage_payload_client_id_map_reset_request_MSGTYPE alox_ClientIdMapResetRequest #define alox_UartMessage_payload_client_id_map_reset_response_MSGTYPE alox_ClientIdMapResetResponse +#define alox_UartMessage_payload_input_send_mode_request_MSGTYPE alox_InputSendModeRequest +#define alox_UartMessage_payload_input_send_mode_response_MSGTYPE alox_InputSendModeResponse #define alox_Ack_FIELDLIST(X, a) \ @@ -1014,6 +1073,22 @@ X(a, STATIC, SINGULAR, UINT32, slaves_updated, 4) #define alox_AccelStreamResponse_CALLBACK NULL #define alox_AccelStreamResponse_DEFAULT NULL +#define alox_InputSendModeRequest_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, BOOL, write, 1) \ +X(a, STATIC, SINGULAR, UENUM, mode, 2) \ +X(a, STATIC, SINGULAR, UINT32, client_id, 3) \ +X(a, STATIC, SINGULAR, BOOL, all_clients, 4) +#define alox_InputSendModeRequest_CALLBACK NULL +#define alox_InputSendModeRequest_DEFAULT NULL + +#define alox_InputSendModeResponse_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, BOOL, success, 1) \ +X(a, STATIC, SINGULAR, UENUM, mode, 2) \ +X(a, STATIC, SINGULAR, UINT32, client_id, 3) \ +X(a, STATIC, SINGULAR, UINT32, slaves_updated, 4) +#define alox_InputSendModeResponse_CALLBACK NULL +#define alox_InputSendModeResponse_DEFAULT NULL + #define alox_BatteryStatusRequest_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UINT32, client_id, 1) \ X(a, STATIC, SINGULAR, BOOL, all_clients, 2) @@ -1312,6 +1387,8 @@ extern const pb_msgdesc_t alox_AccelDeadzoneRequest_msg; extern const pb_msgdesc_t alox_AccelDeadzoneResponse_msg; extern const pb_msgdesc_t alox_AccelStreamRequest_msg; extern const pb_msgdesc_t alox_AccelStreamResponse_msg; +extern const pb_msgdesc_t alox_InputSendModeRequest_msg; +extern const pb_msgdesc_t alox_InputSendModeResponse_msg; extern const pb_msgdesc_t alox_BatteryStatusRequest_msg; extern const pb_msgdesc_t alox_LipoReading_msg; extern const pb_msgdesc_t alox_BatterySample_msg; @@ -1363,6 +1440,8 @@ extern const pb_msgdesc_t alox_OtaSlaveProgressResponse_msg; #define alox_AccelDeadzoneResponse_fields &alox_AccelDeadzoneResponse_msg #define alox_AccelStreamRequest_fields &alox_AccelStreamRequest_msg #define alox_AccelStreamResponse_fields &alox_AccelStreamResponse_msg +#define alox_InputSendModeRequest_fields &alox_InputSendModeRequest_msg +#define alox_InputSendModeResponse_fields &alox_InputSendModeResponse_msg #define alox_BatteryStatusRequest_fields &alox_BatteryStatusRequest_msg #define alox_LipoReading_fields &alox_LipoReading_msg #define alox_BatterySample_fields &alox_BatterySample_msg @@ -1433,6 +1512,8 @@ extern const pb_msgdesc_t alox_OtaSlaveProgressResponse_msg; #define alox_EspNowFindMeResponse_size 8 #define alox_EspNowUnicastTestRequest_size 12 #define alox_EspNowUnicastTestResponse_size 8 +#define alox_InputSendModeRequest_size 12 +#define alox_InputSendModeResponse_size 16 #define alox_LedRingProgressRequest_size 64 #define alox_LedRingProgressResponse_size 32 #define alox_LipoReading_size 8 diff --git a/main/proto/uart_messages.proto b/main/proto/uart_messages.proto index ab1d5c1..11593d8 100644 --- a/main/proto/uart_messages.proto +++ b/main/proto/uart_messages.proto @@ -42,6 +42,11 @@ enum MessageType { * online slaves), or on a slave clear local master/id binding only. */ CLIENT_ID_MAP_RESET = 34; + /** + * Host → master: get/set slave ESP-NOW send path for accel/tap + * (best_effort / fast / wait / reliable). + */ + INPUT_SEND_MODE = 35; } message UartMessage { @@ -85,6 +90,8 @@ message UartMessage { BleStreamTick ble_stream_tick = 41; ClientIdMapResetRequest client_id_map_reset_request = 42; ClientIdMapResetResponse client_id_map_reset_response = 43; + InputSendModeRequest input_send_mode_request = 44; + InputSendModeResponse input_send_mode_response = 45; } } @@ -167,6 +174,34 @@ message AccelStreamResponse { uint32 slaves_updated = 4; } +/** + * Slave ESP-NOW TX path for ACCEL_SAMPLE / TAP_EVENT (debug A/B). + * Maps 1:1 to esp_now_core_send_*. + */ +enum InputSendMode { + INPUT_SEND_BEST_EFFORT = 0; + INPUT_SEND_FAST = 1; + INPUT_SEND_WAIT = 2; + INPUT_SEND_RELIABLE = 3; +} + +// Host → master: get/set input send mode on slaves. +// write=false: return last mode remembered on master (client_id ignored). +// write=true: push mode via ESP-NOW (all_clients or one client_id). +message InputSendModeRequest { + bool write = 1; + InputSendMode mode = 2; + uint32 client_id = 3; + bool all_clients = 4; +} + +message InputSendModeResponse { + bool success = 1; + InputSendMode mode = 2; + uint32 client_id = 3; + uint32 slaves_updated = 4; +} + /** Host → master: read LiPo ADC voltages (master local and/or slaves via ESP-NOW). */ message BatteryStatusRequest { /** 0 = master only; >0 = one slave; ignored when all_clients */