firmware
firmware copied to clipboard
Add REGULATORY_GAIN configuration to remain within regulatory ERP limit
REGULATORY_GAIN is the total system gain in dBm to subtract from the configured Tx power, to remain within regulatory ERP limit for non-licensed operators.
This value should be set in variant.h and is PA gain + antenna gain (if system has a fixed antenna).
This is similar to antenna_gain/NL80211_ATTR_WIPHY_ANTENNA_GAIN/NL80211_ATTR_REG_RULE_POWER_MAX_ANT_GAIN setting in Linux Regulatory/OpenWrt/mac80211/nl80211/iw.
The final transmit power is (myRegion->powerLimit - REGULATORY_GAIN) or the user's configured loraConfig.tx_power, whichever is lower.
This is implemented in DIY XIAO BLE EBYTE E22-900M30S variant as an example.