Merge pull request #169 from jgillula/listen_mode_encryption_fix
This is OK, but see my other comments on #171 Fixing a bug with restoring encryption in listen mode Fixes #170
This commit is contained in:
commit
3cbd159143
|
|
@ -1046,8 +1046,9 @@ volatile uint16_t RFM69::RF69_LISTEN_BURST_REMAINING_MS = 0;
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
bool RFM69::reinitRadio()
|
bool RFM69::reinitRadio()
|
||||||
{
|
{
|
||||||
|
bool haveEncryptKey = _haveEncryptKey;
|
||||||
if (!initialize(_freqBand, _address, _networkID)) return false;
|
if (!initialize(_freqBand, _address, _networkID)) return false;
|
||||||
if (_haveEncryptKey) RFM69::encrypt(_encryptKey); // Restore the encryption key if necessary
|
if (haveEncryptKey) encrypt(_encryptKey); // Restore the encryption key if necessary
|
||||||
if (_isHighSpeed) writeReg(REG_LNA, (readReg(REG_LNA) & ~0x3) | RF_LNA_GAINSELECT_AUTO);
|
if (_isHighSpeed) writeReg(REG_LNA, (readReg(REG_LNA) & ~0x3) | RF_LNA_GAINSELECT_AUTO);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -1305,4 +1306,4 @@ void RFM69::listenModeSendBurst( uint8_t targetNode, const void* buffer, uint8_t
|
||||||
setMode(RF69_MODE_STANDBY);
|
setMode(RF69_MODE_STANDBY);
|
||||||
reinitRadio();
|
reinitRadio();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue