Documentation ¶
Index ¶
- Variables
- func Read(ctx context.Context, sensors []Sensor) ([]*types.MeasuredValue, error)
- func ReadChannel(ctx context.Context, sensors []Sensor, ...)
- func ReadContinuously(ctx context.Context, sensors []Sensor, ...)
- type BME280
- func (s *BME280) GetSensorModel() types.SensorModel
- func (s *BME280) Read() ([]*types.MeasuredValue, error)
- func (s *BME280) ReadChannel(measuredValuesChannel chan<- []*types.MeasuredValue, errorChannel chan<- error, ...)
- func (s *BME280) ReadContinously(ctx context.Context, measuredValuesChannel chan<- []*types.MeasuredValue, ...)
- type DHT11
- func (s *DHT11) GetSensorModel() types.SensorModel
- func (s *DHT11) Read() ([]*types.MeasuredValue, error)
- func (s *DHT11) ReadChannel(measuredValuesChannel chan<- []*types.MeasuredValue, errorChannel chan<- error, ...)
- func (s *DHT11) ReadContinously(ctx context.Context, measuredValuesChannel chan<- []*types.MeasuredValue, ...)
- type DHT22
- func (s *DHT22) GetSensorModel() types.SensorModel
- func (s *DHT22) Read() ([]*types.MeasuredValue, error)
- func (s *DHT22) ReadChannel(measuredValuesChannel chan<- []*types.MeasuredValue, errorChannel chan<- error, ...)
- func (s *DHT22) ReadContinously(ctx context.Context, measuredValuesChannel chan<- []*types.MeasuredValue, ...)
- type DS18B20
- func (s *DS18B20) GetSensorModel() types.SensorModel
- func (s *DS18B20) Read() ([]*types.MeasuredValue, error)
- func (s *DS18B20) ReadChannel(measuredValuesChannel chan<- []*types.MeasuredValue, errorChannel chan<- error, ...)
- func (s *DS18B20) ReadContinously(ctx context.Context, measuredValuesChannel chan<- []*types.MeasuredValue, ...)
- type Sensor
Constants ¶
This section is empty.
Variables ¶
var ErrParseData = errors.New("Can not parse data")
var ErrReadSensor = errors.New("Can not read data from Sensor")
Functions ¶
func ReadChannel ¶
func ReadChannel(ctx context.Context, sensors []Sensor, measuredValuesChannel chan<- []*types.MeasuredValue, errorChannel chan<- error)
ReadChannel reads the measured values from sensors and writes them to a channel.
func ReadContinuously ¶
func ReadContinuously(ctx context.Context, sensors []Sensor, measuredValuesChannel chan<- []*types.MeasuredValue, errorChannel chan<- error)
ReadContinuously reads the measured values continously from sensors and writes them to a channel.
Types ¶
type BME280 ¶
BME280 is a sensor to measure humidity and temperature.
func (*BME280) GetSensorModel ¶
func (s *BME280) GetSensorModel() types.SensorModel
GetSensorModel returns the sensor model
func (*BME280) ReadChannel ¶
func (s *BME280) ReadChannel(measuredValuesChannel chan<- []*types.MeasuredValue, errorChannel chan<- error, wg *sync.WaitGroup)
ReadChannel reads the measured values from the sensor and writes them to a channel.
func (*BME280) ReadContinously ¶
func (s *BME280) ReadContinously(ctx context.Context, measuredValuesChannel chan<- []*types.MeasuredValue, errorChannel chan<- error)
ReadContinously reads the measured values continously from the sensor and writes them to a channel.
type DHT11 ¶
DHT11 is a sensor to measure humidity and temperature.
func (*DHT11) GetSensorModel ¶
func (s *DHT11) GetSensorModel() types.SensorModel
GetSensorModel returns the sensor model
func (*DHT11) ReadChannel ¶
func (s *DHT11) ReadChannel(measuredValuesChannel chan<- []*types.MeasuredValue, errorChannel chan<- error, wg *sync.WaitGroup)
ReadChannel reads the measured values from the sensor and writes them to a channel.
func (*DHT11) ReadContinously ¶
func (s *DHT11) ReadContinously(ctx context.Context, measuredValuesChannel chan<- []*types.MeasuredValue, errorChannel chan<- error)
ReadContinously reads the measured values continously from the sensor and writes them to a channel.
type DHT22 ¶
DHT22 is a sensor to measure humidity and temperature.
func (*DHT22) GetSensorModel ¶
func (s *DHT22) GetSensorModel() types.SensorModel
GetSensorModel returns the sensor model
func (*DHT22) ReadChannel ¶
func (s *DHT22) ReadChannel(measuredValuesChannel chan<- []*types.MeasuredValue, errorChannel chan<- error, wg *sync.WaitGroup)
ReadChannel reads the measured values from the sensor and writes them to a channel.
func (*DHT22) ReadContinously ¶
func (s *DHT22) ReadContinously(ctx context.Context, measuredValuesChannel chan<- []*types.MeasuredValue, errorChannel chan<- error)
ReadContinously reads the measured values continously from the sensor and writes them to a channel.
type DS18B20 ¶
DS18B20 is a sensor to measure humidity and temperature.
func (*DS18B20) GetSensorModel ¶
func (s *DS18B20) GetSensorModel() types.SensorModel
GetSensorModel returns the sensor model
func (*DS18B20) Read ¶
func (s *DS18B20) Read() ([]*types.MeasuredValue, error)
Read measured values
func (*DS18B20) ReadChannel ¶
func (s *DS18B20) ReadChannel(measuredValuesChannel chan<- []*types.MeasuredValue, errorChannel chan<- error, wg *sync.WaitGroup)
ReadChannel reads the measured values from the sensor and writes them to a channel.
func (*DS18B20) ReadContinously ¶
func (s *DS18B20) ReadContinously(ctx context.Context, measuredValuesChannel chan<- []*types.MeasuredValue, errorChannel chan<- error)
ReadContinously reads the measured values continously from the sensor and writes them to a channel.
type Sensor ¶
type Sensor interface { GetSensorModel() types.SensorModel Read() ([]*types.MeasuredValue, error) ReadChannel(measuredValuesChannel chan<- []*types.MeasuredValue, errorChannel chan<- error, wg *sync.WaitGroup) ReadContinously(ctx context.Context, measuredValuesChannel chan<- []*types.MeasuredValue, errorChannel chan<- error) }