serial

package
v0.0.0-...-ad0604f Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ParamNameBaudRate     = "baudRate"
	ParamNameDataBits     = "dataBits"
	ParamNameParity       = "parity"
	ParamNameStopBits     = "stopBits"
	ParamNameReadTimeout  = "readTimeout"
	ParamNameWriteTimeout = "writeTimeout"
)

serial transport parameters names

Variables

View Source
var TransportInfo *defs.TransportInfo = &defs.TransportInfo{
	Name: "Serial",
	Params: defs.Params{
		ParamNameBaudRate: {
			Description:  "The serial port bitrate",
			Type:         defs.ParamTypeInt32,
			DefaultValue: "115200",
		},
		ParamNameDataBits: {
			Description:  "The size of the character, bits",
			Type:         defs.ParamTypeEnum,
			DefaultValue: "8",
			EnumValues:   []string{"5", "6", "7", "8"},
		},
		ParamNameParity: {
			Description:  "The parity",
			Type:         defs.ParamTypeEnum,
			DefaultValue: "none",
			EnumValues:   []string{"none", "odd", "even", "mark", "space"},
		},
		ParamNameStopBits: {
			Description:  "The number of stop bits",
			Type:         defs.ParamTypeEnum,
			DefaultValue: "1",
			EnumValues:   []string{"1", "1.5", "2"},
		},
		ParamNameReadTimeout: {
			Description:  "The read timeout, millisecons",
			Type:         defs.ParamTypeUint32,
			DefaultValue: "3000",
		},
		ParamNameWriteTimeout: {
			Description:  "The write timeout, millisecons",
			Type:         defs.ParamTypeUint32,
			DefaultValue: "3000",
		},
	},
}

Functions

This section is empty.

Types

type Transport

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

Transport struct - serial Transport implementation

func (*Transport) Close

func (t *Transport) Close() error

Close func

func (*Transport) ID

func (*Transport) Open

func (t *Transport) Open(entry string, params api.ParamValues) (err error)

Open func

func (*Transport) Read

func (t *Transport) Read(p []byte) (int, error)

Read func

func (*Transport) ReadyToRead

func (t *Transport) ReadyToRead() <-chan struct{}

ReadyToRead function, singal in the channel if something could be read from the port or port state has changed

func (*Transport) Write

func (t *Transport) Write(p []byte) (int, error)

Write func

Jump to

Keyboard shortcuts

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