Documentation
¶
Index ¶
- func BaseTopics(devices []*Device) []string
- type Component
- type Device
- type Fleet
- func (f *Fleet) Collect(duration time.Duration) ([]*Device, error)
- func (f *Fleet) Debug(pattern string, delete bool, duration time.Duration) (map[*Device][]byte, error)
- func (f *Fleet) DeviceByBaseTopic(baseTopic string) *Device
- func (f *Fleet) Discover(pattern string, timeout time.Duration) ([]*Device, error)
- func (f *Fleet) FilterDevices(pattern string) []*Device
- func (f *Fleet) GetParams(pattern, param string, timeout time.Duration) ([]*Device, error)
- func (f *Fleet) Monitor(pattern string, quit chan struct{}, timeout time.Duration, ...) error
- func (f *Fleet) Ping(pattern string, timeout time.Duration) error
- func (f *Fleet) Receive(pattern, topic string, timeout time.Duration) (map[string]string, error)
- func (f *Fleet) Record(pattern string, quit chan struct{}, timeout time.Duration, ...) error
- func (f *Fleet) Save(path string) error
- func (f *Fleet) Send(pattern, topic, message string, timeout time.Duration) error
- func (f *Fleet) SetParams(pattern, param, value string, timeout time.Duration) ([]*Device, error)
- func (f *Fleet) UnsetParams(pattern, param string, timeout time.Duration) ([]*Device, error)
- func (f *Fleet) Update(version, pattern string, firmware []byte, jobs int, timeout time.Duration, ...) error
- type Frameworks
- type Inventory
- type Project
- func (p *Project) Attach(device string, out io.Writer, in io.Reader) error
- func (p *Project) Build(clean, reconfigure, appOnly bool, out io.Writer) error
- func (p *Project) BuildTrace(cpuCore, baudRate string, clean, reconfigure, appOnly bool, out io.Writer) error
- func (p *Project) Bundle(file string, out io.Writer) error
- func (p *Project) Config(file, device, baudRate string, useBLE bool, out io.Writer) error
- func (p *Project) Debug(pattern string, delete bool, duration time.Duration, out io.Writer) error
- func (p *Project) Exec(cmd string, out io.Writer, in io.Reader) error
- func (p *Project) Flash(device, baudRate string, erase bool, appOnly, alt bool, out io.Writer) error
- func (p *Project) Format(out io.Writer) error
- func (p *Project) Install(force bool, out io.Writer) error
- func (p *Project) SaveFleet() error
- func (p *Project) SaveInventory() error
- func (p *Project) Tree() string
- func (p *Project) Update(version, pattern string, jobs int, timeout time.Duration, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BaseTopics ¶ added in v0.8.0
BaseTopics returns a list of base topics from the provided devices.
Types ¶
type Component ¶
type Component struct {
Path string `json:"path"`
Registry string `json:"registry"`
Repository string `json:"repository"`
Version string `json:"version"`
}
A Component represents an installable component.
type Device ¶
type Device struct {
BaseTopic string `json:"base_topic"`
Name string `json:"name"`
Type string `json:"type"`
FirmwareVersion string `json:"firmware_version"`
Parameters map[string]string `json:"parameters"`
}
A Device represents a single device in a Fleet.
type Fleet ¶ added in v0.12.1
type Fleet struct {
Broker string `json:"broker,omitempty"`
Devices map[string]*Device `json:"devices,omitempty"`
}
A Fleet represents the contents of the fleet file.
func ReadFleet ¶ added in v0.12.1
ReadFleet will attempt to read the fleet file at the specified path.
func (*Fleet) Collect ¶ added in v0.12.1
Collect will collect announcements and update the inventory with found devices for the given amount of time. It will return a list of devices that have been added to the inventory.
func (*Fleet) Debug ¶ added in v0.12.1
func (f *Fleet) Debug(pattern string, delete bool, duration time.Duration) (map[*Device][]byte, error)
Debug will load the coredump data from the devices that match the supplied glob pattern.
func (*Fleet) DeviceByBaseTopic ¶ added in v0.12.1
DeviceByBaseTopic returns the first device that has the matching base topic.
func (*Fleet) Discover ¶ added in v0.12.1
Discover will request the list of parameters from all devices matching the supplied glob pattern. The inventory is updated with the reported parameters and a list of answering devices is returned.
func (*Fleet) FilterDevices ¶ added in v0.12.1
FilterDevices will return a list of devices that have a name matching the supplied glob pattern.
func (*Fleet) GetParams ¶ added in v0.12.1
GetParams will request specified parameter from all devices matching the supplied glob pattern. The inventory is updated with the reported value and a list of answering devices is returned.
func (*Fleet) Monitor ¶ added in v0.12.1
func (f *Fleet) Monitor(pattern string, quit chan struct{}, timeout time.Duration, callback func(*Device, *fleet.Heartbeat)) error
Monitor will monitor the devices that match the supplied glob pattern and update the inventory accordingly. The specified callback is called for every heartbeat with the update device and the heartbeat available at device.LastHeartbeat.
func (*Fleet) Ping ¶ added in v0.12.1
Ping will send a ping message to all devices matching the supplied glob pattern.
func (*Fleet) Receive ¶ added in v0.12.1
Receive will receive messages from all devices matching the supplied glob pattern.
func (*Fleet) Record ¶ added in v0.12.1
func (f *Fleet) Record(pattern string, quit chan struct{}, timeout time.Duration, callback func(time.Time, *Device, string)) error
Record will enable log recording mode and yield the received log messages until the provided channel has been closed.
func (*Fleet) Send ¶ added in v0.12.1
Send will send a message to all devices matching the supplied glob pattern.
func (*Fleet) SetParams ¶ added in v0.12.1
SetParams will set the specified parameter on all devices matching the supplied glob pattern. The inventory is updated with the saved value and a list of updated devices is returned.
func (*Fleet) UnsetParams ¶ added in v0.12.1
UnsetParams will unset the specified parameter on all devices matching the supplied glob pattern. The inventory is updated with the removed value and a list of updated devices is returned.
func (*Fleet) Update ¶ added in v0.12.1
func (f *Fleet) Update(version, pattern string, firmware []byte, jobs int, timeout time.Duration, callback func(*Device, *fleet.UpdateStatus)) error
Update will update the devices that match the supplied glob pattern with the specified image. The specified callback is called for every change in state or progress.
type Frameworks ¶ added in v0.10.0
type Frameworks struct {
Audio string `json:"audio,omitempty"`
}
Frameworks represents the official frameworks.
type Inventory ¶
type Inventory struct {
Name string `json:"name"`
Version string `json:"version"`
Target string `json:"target"`
BaudRate string `json:"baud_rate,omitempty"`
TagPrefix string `json:"tag_prefix,omitempty"`
Embeds []string `json:"embeds"`
Overrides map[string]string `json:"overrides"`
Partitions *tree.Partitions `json:"partitions"`
Components map[string]*Component `json:"components"`
Frameworks Frameworks `json:"frameworks,omitempty"`
}
An Inventory represents the contents of the inventory file.
func ReadInventory ¶
ReadInventory will attempt to read the inventory file at the specified path.
type Project ¶
A Project is a project available on disk.
func CreateProject ¶
CreateProject will initialize a project in the specified directory. If out is not nil, it will be used to log information about the process.
func OpenProject ¶
OpenProject will open the project in the specified path.
func (*Project) BuildTrace ¶ added in v0.10.0
func (p *Project) BuildTrace(cpuCore, baudRate string, clean, reconfigure, appOnly bool, out io.Writer) error
BuildTrace will build the project with tracing enabled.
func (*Project) Config ¶ added in v0.8.0
Config will write settings and parameters to an attached device.
func (*Project) Debug ¶
Debug will request coredumps from the devices that match the supplied glob pattern. The coredumps are saved to the 'debug' directory in the project.
func (*Project) Flash ¶
func (p *Project) Flash(device, baudRate string, erase bool, appOnly, alt bool, out io.Writer) error
Flash will flash the project to the attached device.
func (*Project) Format ¶
Format will format all source files in the project if 'clang-format' is available.
func (*Project) Install ¶
Install will download necessary dependencies. Any existing dependencies will be removed if force is set to true. If out is not nil, it will be used to log information about the process.
func (*Project) SaveInventory ¶
SaveInventory will save the associated inventory to disk.
func (*Project) Tree ¶
Tree returns the internal directory used to store the toolchain, development framework and other necessary files.
func (*Project) Update ¶
func (p *Project) Update(version, pattern string, jobs int, timeout time.Duration, callback func(*Device, *fleet.UpdateStatus)) error
Update will update the devices that match the supplied glob pattern with the previously built image. The specified callback is called for every change in state or progress.