Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Broadcast ¶
type Broadcast struct {
// contains filtered or unexported fields
}
Broadcast represents a broadcast message sent by a Robomaster robot.
func ParseBroadcast ¶
ParseBroadcast parses the given data as a BroadcastMessage. It returns the associated BroadcastMessage instance pointer and a nil error on success and a nil BroadcastMessage and a non-nil error on failure.
func (*Broadcast) SourceMac ¶
func (b *Broadcast) SourceMac() net.HardwareAddr
type Finder ¶
type Finder struct {
// contains filtered or unexported fields
}
Finder provides an interface for finding a robot broadcasting its ip in the network.
func New ¶
New returns a new Finder instance. If appID is zero, consider any robots detected in the network regardless of their pairing status or appID. If appID is non-zero, returns only robots with the given appID and that are not in pairing mode.
func (*Finder) Find ¶
Find waits for a robot to broadcast its IP address in the network. It returns a non-nil error if no robot is found in the given timeout.
func (*Finder) SendACK ¶
SendACK sends an ACK message to the given IP address. This is used to acknowledge a pairing request.
func (*Finder) StartFinding ¶
StartFinding starts listening for Robomaster broadcast messages in the network. It returns a non-nil error if it is already looking for robots.
func (*Finder) StopFinding ¶
StopFinding stops listening for Robomaster broadcast messages in the network. It returns a non-nil error if it is not currently looking for robots.