LowPowerLab/RFM69

Bug with encryption in listen mode

jgillula opened this issue · 0 comments

When listen mode is done, RFM69::listenModeEnd() calls RFM69::reinitRadio(), which calls RFM69::initialize(...). However, RFM69::initialize(...) always calls RFM69::encrypt(0), which sets RFM69::_haveEncryptKey to 0. As a result, even if we had an encryption key enabled before starting listen mode, the fact that we had it gets erased when we call RFM69::listenModeEnd().

PR #169 fixes this by saving the value of RFM69::_haveEncryptKey before calling RFM69::initialize(...), and then using that value to decide whether or not we should try to call RFM69::encrypt(...)