serial

package
v0.0.0-...-928ff21 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OperationExecute = byte('#')
	OperationQuery   = byte('?')
	OperationMonitor = byte('~')

	TypeDevice = "DEVICE"
	GrafikEye  = "GRAFIKEYE"

	ButtonScene1 = "70"
	ButtonScene2 = "71"
	ButtonScene3 = "76"
	ButtonScene4 = "77"
	ButtonScene5 = "83"

	ButtonShade1 = "38"
	ButtonShade2 = "39"
	ButtonShade3 = "40"

	ActionPress   = "3"
	ActionRelease = "4"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type QSCommand

type QSCommand struct {
	Operation     byte
	Type          string
	IntegrationId string
	CommandFields []string // using string because field content types are variable
}

func (*QSCommand) Bytes

func (c *QSCommand) Bytes() []byte

type QSESession

type QSESession struct {
	SerialPort string
	BaudRate   int
	// contains filtered or unexported fields
}

func (*QSESession) NewSession

func (q *QSESession) NewSession() error

func (*QSESession) PressButton

func (q *QSESession) PressButton(button string) error

func (*QSESession) Send

func (q *QSESession) Send(cmd QSCommand) error

func (*QSESession) StartMonitor

func (q *QSESession) StartMonitor(callback func(command QSCommand)) error

StartMonitor begins reading the serial connection. When a complete QSE message is found, it calls the provided function. TODO: add cancel channel to break out of monitor loop TODO: handle closing session

Jump to

Keyboard shortcuts

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