Add UART SET_LOG_LEVEL for runtime master ESP-IDF logging.
Expose the command via goTool CLI/REST and dashboard controls so log verbosity can be tuned without reflashing. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -36,6 +36,7 @@ go run . -port /dev/ttyUSB0 clients
|
||||
| `led-ring` | 8 | LED ring: `-mode clear\|color\|progress\|digit\|blink\|find-me`, `-client`, `-all` |
|
||||
| `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 |
|
||||
|
||||
`clients` requires slaves to have responded to master discover broadcasts first.
|
||||
|
||||
@@ -116,8 +117,12 @@ On success the slave serial log should show `UNICAST TEST OK from master … seq
|
||||
|
||||
```bash
|
||||
go run . -port /dev/ttyUSB0 echo-ping -client 16
|
||||
go run . -port /dev/ttyUSB0 log-level
|
||||
go run . -port /dev/ttyUSB0 log-level -set -level 3
|
||||
```
|
||||
|
||||
`log-level` controls `esp_log_*` on the master (UART0 USB console). The host protocol UART (GPIO 2/3) is unchanged.
|
||||
|
||||
Measures latency to one slave. `rtt_ms` is the full host round-trip (UART + ESP-NOW + UART back). `esp_rtt_us` is the master-side ESP-NOW leg only (`esp_timer_get_time()` delta, raw microseconds from firmware).
|
||||
|
||||
Example output:
|
||||
|
||||
@@ -74,6 +74,17 @@ type restartAPIResponse struct {
|
||||
Error string `json:"error,omitempty"`
|
||||
}
|
||||
|
||||
type logLevelAPIResponse struct {
|
||||
Success bool `json:"success"`
|
||||
Level uint32 `json:"level"`
|
||||
Error string `json:"error,omitempty"`
|
||||
}
|
||||
|
||||
type logLevelAPIRequest struct {
|
||||
Write bool `json:"write"`
|
||||
Level uint32 `json:"level"`
|
||||
}
|
||||
|
||||
type otaAPIResponse struct {
|
||||
Success bool `json:"success"`
|
||||
BytesWritten uint32 `json:"bytes_written,omitempty"`
|
||||
@@ -125,6 +136,16 @@ func mountServeAPI(mux *http.ServeMux, link *managedSerial, hub *wsHub, streamCt
|
||||
}
|
||||
serveRestart(w, r, link)
|
||||
})
|
||||
mux.HandleFunc("/api/log-level", func(w http.ResponseWriter, r *http.Request) {
|
||||
switch r.Method {
|
||||
case http.MethodGet:
|
||||
serveLogLevelGet(w, r, link)
|
||||
case http.MethodPost:
|
||||
serveLogLevelPost(w, r, link)
|
||||
default:
|
||||
http.Error(w, "method not allowed", http.StatusMethodNotAllowed)
|
||||
}
|
||||
})
|
||||
mux.HandleFunc("/api/ota", func(w http.ResponseWriter, r *http.Request) {
|
||||
if r.Method != http.MethodPost {
|
||||
http.Error(w, "method not allowed", http.StatusMethodNotAllowed)
|
||||
@@ -280,6 +301,43 @@ func applyDeadzoneToSlaves(link *managedSerial, deadzone uint32) (uint32, error)
|
||||
return updated, nil
|
||||
}
|
||||
|
||||
func serveLogLevelGet(w http.ResponseWriter, r *http.Request, link *managedSerial) {
|
||||
resp, err := link.SetLogLevel(false, 0)
|
||||
if err != nil {
|
||||
writeJSON(w, http.StatusServiceUnavailable, logLevelAPIResponse{Error: err.Error()})
|
||||
return
|
||||
}
|
||||
writeJSON(w, http.StatusOK, logLevelAPIResponse{
|
||||
Success: resp.GetSuccess(),
|
||||
Level: resp.GetLevel(),
|
||||
})
|
||||
}
|
||||
|
||||
func serveLogLevelPost(w http.ResponseWriter, r *http.Request, link *managedSerial) {
|
||||
var body logLevelAPIRequest
|
||||
if err := json.NewDecoder(r.Body).Decode(&body); err != nil {
|
||||
writeJSON(w, http.StatusBadRequest, logLevelAPIResponse{Error: "invalid JSON"})
|
||||
return
|
||||
}
|
||||
if !body.Write {
|
||||
writeJSON(w, http.StatusBadRequest, logLevelAPIResponse{Error: "write must be true"})
|
||||
return
|
||||
}
|
||||
if body.Level > 5 {
|
||||
writeJSON(w, http.StatusBadRequest, logLevelAPIResponse{Error: "level must be 0–5"})
|
||||
return
|
||||
}
|
||||
resp, err := link.SetLogLevel(true, body.Level)
|
||||
if err != nil {
|
||||
writeJSON(w, http.StatusServiceUnavailable, logLevelAPIResponse{Error: err.Error()})
|
||||
return
|
||||
}
|
||||
writeJSON(w, http.StatusOK, logLevelAPIResponse{
|
||||
Success: resp.GetSuccess(),
|
||||
Level: resp.GetLevel(),
|
||||
})
|
||||
}
|
||||
|
||||
func serveRestart(w http.ResponseWriter, r *http.Request, link *managedSerial) {
|
||||
var body restartAPIRequest
|
||||
if err := json.NewDecoder(r.Body).Decode(&body); err != nil {
|
||||
|
||||
@@ -477,6 +477,16 @@ func (m *managedSerial) FindMe(clientID uint32) error {
|
||||
})
|
||||
}
|
||||
|
||||
func (m *managedSerial) SetLogLevel(write bool, level uint32) (*pb.SetLogLevelResponse, error) {
|
||||
var resp *pb.SetLogLevelResponse
|
||||
err := m.withPort(func(sp *serialPort) error {
|
||||
var e error
|
||||
resp, e = runSetLogLevelClient(sp, write, level)
|
||||
return e
|
||||
})
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (m *managedSerial) Restart(clientID uint32) error {
|
||||
err := m.withPort(func(sp *serialPort) error {
|
||||
return runRestartClient(sp, clientID)
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
"powerpod/gotool/pb"
|
||||
)
|
||||
|
||||
func runLogLevel(sp *serialPort, args []string) error {
|
||||
fs := flag.NewFlagSet("log-level", flag.ExitOnError)
|
||||
write := fs.Bool("set", false, "write log level (default: read)")
|
||||
level := fs.Uint("level", 0, "esp_log_level_t 0–5 (with -set)")
|
||||
if err := fs.Parse(args); err != nil {
|
||||
return err
|
||||
}
|
||||
resp, err := sp.setLogLevel(*write, uint32(*level))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !resp.GetSuccess() {
|
||||
return fmt.Errorf("set_log_level rejected (level=%d)", resp.GetLevel())
|
||||
}
|
||||
fmt.Printf("log_level=%d success=%v\n", resp.GetLevel(), resp.GetSuccess())
|
||||
return nil
|
||||
}
|
||||
|
||||
func runSetLogLevelClient(sp *serialPort, write bool, level uint32) (*pb.SetLogLevelResponse, error) {
|
||||
return sp.setLogLevel(write, level)
|
||||
}
|
||||
|
||||
func (s *serialPort) setLogLevel(write bool, level uint32) (*pb.SetLogLevelResponse, error) {
|
||||
msg := &pb.UartMessage{
|
||||
Type: pb.MessageType_SET_LOG_LEVEL,
|
||||
Payload: &pb.UartMessage_SetLogLevelRequest{
|
||||
SetLogLevelRequest: &pb.SetLogLevelRequest{
|
||||
Write: write,
|
||||
Level: level,
|
||||
},
|
||||
},
|
||||
}
|
||||
body, err := proto.Marshal(msg)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("encode: %w", err)
|
||||
}
|
||||
payload := append([]byte{byte(pb.MessageType_SET_LOG_LEVEL)}, body...)
|
||||
respPayload, err := s.exchangePayload(payload, "SET_LOG_LEVEL")
|
||||
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.GetSetLogLevelResponse()
|
||||
if r == nil {
|
||||
return nil, fmt.Errorf("missing set_log_level_response")
|
||||
}
|
||||
return r, nil
|
||||
}
|
||||
@@ -282,6 +282,39 @@ Content-Type: application/json
|
||||
{"client_id": 16}
|
||||
```
|
||||
|
||||
### Log level (master ESP-IDF console)
|
||||
|
||||
Runtime get/set of the **global** log filter on the master (`esp_log_level_set("*", …)`). Output goes to **UART0** (USB debug, 115200), not the host protocol UART (GPIO 2/3, 921600).
|
||||
|
||||
```http
|
||||
GET /api/log-level
|
||||
POST /api/log-level
|
||||
Content-Type: application/json
|
||||
{"write": true, "level": 3}
|
||||
```
|
||||
|
||||
| `level` | Meaning |
|
||||
|---------|---------|
|
||||
| 0 | None (no log output) |
|
||||
| 1 | Error |
|
||||
| 2 | Warn |
|
||||
| 3 | Info |
|
||||
| 4 | Debug |
|
||||
| 5 | Verbose |
|
||||
|
||||
```json
|
||||
{"success": true, "level": 3}
|
||||
```
|
||||
|
||||
**CLI:**
|
||||
|
||||
```bash
|
||||
go run . -port /dev/ttyUSB0 log-level
|
||||
go run . -port /dev/ttyUSB0 log-level -set -level 3
|
||||
```
|
||||
|
||||
Dashboard: Master card → dropdown **ESP Log-Level** with **Lesen** / **Setzen**.
|
||||
|
||||
### OTA (master UART upload)
|
||||
|
||||
```http
|
||||
@@ -329,5 +362,6 @@ Same as external API:
|
||||
| Alle Slaves deadzone | `all_clients` + `slaves_only` on POST |
|
||||
| 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` |
|
||||
| Tap notify S/D/T | `PUT /api/clients/{id}/tap-notify` |
|
||||
| Tap receive (UI) | Live stream + tap notify; see WebSocket doc for external API |
|
||||
|
||||
+5
-2
@@ -26,7 +26,8 @@ func usage() {
|
||||
fmt.Fprintf(os.Stderr, " ota-progress query per-slave ESP-NOW OTA progress on master\n")
|
||||
fmt.Fprintf(os.Stderr, " led-ring set LED ring progress bar (0–100%%, rgb, intensity)\n")
|
||||
fmt.Fprintf(os.Stderr, " find-me blink LED ring red/green/blue (3× each, full brightness)\n")
|
||||
fmt.Fprintf(os.Stderr, " restart reboot master or slave (ESP-NOW)\n\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")
|
||||
flag.PrintDefaults()
|
||||
}
|
||||
|
||||
@@ -53,7 +54,7 @@ func main() {
|
||||
os.Exit(2)
|
||||
}
|
||||
runErr = runServe(*portName, *baud, flag.Args()[1:])
|
||||
case "version", "clients", "client-info", "deadzone", "accel-deadzone", "tap-notify", "tap_notify", "cache-status", "cache_status", "unicast-test", "unicast_test", "echo-ping", "echo_ping", "led-ring", "led_ring", "find-me", "find_me", "restart", "ota", "ota-progress", "ota_progress":
|
||||
case "version", "clients", "client-info", "deadzone", "accel-deadzone", "tap-notify", "tap_notify", "cache-status", "cache_status", "unicast-test", "unicast_test", "echo-ping", "echo_ping", "led-ring", "led_ring", "find-me", "find_me", "restart", "log-level", "log_level", "ota", "ota-progress", "ota_progress":
|
||||
if *portName == "" {
|
||||
fmt.Fprintf(os.Stderr, "command %q requires -port\n\n", cmd)
|
||||
usage()
|
||||
@@ -87,6 +88,8 @@ func main() {
|
||||
runErr = runFindMe(sp, flag.Args()[1:])
|
||||
case "restart":
|
||||
runErr = runRestart(sp, flag.Args()[1:])
|
||||
case "log-level", "log_level":
|
||||
runErr = runLogLevel(sp, flag.Args()[1:])
|
||||
case "ota":
|
||||
runErr = runOTA(sp, flag.Args()[1:])
|
||||
case "ota-progress", "ota_progress":
|
||||
|
||||
+214
-57
@@ -48,6 +48,8 @@ const (
|
||||
MessageType_CACHE_STATUS MessageType = 29
|
||||
// * Host → master → slave → master: timestamp echo round-trip (latency test).
|
||||
MessageType_ESPNOW_ECHO_PING MessageType = 30
|
||||
// * Host → master: get/set ESP-IDF log level for tag "*" (global).
|
||||
MessageType_SET_LOG_LEVEL MessageType = 31
|
||||
)
|
||||
|
||||
// Enum value maps for MessageType.
|
||||
@@ -75,6 +77,7 @@ var (
|
||||
27: "TAP_NOTIFY",
|
||||
29: "CACHE_STATUS",
|
||||
30: "ESPNOW_ECHO_PING",
|
||||
31: "SET_LOG_LEVEL",
|
||||
}
|
||||
MessageType_value = map[string]int32{
|
||||
"UNKNOWN": 0,
|
||||
@@ -99,6 +102,7 @@ var (
|
||||
"TAP_NOTIFY": 27,
|
||||
"CACHE_STATUS": 29,
|
||||
"ESPNOW_ECHO_PING": 30,
|
||||
"SET_LOG_LEVEL": 31,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -217,6 +221,8 @@ type UartMessage struct {
|
||||
// *UartMessage_CacheStatusResponse
|
||||
// *UartMessage_EspnowEchoPingRequest
|
||||
// *UartMessage_EspnowEchoPingResponse
|
||||
// *UartMessage_SetLogLevelRequest
|
||||
// *UartMessage_SetLogLevelResponse
|
||||
Payload isUartMessage_Payload `protobuf_oneof:"payload"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
@@ -545,6 +551,24 @@ func (x *UartMessage) GetEspnowEchoPingResponse() *EspNowEchoPingResponse {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *UartMessage) GetSetLogLevelRequest() *SetLogLevelRequest {
|
||||
if x != nil {
|
||||
if x, ok := x.Payload.(*UartMessage_SetLogLevelRequest); ok {
|
||||
return x.SetLogLevelRequest
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *UartMessage) GetSetLogLevelResponse() *SetLogLevelResponse {
|
||||
if x != nil {
|
||||
if x, ok := x.Payload.(*UartMessage_SetLogLevelResponse); ok {
|
||||
return x.SetLogLevelResponse
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type isUartMessage_Payload interface {
|
||||
isUartMessage_Payload()
|
||||
}
|
||||
@@ -673,6 +697,14 @@ type UartMessage_EspnowEchoPingResponse struct {
|
||||
EspnowEchoPingResponse *EspNowEchoPingResponse `protobuf:"bytes,36,opt,name=espnow_echo_ping_response,json=espnowEchoPingResponse,proto3,oneof"`
|
||||
}
|
||||
|
||||
type UartMessage_SetLogLevelRequest struct {
|
||||
SetLogLevelRequest *SetLogLevelRequest `protobuf:"bytes,37,opt,name=set_log_level_request,json=setLogLevelRequest,proto3,oneof"`
|
||||
}
|
||||
|
||||
type UartMessage_SetLogLevelResponse struct {
|
||||
SetLogLevelResponse *SetLogLevelResponse `protobuf:"bytes,38,opt,name=set_log_level_response,json=setLogLevelResponse,proto3,oneof"`
|
||||
}
|
||||
|
||||
func (*UartMessage_AckPayload) isUartMessage_Payload() {}
|
||||
|
||||
func (*UartMessage_EchoPayload) isUartMessage_Payload() {}
|
||||
@@ -735,6 +767,10 @@ func (*UartMessage_EspnowEchoPingRequest) isUartMessage_Payload() {}
|
||||
|
||||
func (*UartMessage_EspnowEchoPingResponse) isUartMessage_Payload() {}
|
||||
|
||||
func (*UartMessage_SetLogLevelRequest) isUartMessage_Payload() {}
|
||||
|
||||
func (*UartMessage_SetLogLevelResponse) isUartMessage_Payload() {}
|
||||
|
||||
type Ack struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
@@ -2909,6 +2945,112 @@ func (x *RestartResponse) GetClientId() uint32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// * Host → master: read/write global log level (esp_log_level_set("*", …)).
|
||||
type SetLogLevelRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Write bool `protobuf:"varint,1,opt,name=write,proto3" json:"write,omitempty"`
|
||||
// * esp_log_level_t: 0=NONE, 1=ERROR, 2=WARN, 3=INFO, 4=DEBUG, 5=VERBOSE
|
||||
Level uint32 `protobuf:"varint,2,opt,name=level,proto3" json:"level,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *SetLogLevelRequest) Reset() {
|
||||
*x = SetLogLevelRequest{}
|
||||
mi := &file_uart_messages_proto_msgTypes[35]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *SetLogLevelRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SetLogLevelRequest) ProtoMessage() {}
|
||||
|
||||
func (x *SetLogLevelRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_uart_messages_proto_msgTypes[35]
|
||||
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 SetLogLevelRequest.ProtoReflect.Descriptor instead.
|
||||
func (*SetLogLevelRequest) Descriptor() ([]byte, []int) {
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{35}
|
||||
}
|
||||
|
||||
func (x *SetLogLevelRequest) GetWrite() bool {
|
||||
if x != nil {
|
||||
return x.Write
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *SetLogLevelRequest) GetLevel() uint32 {
|
||||
if x != nil {
|
||||
return x.Level
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type SetLogLevelResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
|
||||
Level uint32 `protobuf:"varint,2,opt,name=level,proto3" json:"level,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *SetLogLevelResponse) Reset() {
|
||||
*x = SetLogLevelResponse{}
|
||||
mi := &file_uart_messages_proto_msgTypes[36]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *SetLogLevelResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SetLogLevelResponse) ProtoMessage() {}
|
||||
|
||||
func (x *SetLogLevelResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_uart_messages_proto_msgTypes[36]
|
||||
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 SetLogLevelResponse.ProtoReflect.Descriptor instead.
|
||||
func (*SetLogLevelResponse) Descriptor() ([]byte, []int) {
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{36}
|
||||
}
|
||||
|
||||
func (x *SetLogLevelResponse) GetSuccess() bool {
|
||||
if x != nil {
|
||||
return x.Success
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *SetLogLevelResponse) GetLevel() uint32 {
|
||||
if x != nil {
|
||||
return x.Level
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// Host → device: begin UART OTA (erase inactive OTA slot; device replies OTA_STATUS).
|
||||
type OtaStartPayload struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
@@ -2919,7 +3061,7 @@ type OtaStartPayload struct {
|
||||
|
||||
func (x *OtaStartPayload) Reset() {
|
||||
*x = OtaStartPayload{}
|
||||
mi := &file_uart_messages_proto_msgTypes[35]
|
||||
mi := &file_uart_messages_proto_msgTypes[37]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -2931,7 +3073,7 @@ func (x *OtaStartPayload) String() string {
|
||||
func (*OtaStartPayload) ProtoMessage() {}
|
||||
|
||||
func (x *OtaStartPayload) 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 {
|
||||
@@ -2944,7 +3086,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{35}
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{37}
|
||||
}
|
||||
|
||||
func (x *OtaStartPayload) GetTotalSize() uint32 {
|
||||
@@ -2965,7 +3107,7 @@ type OtaPayload struct {
|
||||
|
||||
func (x *OtaPayload) Reset() {
|
||||
*x = OtaPayload{}
|
||||
mi := &file_uart_messages_proto_msgTypes[36]
|
||||
mi := &file_uart_messages_proto_msgTypes[38]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -2977,7 +3119,7 @@ func (x *OtaPayload) String() string {
|
||||
func (*OtaPayload) ProtoMessage() {}
|
||||
|
||||
func (x *OtaPayload) 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 {
|
||||
@@ -2990,7 +3132,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{36}
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{38}
|
||||
}
|
||||
|
||||
func (x *OtaPayload) GetSeq() uint32 {
|
||||
@@ -3016,7 +3158,7 @@ type OtaEndPayload struct {
|
||||
|
||||
func (x *OtaEndPayload) Reset() {
|
||||
*x = OtaEndPayload{}
|
||||
mi := &file_uart_messages_proto_msgTypes[37]
|
||||
mi := &file_uart_messages_proto_msgTypes[39]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -3028,7 +3170,7 @@ func (x *OtaEndPayload) String() string {
|
||||
func (*OtaEndPayload) ProtoMessage() {}
|
||||
|
||||
func (x *OtaEndPayload) 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 {
|
||||
@@ -3041,7 +3183,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{37}
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{39}
|
||||
}
|
||||
|
||||
// Device → host status (also used as ACK after each 4 KiB written).
|
||||
@@ -3058,7 +3200,7 @@ type OtaStatusPayload struct {
|
||||
|
||||
func (x *OtaStatusPayload) Reset() {
|
||||
*x = OtaStatusPayload{}
|
||||
mi := &file_uart_messages_proto_msgTypes[38]
|
||||
mi := &file_uart_messages_proto_msgTypes[40]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -3070,7 +3212,7 @@ func (x *OtaStatusPayload) String() string {
|
||||
func (*OtaStatusPayload) ProtoMessage() {}
|
||||
|
||||
func (x *OtaStatusPayload) 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 {
|
||||
@@ -3083,7 +3225,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{38}
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{40}
|
||||
}
|
||||
|
||||
func (x *OtaStatusPayload) GetStatus() uint32 {
|
||||
@@ -3124,7 +3266,7 @@ type OtaSlaveProgressRequest struct {
|
||||
|
||||
func (x *OtaSlaveProgressRequest) Reset() {
|
||||
*x = OtaSlaveProgressRequest{}
|
||||
mi := &file_uart_messages_proto_msgTypes[39]
|
||||
mi := &file_uart_messages_proto_msgTypes[41]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -3136,7 +3278,7 @@ func (x *OtaSlaveProgressRequest) String() string {
|
||||
func (*OtaSlaveProgressRequest) ProtoMessage() {}
|
||||
|
||||
func (x *OtaSlaveProgressRequest) 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 {
|
||||
@@ -3149,7 +3291,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{39}
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{41}
|
||||
}
|
||||
|
||||
func (x *OtaSlaveProgressRequest) GetClientId() uint32 {
|
||||
@@ -3173,7 +3315,7 @@ type OtaSlaveProgressEntry struct {
|
||||
|
||||
func (x *OtaSlaveProgressEntry) Reset() {
|
||||
*x = OtaSlaveProgressEntry{}
|
||||
mi := &file_uart_messages_proto_msgTypes[40]
|
||||
mi := &file_uart_messages_proto_msgTypes[42]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -3185,7 +3327,7 @@ func (x *OtaSlaveProgressEntry) String() string {
|
||||
func (*OtaSlaveProgressEntry) ProtoMessage() {}
|
||||
|
||||
func (x *OtaSlaveProgressEntry) 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 {
|
||||
@@ -3198,7 +3340,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{40}
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{42}
|
||||
}
|
||||
|
||||
func (x *OtaSlaveProgressEntry) GetClientId() uint32 {
|
||||
@@ -3249,7 +3391,7 @@ type OtaSlaveProgressResponse struct {
|
||||
|
||||
func (x *OtaSlaveProgressResponse) Reset() {
|
||||
*x = OtaSlaveProgressResponse{}
|
||||
mi := &file_uart_messages_proto_msgTypes[41]
|
||||
mi := &file_uart_messages_proto_msgTypes[43]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -3261,7 +3403,7 @@ func (x *OtaSlaveProgressResponse) String() string {
|
||||
func (*OtaSlaveProgressResponse) ProtoMessage() {}
|
||||
|
||||
func (x *OtaSlaveProgressResponse) 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 {
|
||||
@@ -3274,7 +3416,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{41}
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{43}
|
||||
}
|
||||
|
||||
func (x *OtaSlaveProgressResponse) GetActive() bool {
|
||||
@@ -3316,7 +3458,7 @@ var File_uart_messages_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_uart_messages_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x13uart_messages.proto\x12\x04alox\x1a\fnanopb.proto\"\x9f\x13\n" +
|
||||
"\x13uart_messages.proto\x12\x04alox\x1a\fnanopb.proto\"\xc0\x14\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" +
|
||||
@@ -3353,7 +3495,9 @@ const file_uart_messages_proto_rawDesc = "" +
|
||||
"\x14cache_status_request\x18! \x01(\v2\x18.alox.CacheStatusRequestH\x00R\x12cacheStatusRequest\x12O\n" +
|
||||
"\x15cache_status_response\x18\" \x01(\v2\x19.alox.CacheStatusResponseH\x00R\x13cacheStatusResponse\x12V\n" +
|
||||
"\x18espnow_echo_ping_request\x18# \x01(\v2\x1b.alox.EspNowEchoPingRequestH\x00R\x15espnowEchoPingRequest\x12Y\n" +
|
||||
"\x19espnow_echo_ping_response\x18$ \x01(\v2\x1c.alox.EspNowEchoPingResponseH\x00R\x16espnowEchoPingResponseB\t\n" +
|
||||
"\x19espnow_echo_ping_response\x18$ \x01(\v2\x1c.alox.EspNowEchoPingResponseH\x00R\x16espnowEchoPingResponse\x12M\n" +
|
||||
"\x15set_log_level_request\x18% \x01(\v2\x18.alox.SetLogLevelRequestH\x00R\x12setLogLevelRequest\x12P\n" +
|
||||
"\x16set_log_level_response\x18& \x01(\v2\x19.alox.SetLogLevelResponseH\x00R\x13setLogLevelResponseB\t\n" +
|
||||
"\apayload\"\x05\n" +
|
||||
"\x03Ack\"!\n" +
|
||||
"\vEchoPayload\x12\x12\n" +
|
||||
@@ -3516,7 +3660,13 @@ const file_uart_messages_proto_rawDesc = "" +
|
||||
"\tclient_id\x18\x01 \x01(\rR\bclientId\"H\n" +
|
||||
"\x0fRestartResponse\x12\x18\n" +
|
||||
"\asuccess\x18\x01 \x01(\bR\asuccess\x12\x1b\n" +
|
||||
"\tclient_id\x18\x02 \x01(\rR\bclientId\"0\n" +
|
||||
"\tclient_id\x18\x02 \x01(\rR\bclientId\"@\n" +
|
||||
"\x12SetLogLevelRequest\x12\x14\n" +
|
||||
"\x05write\x18\x01 \x01(\bR\x05write\x12\x14\n" +
|
||||
"\x05level\x18\x02 \x01(\rR\x05level\"E\n" +
|
||||
"\x13SetLogLevelResponse\x12\x18\n" +
|
||||
"\asuccess\x18\x01 \x01(\bR\asuccess\x12\x14\n" +
|
||||
"\x05level\x18\x02 \x01(\rR\x05level\"0\n" +
|
||||
"\x0fOtaStartPayload\x12\x1d\n" +
|
||||
"\n" +
|
||||
"total_size\x18\x01 \x01(\rR\ttotalSize\":\n" +
|
||||
@@ -3547,7 +3697,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*\x87\x03\n" +
|
||||
"\x06slaves\x18\x05 \x03(\v2\x1b.alox.OtaSlaveProgressEntryB\x05\x92?\x02\x10\x10R\x06slaves*\x9a\x03\n" +
|
||||
"\vMessageType\x12\v\n" +
|
||||
"\aUNKNOWN\x10\x00\x12\a\n" +
|
||||
"\x03ACK\x10\x01\x12\b\n" +
|
||||
@@ -3572,7 +3722,8 @@ const file_uart_messages_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"TAP_NOTIFY\x10\x1b\x12\x10\n" +
|
||||
"\fCACHE_STATUS\x10\x1d\x12\x14\n" +
|
||||
"\x10ESPNOW_ECHO_PING\x10\x1e\"\x04\b\x18\x10\x18\"\x04\b\x1c\x10\x1c*G\n" +
|
||||
"\x10ESPNOW_ECHO_PING\x10\x1e\x12\x11\n" +
|
||||
"\rSET_LOG_LEVEL\x10\x1f\"\x04\b\x18\x10\x18\"\x04\b\x1c\x10\x1c*G\n" +
|
||||
"\aTapKind\x12\f\n" +
|
||||
"\bTAP_NONE\x10\x00\x12\x0e\n" +
|
||||
"\n" +
|
||||
@@ -3595,7 +3746,7 @@ func file_uart_messages_proto_rawDescGZIP() []byte {
|
||||
}
|
||||
|
||||
var file_uart_messages_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
|
||||
var file_uart_messages_proto_msgTypes = make([]protoimpl.MessageInfo, 42)
|
||||
var file_uart_messages_proto_msgTypes = make([]protoimpl.MessageInfo, 44)
|
||||
var file_uart_messages_proto_goTypes = []any{
|
||||
(MessageType)(0), // 0: alox.MessageType
|
||||
(TapKind)(0), // 1: alox.TapKind
|
||||
@@ -3634,13 +3785,15 @@ var file_uart_messages_proto_goTypes = []any{
|
||||
(*EspNowFindMeResponse)(nil), // 34: alox.EspNowFindMeResponse
|
||||
(*RestartRequest)(nil), // 35: alox.RestartRequest
|
||||
(*RestartResponse)(nil), // 36: alox.RestartResponse
|
||||
(*OtaStartPayload)(nil), // 37: alox.OtaStartPayload
|
||||
(*OtaPayload)(nil), // 38: alox.OtaPayload
|
||||
(*OtaEndPayload)(nil), // 39: alox.OtaEndPayload
|
||||
(*OtaStatusPayload)(nil), // 40: alox.OtaStatusPayload
|
||||
(*OtaSlaveProgressRequest)(nil), // 41: alox.OtaSlaveProgressRequest
|
||||
(*OtaSlaveProgressEntry)(nil), // 42: alox.OtaSlaveProgressEntry
|
||||
(*OtaSlaveProgressResponse)(nil), // 43: alox.OtaSlaveProgressResponse
|
||||
(*SetLogLevelRequest)(nil), // 37: alox.SetLogLevelRequest
|
||||
(*SetLogLevelResponse)(nil), // 38: alox.SetLogLevelResponse
|
||||
(*OtaStartPayload)(nil), // 39: alox.OtaStartPayload
|
||||
(*OtaPayload)(nil), // 40: alox.OtaPayload
|
||||
(*OtaEndPayload)(nil), // 41: alox.OtaEndPayload
|
||||
(*OtaStatusPayload)(nil), // 42: alox.OtaStatusPayload
|
||||
(*OtaSlaveProgressRequest)(nil), // 43: alox.OtaSlaveProgressRequest
|
||||
(*OtaSlaveProgressEntry)(nil), // 44: alox.OtaSlaveProgressEntry
|
||||
(*OtaSlaveProgressResponse)(nil), // 45: alox.OtaSlaveProgressResponse
|
||||
}
|
||||
var file_uart_messages_proto_depIdxs = []int32{
|
||||
0, // 0: alox.UartMessage.type:type_name -> alox.MessageType
|
||||
@@ -3649,16 +3802,16 @@ var file_uart_messages_proto_depIdxs = []int32{
|
||||
5, // 3: alox.UartMessage.version_response:type_name -> alox.VersionResponse
|
||||
7, // 4: alox.UartMessage.client_info_response:type_name -> alox.ClientInfoResponse
|
||||
9, // 5: alox.UartMessage.client_input_response:type_name -> alox.ClientInputResponse
|
||||
37, // 6: alox.UartMessage.ota_start:type_name -> alox.OtaStartPayload
|
||||
38, // 7: alox.UartMessage.ota_payload:type_name -> alox.OtaPayload
|
||||
39, // 8: alox.UartMessage.ota_end:type_name -> alox.OtaEndPayload
|
||||
40, // 9: alox.UartMessage.ota_status:type_name -> alox.OtaStatusPayload
|
||||
39, // 6: alox.UartMessage.ota_start:type_name -> alox.OtaStartPayload
|
||||
40, // 7: alox.UartMessage.ota_payload:type_name -> alox.OtaPayload
|
||||
41, // 8: alox.UartMessage.ota_end:type_name -> alox.OtaEndPayload
|
||||
42, // 9: alox.UartMessage.ota_status:type_name -> alox.OtaStatusPayload
|
||||
10, // 10: alox.UartMessage.accel_deadzone_request:type_name -> alox.AccelDeadzoneRequest
|
||||
11, // 11: alox.UartMessage.accel_deadzone_response:type_name -> alox.AccelDeadzoneResponse
|
||||
27, // 12: alox.UartMessage.espnow_unicast_test_request:type_name -> alox.EspNowUnicastTestRequest
|
||||
28, // 13: alox.UartMessage.espnow_unicast_test_response:type_name -> alox.EspNowUnicastTestResponse
|
||||
41, // 14: alox.UartMessage.ota_slave_progress_request:type_name -> alox.OtaSlaveProgressRequest
|
||||
43, // 15: alox.UartMessage.ota_slave_progress_response:type_name -> alox.OtaSlaveProgressResponse
|
||||
43, // 14: alox.UartMessage.ota_slave_progress_request:type_name -> alox.OtaSlaveProgressRequest
|
||||
45, // 15: alox.UartMessage.ota_slave_progress_response:type_name -> alox.OtaSlaveProgressResponse
|
||||
31, // 16: alox.UartMessage.led_ring_progress_request:type_name -> alox.LedRingProgressRequest
|
||||
32, // 17: alox.UartMessage.led_ring_progress_response:type_name -> alox.LedRingProgressResponse
|
||||
33, // 18: alox.UartMessage.espnow_find_me_request:type_name -> alox.EspNowFindMeRequest
|
||||
@@ -3675,22 +3828,24 @@ var file_uart_messages_proto_depIdxs = []int32{
|
||||
26, // 29: alox.UartMessage.cache_status_response:type_name -> alox.CacheStatusResponse
|
||||
29, // 30: alox.UartMessage.espnow_echo_ping_request:type_name -> alox.EspNowEchoPingRequest
|
||||
30, // 31: alox.UartMessage.espnow_echo_ping_response:type_name -> alox.EspNowEchoPingResponse
|
||||
6, // 32: alox.ClientInfoResponse.clients:type_name -> alox.ClientInfo
|
||||
8, // 33: alox.ClientInputResponse.clients:type_name -> alox.ClientInput
|
||||
15, // 34: alox.BatterySample.lipo1:type_name -> alox.LipoReading
|
||||
15, // 35: alox.BatterySample.lipo2:type_name -> alox.LipoReading
|
||||
16, // 36: alox.BatteryStatusResponse.samples:type_name -> alox.BatterySample
|
||||
1, // 37: alox.TapEvent.kind:type_name -> alox.TapKind
|
||||
1, // 38: alox.CacheClientTap.kind:type_name -> alox.TapKind
|
||||
23, // 39: alox.CacheClientStatus.accel:type_name -> alox.CacheClientAccel
|
||||
24, // 40: alox.CacheClientStatus.tap:type_name -> alox.CacheClientTap
|
||||
25, // 41: alox.CacheStatusResponse.clients:type_name -> alox.CacheClientStatus
|
||||
42, // 42: alox.OtaSlaveProgressResponse.slaves:type_name -> alox.OtaSlaveProgressEntry
|
||||
43, // [43:43] is the sub-list for method output_type
|
||||
43, // [43:43] is the sub-list for method input_type
|
||||
43, // [43:43] is the sub-list for extension type_name
|
||||
43, // [43:43] is the sub-list for extension extendee
|
||||
0, // [0:43] is the sub-list for field type_name
|
||||
37, // 32: alox.UartMessage.set_log_level_request:type_name -> alox.SetLogLevelRequest
|
||||
38, // 33: alox.UartMessage.set_log_level_response:type_name -> alox.SetLogLevelResponse
|
||||
6, // 34: alox.ClientInfoResponse.clients:type_name -> alox.ClientInfo
|
||||
8, // 35: alox.ClientInputResponse.clients:type_name -> alox.ClientInput
|
||||
15, // 36: alox.BatterySample.lipo1:type_name -> alox.LipoReading
|
||||
15, // 37: alox.BatterySample.lipo2:type_name -> alox.LipoReading
|
||||
16, // 38: alox.BatteryStatusResponse.samples:type_name -> alox.BatterySample
|
||||
1, // 39: alox.TapEvent.kind:type_name -> alox.TapKind
|
||||
1, // 40: alox.CacheClientTap.kind:type_name -> alox.TapKind
|
||||
23, // 41: alox.CacheClientStatus.accel:type_name -> alox.CacheClientAccel
|
||||
24, // 42: alox.CacheClientStatus.tap:type_name -> alox.CacheClientTap
|
||||
25, // 43: alox.CacheStatusResponse.clients:type_name -> alox.CacheClientStatus
|
||||
44, // 44: alox.OtaSlaveProgressResponse.slaves:type_name -> alox.OtaSlaveProgressEntry
|
||||
45, // [45:45] is the sub-list for method output_type
|
||||
45, // [45:45] is the sub-list for method input_type
|
||||
45, // [45:45] is the sub-list for extension type_name
|
||||
45, // [45:45] is the sub-list for extension extendee
|
||||
0, // [0:45] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_uart_messages_proto_init() }
|
||||
@@ -3730,6 +3885,8 @@ func file_uart_messages_proto_init() {
|
||||
(*UartMessage_CacheStatusResponse)(nil),
|
||||
(*UartMessage_EspnowEchoPingRequest)(nil),
|
||||
(*UartMessage_EspnowEchoPingResponse)(nil),
|
||||
(*UartMessage_SetLogLevelRequest)(nil),
|
||||
(*UartMessage_SetLogLevelResponse)(nil),
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
@@ -3737,7 +3894,7 @@ func file_uart_messages_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_uart_messages_proto_rawDesc), len(file_uart_messages_proto_rawDesc)),
|
||||
NumEnums: 2,
|
||||
NumMessages: 42,
|
||||
NumMessages: 44,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
|
||||
@@ -219,6 +219,8 @@
|
||||
<dd class="col-7" x-text="state.master.running_partition || '—'"></dd>
|
||||
<dt class="col-5 text-muted">Deadzone</dt>
|
||||
<dd class="col-7" x-text="state.master.deadzone != null ? state.master.deadzone + ' LSB' : '—'"></dd>
|
||||
<dt class="col-5 text-muted">Log-Level</dt>
|
||||
<dd class="col-7" x-text="formatLogLevel(masterLogLevel)"></dd>
|
||||
<dt class="col-5 text-muted">LiPo 1</dt>
|
||||
<dd class="col-7" x-text="formatLipo(state.master?.lipo1)"></dd>
|
||||
<dt class="col-5 text-muted">LiPo 2</dt>
|
||||
@@ -264,6 +266,31 @@
|
||||
Restart
|
||||
</button>
|
||||
</div>
|
||||
<label class="form-label text-muted small mb-1 mt-3" for="master-log-level">
|
||||
ESP Log-Level (global)
|
||||
</label>
|
||||
<div class="d-flex flex-wrap gap-2 align-items-end">
|
||||
<select id="master-log-level" class="form-select form-select-sm config-input"
|
||||
x-model.number="masterLogLevel"
|
||||
:disabled="busy || !state.uart_connected">
|
||||
<option value="0">None (aus)</option>
|
||||
<option value="1">Error</option>
|
||||
<option value="2">Warn</option>
|
||||
<option value="3">Info</option>
|
||||
<option value="4">Debug</option>
|
||||
<option value="5">Verbose</option>
|
||||
</select>
|
||||
<button type="button" class="btn btn-outline-secondary btn-sm"
|
||||
@click="readMasterLogLevel()"
|
||||
:disabled="busy || !state.uart_connected">
|
||||
Lesen
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary btn-sm"
|
||||
@click="setMasterLogLevel()"
|
||||
:disabled="busy || !state.uart_connected">
|
||||
Setzen
|
||||
</button>
|
||||
</div>
|
||||
<p class="text-muted small mt-2 mb-0" x-show="!state.uart_connected">
|
||||
UART nicht verbunden — Eingabe gesperrt.
|
||||
</p>
|
||||
@@ -627,6 +654,7 @@
|
||||
ws: null,
|
||||
wsConnected: false,
|
||||
masterDz: 100,
|
||||
masterLogLevel: 0,
|
||||
allDz: 100,
|
||||
allTapSingle: false,
|
||||
allTapDouble: false,
|
||||
@@ -766,6 +794,11 @@
|
||||
if (data.samples?.length) this.applyBatterySamples(data.samples);
|
||||
} catch (_) {}
|
||||
},
|
||||
formatLogLevel(level) {
|
||||
const labels = ['None', 'Error', 'Warn', 'Info', 'Debug', 'Verbose'];
|
||||
if (level == null || level < 0 || level > 5) return '—';
|
||||
return `${labels[level]} (${level})`;
|
||||
},
|
||||
formatMac(hex) {
|
||||
if (!hex || hex.length !== 12) return hex || '';
|
||||
return hex.match(/.{2}/g).join(':');
|
||||
@@ -1104,6 +1137,44 @@
|
||||
async setMasterDeadzone() {
|
||||
await this.setDeadzone(0, this.masterDz);
|
||||
},
|
||||
async readMasterLogLevel() {
|
||||
this.busy = true;
|
||||
try {
|
||||
const r = await fetch('/api/log-level');
|
||||
const data = await r.json();
|
||||
if (!r.ok || !data.success) {
|
||||
this.flash(data.error || 'Log-Level lesen fehlgeschlagen', false);
|
||||
return;
|
||||
}
|
||||
this.masterLogLevel = data.level;
|
||||
this.flash(`Master: Log-Level ${this.formatLogLevel(data.level)}`, true);
|
||||
} catch (e) {
|
||||
this.flash(String(e), false);
|
||||
} finally {
|
||||
this.busy = false;
|
||||
}
|
||||
},
|
||||
async setMasterLogLevel() {
|
||||
this.busy = true;
|
||||
try {
|
||||
const r = await fetch('/api/log-level', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ write: true, level: this.masterLogLevel })
|
||||
});
|
||||
const data = await r.json();
|
||||
if (!r.ok || !data.success) {
|
||||
this.flash(data.error || 'Log-Level setzen fehlgeschlagen', false);
|
||||
return;
|
||||
}
|
||||
this.masterLogLevel = data.level;
|
||||
this.flash(`Master: Log-Level ${this.formatLogLevel(data.level)} gesetzt`, true);
|
||||
} catch (e) {
|
||||
this.flash(String(e), false);
|
||||
} finally {
|
||||
this.busy = false;
|
||||
}
|
||||
},
|
||||
patchLiveStream(enabled) {
|
||||
let clients = this.state.clients || [];
|
||||
if (!enabled) {
|
||||
|
||||
Reference in New Issue
Block a user