Documentation
¶
Index ¶
Constants ¶
View Source
const ( TypeFake = iota + 1 TypeAtmospheric )
Variables ¶
This section is empty.
Functions ¶
func NameByType ¶
NameByType maps human readable names to sensor types
Types ¶
type AtmosphericDataLine ¶
type AtmosphericDataLine struct { Timestamp time.Time Temperature float32 Humidity float32 Pressure float32 Altitude float32 VOCIndex float32 }
func ParseValidAtmosphericSensorLine ¶
func ParseValidAtmosphericSensorLine(line string) AtmosphericDataLine
ParseValidAtmosphericSensorLine assumes the sensor line is well-formed. If a part is missing, an empty struct is returned. If all parts are present but not valid types, that field will be unset.
type AtmosphericSensor ¶
type AtmosphericSensor struct {
// contains filtered or unexported fields
}
AtmosphericSensor tracks sensor input from the BME280 and SGP40 sensor boards from Adafruit
func NewAtmospheric ¶
func NewAtmospheric(executable string, sensorPollFreqSec int) *AtmosphericSensor
func (*AtmosphericSensor) Close ¶
func (a *AtmosphericSensor) Close()
func (*AtmosphericSensor) Data ¶
func (a *AtmosphericSensor) Data() (chan Data, chan error)
func (*AtmosphericSensor) Init ¶
func (a *AtmosphericSensor) Init() error
func (*AtmosphericSensor) Ping ¶
func (a *AtmosphericSensor) Ping() error
func (*AtmosphericSensor) Type ¶
func (a *AtmosphericSensor) Type() uint8
func (*AtmosphericSensor) TypeStr ¶
func (a *AtmosphericSensor) TypeStr() string
type FakeSensor ¶
type FakeSensor struct {
Buf string
}
func (*FakeSensor) Close ¶
func (f *FakeSensor) Close()
func (*FakeSensor) Data ¶
func (f *FakeSensor) Data() (chan Data, chan error)
func (*FakeSensor) Init ¶
func (f *FakeSensor) Init() error
func (*FakeSensor) Ping ¶
func (f *FakeSensor) Ping() error
func (*FakeSensor) Type ¶
func (f *FakeSensor) Type() uint8
func (*FakeSensor) TypeStr ¶
func (f *FakeSensor) TypeStr() string
type Sensor ¶
type Sensor interface { // Type denotes the sensor type in the message. // If type is 0, it corresponds to a non-data message (ping, etc) Type() uint8 TypeStr() string // Init starts or initializes the connection with the sensor Init() error Ping() error // Data returns error and data channels from the sensor. // The channels do not have to be buffered Data() (chan Data, chan error) Close() }
Click to show internal directories.
Click to hide internal directories.