helper

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: AGPL-3.0 Imports: 9 Imported by: 3

README

Arduino Firmware Uploader Plugin helper library

Go Reference Check Go status Sync Labels status Check Go Dependencies status Check Taskfiles status Check Workflows status Release status Check Markdown status

This project is a library to ease implementation of plugins for the Arduino Firmware Uploader.

Reference implementation

The dummy-plugin folder contains a reference fwuploader plugin implementation.

Security

If you think you found a vulnerability or other security-related bug in this project, please read our security policy and report the bug to our Security Team 🛡️ Thank you!

e-mail contact: security@arduino.cc

License

Copyright (c) 2023 ARDUINO SA (https://www.arduino.cc)

The software is released under the GNU General Public License, which covers the main body of the serial-discovery code. The terms of this license can be found at: https://www.gnu.org/licenses/gpl-3.0.en.html

See LICENSE.txt for details.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindToolPath

func FindToolPath(toolName string, toolVersion *semver.Version) (*paths.Path, error)

FindToolPath retrieve the path to the given tool, if available, otherwise returns an error

func RunPlugin

func RunPlugin(plugin Plugin)

RunPlugin runs the given plugin

Types

type Plugin

type Plugin interface {
	// GetPluginInfo returns information about the plugin
	GetPluginInfo() *PluginInfo

	// UploadFirmware performs a firmware upload on the board
	UploadFirmware(portAddress, fqbn string, firmwarePath *paths.Path, feedback *PluginFeedback) error

	// UploadCertificate performs a certificate upload on the board
	UploadCertificate(portAddress, fqbn string, certificatePath *paths.Path, feedback *PluginFeedback) error

	// GetFirmwareVersion retrieve the firmware version installed on the board
	GetFirmwareVersion(portAddress, fqbn string, feedback *PluginFeedback) (*semver.RelaxedVersion, error)
}

Plugin is the interface that the implementations of the Firmware Uploader plugins must follow

type PluginFeedback

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

PluginFeedback is a struct that provides ways for the plugin to give feedback to the user.

func (*PluginFeedback) Err

func (f *PluginFeedback) Err() io.Writer

Err returns an error stream for console-like feedback

func (*PluginFeedback) Out

func (f *PluginFeedback) Out() io.Writer

Out returns an output stream for console-like feedback

type PluginInfo

type PluginInfo struct {
	// Name of the plugin
	Name string

	// Version of the plugin
	Version *semver.Version
}

PluginInfo is a set of information describing the plugin

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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