serial

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BoardSysTime time.Time = time.Now() // 虚拟电路板的系统时间
)
View Source
var Chch = make(chan string) // 新图表Json
View Source
var SerialCur = T{
	Name: "",
	Mode: serial.Mode{
		BaudRate: 115200,
		Parity:   serial.NoParity,
		DataBits: 8,
		StopBits: serial.OneStopBit,
	},
	Port: nil,
}

Functions

func Close

func Close() error

Close serial port

func Find

func Find() []string

Find ports

func GrReceive

func GrReceive()

func GrRxPrase

func GrRxPrase()

func GrTransmit

func GrTransmit()

func Open

func Open(name string, baud int) error

Open serial port

func Receive

func Receive(buff []byte) ([]byte, error)

Receive data

func SendCmd

func SendCmd(act variable.ActMode, v variable.CmdT) error

func SendWriteCmd

func SendWriteCmd(v variable.T) error

func Transmit

func Transmit(data []byte) error

Transmit data

Types

type T

type T struct {
	Name string
	Mode serial.Mode
	Port serial.Port
}

Jump to

Keyboard shortcuts

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