Skip to content

Commit

Permalink
Fix #85: always use m_fTxPending for transmit complete
Browse files Browse the repository at this point in the history
  • Loading branch information
terrillmoore committed Apr 1, 2019
1 parent 2643166 commit 530778f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Arduino_LoRaWAN.h
Original file line number Diff line number Diff line change
Expand Up @@ -590,13 +590,17 @@ class Arduino_LoRaWAN
SendBufferCbFn *m_pSendBufferDoneFn;
void *m_pSendBufferDoneCtx;

// complete transmit.
void completeTx(bool fStatus)
{
SendBufferCbFn * const pSendBufferDoneFn = this->m_pSendBufferDoneFn;

this->m_pSendBufferDoneFn = nullptr;
if (pSendBufferDoneFn != nullptr)
if (this->m_fTxPending && pSendBufferDoneFn != nullptr)
{
this->m_fTxPending = false;
(*pSendBufferDoneFn)(this->m_pSendBufferDoneCtx, true);
}
};

private:
Expand Down

0 comments on commit 530778f

Please sign in to comment.