sensors

package
v0.51.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package sensors contains a gRPC based sensors service client

Package sensors implements a sensors service.

Package sensors contains a gRPC based sensors service server

Index

Constants

View Source
const SubtypeName = "sensors"

SubtypeName is the name of the type of service.

Variables

View Source
var API = resource.APINamespaceRDK.WithServiceType(SubtypeName)

API is a variable that identifies the sensor service resource API.

Functions

func FindFirstName added in v0.0.8

func FindFirstName(r robot.Robot) string

FindFirstName returns name of first sensors service found.

func Named

func Named(name string) resource.Name

Named is a helper for getting the named sensor's typed resource name. RSDK-347 Implements senors's Named.

func NewRPCServiceServer added in v0.2.36

func NewRPCServiceServer(coll resource.APIResourceCollection[Service]) interface{}

NewRPCServiceServer constructs a sensors gRPC service server. It is intentionally untyped to prevent use outside of tests.

Types

type Readings

type Readings struct {
	Name     resource.Name
	Readings map[string]interface{}
}

A Readings ties both the sensor name and its reading together.

// Get the readings provided by the sensor.
readings, err := mySensor.Readings(context.Background(), nil)

type Service

type Service interface {
	resource.Resource
	Sensors(ctx context.Context, extra map[string]interface{}) ([]resource.Name, error)
	Readings(ctx context.Context, sensorNames []resource.Name, extra map[string]interface{}) ([]Readings, error)
}

A Service centralizes all sensors into one place.

func FirstFromRobot added in v0.0.8

func FirstFromRobot(r robot.Robot) (Service, error)

FirstFromRobot returns the first sensor service in this robot.

func FromRobot

func FromRobot(r robot.Robot, name string) (Service, error)

FromRobot is a helper for getting the named sensor service from the given Robot.

func NewClientFromConn

func NewClientFromConn(
	ctx context.Context,
	conn rpc.ClientConn,
	remoteName string,
	name resource.Name,
	logger logging.Logger,
) (Service, error)

NewClientFromConn constructs a new Client from connection passed in.

Directories

Path Synopsis
Package builtin implements the default sensors service.
Package builtin implements the default sensors service.
Package register registers all relevant sensors models and also API specific functions
Package register registers all relevant sensors models and also API specific functions

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL