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:
@@ -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() }
|
||||
|
||||
Reference in New Issue
Block a user