discovery
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Index¶
- Constants
- type Event
- type PluggableDiscovery
- func (disc *PluggableDiscovery) GetID() string
- func (disc *PluggableDiscovery) List() ([]*Port, error)
- func (disc *PluggableDiscovery) Quit()
- func (disc *PluggableDiscovery) Run() (err error)
- func (disc *PluggableDiscovery) Start() error
- func (disc *PluggableDiscovery) StartSync(size int) (<-chan *Event, error)
- func (disc *PluggableDiscovery) State() int
- func (disc *PluggableDiscovery) Stop() error
- func (disc *PluggableDiscovery) String() string
- type Port
Constants¶
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¶
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¶
PortFromRPCPort converts an *rpc.Port to a *Port
Directories¶
| Path | Synopsis |
|---|---|
discovery_client is a command line UI client to test pluggable discoveries. | discovery_client is a command line UI client to test pluggable discoveries. |