ardi

package
v1.1.1-0...-f5f3059 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2021 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ArdiDir = path.Join(homeDir, ".ardi")

ArdiDir location of .ardi directory in users home directory

View Source
var DataDir = path.Join(ArdiDir, "arduino-rpc-client")

DataDir location of data directory inside ~/.ardi To avoid polluting an existing arduino-cli installation, ardi uses its own data directory to keep cores, libraries and the likes.

View Source
var DepConfig = "ardi.json"

DepConfig used to tell ardi which libraries to use for a specific project

View Source
var GlobalLibConfig = path.Join(DataDir, LibConfig)

GlobalLibConfig returns path to global library directory config file

View Source
var LibConfig = "ardi.yaml"

LibConfig used to tell arduino-cli where to find libraries

Functions

func Compile

func Compile(client rpc.ArduinoCoreClient, instance *rpc.Instance, target *TargetInfo)

Compile the specified sketch

func GetDesiredBoard

func GetDesiredBoard(client rpc.ArduinoCoreClient, instance *rpc.Instance) string

GetDesiredBoard prints list of supported boards and asks user to choose

func Initialize

func Initialize(platform, version string)

Initialize downloads and installs all available platforms for maximum board support

func IsInitialized

func IsInitialized() bool

IsInitialized returns whether or not ardi had been initialized (has a data directory)

func IsProjectDirectory

func IsProjectDirectory() bool

IsProjectDirectory returns whether or not current directory is configured with

func LibInstall

func LibInstall(client rpc.ArduinoCoreClient, instance *rpc.Instance, name, version string) string

LibInstall installs library either globally or for project

func LibSearch

func LibSearch(client rpc.ArduinoCoreClient, instance *rpc.Instance, searchArg string)

LibSearch searches all available libraries with optional search filter

func LibUnInstall

func LibUnInstall(client rpc.ArduinoCoreClient, instance *rpc.Instance, name string)

LibUnInstall installs library either globally or for project

func ListBoards

func ListBoards(board string)

ListBoards lists all available boards with optional search filter

func ListPlatforms

func ListPlatforms(platform string)

ListPlatforms list all available platforms or filter with a search arg

func SetLogLevel

func SetLogLevel(level log.Level)

SetLogLevel sets log level for ardi

func StartDaemonAndGetConnection

func StartDaemonAndGetConnection(pathToConfig string) (*grpc.ClientConn, rpc.ArduinoCoreClient, *rpc.Instance)

StartDaemonAndGetConnection starts daemon as goroutine and return connection, client, and rpc-instance

func Upload

func Upload(client rpc.ArduinoCoreClient, instance *rpc.Instance, target *TargetInfo)

Upload compiled sketches to the specified board

func WatchLogs

func WatchLogs(target *TargetInfo)

WatchLogs connects to a serial port at a specified baud rate and prints any logs received.

func WatchSketch

func WatchSketch(client rpc.ArduinoCoreClient, instance *rpc.Instance, target *TargetInfo)

WatchSketch responds to changes in a given sketch file by automatically recompiling and re-uploading.

Types

type LibraryDirConfig

type LibraryDirConfig struct {
	ProxyType      string                 `yaml:"proxy_type"`
	SketchbookPath string                 `yaml:"sketchbook_path"`
	ArduinoData    string                 `yaml:"arduino_data"`
	BoardManager   map[string]interface{} `yaml:"board_manager,flow"`
}

LibraryDirConfig represents yaml config for telling arduino-cli where to find libraries

type TargetInfo

type TargetInfo struct {
	BoardName    string
	FQBN         string
	Device       string
	SketchDir    string
	SketchFile   string
	Baud         int
	Stream       *serial.Port
	BuildProps   []string
	ShowProps    bool
	Compiling    bool
	CompileError bool
	Uploading    bool
	Logging      bool
}

TargetInfo represents all necessary info for compiling, and uploading

func GetTargetInfo

func GetTargetInfo(list []TargetInfo) TargetInfo

GetTargetInfo returns a connected board if found. If more than one board is connected it will ask the user to choose.

func GetTargetList

func GetTargetList(client rpc.ArduinoCoreClient, instance *rpc.Instance, sketchDir, sketchFile string, baud int) []TargetInfo

GetTargetList returns a list of connected boards and their corresponding info

Jump to

Keyboard shortcuts

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