Skip to content

Commit

Permalink
Removed useless FOptsLen filed check
Browse files Browse the repository at this point in the history
  • Loading branch information
mluis1 committed Sep 22, 2022
1 parent 3eddb29 commit d4c3d53
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/mac/LoRaMacParser.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,8 @@ LoRaMacParserStatus_t LoRaMacParserData( LoRaMacMessageData_t* macMsg )
macMsg->FHDR.FCnt = macMsg->Buffer[bufItr++];
macMsg->FHDR.FCnt |= macMsg->Buffer[bufItr++] << 8;

if( macMsg->FHDR.FCtrl.Bits.FOptsLen <= 15 )
{
memcpy1( macMsg->FHDR.FOpts, &macMsg->Buffer[bufItr], macMsg->FHDR.FCtrl.Bits.FOptsLen );
bufItr = bufItr + macMsg->FHDR.FCtrl.Bits.FOptsLen;
}
else
{
return LORAMAC_PARSER_FAIL;
}
memcpy1( macMsg->FHDR.FOpts, &macMsg->Buffer[bufItr], macMsg->FHDR.FCtrl.Bits.FOptsLen );
bufItr = bufItr + macMsg->FHDR.FCtrl.Bits.FOptsLen;

// Initialize anyway with zero.
macMsg->FPort = 0;
Expand Down

0 comments on commit d4c3d53

Please sign in to comment.