Documentation ¶
Index ¶
- Variables
- func Compile(client rpc.ArduinoCoreClient, instance *rpc.Instance, target *TargetInfo)
- func GetDesiredBoard(client rpc.ArduinoCoreClient, instance *rpc.Instance) string
- func Initialize(platform, version string)
- func IsInitialized() bool
- func IsProjectDirectory() bool
- func LibInstall(client rpc.ArduinoCoreClient, instance *rpc.Instance, name, version string) string
- func LibSearch(client rpc.ArduinoCoreClient, instance *rpc.Instance, searchArg string)
- func LibUnInstall(client rpc.ArduinoCoreClient, instance *rpc.Instance, name string)
- func ListBoards(board string)
- func ListPlatforms(platform string)
- func SetLogLevel(level log.Level)
- func StartDaemonAndGetConnection(pathToConfig string) (*grpc.ClientConn, rpc.ArduinoCoreClient, *rpc.Instance)
- func Upload(client rpc.ArduinoCoreClient, instance *rpc.Instance, target *TargetInfo)
- func WatchLogs(target *TargetInfo)
- func WatchSketch(client rpc.ArduinoCoreClient, instance *rpc.Instance, target *TargetInfo)
- type LibraryDirConfig
- type TargetInfo
Constants ¶
This section is empty.
Variables ¶
var ArdiDir = path.Join(homeDir, ".ardi")
ArdiDir location of .ardi directory in users home directory
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.
var DepConfig = "ardi.json"
DepConfig used to tell ardi which libraries to use for a specific project
var GlobalLibConfig = path.Join(DataDir, LibConfig)
GlobalLibConfig returns path to global library directory config file
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 ¶
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 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