Movatterモバイル変換


[0]ホーム

URL:


discovery

package
v0.35.3Latest Latest
Warning

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

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

Details

Repository

github.com/arduino/arduino-cli

Links

Documentation

Index

Constants

View Source
const (Aliveint =iotaIdlingRunningSyncingDead)

To work correctly a Pluggable Discovery must respect the state machine specified on the documentation:https://arduino.github.io/arduino-cli/latest/pluggable-discovery-specification/#state-machineStates a PluggableDiscovery can be in

Variables

This section is empty.

Functions

This section is empty.

Types

typeEvent

type Event struct {TypestringPort        *PortDiscoveryIDstring}

Event is a pluggable discovery event

typePluggableDiscovery

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

PluggableDiscovery is a tool that detects communication ports to interactwith the boards.

funcNew

func New(idstring, args ...string) *PluggableDiscovery

New create and connect to the given pluggable discovery

func (*PluggableDiscovery)GetID

func (disc *PluggableDiscovery) GetID()string

GetID returns the identifier for this discovery

func (*PluggableDiscovery)List

func (disc *PluggableDiscovery) List() ([]*Port,error)

List executes an enumeration of the ports and returns a list of the availableports at the moment of the call.

func (*PluggableDiscovery)Quit

func (disc *PluggableDiscovery) Quit()

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

func (*PluggableDiscovery)Run

func (disc *PluggableDiscovery) Run() (errerror)

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

func (*PluggableDiscovery)Start

func (disc *PluggableDiscovery) Start()error

Start initializes and start the discovery internal subroutines. This command must becalled before List or StartSync.

func (*PluggableDiscovery)StartSync

func (disc *PluggableDiscovery) StartSync(sizeint) (<-chan *Event,error)

StartSync puts the discovery in "events" mode: the discovery will send "add"and "remove" events each time a new port is detected or removed respectively.After calling StartSync an initial burst of "add" events may be generated toreport all the ports available at the moment of the start.It also creates a channel used to receive events from the pluggable discovery.The event channel must be consumed as quickly as possible since it may block thediscovery if it becomes full. The channel size is configurable.

func (*PluggableDiscovery)State

func (disc *PluggableDiscovery) State()int

State returns the current state of this PluggableDiscovery

func (*PluggableDiscovery)Stop

func (disc *PluggableDiscovery) Stop()error

Stop stops the discovery internal subroutines and possibly free the internallyused resources. This command should be called if the client wants to pause thediscovery for a while.

func (*PluggableDiscovery)String

func (disc *PluggableDiscovery) String()string

typePort

type Port struct {Addressstring          `json:"address"`AddressLabelstring          `json:"label"`Protocolstring          `json:"protocol"`ProtocolLabelstring          `json:"protocolLabel"`HardwareIDstring          `json:"hardwareId,omitempty"`Properties    *properties.Map `json:"properties"`}

Port contains metadata about a port to connect to a board.

funcPortFromRPCPort

func PortFromRPCPort(o *rpc.Port) (p *Port)

PortFromRPCPort converts an *rpc.Port to a *Port

func (*Port)Clone

func (p *Port) Clone() *Port

Clone creates a copy of this Port

func (*Port)Equals

func (p *Port) Equals(o *Port)bool

Equals returns true if the given port has the same address and protocolof the current port.

func (*Port)String

func (p *Port) String()string

func (*Port)ToRPC

func (p *Port) ToRPC() *rpc.Port

ToRPC converts Port into rpc.Port

Source Files

View all Source files

Directories

PathSynopsis
discovery_client is a command line UI client to test pluggable discoveries.
discovery_client is a command line UI client to test pluggable discoveries.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp