ruuvinatortypes

package
v0.0.0-...-f832923 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccelerationData

type AccelerationData struct {
	X int16 `json:"x"`
	Y int16 `json:"y"`
	Z int16 `json:"z"`
}

type Config

type Config struct {
	Output          string           `json:"output"`
	SensorWhitelist SensorWhitelist  `json:"sensor_whitelist"`
	SqsOutputConfig *SqsOutputConfig `json:"sqsoutput_config"` // used if output=sqsoutput
}

type Output

type Output interface {
	GetObservationsChan() chan<- ResolvedSensorObservation
}

type ResolvedSensorObservation

type ResolvedSensorObservation struct {
	SensorName  string            `json:"sensor_name"`
	Observation SensorObservation `json:"observation"`
}

resolved observation means an observation whose presence is detected against a whitelist and thus its friendly name is now also known

type SensorMeasurements

type SensorMeasurements struct {
	Temperature  float64          `json:"temperature"`
	Humidity     float64          `json:"humidity"`
	Pressure     uint32           `json:"pressure"`
	Battery      float64          `json:"battery"`
	Acceleration AccelerationData `json:"acceleration"`
}

type SensorObservation

type SensorObservation struct {
	SensorAddr   string             `json:"sensor_addr"`
	Time         time.Time          `json:"time"`
	Measurements SensorMeasurements `json:"measurements"`
}

type SensorResolver

type SensorResolver interface {
	Resolve(SensorObservation) (*ResolvedSensorObservation, bool)
}

type SensorWhitelist

type SensorWhitelist map[string]string

btAddr => friendlyName

type SqsOutputConfig

type SqsOutputConfig struct {
	QueueUrl           string `json:"queue_url"`
	AwsAccessKeyId     string `json:"aws_access_key_id"`
	AwsAccessKeySecret string `json:"aws_access_key_secret"`
}

Jump to

Keyboard shortcuts

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