config

package
v0.0.0-...-7b92d88 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Board

type Board struct {
	Bootloader *string
	Debug      *extenders.DebugConfig
	IsRouter   bool `yaml:"is_router"`
	LEDs       []types.Pin
	I2C        []extenders.I2CInstance
	UART       []extenders.UARTInstance
}

type Device

type Device struct {
	General General
	Board   Board

	Sensors sensor.Sensors
}

func ParseFromFile

func ParseFromFile(configPath string) (*Device, error)

func (*Device) PrependCommonClusters

func (d *Device) PrependCommonClusters()

PrependCommonClusters adds common device clusters as first endpoint.

This allows to have dynamic set of common device clusters, such as Identify(server), basic, poll controll, etc.

FIXME: It is mostly a "workaround" to simplify device endpoint generation. While the solution is sound to me, the implementation of this function is questionable. Should it be here? Should it look like this? Should this common clusters be a sensor, rather then converting templates to handle endpoints rather than sensors directly?

type General

type General struct {
	NCSToolChainBase string `yaml:"ncs_toolchain_base"`
	NCSVersion       string `yaml:"ncs_version"`
	ZephyrBase       string `yaml:"zephyr_base"`

	Manufacturer string
	DeviceName   string
	// Zephyr name for the board
	Board    string
	RunEvery time.Duration
	// ZigbeeChannels will define which endpoints device should try to use.
	// By default device will try all available channels.
	ZigbeeChannels []int `yaml:"zigbee_channels"`
	// Flasher defines the way the board should be flashed.
	Flasher        string
	FlasherOptions map[string]any
}

func (General) GetToochainsPath

func (g General) GetToochainsPath() (string, string)

type NCSLocation

type NCSLocation struct {
	Version string
	NCS     string
	Zephyr  string
}

func FindNCSLocation

func FindNCSLocation(ncsBase, version string) (NCSLocation, error)

FindNCSLocation will return paths for NCS and Zephyr toolchains.

If toolchain of required version was not found - it will try to use default version from toolchain file, and if it is not present - latest available in list of toolchains.

As such this function can return different toolchain version that was requested, and caller can check it by comparing to version returned in NCSLocation.

Jump to

Keyboard shortcuts

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