com

package
v0.65.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package com reads from COM port.

Index

Constants

This section is empty.

Variables

View Source
var (
	// SerialPortName is the OS specific serial port name used
	SerialPortName string

	// BaudRate is the configured baud rate of the serial port. It is set as command line parameter.
	BaudRate int

	// DataBits is the serial port bit count for one "byte".
	DataBits int

	// Parity is the transmitted bit parity: "even", "odd", "none"
	Parity string

	// StopBits is the number of stop bits: "1", "1.5", "2"
	StopBits string

	// Verbose shows additional information if set true.
	Verbose = false
)

Functions

func GetSerialPorts

func GetSerialPorts(w io.Writer) ([]string, error)

GetSerialPorts scans for serial ports.

func NewPort added in v0.56.0

func NewPort(w io.Writer, comPortName string, verbose bool) *port

NewPort creates an instance of a serial device type trice receiver

Types

type COMport

type COMport interface {
	Open() bool
	Read(buf []byte) (int, error)
	Write(buf []byte) (int, error)
	Close() error
}

COMport is the comport interface type to use different COMports.

Jump to

Keyboard shortcuts

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