rx

package
v0.0.0-...-be5c388 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2017 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	RX_CMD_BIND        byte = 1
	RX_CMD_CANCLE_BIND byte = 2
	RX_CMD_CLEAR       byte = 3
	RX_CMD_CLEAR_ALL   byte = 4
)
View Source
const (
	RX_RESP_TURN_OFF    byte = 0
	RX_RESP_DIM_DOWN    byte = 1
	RX_RESP_TURN_ON     byte = 2
	RX_RESP_DIM_UP      byte = 3
	RX_RESP_TURN_CHANGE byte = 4
	RX_RESP_DIM_CHANGE  byte = 5
	RX_RESP_DIM_SET     byte = 6
	RX_RESP_SCENE_RUN   byte = 7
	RX_RESP_SCENE_SAVE  byte = 8
	RX_RESP_CLEAR_ADDR  byte = 9
	RX_RESP_DIM_STOP    byte = 10
	RX_RESP_WANT_BIND   byte = 15
	RX_RESP_RAINBOW     byte = 16
	RX_RESP_SET_COLOR   byte = 17
	RX_RESP_WORK_MODE   byte = 18
	RX_RESP_WORK_SPEED  byte = 19
	RX_RESP_LOW_BATERY  byte = 20
	RX_RESP_SENSE_INFO  byte = 21
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Type    byte
	Channel byte
}

func (Command) Data

func (this Command) Data(buf []byte) (data []byte)

type Response

type Response []byte

func (Response) Channel

func (this Response) Channel() uint8

response channel (0-63)

func (Response) Command

func (this Response) Command() byte

response command type

func (Response) Data

func (this Response) Data() []byte

response data

func (Response) DataLen

func (this Response) DataLen() int

length of data in response

func (Response) Empty

func (this Response) Empty() bool

func (Response) NewResponse

func (this Response) NewResponse(prevTogl byte) (is_new bool, togl byte)

check if new response received

func (Response) Togl

func (this Response) Togl() byte

togl value for new response mark

type RxEngine

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

func NewRxEngine

func NewRxEngine() (*RxEngine, error)

func (*RxEngine) Close

func (this *RxEngine) Close()

func (*RxEngine) Error

func (this *RxEngine) Error() error

func (*RxEngine) Exit

func (this *RxEngine) Exit()

func (*RxEngine) Open

func (this *RxEngine) Open() error

func (*RxEngine) Read

func (this *RxEngine) Read(timeout time.Duration) (Response, error)

func (*RxEngine) Write

func (this *RxEngine) Write(c Command) error

Jump to

Keyboard shortcuts

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