loracloudgeolocationv3

package
v3.30.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package loracloudgeolocationv3 enables LoRa Cloud Geolocation Services integration.

Index

Constants

View Source
const PackageName = "lora-cloud-geolocation-v3"

PackageName defines the package name.

Variables

This section is empty.

Functions

func New

New instantiates the LoRa Cloud Geolocation package.

func RxMDSliceFromProto added in v3.27.0

func RxMDSliceFromProto(pb []*ttnpb.RxMetadata) ([]*api.RxMetadata, error)

RxMDSliceFromProto converts a slice of RxMetadata from a protobuf representation.

Types

type Data

type Data struct {
	// Query is the query type used by the package.
	Query *QueryType
	// MultiFrame enables multi frame requests for TOARSSI queries.
	MultiFrame *bool
	// MultiFrameWindowSize represents the number of historical frames to consider for the query.
	MultiFrameWindowSize *int
	// MultiFrameWindowAge limits the maximum age of the historical frames considered for the query.
	MultiFrameWindowAge *time.Duration
	// ServerURL represents the remote server to which the GLS queries are sent.
	ServerURL *url.URL
	// Token is the API token to be used when comunicating with the GLS server.
	Token *string
	// RecentMetadata are the metadatas from the recent uplink messages received by the gateway.
	RecentMetadata []*UplinkMetadata
}

Data contains the package configuration.

func (*Data) FromStruct

func (d *Data) FromStruct(st *structpb.Struct) error

FromStruct deserializes the configuration from *structpb.Struct.

func (*Data) GetMultiFrame added in v3.27.0

func (d *Data) GetMultiFrame() bool

GetMultiFrame returns the value of the MultiFrame field.

func (*Data) GetMultiFrameWindowAge added in v3.27.0

func (d *Data) GetMultiFrameWindowAge() time.Duration

GetMultiFrameWindowAge returns the value of the MultiFrameWindowAge field.

func (*Data) GetMultiFrameWindowSize added in v3.27.0

func (d *Data) GetMultiFrameWindowSize() int

GetMultiFrameWindowSize returns the value of the MultiFrameWindowSize field.

func (*Data) Struct

func (d *Data) Struct() (*structpb.Struct, error)

Struct serializes the configuration to *structpb.Struct.

type GeolocationPackage

type GeolocationPackage struct {
	// contains filtered or unexported fields
}

GeolocationPackage is the LoRa Cloud Geolocation application package.

func (*GeolocationPackage) HandleUp

HandleUp implements packages.ApplicationPackageHandler.

func (*GeolocationPackage) Package

Package implements packages.ApplicationPackageHandler.

type QueryType

type QueryType uint8

QueryType enum defines the location query types of the package.

const (
	// QUERY_TOARSSI uses the TOA and RSSI information from the gateway metadata to compute the location of the end device.
	QUERY_TOARSSI QueryType = iota
	// QUERY_GNSS uses the GNSS scan operations payload of the LR1110 transceiver.
	QUERY_GNSS
	// QUERY_TOAWIFI uses the TOA and RSSI information, in addition to nearby WiFi access points.
	QUERY_TOAWIFI
)

func (*QueryType) FromValue

func (t *QueryType) FromValue(v *structpb.Value) error

FromValue sets the query type from a protobuf value.

func (QueryType) Value

func (t QueryType) Value() *structpb.Value

Value returns the protobuf value for the query type.

type UplinkMetadata added in v3.27.0

type UplinkMetadata struct {
	RxMetadata []*api.RxMetadata `json:"rx_metadata"`
	ReceivedAt time.Time         `json:"received_at"`
}

UplinkMetadata contains the uplink metadata stored by the package.

func (u *UplinkMetadata) FromApplicationUplink(msg *ttnpb.ApplicationUplink) error

FromApplicationUplink cleans the ApplicationUplink to stored values for the UpLinkMetadata.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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