sensor

package
v0.0.0-...-65d10dd Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSensorServer

func NewSensorServer() *sensorServer

Types

type Sensor

type Sensor struct {
	*bsbmp.BMP
	SensorID    *uint8   `json:"sensor_id,omitempty"`
	Temperature *float32 `json:"temperature,omitempty"`
	Humidity    *float32 `json:"humidity,omitempty"`
	Pressue     *float32 `json:"pressure,omitempty"`
	Altitude    *float32 `json:"altitude,omitempty"`
}

Sensor is the retreived environment properties.

var PiSensor *Sensor

type SensorStore

type SensorStore struct {
	sync.Mutex
	// contains filtered or unexported fields
}

SensorStore is a simple in-memory database of tasks; SensorStore methods are safe to call concurrently.

func NewSensorStore

func NewSensorStore() *SensorStore

func (*SensorStore) GetAllSensors

func (ss *SensorStore) GetAllSensors() ([]Sensor, error)

GetAllSensors returns all the tasks in the store, in arbitrary order.

func (*SensorStore) GetSensor

func (ss *SensorStore) GetSensor(id int) (*Sensor, error)

SensorStore retrieves a task from the store, by id. If no such id exists, an error is returned.

Jump to

Keyboard shortcuts

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