1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

net/lorawan : Move 'LORAMAC_DEFAULT_TX_MODE' to 'CONFIG_'

Move 'LORAMAC_DEFAULT_TX_MODE' to 'CONFIG_' and added symbols
for Kconfig exposure
This commit is contained in:
Akshai M 2020-11-23 14:16:22 +01:00
parent aa3b1da0c4
commit d2d90fbce5
6 changed files with 14 additions and 8 deletions

View File

@ -252,7 +252,7 @@ int rn2xx3_mac_init(rn2xx3_t *dev)
rn2xx3_mac_set_dr(dev, CONFIG_LORAMAC_DEFAULT_DR);
rn2xx3_mac_set_tx_power(dev, CONFIG_LORAMAC_DEFAULT_TX_POWER);
rn2xx3_mac_set_tx_port(dev, CONFIG_LORAMAC_DEFAULT_TX_PORT);
rn2xx3_mac_set_tx_mode(dev, LORAMAC_DEFAULT_TX_MODE);
rn2xx3_mac_set_tx_mode(dev, CONFIG_LORAMAC_DEFAULT_TX_MODE);
rn2xx3_mac_set_adr(dev, LORAMAC_DEFAULT_ADR);
rn2xx3_mac_set_retx(dev, LORAMAC_DEFAULT_RETX);
rn2xx3_mac_set_linkchk_interval(dev, LORAMAC_DEFAULT_LINKCHK);

View File

@ -47,7 +47,7 @@ CFLAGS += -DLORAMAC_DEFAULT_JOIN_PROCEDURE=LORAMAC_JOIN_OTAA
#CFLAGS += -DCONFIG_LORAMAC_DEFAULT_DR=LORAMAC_DR_5
# Set default messages to unconfirmable
CFLAGS += -DLORAMAC_DEFAULT_TX_MODE=LORAMAC_TX_CNF
CFLAGS += -DCONFIG_LORAMAC_DEFAULT_TX_MODE=LORAMAC_TX_UNCNF
include $(RIOTBASE)/Makefile.include

View File

@ -381,7 +381,7 @@ void _init_loramac(semtech_loramac_t *mac,
semtech_loramac_set_public_network(mac, LORAMAC_DEFAULT_PUBLIC_NETWORK);
semtech_loramac_set_class(mac, CONFIG_LORAMAC_DEFAULT_DEVICE_CLASS);
semtech_loramac_set_tx_port(mac, CONFIG_LORAMAC_DEFAULT_TX_PORT);
semtech_loramac_set_tx_mode(mac, LORAMAC_DEFAULT_TX_MODE);
semtech_loramac_set_tx_mode(mac, CONFIG_LORAMAC_DEFAULT_TX_MODE);
semtech_loramac_set_system_max_rx_error(mac,
LORAMAC_DEFAULT_SYSTEM_MAX_RX_ERROR);
semtech_loramac_set_min_rx_symbols(mac, LORAMAC_DEFAULT_MIN_RX_SYMBOLS);

View File

@ -246,9 +246,15 @@ extern "C" {
/**
* @brief Default MAC TX mode (confirmable or unconfirmable)
*/
#ifndef LORAMAC_DEFAULT_TX_MODE
#define LORAMAC_DEFAULT_TX_MODE (LORAMAC_TX_CNF)
#endif
#if IS_ACTIVE(CONFIG_LORAMAC_DEFAULT_TX_MODE_CNF)
#define CONFIG_LORAMAC_DEFAULT_TX_MODE (LORAMAC_TX_CNF)
#elif IS_ACTIVE(CONFIG_LORAMAC_DEFAULT_TX_MODE_UNCNF)
#define CONFIG_LORAMAC_DEFAULT_TX_MODE (LORAMAC_TX_UNCNF)
#endif
#ifndef CONFIG_LORAMAC_DEFAULT_TX_MODE
#define CONFIG_LORAMAC_DEFAULT_TX_MODE (LORAMAC_TX_CNF)
#endif
/**
* @brief Default adaptive datarate state

View File

@ -183,7 +183,7 @@ static void _reset(gnrc_netif_t *netif)
netif->lorawan.demod_margin = 0;
netif->lorawan.num_gateways = 0;
netif->lorawan.port = CONFIG_LORAMAC_DEFAULT_TX_PORT;
netif->lorawan.ack_req = LORAMAC_DEFAULT_TX_MODE == LORAMAC_TX_CNF;
netif->lorawan.ack_req = CONFIG_LORAMAC_DEFAULT_TX_MODE == LORAMAC_TX_CNF;
netif->lorawan.flags = 0;
}

View File

@ -397,7 +397,7 @@ int _loramac_handler(int argc, char **argv)
return 1;
}
uint8_t cnf = LORAMAC_DEFAULT_TX_MODE; /* Default: confirmable */
uint8_t cnf = CONFIG_LORAMAC_DEFAULT_TX_MODE; /* Default: confirmable */
uint8_t port = CONFIG_LORAMAC_DEFAULT_TX_PORT; /* Default: 2 */
/* handle optional parameters */
if (argc > 3) {