lorawan: Add support for SystemMaxRxError

SystemMaxRxError is used to negotiate overall timing error for Rx
in the loramac-node library. Hence, add support for configuring this
parameter from Kconfig.

Signed-off-by: Kuba Sanak <contact@kuba.fyi>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
This commit is contained in:
Kuba Sanak 2020-03-04 20:14:56 +05:30 committed by Carles Cufí
commit b44dcf88d9
2 changed files with 11 additions and 0 deletions

View file

@ -17,6 +17,13 @@ module = LORAWAN
module-str = lorawan
source "subsys/logging/Kconfig.template.log_config"
config LORAWAN_SYSTEM_MAX_RX_ERROR
int "LoRaWAN System Max Rx Error"
default 20
help
System Max Rx timing error value in ms to be used by LoRaWAN stack
for calculating the RX1/RX2 window timing.
choice
prompt "LoRaWAN Region Selection"
default LORAMAC_REGION_UNKNOWN

View file

@ -511,6 +511,10 @@ int lorawan_start(void)
}
/* TODO: Move these to a proper location */
mib_req.Type = MIB_SYSTEM_MAX_RX_ERROR;
mib_req.Param.SystemMaxRxError = CONFIG_LORAWAN_SYSTEM_MAX_RX_ERROR;
LoRaMacMibSetRequestConfirm(&mib_req);
mib_req.Type = MIB_PUBLIC_NETWORK;
mib_req.Param.EnablePublicNetwork = true;
LoRaMacMibSetRequestConfirm(&mib_req);