Skip to content

Commit

Permalink
Fix #87: clean up tx completion
Browse files Browse the repository at this point in the history
  • Loading branch information
terrillmoore committed Apr 2, 2019
1 parent 6eca474 commit 1040a38
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/lib/SendBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ bool Arduino_LoRaWAN::SendBuffer(
uint8_t port
)
{
if (this->m_fTxPending || LMIC.opmode & OP_TXRXPEND)
if (! this->GetTxReady())
{
if (pDoneFn)
(*pDoneFn)(pDoneCtx, false);
Expand Down
7 changes: 1 addition & 6 deletions src/lib/arduino_lorawan_begin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,7 @@ void Arduino_LoRaWAN::StandardEventProcessor(
// we need to just reset.
if (! this->GetOtaaProvisioningInfo(nullptr))
{
bool txPending = this->m_fTxPending;
this->m_fTxPending = false;
// notify client that TX is complete
if (txPending && this->m_pSendBufferDoneFn)
this->m_pSendBufferDoneFn(this->m_pSendBufferDoneCtx, false);
this->completeTx(false);
}
break;

Expand Down Expand Up @@ -217,7 +213,6 @@ void Arduino_LoRaWAN::StandardEventProcessor(
break;

case EV_TXCOMPLETE:
this->m_fTxPending = false;

// notify framework that RX may be available (because this happens
// after every transmit).
Expand Down

0 comments on commit 1040a38

Please sign in to comment.