Merge branch 'main' of https://git.rouggy.com/rouggy/ShackMaster
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user