utils

package module
v0.0.0-...-2c82f6b Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: MIT Imports: 5 Imported by: 0

README

lidar-utils

Utils library for lidar-arduino

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Serial

type Serial struct {
	Name     string
	Baud     int
	Size     byte
	StopBits serial.StopBits
	Timeout  time.Duration

	Config     *serial.Config // Serial config pointer
	Port       *serial.Port   // Serial port pointer
	ConfigMade bool           // Valid config status
	PortOpen   bool           // Port connection status
}

func NewSerial

func NewSerial(name string, baud int, size byte, stopbits serial.StopBits, timeout time.Duration) *Serial

func (*Serial) Listen

func (s *Serial) Listen(duration time.Duration)

func (*Serial) MakeConfig

func (s *Serial) MakeConfig()

func (*Serial) OpenPortConnection

func (s *Serial) OpenPortConnection() error

func (*Serial) ReadSerial

func (s *Serial) ReadSerial(c chan []byte)

func (*Serial) WriteToFile

func (s *Serial) WriteToFile(c chan []byte)

type SerialWorker

type SerialWorker interface {
	OpenPortConnection()
	MakeConfig()
	Listen()
	Read()
}

Jump to

Keyboard shortcuts

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