sensor

package
v0.0.0-...-b9af62b Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Measurement

type Measurement struct {
	Target     sampler.Target
	Sample     sampler.Sample
	IsOK       bool
	StateCount int
	Error      error
}

Measurement reprents an aggregate of Target, Sample and error.

type Sensor

type Sensor struct {
	Target         sampler.Target
	C              chan Measurement
	StateCounter   int
	StopChan       chan int
	IsStopped      bool
	StopNotifyChan chan bool
	IsOK           bool
	Timeout        int // timeout in secs
}

Sensor is capable of repeatedly measuring a given Target with a specific Sampler, and returns those results over channel C.

func (*Sensor) Start

func (s *Sensor) Start(delay float64)

Start is meant to be called within a goroutine, and fires up the main event loop. interval is number of seconds. delay is number of ms.

func (*Sensor) Stop

func (s *Sensor) Stop()

Stop halts the event loop.

Jump to

Keyboard shortcuts

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