for publishing
Fork of LoRaWAN-lib_publishing_testing_UART_bug by
Revision 9:db4900d60c37, committed 2017-07-26
- Comitter:
- terence304
- Date:
- Wed Jul 26 00:56:14 2017 +0000
- Parent:
- 8:26002607de9c
- Child:
- 10:1ac668ce2b15
- Commit message:
- Fix length error bug
Changed in this revision
LoRaMac.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/LoRaMac.cpp Mon Apr 24 09:42:37 2017 +0000 +++ b/LoRaMac.cpp Wed Jul 26 00:56:14 2017 +0000 @@ -2923,10 +2923,6 @@ } else { - if( ValidatePayloadLength( LoRaMacTxPayloadLen, LoRaMacParams.ChannelsDatarate, MacCommandsBufferIndex ) == false ) - { - return LORAMAC_STATUS_LENGTH_ERROR; - } RxWindow1Delay = LoRaMacParams.ReceiveDelay1 + RxWindowsParams[0].RxOffset; RxWindow2Delay = LoRaMacParams.ReceiveDelay2 + RxWindowsParams[1].RxOffset; } @@ -3152,6 +3148,11 @@ } fCtrl->Bits.AdrAckReq = AdrNextDr( fCtrl->Bits.Adr, true, &LoRaMacParams.ChannelsDatarate ); + + if( ValidatePayloadLength( LoRaMacTxPayloadLen, LoRaMacParams.ChannelsDatarate, MacCommandsBufferIndex ) == false ) + { + return LORAMAC_STATUS_LENGTH_ERROR; + } if( SrvAckRequested == true ) {