Skip to content

Commit

Permalink
Fixed bug related to having high number of sectors compared to the th…
Browse files Browse the repository at this point in the history
…e number of slots in A-BFT slot
  • Loading branch information
hany_assasa committed Mar 2, 2017
1 parent e4162b6 commit f65bfd6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions scratch/test_bug.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

15 changes: 12 additions & 3 deletions src/wifi/model/dmg-sta-wifi-mac.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1167,6 +1167,12 @@ DmgStaWifiMac::StartTransmitSectorSweep (Mac48Address address, BeamformingDirect
m_totalSectors = m_phy->GetDirectionalAntenna ()->GetNumberOfSectors () *
m_phy->GetDirectionalAntenna ()->GetNumberOfAntennas () - 1;

/* Special case for handling less number of frames in the A-BFT */
if (m_accessPeriod == CHANNEL_ACCESS_ABFT)
{
m_totalSectors = std::min (m_totalSectors, uint16_t (m_ssFramesPerSlot - 1));
}

if (direction == BeamformingInitiator)
{
Simulator::ScheduleNow (&DmgStaWifiMac::SendIssSectorSweepFrame, this, address,
Expand Down Expand Up @@ -1489,10 +1495,13 @@ DmgStaWifiMac::FrameTxOk (const WifiMacHeader &hdr)
}

m_totalSectors--;
if (m_accessPeriod == CHANNEL_ACCESS_ABFT)
if ((m_accessPeriod == CHANNEL_ACCESS_ABFT))
{
Simulator::Schedule (m_sbifs, &DmgStaWifiMac::SendSectorSweepFrame, this, hdr.GetAddr1 (),
BeamformingResponder, m_sectorId, m_antennaId, m_totalSectors);
if (m_sectorId <= m_ssFramesPerSlot)
{
Simulator::Schedule (m_sbifs, &DmgStaWifiMac::SendSectorSweepFrame, this, hdr.GetAddr1 (),
BeamformingResponder, m_sectorId, m_antennaId, m_totalSectors);
}
}
else
{
Expand Down

0 comments on commit f65bfd6

Please sign in to comment.