sensor

package
v0.0.0-...-e582b95 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GetBasicInfo  = "sensor_get_basic_info"
	GetDeviceIds  = "sensor_get_device_ids"
	RspController = "rsp-controller"
)
View Source
const (
	DefaultFacility = "DEFAULT_FACILITY"
)

Variables

This section is empty.

Functions

func ExecuteSensorCommand

func ExecuteSensorCommand(deviceId string, commandName string) (*models.Reading, error)

ExecuteSensorCommand makes an HTTP GET call to the EdgeX core command service to execute a specified command on a given RSP sensor

func ForceRefreshSensorInfo

func ForceRefreshSensorInfo(deviceId string)

func QueryBasicInfo

func QueryBasicInfo(deviceId string) (*jsonrpc.SensorBasicInfo, error)

QueryBasicInfo makes a call to the EdgeX command service to request the RSP-Controller to return us more information about a given RSP sensor

func QueryBasicInfoAllSensors

func QueryBasicInfoAllSensors() error

QueryBasicInfoAllSensors retrieves the list of deviceIds from the RSP Controller and then queries the basic info for each one

func UpdateRSP

func UpdateRSP(rsp *RSP)

Types

type Personality

type Personality string
const (
	NoPersonality Personality = "NONE"
	Exit          Personality = "EXIT"
	POS           Personality = "POS"
	FittingRoom   Personality = "FITTING_ROOM"
)

type RSP

type RSP struct {
	DeviceId     string      `json:"device_id" bson:"device_id"`
	FacilityId   string      `json:"facility_id" bson:"facility_id"`
	Personality  Personality `json:"personality" bson:"personality"`
	Aliases      []string    `json:"aliases" bson:"aliases"`
	IsInDeepScan bool        `json:"-" bson:"-"`
}

func FindByAntennaAlias

func FindByAntennaAlias(alias string) *RSP

FindByAntennaAlias is a backwards lookup of an alias to the sensor (RSP) it belongs to Note that if more than one sensor has the same alias, it will just return the first match

func GetOrQueryRSPInfo

func GetOrQueryRSPInfo(deviceId string) (*RSP, error)

GetOrQueryRSPInfo returns a pointer to an RSP if found in memory, otherwise will query the command service for that info

func NewRSP

func NewRSP(deviceId string) *RSP

func NewRSPFromConfigNotification

func NewRSPFromConfigNotification(notification *jsonrpc.SensorConfigNotification) *RSP

func (*RSP) AntennaAlias

func (rsp *RSP) AntennaAlias(antennaId int) string

AntennaAlias gets the string alias of an RSP based on the antenna port format is DeviceId-AntennaId, ie. RSP-150009-0 If there is an alias defined for that antenna port, use that instead Note that each antenna port is supposed to refer to that index in the rsp.Aliases slice

func (*RSP) IsExitSensor

func (rsp *RSP) IsExitSensor() bool

IsExitSensor returns true if this RSP has the EXIT personality

func (*RSP) IsPOSSensor

func (rsp *RSP) IsPOSSensor() bool

IsPOSSensor returns true if this RSP has the POS personality

Jump to

Keyboard shortcuts

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