mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
Merge #19466
19466: sys/shell: fix missing generic lora settings in ifconfig r=aabadie a=aabadie Co-authored-by: Alexandre Abadie <alexandre.abadie@inria.fr>
This commit is contained in:
commit
acd02f1f9c
@ -14,6 +14,7 @@ menuconfig MODULE_SX126X
|
||||
depends on HAS_PERIPH_GPIO
|
||||
depends on HAS_PERIPH_GPIO_IRQ
|
||||
select MODULE_IOLIST
|
||||
select MODULE_LORA
|
||||
select MODULE_NETDEV_LEGACY_API
|
||||
select MODULE_PERIPH_GPIO
|
||||
select MODULE_PERIPH_GPIO_IRQ
|
||||
|
@ -2,3 +2,5 @@ USEMODULE += iolist
|
||||
USEMODULE += netdev_legacy_api
|
||||
USEPKG += driver_sx126x
|
||||
FEATURES_REQUIRED += periph_gpio_irq
|
||||
|
||||
USEMODULE += lora
|
||||
|
@ -215,10 +215,12 @@ static void _set_usage(char *cmd_name)
|
||||
" * \"pan\" - alias for \"nid\"\n"
|
||||
" * \"pan_id\" - alias for \"nid\"\n"
|
||||
" * \"phy_busy\" - set busy mode on-off\n"
|
||||
#if IS_USED(MODULE_SHELL_CMD_GNRC_NETIF_LORAWAN)
|
||||
#if IS_USED(MODULE_LORA)
|
||||
" * \"bw\" - alias for channel bandwidth\n"
|
||||
" * \"sf\" - alias for spreading factor\n"
|
||||
" * \"cr\" - alias for coding rate\n"
|
||||
#endif
|
||||
#if IS_USED(MODULE_SHELL_CMD_GNRC_NETIF_LORAWAN)
|
||||
" * \"appkey\" - sets Application key\n"
|
||||
" * \"appskey\" - sets Application session key\n"
|
||||
#if IS_USED(MODULE_GNRC_LORAWAN_1_1)
|
||||
@ -391,7 +393,7 @@ static void _print_netopt(netopt_t opt)
|
||||
printf("encryption key");
|
||||
break;
|
||||
|
||||
#if IS_USED(MODULE_SHELL_CMD_GNRC_NETIF_LORAWAN)
|
||||
#if IS_USED(MODULE_LORA)
|
||||
case NETOPT_BANDWIDTH:
|
||||
printf("bandwidth");
|
||||
break;
|
||||
@ -504,7 +506,7 @@ static const char *_netopt_state_str[] = {
|
||||
[NETOPT_STATE_STANDBY] = "STANDBY"
|
||||
};
|
||||
|
||||
#if IS_USED(MODULE_SHELL_CMD_GNRC_NETIF_LORAWAN)
|
||||
#if IS_USED(MODULE_LORA)
|
||||
static const char *_netopt_bandwidth_str[] = {
|
||||
[LORA_BW_125_KHZ] = "125",
|
||||
[LORA_BW_250_KHZ] = "250",
|
||||
@ -676,7 +678,7 @@ static void _netif_list(netif_t *iface)
|
||||
if (res >= 0) {
|
||||
printf(" RSSI: %d ", i16);
|
||||
}
|
||||
#if IS_USED(MODULE_SHELL_CMD_GNRC_NETIF_LORAWAN)
|
||||
#if IS_USED(MODULE_LORA)
|
||||
res = netif_get_opt(iface, NETOPT_BANDWIDTH, 0, &u8, sizeof(u8));
|
||||
if (res >= 0) {
|
||||
printf(" BW: %skHz ", _netopt_bandwidth_str[u8]);
|
||||
@ -999,7 +1001,7 @@ static int _netif_set_u32(netif_t *iface, netopt_t opt, uint32_t context,
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if IS_USED(MODULE_SHELL_CMD_GNRC_NETIF_LORAWAN)
|
||||
#if IS_USED(MODULE_LORA)
|
||||
static int _netif_set_bandwidth(netif_t *iface, char *value)
|
||||
{
|
||||
uint8_t bw;
|
||||
@ -1504,7 +1506,7 @@ static int _netif_set(char *cmd_name, netif_t *iface, char *key, char *value)
|
||||
else if ((strcmp("frequency", key) == 0) || (strcmp("freq", key) == 0)) {
|
||||
return _netif_set_u32(iface, NETOPT_CHANNEL_FREQUENCY, 0, value);
|
||||
}
|
||||
#if IS_USED(MODULE_SHELL_CMD_GNRC_NETIF_LORAWAN)
|
||||
#if IS_USED(MODULE_LORA)
|
||||
else if ((strcmp("bandwidth", key) == 0) || (strcmp("bw", key) == 0)) {
|
||||
return _netif_set_bandwidth(iface, value);
|
||||
}
|
||||
@ -1514,6 +1516,8 @@ static int _netif_set(char *cmd_name, netif_t *iface, char *key, char *value)
|
||||
else if ((strcmp("coding_rate", key) == 0) || (strcmp("cr", key) == 0)) {
|
||||
return _netif_set_coding_rate(iface, value);
|
||||
}
|
||||
#endif
|
||||
#if IS_USED(MODULE_SHELL_CMD_GNRC_NETIF_LORAWAN)
|
||||
#if IS_USED(MODULE_GNRC_LORAWAN_1_1)
|
||||
else if (strcmp("joineui", key) == 0) {
|
||||
return _netif_set_lw_key(iface, NETOPT_LORAWAN_JOINEUI, value);
|
||||
|
@ -17,6 +17,7 @@ BOARD_PROVIDES_NETIF := \
|
||||
iotlab-a8-m3 \
|
||||
iotlab-m3 \
|
||||
lobaro-lorabox \
|
||||
lora-e5-dev \
|
||||
lsn50 \
|
||||
microbit \
|
||||
microbit-v2 \
|
||||
@ -35,6 +36,7 @@ BOARD_PROVIDES_NETIF := \
|
||||
nucleo-f429zi \
|
||||
nucleo-f439zi \
|
||||
nucleo-f767zi \
|
||||
nucleo-wl55jc \
|
||||
openlabs-kw41z-mini \
|
||||
openlabs-kw41z-mini-256kib \
|
||||
openmote-b \
|
||||
|
Loading…
Reference in New Issue
Block a user