internal

package
v0.0.0-...-31113e1 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2021 License: ISC Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const RX_BYTE = "1"
View Source
const SPARKFUN_WEATHER_SHIELD = "SPARKFUN-DEV-13956"

Variables

This section is empty.

Functions

func PrettyPrintTimeSeriesData

func PrettyPrintTimeSeriesData(tsd *SparkFunWeatherShieldTimeSeriesData)

Function used to print to the console the time series data.

Types

type ArduinoReader

type ArduinoReader struct {
	// contains filtered or unexported fields
}

The abstraction of the `SparkFun Weather Shield` reader.

func NewArduinoReader

func NewArduinoReader(devicePath string, arduinoShield string) *ArduinoReader

Constructor used to intialize the serial reader designed to communicate with Arduino configured for the `SparkFun Weather Shield` settings.

func (*ArduinoReader) GetTimeSeriesData

func (ar *ArduinoReader) GetTimeSeriesData() []*pb.TelemetryDatum

type SparkFunWeatherShieldTimeSeriesData

type SparkFunWeatherShieldTimeSeriesData struct {
	Status                 string  `json:"status,omitempty"`
	Runtime                int     `json:"runtime,omitempty"`
	Id                     int     `json:"id,omitempty"`
	HumidityValue          float32 `json:"humidity_value,omitempty"`
	HumidityUnit           string  `json:"humidity_unit,omitempty"`
	TemperatureValue       float32 `json:"temperature_primary_value,omitempty"`
	TemperatureUnit        string  `json:"temperature_primary_unit,omitempty"`
	PressureValue          float32 `json:"pressure_value,omitempty"`
	PressureUnit           string  `json:"pressure_unit,omitempty"`
	TemperatureBackupValue float32 `json:"temperature_secondary_value,omitempty"`
	TemperatureBackupUnit  string  `json:"temperature_secondary_unit,omitempty"`
	AltitudeValue          float32 `json:"altitude_value,omitempty"`
	AltitudeUnit           string  `json:"altitude_unit,omitempty"`
	IlluminanceValue       float32 `json:"illuminance_value,omitempty"`
	IlluminanceUnit        string  `json:"illuminance_unit,omitempty"`
	Timestamp              int64   `json:"timestamp,omitempty"`
}

The time-series data structure used to store all the data that will be returned by the `SparkFun Weather Shield` Arduino device.

Please note that the value fields must be float32 as this was specified by the hardware manufacturar, if you use float64 you will get an error.

type TReaderServer

type TReaderServer struct {
	// contains filtered or unexported fields
}

func New

func New(arduinoDevicePath string, arduinoShield string, port int) *TReaderServer

func (*TReaderServer) RunMainRuntimeLoop

func (s *TReaderServer) RunMainRuntimeLoop()

Function will consume the main runtime loop and run the business logic of the application.

func (*TReaderServer) StopMainRuntimeLoop

func (s *TReaderServer) StopMainRuntimeLoop()

Function will tell the application to stop the main runtime loop when the process has been finished.

type TelemetryServerImpl

type TelemetryServerImpl struct {
	pb.TelemetryServer
	// contains filtered or unexported fields
}

func (*TelemetryServerImpl) GetTimeSeriesData

func (s *TelemetryServerImpl) GetTimeSeriesData(in *empty.Empty, stream pb.Telemetry_GetTimeSeriesDataServer) error

Jump to

Keyboard shortcuts

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