Documentation ¶
Index ¶
- type InvalidSketchFolderNameError
- type Profile
- type ProfileLibraryReference
- type ProfilePlatformReference
- type ProfileRequiredLibraries
- type ProfileRequiredPlatforms
- type Project
- type Sketch
- func (s *Sketch) GetDefaultFQBN() string
- func (s *Sketch) GetDefaultPortAddressAndProtocol() (string, string)
- func (s *Sketch) GetDefaultProgrammer() string
- func (s *Sketch) GetProfile(profileName string) (*Profile, error)
- func (s *Sketch) GetProjectPath() *paths.Path
- func (s *Sketch) Hash() string
- func (s *Sketch) SetDefaultFQBN(fqbn string) error
- func (s *Sketch) SetDefaultPort(address, protocol string) error
- func (s *Sketch) SetDefaultProgrammer(programmer string) error
- func (s *Sketch) ToRpc() *rpc.Sketch
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InvalidSketchFolderNameError ¶
type InvalidSketchFolderNameError struct { SketchFolder *paths.Path SketchFile *paths.Path }
InvalidSketchFolderNameError is returned when the sketch directory doesn't match the sketch name
func (*InvalidSketchFolderNameError) Error ¶
func (e *InvalidSketchFolderNameError) Error() string
type Profile ¶
type Profile struct { Name string Notes string `yaml:"notes"` FQBN string `yaml:"fqbn"` Port string `yaml:"port"` PortConfig map[string]string `yaml:"port_config"` Protocol string `yaml:"protocol"` Programmer string `yaml:"programmer"` Platforms ProfileRequiredPlatforms `yaml:"platforms"` Libraries ProfileRequiredLibraries `yaml:"libraries"` }
UnmarshalYAML decodes a Profiles section from YAML source. Profile is a sketch profile, it contains a reference to all the resources needed to build and upload a sketch
func (*Profile) ToRpc ¶
func (p *Profile) ToRpc() *rpc.SketchProfile
ToRpc converts this Profile to an rpc.SketchProfile
type ProfileLibraryReference ¶
ProfileLibraryReference is a reference to a library
func (*ProfileLibraryReference) AsYaml ¶
func (l *ProfileLibraryReference) AsYaml() string
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 (l *ProfileLibraryReference) String() string
func (*ProfileLibraryReference) UnmarshalYAML ¶
func (l *ProfileLibraryReference) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML decodes a ProfileLibraryReference from YAML source.
type ProfilePlatformReference ¶
type ProfilePlatformReference struct { Packager string Architecture string Version *semver.Version PlatformIndexURL *url.URL }
ProfilePlatformReference is a reference to a platform
func (*ProfilePlatformReference) AsYaml ¶
func (p *ProfilePlatformReference) AsYaml() string
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) String ¶
func (p *ProfilePlatformReference) String() string
func (*ProfilePlatformReference) UnmarshalYAML ¶
func (p *ProfilePlatformReference) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML decodes a ProfilePlatformReference from YAML source.
type ProfileRequiredLibraries ¶
type ProfileRequiredLibraries []*ProfileLibraryReference
ProfileRequiredLibraries is a list of ProfileLibraryReference (libraries required to build the sketch using this profile)
func (*ProfileRequiredLibraries) AsYaml ¶
func (p *ProfileRequiredLibraries) AsYaml() string
AsYaml outputs the required libraries as Yaml
type ProfileRequiredPlatforms ¶
type ProfileRequiredPlatforms []*ProfilePlatformReference
ProfileRequiredPlatforms is a list of ProfilePlatformReference (platforms required to build the sketch using this profile)
func (*ProfileRequiredPlatforms) AsYaml ¶
func (p *ProfileRequiredPlatforms) AsYaml() string
AsYaml outputs the required platforms as Yaml
type Project ¶
type Project struct { Profiles []*Profile DefaultProfile string DefaultFqbn string DefaultPort string DefaultPortConfig map[string]string DefaultProtocol string DefaultProgrammer string }
Project represents the sketch project file
func LoadProjectFile ¶
LoadProjectFile reads a sketch project file
type Sketch ¶
type Sketch struct { Name string MainFile *paths.Path FullPath *paths.Path // FullPath is the path to the Sketch folder OtherSketchFiles paths.PathList // Sketch files that end in .ino other than main file AdditionalFiles paths.PathList RootFolderFiles paths.PathList // All files that are in the Sketch root Project *Project }
Sketch holds all the files composing a sketch
func New ¶
New creates an Sketch instance by reading all the files composing a sketch and grouping them by file type.
func (*Sketch) GetDefaultFQBN ¶
GetDefaultFQBN returns the default FQBN for the sketch (from the sketch.yaml project file), or the empty string if not set.
func (*Sketch) GetDefaultPortAddressAndProtocol ¶
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 ¶
GetDefaultProgrammer return the default Programmer for the sketch (from the sketch.yaml project file), ore the empty string if not set.
func (*Sketch) GetProfile ¶
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) SetDefaultFQBN ¶
SetDefaultFQBN sets the default FQBN for the sketch and saves it in the sketch.yaml project file.
func (*Sketch) SetDefaultPort ¶
SetDefaultPort sets the default port address and port protocol for the sketch and saves it in the sketch.yaml project file.
func (*Sketch) SetDefaultProgrammer ¶
SetDefaultFQBN sets the default programmer for the sketch and saves it in the sketch.yaml project file.