sensor

package
v0.0.0-...-f934f63 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, s Sensor)

Register adds a Sensor to the set of available sensors.

Types

type Sensor

type Sensor interface {
	// Init performs any sensor-specific initialization.
	Init() error
	// Sense queries the sensor for measurements and sets the appropriate
	// field(s) in the given Measurement. This is so that the same Measurement
	// may be passed to a series of sensors that each measure different things.
	Sense(m *mpb.Measurement) error
	// Shutdown performs an sensor-specific shutdown or cleanup operations.
	Shutdown() error
}

func Get

func Get(name string) (Sensor, error)

Get looks up a sensor by name. It returns an error if no sensor with the given name is found.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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