Documentation ¶
Index ¶
Constants ¶
const ( EuropeG subBand = "europe g" EuropeG1 = "europe g1" EuropeG2 = "europe g2" EuropeG3 = "europe g3" EuropeG4 = "europe g4" UsISM = "united states" AuISM = "australia" )
Available sub-bands
const ( Europe Region = "eu" US = "us" China = "cn" Australia = "au" World = "world" )
Available regions for LoRaWAN
Variables ¶
This section is empty.
Functions ¶
func GetSubBand ¶
GetSubBand returns the subband associated to a given frequency
Types ¶
type Configuration ¶
type Configuration struct { ID int // The ID provided during updates Frequency float32 DataRate string RXDelay uint32 JoinDelay uint32 Power uint32 CFList [5]uint32 }
Configuration 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 ¶
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(r Region, 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, isJoin bool) *Configuration
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