serial

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2025 License: BSD-2-Clause Imports: 12 Imported by: 0

README

The serial package provides a single module:

Serial

This module establishes an serial connection to the DUT from the dutagent and forwards the output.

ARGUMENTS:
	[-t <duration>] [<expect>]

If a regex is provided, the module will wait for the regex to match on the serial output, 
then exit with success.
If no expect string is provided, the module will read from the serial port until it is terminated by a signal (e.g. Ctrl-C).
The  expect string supports regular expressions. The optional -t flag specifies the maximum time to wait for the regex to match.
The regex is passed to the shell as a single argument. The regex must not contain any newlines.
Quote the regex if it contains spaces or special characters. E.g.: "(?i)hello\s+world!? dutctl"

The syntax of the regular expressions accepted is the syntax accepted by RE2 and described at https://golang.org/s/re2syntax.

The module is read-only at that time and does not support, sending bytes over the serial connection.

See serial-example-cfg.yml for examples.

Configuration Options

Option Value Description
port string Hostname or IP address of the DUT
baud int Port number of the SSH server on the DUT (default: 22)

Documentation

Overview

Package serial provides a dutagent module that listens on a defined COM port.

Index

Constants

View Source
const DefaultBaudRate = 115200

DefaultBaudRate is the default baud rate for the serial connection.

Variables

This section is empty.

Functions

This section is empty.

Types

type Serial

type Serial struct {
	Port string // Port is the path to the serial device on the dutagent.
	Baud int    // Baud is the baud rate of the serial device. Is unset, DefaultBaudRate is used.
	// contains filtered or unexported fields
}

Serial is a module that forwards the serial output of a connected DUT to the dutctl client. It is non-interactive and does not support stdin yet.

func (*Serial) Deinit

func (s *Serial) Deinit() error

func (*Serial) Help

func (s *Serial) Help() string

func (*Serial) Init

func (s *Serial) Init() error

func (*Serial) Run

func (s *Serial) Run(ctx context.Context, session module.Session, args ...string) error

Jump to

Keyboard shortcuts

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