devices

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyTestConnection = 0x00

	Key1     = 0x01
	Key2     = 0x02
	Key3     = 0x03
	KeyUp    = 0x04
	KeyDown  = 0x05
	KeyLeft  = 0x06
	KeyRight = 0x07
	KeyOk    = 0x08
)

key selection bit

View Source
const (
	KeyActionRequireTest  = 0x00
	KeyActionConnectionOk = 0x01

	KeyActionPress   = 0x01
	KeyActionRelease = 0x02
)

key action bit

View Source
const DeviceSpecialProtocol = 0x00
View Source
const ProtocolHead = 0x01

Variables

View Source
var EnableRead bool
View Source
var EnableReadMtx sync.Mutex
View Source
var TestConnectionSend = []byte{ProtocolHead, DeviceSpecialProtocol, KeyTestConnection, KeyActionRequireTest, 0x00, 0x00, 0x00, 0x00}

Functions

func ConnectSerial

func ConnectSerial(path string) error

ConnectSerial connects to the serial port

func GetDevices added in v1.0.0

func GetDevices() []int

GetDevices 获取在线设备列表

func GetPortList

func GetPortList() ([]string, error)

GetPortList returns a list of available serial ports

func RealtimeRead

func RealtimeRead()

func SetKey added in v1.0.0

func SetKey(device, key int, target string)

func TestConnection

func TestConnection() error

TestConnection test read and write function

func UsePreset added in v1.0.0

func UsePreset(preset string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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