This commit is contained in:
2026-01-09 23:55:14 +01:00
16 changed files with 1514 additions and 0 deletions

View File

@@ -8,6 +8,8 @@ import (
"strings"
"sync"
"time"
. "git.rouggy.com/rouggy/ShackMaster/internal/devices"
)
type Client struct {
@@ -149,7 +151,18 @@ func (c *Client) sendCommand(cmd string) error {
return fmt.Errorf("not connected")
}
<<<<<<< HEAD
_, err := c.conn.Write([]byte(cmd))
=======
// Get next command ID from global counter
cmdID := GetGlobalCommandID().GetNextID()
// Format command with ID: C<id>|<command>
fullCmd := fmt.Sprintf("C%d%s", cmdID, cmd)
// Send command
_, err := c.conn.Write([]byte(fullCmd))
>>>>>>> 4ab192418e21065c68d59777493ea03b76c061e7
if err != nil {
c.conn = nil
c.reader = nil