pub const fn rssi_dbm(byte: u8, port: Port) -> DecibelsExpand description
Decodes RegRssiValue, the signal power the receiver hears right now.
§Arguments
byte- the RegRssiValue byte.port- the port the radio listens on.
§Returns
The RSSI in dBm: the port’s offset plus the register value.
§Examples
use pamoja_radios::sx127x::status::{rssi_dbm, Port};
// RegRssiValue reads 48: -109 dBm on the high band's port, whose offset is -157, and
// -116 dBm on the low band's, whose offset is -164.
assert_eq!(rssi_dbm(48, Port::High).to_string(), "-109.00");
assert_eq!(rssi_dbm(48, Port::Low).to_string(), "-116.00");