DeviceShouldAdaptDataRate returns if the ADR algorithm should be run for the end device.
(dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings, phy *band.Band)
| 148 | |
| 149 | // DeviceShouldAdaptDataRate returns if the ADR algorithm should be run for the end device. |
| 150 | func 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 | |
| 157 | func deviceADRMargin(dev *ttnpb.EndDevice, defaults *ttnpb.MACSettings) float32 { |
| 158 | switch { |
no test coverage detected