Skip to content

Commit

Permalink
Fix Roborock support
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Mar 21, 2023
1 parent cca4f05 commit 3002d5f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/roborock/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ func (c *Client) Connect() error {
_ = c.SendICEtoRobot(msg.ToJSON().Candidate, "0")
}
case pion.PeerConnectionState:
if msg == pion.PeerConnectionStateConnecting {
return
}
// unblocking write to channel
select {
case connected <- msg == pion.PeerConnectionStateConnected:
Expand All @@ -131,8 +134,9 @@ func (c *Client) Connect() error {
return err
}

log.Printf("[roborock] offer\n%s", pc.LocalDescription().SDP)
if err = c.SendSDPtoRobot(pc.LocalDescription()); err != nil {
offer := pc.LocalDescription()
log.Printf("[roborock] offer\n%s", offer.SDP)
if err = c.SendSDPtoRobot(offer); err != nil {
return err
}

Expand Down

0 comments on commit 3002d5f

Please sign in to comment.