Movatterモバイル変換


[0]ホーム

URL:


sketch

package
v1.3.1Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2025 License:GPL-3.0Imports:18Imported by:0

Details

Repository

github.com/arduino/arduino-cli

Links

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

typeInvalidSketchFolderNameError

type InvalidSketchFolderNameError struct {SketchFolder *paths.PathSketchFile   *paths.Path}

InvalidSketchFolderNameError is returned when the sketch directory doesn't match the sketch name

func (*InvalidSketchFolderNameError)Error

typeProfile

type Profile struct {NamestringNotesstring                   `yaml:"notes"`FQBNstring                   `yaml:"fqbn"`Portstring                   `yaml:"port"`PortConfig map[string]string        `yaml:"port_config"`Protocolstring                   `yaml:"protocol"`Programmerstring                   `yaml:"programmer"`PlatformsProfileRequiredPlatforms `yaml:"platforms"`LibrariesProfileRequiredLibraries `yaml:"libraries"`}

UnmarshalYAML decodes a Profiles section from YAML source.Profile is a sketch profile, it contains a reference to all the resourcesneeded to build and upload a sketch

func (*Profile)AsYaml

func (p *Profile) AsYaml()string

AsYaml outputs the profile as Yaml

func (*Profile)RequireSystemInstalledPlatformadded inv1.3.0

func (p *Profile) RequireSystemInstalledPlatform()bool

UsesSystemPlatform checks if this profile requires a system installed platform.

func (*Profile)ToRpc

func (p *Profile) ToRpc() *rpc.SketchProfile

ToRpc converts this Profile to an rpc.SketchProfile

typeProfileLibraryReference

type ProfileLibraryReference struct {LibrarystringInstallDir *paths.PathVersion    *semver.Version}

ProfileLibraryReference is a reference to a library

func (*ProfileLibraryReference)AsYaml

AsYaml outputs the required library as Yaml

func (*ProfileLibraryReference)InternalUniqueIdentifier

func (l *ProfileLibraryReference) InternalUniqueIdentifier()string

InternalUniqueIdentifier returns the unique identifier for this object

func (*ProfileLibraryReference)String

func (*ProfileLibraryReference)UnmarshalYAML

func (l *ProfileLibraryReference) UnmarshalYAML(unmarshal func(interface{})error)error

UnmarshalYAML decodes a ProfileLibraryReference from YAML source.

typeProfilePlatformReference

type ProfilePlatformReference struct {PackagerstringArchitecturestringVersion          *semver.VersionPlatformIndexURL *url.URL}

ProfilePlatformReference is a reference to a platform

func (*ProfilePlatformReference)AsYaml

AsYaml outputs the platform reference as Yaml

func (*ProfilePlatformReference)InternalUniqueIdentifier

func (p *ProfilePlatformReference) InternalUniqueIdentifier()string

InternalUniqueIdentifier returns the unique identifier for this object

func (*ProfilePlatformReference)RequireSystemInstalledPlatformadded inv1.3.0

func (p *ProfilePlatformReference) RequireSystemInstalledPlatform()bool

RequireSystemInstalledPlatform returns true if the platform referencedoes not specify a version, meaning it requires the system installed platform.

func (*ProfilePlatformReference)String

func (*ProfilePlatformReference)UnmarshalYAML

func (p *ProfilePlatformReference) UnmarshalYAML(unmarshal func(interface{})error)error

UnmarshalYAML decodes a ProfilePlatformReference from YAML source.

typeProfileRequiredLibraries

type ProfileRequiredLibraries []*ProfileLibraryReference

ProfileRequiredLibraries is a list of ProfileLibraryReference (librariesrequired to build the sketch using this profile)

func (*ProfileRequiredLibraries)AsYaml

AsYaml outputs the required libraries as Yaml

typeProfileRequiredPlatforms

type ProfileRequiredPlatforms []*ProfilePlatformReference

ProfileRequiredPlatforms is a list of ProfilePlatformReference (platformsrequired to build the sketch using this profile)

func (*ProfileRequiredPlatforms)AsYaml

AsYaml outputs the required platforms as Yaml

func (*ProfileRequiredPlatforms)UnmarshalYAMLadded inv1.3.0

func (p *ProfileRequiredPlatforms) UnmarshalYAML(unmarshal func(interface{})error)error

typeProject

type Project struct {Profiles          []*ProfileDefaultProfilestringDefaultFqbnstringDefaultPortstringDefaultPortConfig map[string]stringDefaultProtocolstringDefaultProgrammerstring}

Project represents the sketch project file

funcLoadProjectFile

func LoadProjectFile(file *paths.Path) (*Project,error)

LoadProjectFile reads a sketch project file

func (*Project)AsYaml

func (p *Project) AsYaml()string

AsYaml outputs the sketch project file as YAML

typeSketch

type Sketch struct {NamestringMainFile         *paths.PathFullPath         *paths.Path// FullPath is the path to the Sketch folderOtherSketchFiles paths.PathList// Sketch files that end in .ino other than main fileAdditionalFiles  paths.PathListRootFolderFiles  paths.PathList// All files that are in the Sketch rootProject          *Project}

Sketch holds all the files composing a sketch

funcNew

func New(path *paths.Path) (*Sketch,error)

New creates an Sketch instance by reading all the files composing a sketch and grouping themby file type.

func (*Sketch)GetDefaultFQBN

func (s *Sketch) GetDefaultFQBN()string

GetDefaultFQBN returns the default FQBN for the sketch (from the sketch.yaml project file), or theempty string if not set.

func (*Sketch)GetDefaultPortAddressAndProtocol

func (s *Sketch) GetDefaultPortAddressAndProtocol() (string,string)

GetDefaultPortAddressAndProtocol returns the default port address and port protocol for the sketch(from the sketch.yaml project file), or empty strings if not set.

func (*Sketch)GetDefaultProgrammer

func (s *Sketch) GetDefaultProgrammer()string

GetDefaultProgrammer return the default Programmer for the sketch (from the sketch.yaml project file),ore the empty string if not set.

func (*Sketch)GetProfile

func (s *Sketch) GetProfile(profileNamestring) (*Profile,error)

GetProfile returns the requested profile or an error if not found

func (*Sketch)GetProjectPath

func (s *Sketch) GetProjectPath() *paths.Path

GetProjectPath returns the path to the sketch project file (sketch.yaml or sketch.yml)

func (*Sketch)Hash

func (s *Sketch) Hash()string

Hash generate a unique hash for the given sketch.

func (*Sketch)SetDefaultFQBN

func (s *Sketch) SetDefaultFQBN(fqbnstring)error

SetDefaultFQBN sets the default FQBN for the sketch and saves it in the sketch.yaml project file.

func (*Sketch)SetDefaultPort

func (s *Sketch) SetDefaultPort(address, protocolstring)error

SetDefaultPort sets the default port address and port protocol for the sketch and saves it in thesketch.yaml project file.

func (*Sketch)SetDefaultProgrammer

func (s *Sketch) SetDefaultProgrammer(programmerstring)error

SetDefaultFQBN sets the default programmer for the sketch and saves it in the sketch.yaml project file.

func (*Sketch)ToRpc

func (s *Sketch) ToRpc() *rpc.Sketch

ToRpc converts this Sketch into a rpc.LoadSketchResponse

Source Files

View all Source files

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