pairing

package
v0.0.0-...-3e1ade8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventAdd    = EventType(0)
	EventRemove = EventType(1)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BroadcastMessage

type BroadcastMessage struct {
	// contains filtered or unexported fields
}

BroadcastMessage represents a broadcast message sent by a Robomaster S1. Currently it only handles pairing messages (although, so far, no other types of broadcast messages have been observed).

func ParseBroadcastMessageData

func ParseBroadcastMessageData(data []byte) (*BroadcastMessage, error)

ParseBroadcastMessageData parses the given data as a BroadcastMessage. It return the associated BroadcastMessage instance pointer and a nil error on success and a nil and a non-nil error on failure.

func (*BroadcastMessage) AppId

func (b *BroadcastMessage) AppId() uint64

func (*BroadcastMessage) IsPairing

func (b *BroadcastMessage) IsPairing() bool

func (*BroadcastMessage) SourceIp

func (b *BroadcastMessage) SourceIp() net.IP

func (*BroadcastMessage) SourceMac

func (b *BroadcastMessage) SourceMac() net.HardwareAddr

func (*BroadcastMessage) String

func (b *BroadcastMessage) String() string

type Event

type Event struct {
	// contains filtered or unexported fields
}

func NewEvent

func NewEvent(typ EventType, ip net.IP,
	hardwareAddr net.HardwareAddr) *Event

func (*Event) HardwareAddr

func (p *Event) HardwareAddr() net.HardwareAddr

func (*Event) IP

func (p *Event) IP() net.IP

func (*Event) Type

func (p *Event) Type() EventType

type EventType

type EventType int

type Listener

type Listener struct {
	// contains filtered or unexported fields
}

func NewListener

func NewListener(appId uint64) *Listener

func (*Listener) SendACK

func (l *Listener) SendACK(ip net.IP) error

func (*Listener) Start

func (l *Listener) Start() (<-chan *Event, error)

func (*Listener) Stop

func (l *Listener) Stop() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL