Documentation ¶
Overview ¶
Package sensor contains a gRPC based sensor client.
Package sensor defines an abstract sensing device that can provide measurement readings.
Package sensor contains a gRPC based Sensor service subtypeServer.
Index ¶
- Constants
- Variables
- func Named(name string) resource.Name
- func NamesFromRobot(r robot.Robot) []string
- func NewServer(s subtype.Service) pb.SensorServiceServer
- func NewUnimplementedInterfaceError(actual interface{}) error
- func WrapWithReconfigurable(r interface{}, name resource.Name) (resource.Reconfigurable, error)
- type ReadingRecord
- type ReadingRecords
- type Sensor
Constants ¶
const SubtypeName = resource.SubtypeName("sensor")
SubtypeName is a constant that identifies the component resource subtype string "Sensor".
Variables ¶
var Subtype = resource.NewSubtype( resource.ResourceNamespaceRDK, resource.ResourceTypeComponent, SubtypeName, )
Subtype is a constant that identifies the component resource subtype.
Functions ¶
func NamesFromRobot ¶
NamesFromRobot is a helper for getting all sensor names from the given Robot.
func NewServer ¶
func NewServer(s subtype.Service) pb.SensorServiceServer
NewServer constructs an sensor gRPC service subtypeServer.
func NewUnimplementedInterfaceError ¶
func NewUnimplementedInterfaceError(actual interface{}) error
NewUnimplementedInterfaceError is used when there is a failed interface check.
func WrapWithReconfigurable ¶
func WrapWithReconfigurable(r interface{}, name resource.Name) (resource.Reconfigurable, error)
WrapWithReconfigurable converts a regular Sensor implementation to a reconfigurableSensor. If Sensor is already a reconfigurableSensor, then nothing is done.
Types ¶
type ReadingRecord ¶ added in v0.2.19
type ReadingRecord struct { ReadingName string Reading interface{} }
ReadingRecord a single analog reading.
type ReadingRecords ¶ added in v0.2.19
type ReadingRecords struct {
Readings []ReadingRecord
}
ReadingRecords a collection of ReadingRecord.
type Sensor ¶
type Sensor interface { // Readings return data specific to the type of sensor and can be of any type. Readings(ctx context.Context, extra map[string]interface{}) (map[string]interface{}, error) generic.Generic }
A Sensor represents a general purpose sensors that can give arbitrary readings of some thing that it is sensing.
func NewClientFromConn ¶
func NewClientFromConn(ctx context.Context, conn rpc.ClientConn, name string, logger golog.Logger) Sensor
NewClientFromConn constructs a new Client from connection passed in.
Directories ¶
Path | Synopsis |
---|---|
Package bme280 implements a bme280 sensor for temperature, humidity, and pressure.
|
Package bme280 implements a bme280 sensor for temperature, humidity, and pressure. |
Package charge implements a charge controller sensor
|
Package charge implements a charge controller sensor |
Package ds18b20 implements a 1-wire temperature sensor
|
Package ds18b20 implements a 1-wire temperature sensor |
Package fake implements a fake Sensor.
|
Package fake implements a fake Sensor. |
Package register registers all relevant Sensors
|
Package register registers all relevant Sensors |
Package sht3xd implements a sht3x-d sensor for temperature and humidity datasheet can be found at: https://cdn-shop.adafruit.com/product-files/2857/Sensirion_Humidity_SHT3x_Datasheet_digital-767294.pdf example repo: https://github.com/esphome/esphome/tree/dev/esphome/components/sht3xd
|
Package sht3xd implements a sht3x-d sensor for temperature and humidity datasheet can be found at: https://cdn-shop.adafruit.com/product-files/2857/Sensirion_Humidity_SHT3x_Datasheet_digital-767294.pdf example repo: https://github.com/esphome/esphome/tree/dev/esphome/components/sht3xd |
Package ultrasonic implements an ultrasonic sensor based of the yahboom ultrasonic sensor
|
Package ultrasonic implements an ultrasonic sensor based of the yahboom ultrasonic sensor |