serialhelper

package module
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

README

tc2-hat-controller

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSerial

func GetSerial(retries int, mul0, mul1 gpio.Level, wait time.Duration) (*os.File, error)

GetSerial will try to get a file lock on the serial port. If the file lock can be acquired, it will return the serial file and change mul0 and mul1 to the new values. defer ReleaseSerial(serialFile) should be called to release the lock and close the serial file.

func NewSerialUnavailableError

func NewSerialUnavailableError(msg string) error

func ReleaseSerial

func ReleaseSerial(serialFile *os.File) error

func SerialInUseFromTerminal

func SerialInUseFromTerminal() bool

func SerialSendReceive

func SerialSendReceive(retries int, mul0, mul1 gpio.Level, wait time.Duration, data []byte) ([]byte, error)

Types

type SerialUnavailableError

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

func (*SerialUnavailableError) Error

func (e *SerialUnavailableError) Error() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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