gateway

package
v3.16.8 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SelectDownlinkGateway

func SelectDownlinkGateway(minSNRMargin float64, rxDR int, rxInfo []storage.DeviceGatewayRXInfo) (storage.DeviceGatewayRXInfo, error)

SelectDownlinkGateway returns, given a slice of DeviceGatewayRXInfo elements the gateway (as a DeviceGatewayRXInfo) to use for downlink. In the current implementation it will sort the given slice based on SNR / RSSI, and return:

  • A random item from the elements with an SNR > minSNR
  • The first item of the sorted slice (failing the above)

Types

type BySignal

type BySignal []storage.DeviceGatewayRXInfo

BySignal implements sort.Interface for []gw.UplinkRXInfo based on signal strength.

func (BySignal) Len

func (s BySignal) Len() int

Len returns the number of elements.

func (BySignal) Less

func (s BySignal) Less(i, j int) bool

Less returns if i is greater than j (reverse sorting).

func (BySignal) Swap

func (s BySignal) Swap(i, j int)

Swap swaps i and j.

Jump to

Keyboard shortcuts

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