Skip to content

Commit

Permalink
Fix #81: add additional paramter for port nubmer
Browse files Browse the repository at this point in the history
  • Loading branch information
terrillmoore committed Feb 18, 2019
1 parent be35bc1 commit a5023c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/Arduino_LoRaWAN.h
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,8 @@ class Arduino_LoRaWAN
size_t nBuffer,
SendBufferCbFn *pDoneFn = nullptr,
void *pCtx = nullptr,
bool fConfirmed = false
bool fConfirmed = false,
uint8_t port = 1
);

typedef void ReceivePortBufferCbFn(
Expand Down
5 changes: 3 additions & 2 deletions src/lib/SendBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ bool Arduino_LoRaWAN::SendBuffer(
size_t nBuffer,
SendBufferCbFn *pDoneFn,
void *pDoneCtx,
bool fConfirmed
bool fConfirmed,
uint8_t port
)
{
if (this->m_fTxPending || LMIC.opmode & OP_TXRXPEND)
Expand All @@ -85,7 +86,7 @@ bool Arduino_LoRaWAN::SendBuffer(
}

const int iResult = LMIC_setTxData2(
/* port: */ 1,
/* port: */ port != 0 ? port : 1,
const_cast<xref2u1_t>(pBuffer),
nBuffer,
/* confirmed? */ fConfirmed
Expand Down

0 comments on commit a5023c7

Please sign in to comment.