MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / DeviceShouldAdaptDataRate

Function DeviceShouldAdaptDataRate

pkg/networkserver/mac/adr.go:150–155  ·  view source on GitHub ↗

DeviceShouldAdaptDataRate returns if the ADR algorithm should be run for the end device.

(dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings, phy *band.Band)

Source from the content-addressed store, hash-verified

148
149// DeviceShouldAdaptDataRate returns if the ADR algorithm should be run for the end device.
150func DeviceShouldAdaptDataRate(dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings, phy *band.Band) (adaptDataRate bool, resetDesiredParameters bool, staticSettings *ttnpb.ADRSettings_StaticMode) {
151 if dev.GetMacSettings().GetAdr() != nil {
152 return deviceShouldAdaptDataRate(dev, defaults, phy)
153 }
154 return legacyDeviceShouldAdaptDataRate(dev, defaults, phy)
155}
156
157func deviceADRMargin(dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings) float32 {
158 switch {

Callers 1

handleDataUplinkMethod · 0.92

Calls 4

GetAdrMethod · 0.45
GetMacSettingsMethod · 0.45

Tested by

no test coverage detected