2019-06-13 19:25:32 +00:00
|
|
|
package sensor
|
|
|
|
|
2019-06-17 21:37:48 +00:00
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"sync"
|
|
|
|
|
|
|
|
"github.com/go-flucky/flucky/pkg/types"
|
|
|
|
)
|
2019-06-13 19:25:32 +00:00
|
|
|
|
2019-06-25 20:22:34 +00:00
|
|
|
type Sensor interface {
|
2019-06-13 19:25:32 +00:00
|
|
|
GetSensorModel() types.SensorModel
|
2019-06-25 20:22:34 +00:00
|
|
|
Read() ([]types.MeasuredValue, error)
|
2019-06-27 07:31:40 +00:00
|
|
|
ReadChannel(measuredValuesChannel chan<- []types.MeasuredValue, errorChannel chan<- error, wg *sync.WaitGroup)
|
|
|
|
ReadContinously(ctx context.Context, measuredValuesChannel chan<- []types.MeasuredValue, errorChannel chan<- error)
|
2019-06-13 19:25:32 +00:00
|
|
|
}
|