monitor

package
v0.35.3 Latest Latest
Warning

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

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

Documentation

Overview

Package monitor provides a client for Pluggable Monitors. Documentation is available here: https://arduino.github.io/arduino-cli/latest/pluggable-monitor-specification/

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PluggableMonitor

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

PluggableMonitor is a tool that communicates with a board through a communication port.

func New

func New(id string, args ...string) *PluggableMonitor

New create and connect to the given pluggable monitor

func (*PluggableMonitor) Close

func (mon *PluggableMonitor) Close() error

Close the communication port with the board.

func (*PluggableMonitor) Configure

func (mon *PluggableMonitor) Configure(param, value string) error

Configure sets a port configuration parameter.

func (*PluggableMonitor) Describe

func (mon *PluggableMonitor) Describe() (*PortDescriptor, error)

Describe returns a description of the Port and the configuration parameters.

func (*PluggableMonitor) GetID

func (mon *PluggableMonitor) GetID() string

GetID returns the identifier for this monitor

func (*PluggableMonitor) Open

func (mon *PluggableMonitor) Open(portAddress, portProtocol string) (io.ReadWriter, error)

Open connects to the given Port. A communication channel is opened

func (*PluggableMonitor) Quit

func (mon *PluggableMonitor) Quit() error

Quit terminates the monitor. No more commands can be accepted by the monitor.

func (*PluggableMonitor) Run

func (mon *PluggableMonitor) Run() (err error)

Run starts the monitor executable process and sends the HELLO command to the monitor to agree on the pluggable monitor protocol. This must be the first command to run in the communication with the monitor. If the process is started but the HELLO command fails the process is killed.

func (*PluggableMonitor) String

func (mon *PluggableMonitor) String() string

type PortDescriptor

type PortDescriptor struct {
	Protocol                string                              `json:"protocol,omitempty"`
	ConfigurationParameters map[string]*PortParameterDescriptor `json:"configuration_parameters,omitempty"`
}

PortDescriptor is a struct to describe the characteristic of a port

type PortParameterDescriptor

type PortParameterDescriptor struct {
	Label    string   `json:"label,omitempty"`
	Type     string   `json:"type,omitempty"`
	Values   []string `json:"value,omitempty"`
	Selected string   `json:"selected,omitempty"`
}

PortParameterDescriptor contains characteristics for every parameter

Jump to

Keyboard shortcuts

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