Skip to content

Commit

Permalink
RadioWrapper: fix long range PHY advertising
Browse files Browse the repository at this point in the history
  • Loading branch information
sultanqasim committed Apr 24, 2024
1 parent f318f7b commit df477ae
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions fw/RadioWrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -830,13 +830,18 @@ int RadioWrapper_advertiseExt3(RadioWrapper_Callback callback, const uint16_t *a
adv37.commandNo = 0x1823;
adv37.condition.rule = COND_STOP_ON_FALSE;
adv37.phyMode.mainMode = (primaryPhy == PHY_CODED_S2) ? 2 : primaryPhy;
adv37.phyMode.coding = (primaryPhy == PHY_CODED_S2) ? 6 : 4;
adv37.phyMode.coding = (primaryPhy == PHY_CODED_S2) ? 7 : 4;
adv37.pParams = &params;

memset(&params, 0, sizeof(params));
params.advConfig.deviceAddrType = advRandom ? 1 : 0;
params.auxPtrTargetType = TRIG_ABSTIME;
params.auxPtrTargetTime = RF_getCurrentTime() + 8000;
if (primaryPhy == PHY_1M)
params.auxPtrTargetTime = RF_getCurrentTime() + 2*4000;
else if (primaryPhy == PHY_CODED_S8)
params.auxPtrTargetTime = RF_getCurrentTime() + 5*4000;
else // PHY_CODED_S2
params.auxPtrTargetTime = RF_getCurrentTime() + 3*4000;
params.pAdvPkt = (uint8_t *)&advPkt;
params.pDeviceAddress = (uint16_t *)advAddr;

Expand Down Expand Up @@ -871,7 +876,7 @@ int RadioWrapper_advertiseExt3(RadioWrapper_Callback callback, const uint16_t *a
adv2.condition.rule = COND_NEVER;
adv2.channel = secondaryChan;
adv2.phyMode.mainMode = (secondaryPhy == PHY_CODED_S2) ? 2 : secondaryPhy;
adv2.phyMode.coding = (secondaryPhy == PHY_CODED_S2) ? 6 : 4;
adv2.phyMode.coding = (secondaryPhy == PHY_CODED_S2) ? 7 : 4;
adv2.pParams = &params2;

memset(&params2, 0, sizeof(params2));
Expand Down

0 comments on commit df477ae

Please sign in to comment.