diff --git a/drivers/atwinc15x0/atwinc15x0_netdev.c b/drivers/atwinc15x0/atwinc15x0_netdev.c index 94fdf93969..54b90b0e22 100644 --- a/drivers/atwinc15x0/atwinc15x0_netdev.c +++ b/drivers/atwinc15x0/atwinc15x0_netdev.c @@ -372,7 +372,7 @@ static int _atwinc15x0_get(netdev_t *netdev, netopt_t opt, void *val, return sizeof(uint16_t); case NETOPT_RSSI: - assert(max_len == sizeof(int8_t)); + assert(max_len == sizeof(int16_t)); _rssi_info_ready = false; /* trigger the request current RSSI (asynchronous function) */ if (m2m_wifi_req_curr_rssi() != M2M_SUCCESS) { @@ -384,8 +384,8 @@ static int _atwinc15x0_get(netdev_t *netdev, netopt_t opt, void *val, ztimer_sleep(ZTIMER_MSEC, ATWINC15X0_WAIT_TIME_MS); } /* return the RSSI */ - *((int8_t *)val) = dev->rssi; - return sizeof(int8_t); + *((int16_t *)val) = dev->rssi; + return sizeof(int16_t); default: return netdev_eth_get(netdev, opt, val, max_len); diff --git a/drivers/include/net/netdev/lora.h b/drivers/include/net/netdev/lora.h index fc89a2ce24..4967930769 100644 --- a/drivers/include/net/netdev/lora.h +++ b/drivers/include/net/netdev/lora.h @@ -32,7 +32,7 @@ extern "C" { * @brief Received LoRa packet status information */ typedef struct { - uint8_t rssi; /**< RSSI of a received packet */ + int16_t rssi; /**< RSSI of a received packet */ int8_t snr; /**< S/N ratio */ } netdev_lora_rx_info_t; diff --git a/drivers/sx126x/sx126x_netdev.c b/drivers/sx126x/sx126x_netdev.c index 4d8ec8dc1a..6940e20a0b 100644 --- a/drivers/sx126x/sx126x_netdev.c +++ b/drivers/sx126x/sx126x_netdev.c @@ -291,9 +291,9 @@ static int _get(netdev_t *netdev, netopt_t opt, void *val, size_t max_len) return sizeof(netopt_enable_t); case NETOPT_RSSI: - assert(max_len >= sizeof(int8_t)); + assert(max_len >= sizeof(int16_t)); sx126x_get_rssi_inst(dev, ((int16_t *)val)); - return sizeof(int8_t); + return sizeof(int16_t); default: break; diff --git a/drivers/sx127x/sx127x_netdev.c b/drivers/sx127x/sx127x_netdev.c index c4d9667f24..c2091fea26 100644 --- a/drivers/sx127x/sx127x_netdev.c +++ b/drivers/sx127x/sx127x_netdev.c @@ -345,9 +345,9 @@ static int _get(netdev_t *netdev, netopt_t opt, void *val, size_t max_len) return sizeof(netopt_enable_t); case NETOPT_RSSI: - assert(max_len >= sizeof(int8_t)); - *((int8_t *)val) = sx127x_read_rssi(dev); - return sizeof(int8_t); + assert(max_len >= sizeof(int16_t)); + *((int16_t *)val) = sx127x_read_rssi(dev); + return sizeof(int16_t); default: break; diff --git a/pkg/semtech-loramac/contrib/semtech_loramac_radio.c b/pkg/semtech-loramac/contrib/semtech_loramac_radio.c index ea05dcb2ac..3d301b5221 100644 --- a/pkg/semtech-loramac/contrib/semtech_loramac_radio.c +++ b/pkg/semtech-loramac/contrib/semtech_loramac_radio.c @@ -205,8 +205,8 @@ void SX127XStartCad(void) int16_t SX127XRssi(RadioModems_t modem) { (void)modem; - int8_t rssi; - loramac_netdev_ptr->driver->get(loramac_netdev_ptr, NETOPT_RSSI, &rssi, sizeof(int8_t)); + int16_t rssi; + loramac_netdev_ptr->driver->get(loramac_netdev_ptr, NETOPT_RSSI, &rssi, sizeof(int16_t)); return rssi; } diff --git a/sys/include/net/netopt.h b/sys/include/net/netopt.h index 641ab8de7d..d072f22300 100644 --- a/sys/include/net/netopt.h +++ b/sys/include/net/netopt.h @@ -772,7 +772,7 @@ typedef enum { NETOPT_LINK_CHECK, /** - * @brief (int8_t) Received Signal Strength Indicator (RSSI) + * @brief (int16_t) Received Signal Strength Indicator (RSSI) * * The RSSI is an indicator for the received field strength in wireless * channels. It is often represented as the ratio of received power to diff --git a/sys/shell/commands/sc_gnrc_netif.c b/sys/shell/commands/sc_gnrc_netif.c index 8ad83d7fc6..4f82162b00 100644 --- a/sys/shell/commands/sc_gnrc_netif.c +++ b/sys/shell/commands/sc_gnrc_netif.c @@ -607,7 +607,6 @@ static void _netif_list(netif_t *iface) uint16_t u16; int16_t i16; uint8_t u8; - int8_t i8; int res; netopt_state_t state; unsigned line_thresh = 1; @@ -639,9 +638,9 @@ static void _netif_list(netif_t *iface) if (res >= 0) { printf(" NID: 0x%" PRIx16 " ", u16); } - res = netif_get_opt(iface, NETOPT_RSSI, 0, &i8, sizeof(i8)); + res = netif_get_opt(iface, NETOPT_RSSI, 0, &i16, sizeof(i16)); if (res >= 0) { - printf(" RSSI: %d ", i8); + printf(" RSSI: %d ", i16); } #ifdef MODULE_GNRC_NETIF_CMD_LORA res = netif_get_opt(iface, NETOPT_BANDWIDTH, 0, &u8, sizeof(u8));