Skip to content

Commit

Permalink
Replace generic with specific frequency validation.
Browse files Browse the repository at this point in the history
  • Loading branch information
mluis1 committed Jun 14, 2019
1 parent ffbd453 commit 003b162
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/mac/LoRaMacClassB.c
Original file line number Diff line number Diff line change
Expand Up @@ -1543,7 +1543,8 @@ uint8_t LoRaMacClassBPingSlotChannelReq( uint8_t datarate, uint32_t frequency )
if( frequency != 0 )
{
isCustomFreq = true;
if( Radio.CheckRfFrequency( frequency ) == false )
verify.Frequency = frequency;
if( RegionVerify( *Ctx.LoRaMacClassBParams.LoRaMacRegion, &verify, PHY_FREQUENCY ) == false )
{
status &= 0xFE; // Channel frequency KO
}
Expand Down Expand Up @@ -1647,9 +1648,13 @@ void LoRaMacClassBDeviceTimeAns( void )
bool LoRaMacClassBBeaconFreqReq( uint32_t frequency )
{
#ifdef LORAMAC_CLASSB_ENABLED
VerifyParams_t verify;

if( frequency != 0 )
{
if( Radio.CheckRfFrequency( frequency ) == true )
verify.Frequency = frequency;

if( RegionVerify( *Ctx.LoRaMacClassBParams.LoRaMacRegion, &verify, PHY_FREQUENCY ) == true )
{
Ctx.NvmCtx->BeaconCtx.Ctrl.CustomFreq = 1;
Ctx.NvmCtx->BeaconCtx.Frequency = frequency;
Expand Down

0 comments on commit 003b162

Please sign in to comment.