Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
func (*Dispatcher) OnError ¶
func (d *Dispatcher) OnError(id ID, err error)
OnError dispatches a new error event.
func (*Dispatcher) OnHumidity ¶
func (d *Dispatcher) OnHumidity(id ID, h RH)
OnHumidity dispatches a new humidity event.
func (*Dispatcher) OnTemperature ¶
func (d *Dispatcher) OnTemperature(id ID, t T)
OnTemperature dispatches a new temperature event.
func (*Dispatcher) Register ¶
func (d *Dispatcher) Register(observer interface{}) (hnd int)
func (*Dispatcher) Time ¶
func (d *Dispatcher) Time() time.Time
func (*Dispatcher) Unregister ¶
func (d *Dispatcher) Unregister(hnd int)
type ErrorObserver ¶
type HumidityObserver ¶
type Observer ¶
type Observer interface { TemperatureObserver HumidityObserver ErrorObserver }
type Polling ¶
type Polling struct {
// contains filtered or unexported fields
}
func NewPolling ¶
NewPolling tries to identify the correct i2c bus and the connected devices and immediately starts polling. It does never fail, and instead just returns an instance which has no sensors.
func (*Polling) Dispatcher ¶
func (p *Polling) Dispatcher() *Dispatcher
type PrintObserver ¶
type PrintObserver struct { }
func (PrintObserver) OnError ¶
func (p PrintObserver) OnError(id ID, err error)
func (PrintObserver) OnHumidity ¶
func (p PrintObserver) OnHumidity(id ID, h RH)
func (PrintObserver) OnTemperature ¶
func (p PrintObserver) OnTemperature(id ID, t T)
type Sensor ¶
type Sensor interface {
Poll(*Dispatcher)
}
type TemperatureObserver ¶
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
Package crc8 provides a simple CRC8 implementation according to the Sensirion documentation.
|
Package crc8 provides a simple CRC8 implementation according to the Sensirion documentation. |
sensor
|
|
shtc3
Package shtc3 provides the i2c protocol implementation for the Sensirion shtc-3 temperature and humidity sensor.
|
Package shtc3 provides the i2c protocol implementation for the Sensirion shtc-3 temperature and humidity sensor. |
Click to show internal directories.
Click to hide internal directories.