Merge pull request #243 from angrypig7/master

Added GetRSSIInst command for SX126x
This commit is contained in:
Jan Gromeš 2021-02-04 09:35:31 +01:00 committed by GitHub
commit f6cfed4c60
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View file

@ -1130,6 +1130,13 @@ uint32_t SX126x::getTimeOnAir(size_t len) {
}
}
float SX126x::getRSSIInst() {
uint8_t data[3] = {0, 0, 0}; // RssiInst, Status, RFU
SPIreadCommand(SX126X_CMD_GET_RSSI_INST, data, 3);
return (float)data[0] / (-2.0);
}
int16_t SX126x::implicitHeader(size_t len) {
return(setHeaderType(SX126X_LORA_HEADER_IMPLICIT, len));
}

View file

@ -806,6 +806,13 @@ class SX126x: public PhysicalLayer {
*/
uint32_t getTimeOnAir(size_t len);
/*!
\brief Get instantaneous RSSI value during recption of the packet. Should switch to FSK receive mode for LBT implementation.
\returns Instantaneous RSSI value in dBm, in steps of 0.5dBm
*/
float getRSSIInst();
/*!
\brief Set implicit header mode for future reception/transmission.