diff --git a/src/modules/SX126x/SX126x.cpp b/src/modules/SX126x/SX126x.cpp index 63b5ebc8..db491cdf 100644 --- a/src/modules/SX126x/SX126x.cpp +++ b/src/modules/SX126x/SX126x.cpp @@ -1130,6 +1130,13 @@ uint32_t SX126x::getTimeOnAir(size_t len) { } } +uint8_t SX126x::getRSSIInst() { + uint8_t data[3] = {0, 0, 0}; // RssiInst, Status, RFU + SPIreadCommand(SX126X_CMD_GET_RSSI_INST, data, 3); + + return data[0]; +} + int16_t SX126x::implicitHeader(size_t len) { return(setHeaderType(SX126X_LORA_HEADER_IMPLICIT, len)); } diff --git a/src/modules/SX126x/SX126x.h b/src/modules/SX126x/SX126x.h index 46b510f8..b0c50b79 100644 --- a/src/modules/SX126x/SX126x.h +++ b/src/modules/SX126x/SX126x.h @@ -806,6 +806,13 @@ class SX126x: public PhysicalLayer { */ uint32_t getTimeOnAir(size_t len); + /*! + \brief Get instantaneous RSSI value in FSK mode. Can be used for LBT implementation, checking for interference before transmitting. + + \returns Instantaneous RSSI value in (-2)*dBm + */ + uint8_t getRSSIInst(); + /*! \brief Set implicit header mode for future reception/transmission.