Add UART LED_RING command for progress bar, digits, and clear.
Stop the main-loop digit demo so host-driven display persists; expose clear/progress/digit modes with RGB and intensity via protobuf and goTool. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -29,6 +29,7 @@ go run . -port /dev/ttyUSB0 clients
|
||||
| `serve` | — | Web dashboard at `http://localhost:8080` (WebSocket live updates) |
|
||||
| `ota` | 16–19 | UART firmware upload to master; firmware then pushes to slaves via ESP-NOW |
|
||||
| `ota-progress` | 21 | Query per-slave ESP-NOW OTA progress on the master (`-client N`, default all) |
|
||||
| `led-ring` | 8 | LED ring: `-mode clear\|progress\|digit`, `-progress`, `-digit`, RGB, `-intensity` |
|
||||
|
||||
`clients` requires slaves to have responded to master discover broadcasts first.
|
||||
|
||||
|
||||
@@ -172,6 +172,33 @@ func (s *serialPort) espnowUnicastTest(clientID, seq uint32) (*pb.EspNowUnicastT
|
||||
return r, nil
|
||||
}
|
||||
|
||||
func (s *serialPort) ledRingProgress(req *pb.LedRingProgressRequest) (*pb.LedRingProgressResponse, error) {
|
||||
msg := &pb.UartMessage{
|
||||
Type: pb.MessageType_LED_RING,
|
||||
Payload: &pb.UartMessage_LedRingProgressRequest{
|
||||
LedRingProgressRequest: req,
|
||||
},
|
||||
}
|
||||
body, err := proto.Marshal(msg)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("encode: %w", err)
|
||||
}
|
||||
payload := append([]byte{byte(pb.MessageType_LED_RING)}, body...)
|
||||
respPayload, err := s.exchangePayload(payload, "LED_RING")
|
||||
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.GetLedRingProgressResponse()
|
||||
if r == nil {
|
||||
return nil, fmt.Errorf("missing led_ring_progress_response")
|
||||
}
|
||||
return r, nil
|
||||
}
|
||||
|
||||
func (s *serialPort) GetVersion() (*pb.VersionResponse, error) { return s.getVersion() }
|
||||
|
||||
func (s *serialPort) ListClients() ([]*pb.ClientInfo, error) { return s.listClients() }
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
|
||||
"powerpod/gotool/pb"
|
||||
)
|
||||
|
||||
const (
|
||||
ledRingModeClear = 0
|
||||
ledRingModeProgress = 1
|
||||
ledRingModeDigit = 2
|
||||
)
|
||||
|
||||
func runLedRing(sp *serialPort, args []string) error {
|
||||
fs := flag.NewFlagSet("led-ring", flag.ExitOnError)
|
||||
mode := fs.String("mode", "progress", "clear, progress, or digit")
|
||||
progress := fs.Uint("progress", 0, "fill level 0–100 (mode=progress)")
|
||||
digit := fs.Uint("digit", 0, "digit 0–10 (mode=digit)")
|
||||
r := fs.Uint("r", 0, "red 0–255")
|
||||
g := fs.Uint("g", 255, "green 0–255")
|
||||
b := fs.Uint("b", 0, "blue 0–255")
|
||||
intensity := fs.Uint("intensity", 255, "brightness 0–255")
|
||||
if err := fs.Parse(args); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var modeVal uint32
|
||||
switch *mode {
|
||||
case "clear":
|
||||
modeVal = ledRingModeClear
|
||||
case "progress":
|
||||
modeVal = ledRingModeProgress
|
||||
case "digit":
|
||||
modeVal = ledRingModeDigit
|
||||
default:
|
||||
return fmt.Errorf("unknown -mode %q (clear, progress, digit)", *mode)
|
||||
}
|
||||
|
||||
resp, err := sp.ledRingProgress(&pb.LedRingProgressRequest{
|
||||
Mode: modeVal,
|
||||
Progress: uint32(*progress),
|
||||
Digit: uint32(*digit),
|
||||
R: uint32(*r),
|
||||
G: uint32(*g),
|
||||
B: uint32(*b),
|
||||
Intensity: uint32(*intensity),
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Printf("success=%v mode=%d progress=%d digit=%d\n",
|
||||
resp.GetSuccess(), resp.GetMode(), resp.GetProgress(), resp.GetDigit())
|
||||
return nil
|
||||
}
|
||||
+5
-2
@@ -20,7 +20,8 @@ func usage() {
|
||||
fmt.Fprintf(os.Stderr, " test run automated scenario (see testdata/)\n")
|
||||
fmt.Fprintf(os.Stderr, " serve web dashboard (Bootstrap + WebSocket)\n")
|
||||
fmt.Fprintf(os.Stderr, " ota UART OTA upload (A/B partitions)\n")
|
||||
fmt.Fprintf(os.Stderr, " ota-progress query per-slave ESP-NOW OTA progress on master\n\n")
|
||||
fmt.Fprintf(os.Stderr, " ota-progress query per-slave ESP-NOW OTA progress on master\n")
|
||||
fmt.Fprintf(os.Stderr, " led-ring set LED ring progress bar (0–100%%, rgb, intensity)\n\n")
|
||||
flag.PrintDefaults()
|
||||
}
|
||||
|
||||
@@ -47,7 +48,7 @@ func main() {
|
||||
os.Exit(2)
|
||||
}
|
||||
runErr = runServe(*portName, *baud, flag.Args()[1:])
|
||||
case "version", "clients", "client-info", "deadzone", "accel-deadzone", "unicast-test", "unicast_test", "ota", "ota-progress", "ota_progress":
|
||||
case "version", "clients", "client-info", "deadzone", "accel-deadzone", "unicast-test", "unicast_test", "led-ring", "led_ring", "ota", "ota-progress", "ota_progress":
|
||||
if *portName == "" {
|
||||
fmt.Fprintf(os.Stderr, "command %q requires -port\n\n", cmd)
|
||||
usage()
|
||||
@@ -67,6 +68,8 @@ func main() {
|
||||
runErr = runDeadzone(sp, flag.Args()[1:])
|
||||
case "unicast-test", "unicast_test":
|
||||
runErr = runUnicastTest(sp, flag.Args()[1:])
|
||||
case "led-ring", "led_ring":
|
||||
runErr = runLedRing(sp, flag.Args()[1:])
|
||||
case "ota":
|
||||
runErr = runOTA(sp, flag.Args()[1:])
|
||||
case "ota-progress", "ota_progress":
|
||||
|
||||
+272
-49
@@ -32,6 +32,7 @@ const (
|
||||
MessageType_CLIENT_INPUT MessageType = 5
|
||||
MessageType_ACCEL_DEADZONE MessageType = 6
|
||||
MessageType_ESPNOW_UNICAST_TEST MessageType = 7
|
||||
MessageType_LED_RING MessageType = 8
|
||||
MessageType_OTA_START MessageType = 16
|
||||
MessageType_OTA_PAYLOAD MessageType = 17
|
||||
MessageType_OTA_END MessageType = 18
|
||||
@@ -51,6 +52,7 @@ var (
|
||||
5: "CLIENT_INPUT",
|
||||
6: "ACCEL_DEADZONE",
|
||||
7: "ESPNOW_UNICAST_TEST",
|
||||
8: "LED_RING",
|
||||
16: "OTA_START",
|
||||
17: "OTA_PAYLOAD",
|
||||
18: "OTA_END",
|
||||
@@ -67,6 +69,7 @@ var (
|
||||
"CLIENT_INPUT": 5,
|
||||
"ACCEL_DEADZONE": 6,
|
||||
"ESPNOW_UNICAST_TEST": 7,
|
||||
"LED_RING": 8,
|
||||
"OTA_START": 16,
|
||||
"OTA_PAYLOAD": 17,
|
||||
"OTA_END": 18,
|
||||
@@ -123,6 +126,8 @@ type UartMessage struct {
|
||||
// *UartMessage_EspnowUnicastTestResponse
|
||||
// *UartMessage_OtaSlaveProgressRequest
|
||||
// *UartMessage_OtaSlaveProgressResponse
|
||||
// *UartMessage_LedRingProgressRequest
|
||||
// *UartMessage_LedRingProgressResponse
|
||||
Payload isUartMessage_Payload `protobuf_oneof:"payload"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
@@ -307,6 +312,24 @@ func (x *UartMessage) GetOtaSlaveProgressResponse() *OtaSlaveProgressResponse {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *UartMessage) GetLedRingProgressRequest() *LedRingProgressRequest {
|
||||
if x != nil {
|
||||
if x, ok := x.Payload.(*UartMessage_LedRingProgressRequest); ok {
|
||||
return x.LedRingProgressRequest
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *UartMessage) GetLedRingProgressResponse() *LedRingProgressResponse {
|
||||
if x != nil {
|
||||
if x, ok := x.Payload.(*UartMessage_LedRingProgressResponse); ok {
|
||||
return x.LedRingProgressResponse
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type isUartMessage_Payload interface {
|
||||
isUartMessage_Payload()
|
||||
}
|
||||
@@ -371,6 +394,14 @@ type UartMessage_OtaSlaveProgressResponse struct {
|
||||
OtaSlaveProgressResponse *OtaSlaveProgressResponse `protobuf:"bytes,16,opt,name=ota_slave_progress_response,json=otaSlaveProgressResponse,proto3,oneof"`
|
||||
}
|
||||
|
||||
type UartMessage_LedRingProgressRequest struct {
|
||||
LedRingProgressRequest *LedRingProgressRequest `protobuf:"bytes,17,opt,name=led_ring_progress_request,json=ledRingProgressRequest,proto3,oneof"`
|
||||
}
|
||||
|
||||
type UartMessage_LedRingProgressResponse struct {
|
||||
LedRingProgressResponse *LedRingProgressResponse `protobuf:"bytes,18,opt,name=led_ring_progress_response,json=ledRingProgressResponse,proto3,oneof"`
|
||||
}
|
||||
|
||||
func (*UartMessage_AckPayload) isUartMessage_Payload() {}
|
||||
|
||||
func (*UartMessage_EchoPayload) isUartMessage_Payload() {}
|
||||
@@ -401,6 +432,10 @@ func (*UartMessage_OtaSlaveProgressRequest) isUartMessage_Payload() {}
|
||||
|
||||
func (*UartMessage_OtaSlaveProgressResponse) isUartMessage_Payload() {}
|
||||
|
||||
func (*UartMessage_LedRingProgressRequest) isUartMessage_Payload() {}
|
||||
|
||||
func (*UartMessage_LedRingProgressResponse) isUartMessage_Payload() {}
|
||||
|
||||
type Ack struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
@@ -1033,6 +1068,171 @@ func (x *EspNowUnicastTestResponse) GetSeq() uint32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Host → device: LED ring display (progress bar, digit, or clear).
|
||||
// mode: 0=clear, 1=progress (0–100 %), 2=digit (0–10, same layout as firmware digit maps).
|
||||
type LedRingProgressRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Mode uint32 `protobuf:"varint,1,opt,name=mode,proto3" json:"mode,omitempty"`
|
||||
// * 0–100: fraction of ring LEDs to light (mode=progress)
|
||||
Progress uint32 `protobuf:"varint,2,opt,name=progress,proto3" json:"progress,omitempty"`
|
||||
// * 0–10 (mode=digit)
|
||||
Digit uint32 `protobuf:"varint,3,opt,name=digit,proto3" json:"digit,omitempty"`
|
||||
R uint32 `protobuf:"varint,4,opt,name=r,proto3" json:"r,omitempty"`
|
||||
G uint32 `protobuf:"varint,5,opt,name=g,proto3" json:"g,omitempty"`
|
||||
B uint32 `protobuf:"varint,6,opt,name=b,proto3" json:"b,omitempty"`
|
||||
// * 0–255 brightness scale applied to r/g/b
|
||||
Intensity uint32 `protobuf:"varint,7,opt,name=intensity,proto3" json:"intensity,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *LedRingProgressRequest) Reset() {
|
||||
*x = LedRingProgressRequest{}
|
||||
mi := &file_uart_messages_proto_msgTypes[12]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *LedRingProgressRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*LedRingProgressRequest) ProtoMessage() {}
|
||||
|
||||
func (x *LedRingProgressRequest) 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 LedRingProgressRequest.ProtoReflect.Descriptor instead.
|
||||
func (*LedRingProgressRequest) Descriptor() ([]byte, []int) {
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{12}
|
||||
}
|
||||
|
||||
func (x *LedRingProgressRequest) GetMode() uint32 {
|
||||
if x != nil {
|
||||
return x.Mode
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *LedRingProgressRequest) GetProgress() uint32 {
|
||||
if x != nil {
|
||||
return x.Progress
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *LedRingProgressRequest) GetDigit() uint32 {
|
||||
if x != nil {
|
||||
return x.Digit
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *LedRingProgressRequest) GetR() uint32 {
|
||||
if x != nil {
|
||||
return x.R
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *LedRingProgressRequest) GetG() uint32 {
|
||||
if x != nil {
|
||||
return x.G
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *LedRingProgressRequest) GetB() uint32 {
|
||||
if x != nil {
|
||||
return x.B
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *LedRingProgressRequest) GetIntensity() uint32 {
|
||||
if x != nil {
|
||||
return x.Intensity
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type LedRingProgressResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
|
||||
Mode uint32 `protobuf:"varint,2,opt,name=mode,proto3" json:"mode,omitempty"`
|
||||
Progress uint32 `protobuf:"varint,3,opt,name=progress,proto3" json:"progress,omitempty"`
|
||||
Digit uint32 `protobuf:"varint,4,opt,name=digit,proto3" json:"digit,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *LedRingProgressResponse) Reset() {
|
||||
*x = LedRingProgressResponse{}
|
||||
mi := &file_uart_messages_proto_msgTypes[13]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *LedRingProgressResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*LedRingProgressResponse) ProtoMessage() {}
|
||||
|
||||
func (x *LedRingProgressResponse) 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 LedRingProgressResponse.ProtoReflect.Descriptor instead.
|
||||
func (*LedRingProgressResponse) Descriptor() ([]byte, []int) {
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{13}
|
||||
}
|
||||
|
||||
func (x *LedRingProgressResponse) GetSuccess() bool {
|
||||
if x != nil {
|
||||
return x.Success
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *LedRingProgressResponse) GetMode() uint32 {
|
||||
if x != nil {
|
||||
return x.Mode
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *LedRingProgressResponse) GetProgress() uint32 {
|
||||
if x != nil {
|
||||
return x.Progress
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *LedRingProgressResponse) GetDigit() uint32 {
|
||||
if x != nil {
|
||||
return x.Digit
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// Host → device: begin UART OTA (erase inactive OTA slot; device replies OTA_STATUS).
|
||||
type OtaStartPayload struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
@@ -1043,7 +1243,7 @@ type OtaStartPayload struct {
|
||||
|
||||
func (x *OtaStartPayload) Reset() {
|
||||
*x = OtaStartPayload{}
|
||||
mi := &file_uart_messages_proto_msgTypes[12]
|
||||
mi := &file_uart_messages_proto_msgTypes[14]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -1055,7 +1255,7 @@ func (x *OtaStartPayload) String() string {
|
||||
func (*OtaStartPayload) ProtoMessage() {}
|
||||
|
||||
func (x *OtaStartPayload) 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 {
|
||||
@@ -1068,7 +1268,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{12}
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{14}
|
||||
}
|
||||
|
||||
func (x *OtaStartPayload) GetTotalSize() uint32 {
|
||||
@@ -1089,7 +1289,7 @@ type OtaPayload struct {
|
||||
|
||||
func (x *OtaPayload) Reset() {
|
||||
*x = OtaPayload{}
|
||||
mi := &file_uart_messages_proto_msgTypes[13]
|
||||
mi := &file_uart_messages_proto_msgTypes[15]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -1101,7 +1301,7 @@ func (x *OtaPayload) String() string {
|
||||
func (*OtaPayload) ProtoMessage() {}
|
||||
|
||||
func (x *OtaPayload) 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 {
|
||||
@@ -1114,7 +1314,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{13}
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{15}
|
||||
}
|
||||
|
||||
func (x *OtaPayload) GetSeq() uint32 {
|
||||
@@ -1140,7 +1340,7 @@ type OtaEndPayload struct {
|
||||
|
||||
func (x *OtaEndPayload) Reset() {
|
||||
*x = OtaEndPayload{}
|
||||
mi := &file_uart_messages_proto_msgTypes[14]
|
||||
mi := &file_uart_messages_proto_msgTypes[16]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -1152,7 +1352,7 @@ func (x *OtaEndPayload) String() string {
|
||||
func (*OtaEndPayload) ProtoMessage() {}
|
||||
|
||||
func (x *OtaEndPayload) 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 {
|
||||
@@ -1165,7 +1365,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{14}
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{16}
|
||||
}
|
||||
|
||||
// Device → host status (also used as ACK after each 4 KiB written).
|
||||
@@ -1182,7 +1382,7 @@ type OtaStatusPayload struct {
|
||||
|
||||
func (x *OtaStatusPayload) Reset() {
|
||||
*x = OtaStatusPayload{}
|
||||
mi := &file_uart_messages_proto_msgTypes[15]
|
||||
mi := &file_uart_messages_proto_msgTypes[17]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -1194,7 +1394,7 @@ func (x *OtaStatusPayload) String() string {
|
||||
func (*OtaStatusPayload) ProtoMessage() {}
|
||||
|
||||
func (x *OtaStatusPayload) 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 {
|
||||
@@ -1207,7 +1407,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{15}
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{17}
|
||||
}
|
||||
|
||||
func (x *OtaStatusPayload) GetStatus() uint32 {
|
||||
@@ -1248,7 +1448,7 @@ type OtaSlaveProgressRequest struct {
|
||||
|
||||
func (x *OtaSlaveProgressRequest) Reset() {
|
||||
*x = OtaSlaveProgressRequest{}
|
||||
mi := &file_uart_messages_proto_msgTypes[16]
|
||||
mi := &file_uart_messages_proto_msgTypes[18]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -1260,7 +1460,7 @@ func (x *OtaSlaveProgressRequest) String() string {
|
||||
func (*OtaSlaveProgressRequest) ProtoMessage() {}
|
||||
|
||||
func (x *OtaSlaveProgressRequest) 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 {
|
||||
@@ -1273,7 +1473,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{16}
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{18}
|
||||
}
|
||||
|
||||
func (x *OtaSlaveProgressRequest) GetClientId() uint32 {
|
||||
@@ -1297,7 +1497,7 @@ type OtaSlaveProgressEntry struct {
|
||||
|
||||
func (x *OtaSlaveProgressEntry) Reset() {
|
||||
*x = OtaSlaveProgressEntry{}
|
||||
mi := &file_uart_messages_proto_msgTypes[17]
|
||||
mi := &file_uart_messages_proto_msgTypes[19]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -1309,7 +1509,7 @@ func (x *OtaSlaveProgressEntry) String() string {
|
||||
func (*OtaSlaveProgressEntry) ProtoMessage() {}
|
||||
|
||||
func (x *OtaSlaveProgressEntry) 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 {
|
||||
@@ -1322,7 +1522,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{17}
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{19}
|
||||
}
|
||||
|
||||
func (x *OtaSlaveProgressEntry) GetClientId() uint32 {
|
||||
@@ -1373,7 +1573,7 @@ type OtaSlaveProgressResponse struct {
|
||||
|
||||
func (x *OtaSlaveProgressResponse) Reset() {
|
||||
*x = OtaSlaveProgressResponse{}
|
||||
mi := &file_uart_messages_proto_msgTypes[18]
|
||||
mi := &file_uart_messages_proto_msgTypes[20]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -1385,7 +1585,7 @@ func (x *OtaSlaveProgressResponse) String() string {
|
||||
func (*OtaSlaveProgressResponse) ProtoMessage() {}
|
||||
|
||||
func (x *OtaSlaveProgressResponse) 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 {
|
||||
@@ -1398,7 +1598,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{18}
|
||||
return file_uart_messages_proto_rawDescGZIP(), []int{20}
|
||||
}
|
||||
|
||||
func (x *OtaSlaveProgressResponse) GetActive() bool {
|
||||
@@ -1440,7 +1640,8 @@ var File_uart_messages_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_uart_messages_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\x13uart_messages.proto\x12\x04alox\x1a\fnanopb.proto\"\x8b\t\n" +
|
||||
"\x13uart_messages.proto\x12\x04alox\x1a\fnanopb.proto\"\xc4\n" +
|
||||
"\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" +
|
||||
@@ -1461,7 +1662,9 @@ const file_uart_messages_proto_rawDesc = "" +
|
||||
"\x1bespnow_unicast_test_request\x18\r \x01(\v2\x1e.alox.EspNowUnicastTestRequestH\x00R\x18espnowUnicastTestRequest\x12b\n" +
|
||||
"\x1cespnow_unicast_test_response\x18\x0e \x01(\v2\x1f.alox.EspNowUnicastTestResponseH\x00R\x19espnowUnicastTestResponse\x12\\\n" +
|
||||
"\x1aota_slave_progress_request\x18\x0f \x01(\v2\x1d.alox.OtaSlaveProgressRequestH\x00R\x17otaSlaveProgressRequest\x12_\n" +
|
||||
"\x1bota_slave_progress_response\x18\x10 \x01(\v2\x1e.alox.OtaSlaveProgressResponseH\x00R\x18otaSlaveProgressResponseB\t\n" +
|
||||
"\x1bota_slave_progress_response\x18\x10 \x01(\v2\x1e.alox.OtaSlaveProgressResponseH\x00R\x18otaSlaveProgressResponse\x12Y\n" +
|
||||
"\x19led_ring_progress_request\x18\x11 \x01(\v2\x1c.alox.LedRingProgressRequestH\x00R\x16ledRingProgressRequest\x12\\\n" +
|
||||
"\x1aled_ring_progress_response\x18\x12 \x01(\v2\x1d.alox.LedRingProgressResponseH\x00R\x17ledRingProgressResponseB\t\n" +
|
||||
"\apayload\"\x05\n" +
|
||||
"\x03Ack\"!\n" +
|
||||
"\vEchoPayload\x12\x12\n" +
|
||||
@@ -1504,7 +1707,20 @@ const file_uart_messages_proto_rawDesc = "" +
|
||||
"\x03seq\x18\x02 \x01(\rR\x03seq\"G\n" +
|
||||
"\x19EspNowUnicastTestResponse\x12\x18\n" +
|
||||
"\asuccess\x18\x01 \x01(\bR\asuccess\x12\x10\n" +
|
||||
"\x03seq\x18\x02 \x01(\rR\x03seq\"0\n" +
|
||||
"\x03seq\x18\x02 \x01(\rR\x03seq\"\xa6\x01\n" +
|
||||
"\x16LedRingProgressRequest\x12\x12\n" +
|
||||
"\x04mode\x18\x01 \x01(\rR\x04mode\x12\x1a\n" +
|
||||
"\bprogress\x18\x02 \x01(\rR\bprogress\x12\x14\n" +
|
||||
"\x05digit\x18\x03 \x01(\rR\x05digit\x12\f\n" +
|
||||
"\x01r\x18\x04 \x01(\rR\x01r\x12\f\n" +
|
||||
"\x01g\x18\x05 \x01(\rR\x01g\x12\f\n" +
|
||||
"\x01b\x18\x06 \x01(\rR\x01b\x12\x1c\n" +
|
||||
"\tintensity\x18\a \x01(\rR\tintensity\"y\n" +
|
||||
"\x17LedRingProgressResponse\x12\x18\n" +
|
||||
"\asuccess\x18\x01 \x01(\bR\asuccess\x12\x12\n" +
|
||||
"\x04mode\x18\x02 \x01(\rR\x04mode\x12\x1a\n" +
|
||||
"\bprogress\x18\x03 \x01(\rR\bprogress\x12\x14\n" +
|
||||
"\x05digit\x18\x04 \x01(\rR\x05digit\"0\n" +
|
||||
"\x0fOtaStartPayload\x12\x1d\n" +
|
||||
"\n" +
|
||||
"total_size\x18\x01 \x01(\rR\ttotalSize\":\n" +
|
||||
@@ -1535,7 +1751,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*\xf5\x01\n" +
|
||||
"\x06slaves\x18\x05 \x03(\v2\x1b.alox.OtaSlaveProgressEntryB\x05\x92?\x02\x10\x10R\x06slaves*\x83\x02\n" +
|
||||
"\vMessageType\x12\v\n" +
|
||||
"\aUNKNOWN\x10\x00\x12\a\n" +
|
||||
"\x03ACK\x10\x01\x12\b\n" +
|
||||
@@ -1544,7 +1760,8 @@ const file_uart_messages_proto_rawDesc = "" +
|
||||
"\vCLIENT_INFO\x10\x04\x12\x10\n" +
|
||||
"\fCLIENT_INPUT\x10\x05\x12\x12\n" +
|
||||
"\x0eACCEL_DEADZONE\x10\x06\x12\x17\n" +
|
||||
"\x13ESPNOW_UNICAST_TEST\x10\a\x12\r\n" +
|
||||
"\x13ESPNOW_UNICAST_TEST\x10\a\x12\f\n" +
|
||||
"\bLED_RING\x10\b\x12\r\n" +
|
||||
"\tOTA_START\x10\x10\x12\x0f\n" +
|
||||
"\vOTA_PAYLOAD\x10\x11\x12\v\n" +
|
||||
"\aOTA_END\x10\x12\x12\x0e\n" +
|
||||
@@ -1566,7 +1783,7 @@ func file_uart_messages_proto_rawDescGZIP() []byte {
|
||||
}
|
||||
|
||||
var file_uart_messages_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_uart_messages_proto_msgTypes = make([]protoimpl.MessageInfo, 19)
|
||||
var file_uart_messages_proto_msgTypes = make([]protoimpl.MessageInfo, 21)
|
||||
var file_uart_messages_proto_goTypes = []any{
|
||||
(MessageType)(0), // 0: alox.MessageType
|
||||
(*UartMessage)(nil), // 1: alox.UartMessage
|
||||
@@ -1581,13 +1798,15 @@ var file_uart_messages_proto_goTypes = []any{
|
||||
(*AccelDeadzoneResponse)(nil), // 10: alox.AccelDeadzoneResponse
|
||||
(*EspNowUnicastTestRequest)(nil), // 11: alox.EspNowUnicastTestRequest
|
||||
(*EspNowUnicastTestResponse)(nil), // 12: alox.EspNowUnicastTestResponse
|
||||
(*OtaStartPayload)(nil), // 13: alox.OtaStartPayload
|
||||
(*OtaPayload)(nil), // 14: alox.OtaPayload
|
||||
(*OtaEndPayload)(nil), // 15: alox.OtaEndPayload
|
||||
(*OtaStatusPayload)(nil), // 16: alox.OtaStatusPayload
|
||||
(*OtaSlaveProgressRequest)(nil), // 17: alox.OtaSlaveProgressRequest
|
||||
(*OtaSlaveProgressEntry)(nil), // 18: alox.OtaSlaveProgressEntry
|
||||
(*OtaSlaveProgressResponse)(nil), // 19: alox.OtaSlaveProgressResponse
|
||||
(*LedRingProgressRequest)(nil), // 13: alox.LedRingProgressRequest
|
||||
(*LedRingProgressResponse)(nil), // 14: alox.LedRingProgressResponse
|
||||
(*OtaStartPayload)(nil), // 15: alox.OtaStartPayload
|
||||
(*OtaPayload)(nil), // 16: alox.OtaPayload
|
||||
(*OtaEndPayload)(nil), // 17: alox.OtaEndPayload
|
||||
(*OtaStatusPayload)(nil), // 18: alox.OtaStatusPayload
|
||||
(*OtaSlaveProgressRequest)(nil), // 19: alox.OtaSlaveProgressRequest
|
||||
(*OtaSlaveProgressEntry)(nil), // 20: alox.OtaSlaveProgressEntry
|
||||
(*OtaSlaveProgressResponse)(nil), // 21: alox.OtaSlaveProgressResponse
|
||||
}
|
||||
var file_uart_messages_proto_depIdxs = []int32{
|
||||
0, // 0: alox.UartMessage.type:type_name -> alox.MessageType
|
||||
@@ -1596,24 +1815,26 @@ var file_uart_messages_proto_depIdxs = []int32{
|
||||
4, // 3: alox.UartMessage.version_response:type_name -> alox.VersionResponse
|
||||
6, // 4: alox.UartMessage.client_info_response:type_name -> alox.ClientInfoResponse
|
||||
8, // 5: alox.UartMessage.client_input_response:type_name -> alox.ClientInputResponse
|
||||
13, // 6: alox.UartMessage.ota_start:type_name -> alox.OtaStartPayload
|
||||
14, // 7: alox.UartMessage.ota_payload:type_name -> alox.OtaPayload
|
||||
15, // 8: alox.UartMessage.ota_end:type_name -> alox.OtaEndPayload
|
||||
16, // 9: alox.UartMessage.ota_status:type_name -> alox.OtaStatusPayload
|
||||
15, // 6: alox.UartMessage.ota_start:type_name -> alox.OtaStartPayload
|
||||
16, // 7: alox.UartMessage.ota_payload:type_name -> alox.OtaPayload
|
||||
17, // 8: alox.UartMessage.ota_end:type_name -> alox.OtaEndPayload
|
||||
18, // 9: alox.UartMessage.ota_status:type_name -> alox.OtaStatusPayload
|
||||
9, // 10: alox.UartMessage.accel_deadzone_request:type_name -> alox.AccelDeadzoneRequest
|
||||
10, // 11: alox.UartMessage.accel_deadzone_response:type_name -> alox.AccelDeadzoneResponse
|
||||
11, // 12: alox.UartMessage.espnow_unicast_test_request:type_name -> alox.EspNowUnicastTestRequest
|
||||
12, // 13: alox.UartMessage.espnow_unicast_test_response:type_name -> alox.EspNowUnicastTestResponse
|
||||
17, // 14: alox.UartMessage.ota_slave_progress_request:type_name -> alox.OtaSlaveProgressRequest
|
||||
19, // 15: alox.UartMessage.ota_slave_progress_response:type_name -> alox.OtaSlaveProgressResponse
|
||||
5, // 16: alox.ClientInfoResponse.clients:type_name -> alox.ClientInfo
|
||||
7, // 17: alox.ClientInputResponse.clients:type_name -> alox.ClientInput
|
||||
18, // 18: alox.OtaSlaveProgressResponse.slaves:type_name -> alox.OtaSlaveProgressEntry
|
||||
19, // [19:19] is the sub-list for method output_type
|
||||
19, // [19:19] is the sub-list for method input_type
|
||||
19, // [19:19] is the sub-list for extension type_name
|
||||
19, // [19:19] is the sub-list for extension extendee
|
||||
0, // [0:19] is the sub-list for field type_name
|
||||
19, // 14: alox.UartMessage.ota_slave_progress_request:type_name -> alox.OtaSlaveProgressRequest
|
||||
21, // 15: alox.UartMessage.ota_slave_progress_response:type_name -> alox.OtaSlaveProgressResponse
|
||||
13, // 16: alox.UartMessage.led_ring_progress_request:type_name -> alox.LedRingProgressRequest
|
||||
14, // 17: alox.UartMessage.led_ring_progress_response:type_name -> alox.LedRingProgressResponse
|
||||
5, // 18: alox.ClientInfoResponse.clients:type_name -> alox.ClientInfo
|
||||
7, // 19: alox.ClientInputResponse.clients:type_name -> alox.ClientInput
|
||||
20, // 20: alox.OtaSlaveProgressResponse.slaves:type_name -> alox.OtaSlaveProgressEntry
|
||||
21, // [21:21] is the sub-list for method output_type
|
||||
21, // [21:21] is the sub-list for method input_type
|
||||
21, // [21:21] is the sub-list for extension type_name
|
||||
21, // [21:21] is the sub-list for extension extendee
|
||||
0, // [0:21] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_uart_messages_proto_init() }
|
||||
@@ -1637,6 +1858,8 @@ func file_uart_messages_proto_init() {
|
||||
(*UartMessage_EspnowUnicastTestResponse)(nil),
|
||||
(*UartMessage_OtaSlaveProgressRequest)(nil),
|
||||
(*UartMessage_OtaSlaveProgressResponse)(nil),
|
||||
(*UartMessage_LedRingProgressRequest)(nil),
|
||||
(*UartMessage_LedRingProgressResponse)(nil),
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
@@ -1644,7 +1867,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: 1,
|
||||
NumMessages: 19,
|
||||
NumMessages: 21,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user