1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 04:52:59 +01:00

drivers/sx127x: expose RSSI value via netdev

This commit is contained in:
Alexandre Abadie 2021-03-12 10:29:45 +01:00
parent e768a85f62
commit 0ea3b0bac1
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405

View File

@ -338,6 +338,11 @@ static int _get(netdev_t *netdev, netopt_t opt, void *val, size_t max_len)
*((netopt_enable_t*) val) = sx127x_get_iq_invert(dev) ? NETOPT_ENABLE : NETOPT_DISABLE;
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);
default:
break;
}