unity

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: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTypeSetValue           = EventType(0)
	EventTypeGetValue           = EventType(1)
	EventTypeGetAvailableValue  = EventType(2)
	EventTypePerformAction      = EventType(3)
	EventTypeStartListening     = EventType(4)
	EventTypeStopListening      = EventType(5)
	EventTypeActivation         = EventType(6)
	EventTypeLocalAlbum         = EventType(7)
	EventTypeFirmwareUpgrade    = EventType(8)
	EventTypeConnection         = EventType(100)
	EventTypeSecurity           = EventType(101)
	EventTypePrintLog           = EventType(200)
	EventTypeStartVideo         = EventType(300)
	EventTypeStopVideo          = EventType(301)
	EventTypeRender             = EventType(302)
	EventTypeGetNativeTexture   = EventType(303)
	EventTypeVideoTransferSpeed = EventType(304)
	EventTypeAudioDataRecv      = EventType(305)
	EventTypeVideoDataRecv      = EventType(306)
	EventTypeNativeFunctions    = EventType(500)
)

Variables

This section is empty.

Functions

func EventTypeName

func EventTypeName(eventType EventType) string

EventTypeName returns the name associated with the given EventType. If it is not known, returns an empty string.

func IsValidEventType

func IsValidEventType(eventType EventType) bool

IsValidEventType checks if the given EventType is valid. It returns true if it is and false oherwise.

Types

type Event

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

Event represents a Unity Event used for communication with the Robomaster S1.

func NewEvent

func NewEvent(typ EventType) *Event

NewEvent creates a new Event with the given type and 0 as subtype. Returns a pointer to the created Event on success or nil on failure (usually if the specific event type is unknown).

func NewEventFromCode

func NewEventFromCode(code uint64) *Event

NewEventFromCode creates a new Event by parsing the given code. Returns a pointer to the created Event on success or nil on failure (usually if the parsed event type is unknown).

func NewEventWithSubType

func NewEventWithSubType(typ EventType, subTyp uint64) *Event

NewEventWithSubType creates a new Event with the given type and subtype. Returns a pointer to the created Event on success or nil on failure (usually if the specific event type is unknown).

func (*Event) Code

func (e *Event) Code() uint64

Code returns the uint64 code associated with this Event.

func (*Event) Reset

func (e *Event) Reset(typ EventType, subTyp uint64)

Reset resets this Event to have the given type and subtype.

func (*Event) ResetSubType

func (e *Event) ResetSubType(subTyp uint64)

/ ResetSubType resets this event to have the given subtype.

func (*Event) String

func (e *Event) String() string

String returns this Event as a formated string. This implements the fmt.Stringer interface.

func (*Event) SubType

func (e *Event) SubType() uint64

SubType returns the subtype associated with this event.

func (*Event) Type

func (e *Event) Type() EventType

Type returns the type associated with this event.

type EventType

type EventType uint64

EventType represents the specific type of a Unit Event.

func AllEventTypes

func AllEventTypes() []EventType

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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