Documentation ¶
Index ¶
Constants ¶
const ( EuropeG subBand = "europe g" EuropeG1 = "europe g1" EuropeG2 = "europe g2" EuropeG3 = "europe g3" EuropeG4 = "europe g4" )
Available sub-bands
const ( Europe region = iota US China )
Available regions for LoRaWAN
Variables ¶
This section is empty.
Functions ¶
func GetSubBand ¶
GetSubBand returns the subband associated to a given frequency
Types ¶
type BestTarget ¶
type BestTarget struct { ID int // The ID provided during updates IsRX2 bool // Whether it should use RX2 }
BestTarget represents the best result that has been computed after all updates.
type DutyManager ¶
type DutyManager interface { Update(id []byte, freq float32, size uint32, datr string, codr string) error Lookup(id []byte) (Cycles, error) Close() error }
DutyManager provides an interface to manipulate and compute gateways duty-cycles.
func NewManager ¶
func NewManager(filepath string, cycleLength time.Duration, r region) (DutyManager, error)
NewManager constructs a new gateway manager from
type ScoreComputer ¶
type ScoreComputer struct {
// contains filtered or unexported fields
}
ScoreComputer enables an external component to manipulate metadata associated to several targets in order to determine which target is the most suitable for a downlink response. It considers two windows RX1 and RX2 with the following conventions:
For SF7 & SF8, RX1, the algorithm favors RX1
For SF9+ or, if no target is available on RX1, then RX2 is used
Within RX1 or RX2, the SNR is considered first (the higher the better), then the RSSI on a lower plan.
func NewScoreComputer ¶
func NewScoreComputer(datr string) (*ScoreComputer, scores, error)
NewScoreComputer constructs a new ScoreComputer and initiate an empty scores table
func (*ScoreComputer) Get ¶
func (c *ScoreComputer) Get(s scores) *BestTarget
Get returns the best score according to the configured spread factor and all updates. It returns nil if none of the target is available for a response