This commit is contained in:
jgromes 2024-06-29 18:36:24 +02:00
commit 7a0b5bae99
3 changed files with 15 additions and 3 deletions

View file

@ -1327,6 +1327,10 @@ float SX126x::getDataRate() const {
return(this->dataRateMeasured);
}
float SX126x::getRSSI() {
return(this->getRSSI(true));
}
float SX126x::getRSSI(bool packet) {
if(packet) {
// get last packet RSSI from packet status

View file

@ -917,11 +917,18 @@ class SX126x: public PhysicalLayer {
float getDataRate() const;
/*!
\brief GetsRSSI (Recorded Signal Strength Indicator).
\brief Gets recorded signal strength indicator.
Overload with packet mode enabled for PhysicalLayer compatibility.
\returns RSSI value in dBm.
*/
float getRSSI() override;
/*!
\brief Gets RSSI (Recorded Signal Strength Indicator).
\param packet Whether to read last packet RSSI, or the current value.
\returns RSSI value in dBm.
*/
float getRSSI(bool packet = true);
float getRSSI(bool packet);
/*!
\brief Gets SNR (Signal to Noise Ratio) of the last received packet. Only available for LoRa modem.

View file

@ -510,7 +510,8 @@ int16_t LoRaWANNode::activateOTAA(uint8_t joinDr, LoRaWANJoinEvent_t *joinEvent)
RADIOLIB_ASSERT(state);
if(this->dwellTimeEnabledUp) {
RadioLibTime_t toa = this->phyLayer->getTimeOnAir(RADIOLIB_LORAWAN_JOIN_REQUEST_LEN);
// calculate JoinRequest time-on-air in milliseconds
RadioLibTime_t toa = this->phyLayer->getTimeOnAir(RADIOLIB_LORAWAN_JOIN_REQUEST_LEN) / 1000;
if(toa > this->dwellTimeUp) {
return(RADIOLIB_ERR_DWELL_TIME_EXCEEDED);
}