|
|
|
|
@@ -218,9 +218,12 @@ TestThresholdPreambleDetectionWithoutFrameCapture::DoRun (void)
|
|
|
|
|
// otherwise it should be IDLE.
|
|
|
|
|
|
|
|
|
|
Simulator::Schedule (Seconds (1.0), &TestThresholdPreambleDetectionWithoutFrameCapture::SendPacket, this, rxPowerDbm);
|
|
|
|
|
// At 4us, STA PHY STATE should move from IDLE to RX
|
|
|
|
|
// At 4us, preamble should be successfully detected and STA PHY STATE should move from IDLE to CCA_BUSY
|
|
|
|
|
Simulator::Schedule (Seconds (1.0) + NanoSeconds (3999), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
Simulator::Schedule (Seconds (1.0) + NanoSeconds (4000), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
Simulator::Schedule (Seconds (1.0) + NanoSeconds (4000), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
// At 44us, PHY header should be successfully received and STA PHY STATE should move from CCA_BUSY to RX
|
|
|
|
|
Simulator::Schedule (Seconds (1.0) + NanoSeconds (43999), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
Simulator::Schedule (Seconds (1.0) + NanoSeconds (44000), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
// Since it takes 152.8us to transmit the packet, PHY should be back to IDLE at time 152.8us
|
|
|
|
|
Simulator::Schedule (Seconds (1.0) + NanoSeconds (152799), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
Simulator::Schedule (Seconds (1.0) + NanoSeconds (152800), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
@@ -234,7 +237,7 @@ TestThresholdPreambleDetectionWithoutFrameCapture::DoRun (void)
|
|
|
|
|
|
|
|
|
|
Simulator::Schedule (Seconds (2.0), &TestThresholdPreambleDetectionWithoutFrameCapture::SendPacket, this, rxPowerDbm);
|
|
|
|
|
Simulator::Schedule (Seconds (2.0) + MicroSeconds (2.0), &TestThresholdPreambleDetectionWithoutFrameCapture::SendPacket, this, rxPowerDbm);
|
|
|
|
|
// At 4us, STA PHY STATE should move from IDLE to CCA_BUSY
|
|
|
|
|
// At 4us, no preamble is successfully detected and STA PHY STATE should move from IDLE to CCA_BUSY
|
|
|
|
|
Simulator::Schedule (Seconds (2.0) + NanoSeconds (3999), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
Simulator::Schedule (Seconds (2.0) + NanoSeconds (4000), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
// Since it takes 152.8us to transmit each packet, PHY should be back to IDLE at time 152.8 + 2 = 154.8us
|
|
|
|
|
@@ -250,7 +253,7 @@ TestThresholdPreambleDetectionWithoutFrameCapture::DoRun (void)
|
|
|
|
|
|
|
|
|
|
Simulator::Schedule (Seconds (3.0), &TestThresholdPreambleDetectionWithoutFrameCapture::SendPacket, this, rxPowerDbm);
|
|
|
|
|
Simulator::Schedule (Seconds (3.0) + MicroSeconds (2.0), &TestThresholdPreambleDetectionWithoutFrameCapture::SendPacket, this, rxPowerDbm - 3);
|
|
|
|
|
// At 4us, STA PHY STATE should move from IDLE to CCA_BUSY
|
|
|
|
|
// At 4us, no preamble is successfully detected, hence STA PHY STATE should move from IDLE to CCA_BUSY
|
|
|
|
|
Simulator::Schedule (Seconds (3.0) + NanoSeconds (3999), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
Simulator::Schedule (Seconds (3.0) + NanoSeconds (4000), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
// Since it takes 152.8us to transmit each packet, PHY should be back to IDLE at time 152.8 + 2 = 154.8us
|
|
|
|
|
@@ -265,9 +268,12 @@ TestThresholdPreambleDetectionWithoutFrameCapture::DoRun (void)
|
|
|
|
|
|
|
|
|
|
Simulator::Schedule (Seconds (4.0), &TestThresholdPreambleDetectionWithoutFrameCapture::SendPacket, this, rxPowerDbm);
|
|
|
|
|
Simulator::Schedule (Seconds (4.0) + MicroSeconds (2.0), &TestThresholdPreambleDetectionWithoutFrameCapture::SendPacket, this, rxPowerDbm - 6);
|
|
|
|
|
// At 4us, STA PHY STATE should move from IDLE to RX
|
|
|
|
|
// At 4us, preamble should be successfully detected and STA PHY STATE should move from IDLE to CCA_BUSY
|
|
|
|
|
Simulator::Schedule (Seconds (4.0) + NanoSeconds (3999), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
Simulator::Schedule (Seconds (4.0) + NanoSeconds (4000), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
Simulator::Schedule (Seconds (4.0) + NanoSeconds (4000), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
// At 44us, PHY header should be successfully received and STA PHY STATE should move from CCA_BUSY to RX
|
|
|
|
|
Simulator::Schedule (Seconds (4.0) + NanoSeconds (43999), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
Simulator::Schedule (Seconds (4.0) + NanoSeconds (44000), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
// Since it takes 152.8us to transmit the packet, PHY should be back to IDLE at time 152.8us.
|
|
|
|
|
// However, since there is a second packet transmitted with a power above CCA-ED (-62 dBm), PHY should first be seen as CCA_BUSY for 2us.
|
|
|
|
|
Simulator::Schedule (Seconds (4.0) + NanoSeconds (152799), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
@@ -284,7 +290,7 @@ TestThresholdPreambleDetectionWithoutFrameCapture::DoRun (void)
|
|
|
|
|
|
|
|
|
|
Simulator::Schedule (Seconds (5.0), &TestThresholdPreambleDetectionWithoutFrameCapture::SendPacket, this, rxPowerDbm);
|
|
|
|
|
Simulator::Schedule (Seconds (5.0) + MicroSeconds (2.0), &TestThresholdPreambleDetectionWithoutFrameCapture::SendPacket, this, rxPowerDbm + 3);
|
|
|
|
|
// At 4us, STA PHY STATE should move from IDLE to CCA_BUSY
|
|
|
|
|
// At 4us, no preamble is successfully detected, hence STA PHY STATE should move from IDLE to CCA_BUSY
|
|
|
|
|
Simulator::Schedule (Seconds (5.0) + NanoSeconds (3999), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
Simulator::Schedule (Seconds (5.0) + NanoSeconds (4000), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
// Since it takes 152.8us to transmit each packet, PHY should be back to IDLE at time 152.8 + 2 = 154.8us
|
|
|
|
|
@@ -301,9 +307,12 @@ TestThresholdPreambleDetectionWithoutFrameCapture::DoRun (void)
|
|
|
|
|
// otherwise it should be IDLE.
|
|
|
|
|
|
|
|
|
|
Simulator::Schedule (Seconds (6.0), &TestThresholdPreambleDetectionWithoutFrameCapture::SendPacket, this, rxPowerDbm);
|
|
|
|
|
// At 4us, STA PHY STATE should move from IDLE to RX
|
|
|
|
|
// At 4us, preamble should be successfully detected and STA PHY STATE should move from IDLE to CCA_BUSY
|
|
|
|
|
Simulator::Schedule (Seconds (6.0) + NanoSeconds (3999), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
Simulator::Schedule (Seconds (6.0) + NanoSeconds (4000), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
Simulator::Schedule (Seconds (6.0) + NanoSeconds (4000), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
// At 44us, PHY header should be successfully received and STA PHY STATE should move from CCA_BUSY to RX
|
|
|
|
|
Simulator::Schedule (Seconds (6.0) + NanoSeconds (43999), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
Simulator::Schedule (Seconds (6.0) + NanoSeconds (44000), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
// Since it takes 152.8us to transmit the packet, PHY should be back to IDLE at time 152.8us
|
|
|
|
|
Simulator::Schedule (Seconds (6.0) + NanoSeconds (152799), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
Simulator::Schedule (Seconds (6.0) + NanoSeconds (152800), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
@@ -316,7 +325,7 @@ TestThresholdPreambleDetectionWithoutFrameCapture::DoRun (void)
|
|
|
|
|
|
|
|
|
|
Simulator::Schedule (Seconds (7.0), &TestThresholdPreambleDetectionWithoutFrameCapture::SendPacket, this, rxPowerDbm);
|
|
|
|
|
Simulator::Schedule (Seconds (7.0) + MicroSeconds (2.0), &TestThresholdPreambleDetectionWithoutFrameCapture::SendPacket, this, rxPowerDbm);
|
|
|
|
|
// At 4us, STA PHY STATE should stay in IDLE
|
|
|
|
|
// At 4us, STA PHY STATE should stay IDLE
|
|
|
|
|
Simulator::Schedule (Seconds (7.0) + MicroSeconds (4.0), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
// No more packet should have been successfully received, and since preamble detection did not pass the packet should not have been counted as a failure
|
|
|
|
|
Simulator::Schedule (Seconds (7.1), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckRxPacketCount, this, 2, 1);
|
|
|
|
|
@@ -327,7 +336,7 @@ TestThresholdPreambleDetectionWithoutFrameCapture::DoRun (void)
|
|
|
|
|
|
|
|
|
|
Simulator::Schedule (Seconds (8.0), &TestThresholdPreambleDetectionWithoutFrameCapture::SendPacket, this, rxPowerDbm);
|
|
|
|
|
Simulator::Schedule (Seconds (8.0) + MicroSeconds (2.0), &TestThresholdPreambleDetectionWithoutFrameCapture::SendPacket, this, rxPowerDbm - 3);
|
|
|
|
|
// At 4us, STA PHY STATE should stay in IDLE
|
|
|
|
|
// At 4us, STA PHY STATE should stay IDLE
|
|
|
|
|
Simulator::Schedule (Seconds (8.0) + MicroSeconds (4.0), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
// No more packet should have been successfully received, and since preamble detection did not pass the packet should not have been counted as a failure
|
|
|
|
|
Simulator::Schedule (Seconds (8.1), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckRxPacketCount, this, 2, 1);
|
|
|
|
|
@@ -338,9 +347,12 @@ TestThresholdPreambleDetectionWithoutFrameCapture::DoRun (void)
|
|
|
|
|
|
|
|
|
|
Simulator::Schedule (Seconds (9.0), &TestThresholdPreambleDetectionWithoutFrameCapture::SendPacket, this, rxPowerDbm);
|
|
|
|
|
Simulator::Schedule (Seconds (9.0) + MicroSeconds (2.0), &TestThresholdPreambleDetectionWithoutFrameCapture::SendPacket, this, rxPowerDbm - 6);
|
|
|
|
|
// At 4us, STA PHY STATE should move from IDLE to RX
|
|
|
|
|
// At 4us, preamble should be successfully detected and STA PHY STATE should move from IDLE to CCA_BUSY
|
|
|
|
|
Simulator::Schedule (Seconds (9.0) + NanoSeconds (3999), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
Simulator::Schedule (Seconds (9.0) + NanoSeconds (4000), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
Simulator::Schedule (Seconds (9.0) + NanoSeconds (4000), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
// At 44us, PHY header should be successfully received and STA PHY STATE should move from CCA_BUSY to RX
|
|
|
|
|
Simulator::Schedule (Seconds (9.0) + NanoSeconds (43999), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
Simulator::Schedule (Seconds (9.0) + NanoSeconds (44000), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
// Since it takes 152.8us to transmit the packet, PHY should be back to IDLE at time 152.8us.
|
|
|
|
|
Simulator::Schedule (Seconds (9.0) + NanoSeconds (152799), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
Simulator::Schedule (Seconds (9.0) + NanoSeconds (152800), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
@@ -353,7 +365,7 @@ TestThresholdPreambleDetectionWithoutFrameCapture::DoRun (void)
|
|
|
|
|
|
|
|
|
|
Simulator::Schedule (Seconds (10.0), &TestThresholdPreambleDetectionWithoutFrameCapture::SendPacket, this, rxPowerDbm);
|
|
|
|
|
Simulator::Schedule (Seconds (10.0) + MicroSeconds (2.0), &TestThresholdPreambleDetectionWithoutFrameCapture::SendPacket, this, rxPowerDbm + 3);
|
|
|
|
|
// At 4us, STA PHY STATE should stay in IDLE
|
|
|
|
|
// At 4us, STA PHY STATE should stay IDLE
|
|
|
|
|
Simulator::Schedule (Seconds (10.0) + MicroSeconds (4.0), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
// No more packet should have been successfully received, and since preamble detection did not pass the packet should not have been counted as a failure
|
|
|
|
|
Simulator::Schedule (Seconds (10.1), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckRxPacketCount, this, 2, 2);
|
|
|
|
|
@@ -364,9 +376,12 @@ TestThresholdPreambleDetectionWithoutFrameCapture::DoRun (void)
|
|
|
|
|
rxPowerDbm = -81;
|
|
|
|
|
|
|
|
|
|
Simulator::Schedule (Seconds (11.0), &TestThresholdPreambleDetectionWithoutFrameCapture::SendPacket, this, rxPowerDbm);
|
|
|
|
|
// At 4us, STA PHY STATE should move from IDLE to RX
|
|
|
|
|
// At 4us, preamble should be successfully detected and STA PHY STATE should move from IDLE to CCA_BUSY
|
|
|
|
|
Simulator::Schedule (Seconds (11.0) + NanoSeconds (3999), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
Simulator::Schedule (Seconds (11.0) + NanoSeconds (4000), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
Simulator::Schedule (Seconds (11.0) + NanoSeconds (4000), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
// At 44us, PHY header should be successfully received and STA PHY STATE should move from CCA_BUSY to RX
|
|
|
|
|
Simulator::Schedule (Seconds (11.0) + NanoSeconds (43999), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
Simulator::Schedule (Seconds (11.0) + NanoSeconds (44000), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
// Since it takes 152.8us to transmit the packet, PHY should be back to IDLE at time 152.8us.
|
|
|
|
|
Simulator::Schedule (Seconds (11.0) + NanoSeconds (152799), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
Simulator::Schedule (Seconds (11.0) + NanoSeconds (152800), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
@@ -560,9 +575,12 @@ TestThresholdPreambleDetectionWithFrameCapture::DoRun (void)
|
|
|
|
|
// otherwise it should be IDLE.
|
|
|
|
|
|
|
|
|
|
Simulator::Schedule (Seconds (1.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm);
|
|
|
|
|
// At 4us, STA PHY STATE should move from IDLE to RX
|
|
|
|
|
// At 4us, preamble should be successfully detected and STA PHY STATE should move from IDLE to CCA_BUSY
|
|
|
|
|
Simulator::Schedule (Seconds (1.0) + NanoSeconds (3999), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
Simulator::Schedule (Seconds (1.0) + NanoSeconds (4000), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
Simulator::Schedule (Seconds (1.0) + NanoSeconds (4000), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
// At 44us, PHY header should be successfully received and STA PHY STATE should move from CCA_BUSY to RX
|
|
|
|
|
Simulator::Schedule (Seconds (1.0) + NanoSeconds (43999), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
Simulator::Schedule (Seconds (1.0) + NanoSeconds (44000), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
// Since it takes 152.8us to transmit the packet, PHY should be back to IDLE at time 152.8us
|
|
|
|
|
Simulator::Schedule (Seconds (1.0) + NanoSeconds (152799), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
Simulator::Schedule (Seconds (1.0) + NanoSeconds (152800), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
@@ -576,7 +594,7 @@ TestThresholdPreambleDetectionWithFrameCapture::DoRun (void)
|
|
|
|
|
|
|
|
|
|
Simulator::Schedule (Seconds (2.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm);
|
|
|
|
|
Simulator::Schedule (Seconds (2.0) + MicroSeconds (2.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm);
|
|
|
|
|
// At 4us, STA PHY STATE should move from IDLE to CCA_BUSY
|
|
|
|
|
// At 4us, no preamble is successfully detected, hence STA PHY STATE should move from IDLE to CCA_BUSY
|
|
|
|
|
Simulator::Schedule (Seconds (2.0) + NanoSeconds (3999), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
Simulator::Schedule (Seconds (2.0) + NanoSeconds (4000), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
// Since it takes 152.8us to transmit each packet, PHY should be back to IDLE at time 152.8 + 2 = 154.8us
|
|
|
|
|
@@ -592,7 +610,7 @@ TestThresholdPreambleDetectionWithFrameCapture::DoRun (void)
|
|
|
|
|
|
|
|
|
|
Simulator::Schedule (Seconds (3.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm);
|
|
|
|
|
Simulator::Schedule (Seconds (3.0) + MicroSeconds (2.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm - 3);
|
|
|
|
|
// At 4us, STA PHY STATE should move from IDLE to CCA_BUSY
|
|
|
|
|
// At 4us, no preamble is successfully detected, hence STA PHY STATE should move from IDLE to CCA_BUSY
|
|
|
|
|
Simulator::Schedule (Seconds (3.0) + NanoSeconds (3999), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
Simulator::Schedule (Seconds (3.0) + NanoSeconds (4000), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
// Since it takes 152.8us to transmit each packet, PHY should be back to IDLE at time 152.8 + 2 = 154.8us
|
|
|
|
|
@@ -607,9 +625,12 @@ TestThresholdPreambleDetectionWithFrameCapture::DoRun (void)
|
|
|
|
|
|
|
|
|
|
Simulator::Schedule (Seconds (4.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm);
|
|
|
|
|
Simulator::Schedule (Seconds (4.0) + MicroSeconds (2.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm - 6);
|
|
|
|
|
// At 4us, STA PHY STATE should move from IDLE to RX
|
|
|
|
|
// At 4us, preamble should be successfully detected and STA PHY STATE should move from IDLE to CCA_BUSY
|
|
|
|
|
Simulator::Schedule (Seconds (4.0) + NanoSeconds (3999), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
Simulator::Schedule (Seconds (4.0) + NanoSeconds (4000), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
Simulator::Schedule (Seconds (4.0) + NanoSeconds (4000), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
// At 44us, PHY header should be successfully received and STA PHY STATE should move from CCA_BUSY to RX
|
|
|
|
|
Simulator::Schedule (Seconds (4.0) + NanoSeconds (43999), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
Simulator::Schedule (Seconds (4.0) + NanoSeconds (44000), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
// Since it takes 152.8us to transmit the packet, PHY should be back to IDLE at time 152.8us.
|
|
|
|
|
// However, since there is a second packet transmitted with a power above CCA-ED (-62 dBm), PHY should first be seen as CCA_BUSY for 2us.
|
|
|
|
|
Simulator::Schedule (Seconds (4.0) + NanoSeconds (152799), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
@@ -626,7 +647,7 @@ TestThresholdPreambleDetectionWithFrameCapture::DoRun (void)
|
|
|
|
|
|
|
|
|
|
Simulator::Schedule (Seconds (5.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm);
|
|
|
|
|
Simulator::Schedule (Seconds (5.0) + MicroSeconds (2.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm + 3);
|
|
|
|
|
// At 4us, STA PHY STATE should stay in IDLE
|
|
|
|
|
// At 4us, STA PHY STATE should stay IDLE
|
|
|
|
|
Simulator::Schedule (Seconds (5.0) + MicroSeconds (4.0), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
// At 6us, STA PHY STATE should move from IDLE to CCA_BUSY
|
|
|
|
|
Simulator::Schedule (Seconds (5.0) + NanoSeconds (5999), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
@@ -644,11 +665,14 @@ TestThresholdPreambleDetectionWithFrameCapture::DoRun (void)
|
|
|
|
|
|
|
|
|
|
Simulator::Schedule (Seconds (6.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm);
|
|
|
|
|
Simulator::Schedule (Seconds (6.0) + MicroSeconds (2.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm + 6);
|
|
|
|
|
// At 4us, STA PHY STATE should stay in IDLE
|
|
|
|
|
// At 4us, STA PHY STATE should stay IDLE
|
|
|
|
|
Simulator::Schedule (Seconds (6.0) + MicroSeconds (4.0), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
// At 6us, STA PHY STATE should move from IDLE to RX
|
|
|
|
|
// At 6us, preamble should be successfully detected and STA PHY STATE should move from IDLE to CCA_BUSY
|
|
|
|
|
Simulator::Schedule (Seconds (6.0) + NanoSeconds (5999), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
Simulator::Schedule (Seconds (6.0) + NanoSeconds (6000), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
Simulator::Schedule (Seconds (6.0) + NanoSeconds (6000), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
// At 46us, PHY header should be successfully received and STA PHY STATE should move from CCA_BUSY to RX
|
|
|
|
|
Simulator::Schedule (Seconds (6.0) + NanoSeconds (45999), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
Simulator::Schedule (Seconds (6.0) + NanoSeconds (46000), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
// Since it takes 152.8us to transmit each packet, PHY should be back to IDLE at time 152.8 + 2 = 154.8us
|
|
|
|
|
Simulator::Schedule (Seconds (6.0) + NanoSeconds (154799), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
Simulator::Schedule (Seconds (6.0) + NanoSeconds (154800), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
@@ -662,7 +686,7 @@ TestThresholdPreambleDetectionWithFrameCapture::DoRun (void)
|
|
|
|
|
|
|
|
|
|
Simulator::Schedule (Seconds (7.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm);
|
|
|
|
|
Simulator::Schedule (Seconds (7.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm);
|
|
|
|
|
// At 4us, STA PHY STATE should move from IDLE to CCA_BUSY
|
|
|
|
|
// At 4us, no preamble is successfully detected, hence STA PHY STATE should move from IDLE to CCA_BUSY
|
|
|
|
|
Simulator::Schedule (Seconds (7.0) + NanoSeconds (3999), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
Simulator::Schedule (Seconds (7.0) + NanoSeconds (4000), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
// Since it takes 152.8us to transmit each packet, PHY should be back to IDLE at time 152.8 + 2 = 154.8us
|
|
|
|
|
@@ -678,7 +702,7 @@ TestThresholdPreambleDetectionWithFrameCapture::DoRun (void)
|
|
|
|
|
|
|
|
|
|
Simulator::Schedule (Seconds (8.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm);
|
|
|
|
|
Simulator::Schedule (Seconds (8.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm - 3);
|
|
|
|
|
// At 4us, STA PHY STATE should move from IDLE to CCA_BUSY
|
|
|
|
|
// At 4us, no preamble is successfully detected, hence STA PHY STATE should move from IDLE to CCA_BUSY
|
|
|
|
|
Simulator::Schedule (Seconds (8.0) + NanoSeconds (3999), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
Simulator::Schedule (Seconds (8.0) + NanoSeconds (4000), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
// Since it takes 152.8us to transmit each packet, PHY should be back to IDLE at time 152.8 us
|
|
|
|
|
@@ -693,9 +717,12 @@ TestThresholdPreambleDetectionWithFrameCapture::DoRun (void)
|
|
|
|
|
|
|
|
|
|
Simulator::Schedule (Seconds (9.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm);
|
|
|
|
|
Simulator::Schedule (Seconds (9.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm - 6);
|
|
|
|
|
// At 4us, STA PHY STATE should move from IDLE to RX
|
|
|
|
|
// At 4us, preamble should be successfully detected and STA PHY STATE should move from IDLE to CCA_BUSY
|
|
|
|
|
Simulator::Schedule (Seconds (9.0) + NanoSeconds (3999), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
Simulator::Schedule (Seconds (9.0) + NanoSeconds (4000), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
Simulator::Schedule (Seconds (9.0) + NanoSeconds (4000), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
// At 44us, PHY header should be successfully received and STA PHY STATE should move from CCA_BUSY to RX
|
|
|
|
|
Simulator::Schedule (Seconds (9.0) + NanoSeconds (43999), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
Simulator::Schedule (Seconds (9.0) + NanoSeconds (44000), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
// Since it takes 152.8us to transmit the packets, PHY should be back to IDLE at time 152.8us.
|
|
|
|
|
Simulator::Schedule (Seconds (9.0) + NanoSeconds (152799), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
Simulator::Schedule (Seconds (9.0) + NanoSeconds (152800), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
@@ -709,7 +736,7 @@ TestThresholdPreambleDetectionWithFrameCapture::DoRun (void)
|
|
|
|
|
|
|
|
|
|
Simulator::Schedule (Seconds (10.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm);
|
|
|
|
|
Simulator::Schedule (Seconds (10.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm + 3);
|
|
|
|
|
// At 4us, STA PHY STATE should move from IDLE to CCA_BUSY
|
|
|
|
|
// At 4us, no preamble is successfully detected, hence STA PHY STATE should move from IDLE to CCA_BUSY
|
|
|
|
|
Simulator::Schedule (Seconds (10.0) + NanoSeconds (3999), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
Simulator::Schedule (Seconds (10.0) + NanoSeconds (4000), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
// Since it takes 152.8us to transmit each packet, PHY should be back to IDLE at time 152.8 us
|
|
|
|
|
@@ -725,9 +752,12 @@ TestThresholdPreambleDetectionWithFrameCapture::DoRun (void)
|
|
|
|
|
|
|
|
|
|
Simulator::Schedule (Seconds (11.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm);
|
|
|
|
|
Simulator::Schedule (Seconds (11.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm + 6);
|
|
|
|
|
// At 4us, STA PHY STATE should move from IDLE to RX
|
|
|
|
|
// At 4us, preamble should be successfully detected and STA PHY STATE should move from IDLE to CCA_BUSY
|
|
|
|
|
Simulator::Schedule (Seconds (11.0) + NanoSeconds (3999), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
Simulator::Schedule (Seconds (11.0) + NanoSeconds (4000), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
Simulator::Schedule (Seconds (11.0) + NanoSeconds (4000), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
// At 44us, PHY header should be successfully received and STA PHY STATE should move from CCA_BUSY to RX
|
|
|
|
|
Simulator::Schedule (Seconds (11.0) + NanoSeconds (43999), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
Simulator::Schedule (Seconds (11.0) + NanoSeconds (44000), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
// Since it takes 152.8us to transmit each packet, PHY should be back to IDLE at time 152.8 us
|
|
|
|
|
Simulator::Schedule (Seconds (11.0) + NanoSeconds (152799), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
Simulator::Schedule (Seconds (11.0) + NanoSeconds (152800), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
@@ -742,9 +772,12 @@ TestThresholdPreambleDetectionWithFrameCapture::DoRun (void)
|
|
|
|
|
// otherwise it should be IDLE.
|
|
|
|
|
|
|
|
|
|
Simulator::Schedule (Seconds (12.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm);
|
|
|
|
|
// At 4us, STA PHY STATE should move from IDLE to RX
|
|
|
|
|
// At 4us, preamble should be successfully detected and STA PHY STATE should move from IDLE to CCA_BUSY
|
|
|
|
|
Simulator::Schedule (Seconds (12.0) + NanoSeconds (3999), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
Simulator::Schedule (Seconds (12.0) + NanoSeconds (4000), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
Simulator::Schedule (Seconds (12.0) + NanoSeconds (4000), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
// At 44us, PHY header should be successfully received and STA PHY STATE should move from CCA_BUSY to RX
|
|
|
|
|
Simulator::Schedule (Seconds (12.0) + NanoSeconds (43999), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
Simulator::Schedule (Seconds (12.0) + NanoSeconds (44000), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
// Since it takes 152.8us to transmit the packet, PHY should be back to IDLE at time 152.8us
|
|
|
|
|
Simulator::Schedule (Seconds (12.0) + NanoSeconds (152799), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
Simulator::Schedule (Seconds (12.0) + NanoSeconds (152800), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
@@ -757,7 +790,7 @@ TestThresholdPreambleDetectionWithFrameCapture::DoRun (void)
|
|
|
|
|
|
|
|
|
|
Simulator::Schedule (Seconds (13.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm);
|
|
|
|
|
Simulator::Schedule (Seconds (13.0) + MicroSeconds (2.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm);
|
|
|
|
|
// At 4us, STA PHY STATE should stay in IDLE
|
|
|
|
|
// At 4us, STA PHY STATE should stay IDLE
|
|
|
|
|
Simulator::Schedule (Seconds (13.0) + MicroSeconds (4.0), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
// No more packet should have been successfully received, and since preamble detection did not pass the packet should not have been counted as a failure
|
|
|
|
|
Simulator::Schedule (Seconds (13.1), &TestThresholdPreambleDetectionWithFrameCapture::CheckRxPacketCount, this, 2, 4);
|
|
|
|
|
@@ -768,7 +801,7 @@ TestThresholdPreambleDetectionWithFrameCapture::DoRun (void)
|
|
|
|
|
|
|
|
|
|
Simulator::Schedule (Seconds (14.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm);
|
|
|
|
|
Simulator::Schedule (Seconds (14.0) + MicroSeconds (2.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm - 3);
|
|
|
|
|
// At 4us, STA PHY STATE should stay in IDLE
|
|
|
|
|
// At 4us, STA PHY STATE should stay IDLE
|
|
|
|
|
Simulator::Schedule (Seconds (14.0) + MicroSeconds (4.0), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
// No more packet should have been successfully received, and since preamble detection did not pass the packet should not have been counted as a failure
|
|
|
|
|
Simulator::Schedule (Seconds (14.1), &TestThresholdPreambleDetectionWithFrameCapture::CheckRxPacketCount, this, 2, 4);
|
|
|
|
|
@@ -779,9 +812,12 @@ TestThresholdPreambleDetectionWithFrameCapture::DoRun (void)
|
|
|
|
|
|
|
|
|
|
Simulator::Schedule (Seconds (15.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm);
|
|
|
|
|
Simulator::Schedule (Seconds (15.0) + MicroSeconds (2.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm - 6);
|
|
|
|
|
// At 4us, STA PHY STATE should move from IDLE to RX
|
|
|
|
|
// At 4us, preamble should be successfully detected and STA PHY STATE should move from IDLE to CCA_BUSY
|
|
|
|
|
Simulator::Schedule (Seconds (15.0) + NanoSeconds (3999), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
Simulator::Schedule (Seconds (15.0) + NanoSeconds (4000), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
Simulator::Schedule (Seconds (15.0) + NanoSeconds (4000), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
// At 44us, PHY header should be successfully received and STA PHY STATE should move from CCA_BUSY to RX
|
|
|
|
|
Simulator::Schedule (Seconds (15.0) + NanoSeconds (43999), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
Simulator::Schedule (Seconds (15.0) + NanoSeconds (44000), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
// Since it takes 152.8us to transmit the packet, PHY should be back to IDLE at time 152.8us.
|
|
|
|
|
Simulator::Schedule (Seconds (15.0) + NanoSeconds (152799), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
Simulator::Schedule (Seconds (15.0) + NanoSeconds (152800), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
@@ -795,9 +831,9 @@ TestThresholdPreambleDetectionWithFrameCapture::DoRun (void)
|
|
|
|
|
|
|
|
|
|
Simulator::Schedule (Seconds (16.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm);
|
|
|
|
|
Simulator::Schedule (Seconds (16.0) + MicroSeconds (2.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm + 3);
|
|
|
|
|
// At 4us, STA PHY STATE should stay in IDLE
|
|
|
|
|
// At 4us, STA PHY STATE should stay IDLE
|
|
|
|
|
Simulator::Schedule (Seconds (16.0) + MicroSeconds (4.0), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
// At 6us, STA PHY STATE should stay in IDLE
|
|
|
|
|
// At 6us, STA PHY STATE should stay IDLE
|
|
|
|
|
Simulator::Schedule (Seconds (16.0) + MicroSeconds (6.0), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
// No more packet should have been successfully received, and since preamble detection did not pass the packet should not have been counted as a failure
|
|
|
|
|
Simulator::Schedule (Seconds (16.1), &TestThresholdPreambleDetectionWithFrameCapture::CheckRxPacketCount, this, 2, 5);
|
|
|
|
|
@@ -809,11 +845,14 @@ TestThresholdPreambleDetectionWithFrameCapture::DoRun (void)
|
|
|
|
|
|
|
|
|
|
Simulator::Schedule (Seconds (17.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm);
|
|
|
|
|
Simulator::Schedule (Seconds (17.0) + MicroSeconds (2.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm + 6);
|
|
|
|
|
// At 4us, STA PHY STATE should stay in IDLE
|
|
|
|
|
// At 4us, STA PHY STATE should stay IDLE
|
|
|
|
|
Simulator::Schedule (Seconds (17.0) + MicroSeconds (4.0), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
// At 6us, STA PHY STATE should move from IDLE to RX
|
|
|
|
|
// At 6us, preamble should be successfully detected and STA PHY STATE should move from IDLE to CCA_BUSY
|
|
|
|
|
Simulator::Schedule (Seconds (17.0) + NanoSeconds (5999), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
Simulator::Schedule (Seconds (17.0) + NanoSeconds (6000), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
Simulator::Schedule (Seconds (17.0) + NanoSeconds (6000), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
// At 46us, PHY header should be successfully received and STA PHY STATE should move from CCA_BUSY to RX
|
|
|
|
|
Simulator::Schedule (Seconds (17.0) + NanoSeconds (45999), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
Simulator::Schedule (Seconds (17.0) + NanoSeconds (46000), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
// Since it takes 152.8us to transmit each packet, PHY should be back to IDLE at time 152.8 + 2 = 154.8us
|
|
|
|
|
Simulator::Schedule (Seconds (17.0) + NanoSeconds (154799), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
Simulator::Schedule (Seconds (17.0) + NanoSeconds (154800), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
@@ -1213,11 +1252,10 @@ TestPhyHeadersReception::DoRun (void)
|
|
|
|
|
|
|
|
|
|
Simulator::Schedule (Seconds (1.0), &TestPhyHeadersReception::SendPacket, this, rxPowerDbm);
|
|
|
|
|
Simulator::Schedule (Seconds (1.0) + MicroSeconds (10), &TestPhyHeadersReception::SendPacket, this, rxPowerDbm);
|
|
|
|
|
// At 10 us, STA PHY STATE should be RX.
|
|
|
|
|
Simulator::Schedule (Seconds (1.0) + MicroSeconds (10.0), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
// At 24us (end of L-SIG), STA PHY STATE should go to CCA_BUSY because L-SIG reception failed and the total energy is above CCA-ED.
|
|
|
|
|
Simulator::Schedule (Seconds (1.0) + NanoSeconds (23999), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
Simulator::Schedule (Seconds (1.0) + NanoSeconds (24000), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
// At 10 us, STA PHY STATE should be CCA_BUSY.
|
|
|
|
|
Simulator::Schedule (Seconds (1.0) + MicroSeconds (10.0), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
// At 44us (end of PHY header), STA PHY STATE should not have moved to RX and be kept to CCA_BUSY.
|
|
|
|
|
Simulator::Schedule (Seconds (1.0) + NanoSeconds (44000), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
// Since it takes 152.8us to transmit the packet, PHY should be back to IDLE at time 152.8 + 10 = 162.8us.
|
|
|
|
|
Simulator::Schedule (Seconds (1.0) + NanoSeconds (162799), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
Simulator::Schedule (Seconds (1.0) + NanoSeconds (162800), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
@@ -1227,10 +1265,11 @@ TestPhyHeadersReception::DoRun (void)
|
|
|
|
|
|
|
|
|
|
Simulator::Schedule (Seconds (2.0), &TestPhyHeadersReception::SendPacket, this, rxPowerDbm);
|
|
|
|
|
Simulator::Schedule (Seconds (2.0) + MicroSeconds (10), &TestPhyHeadersReception::SendPacket, this, rxPowerDbm - 3);
|
|
|
|
|
// At 10 us, STA PHY STATE should be RX.
|
|
|
|
|
Simulator::Schedule (Seconds (2.0) + MicroSeconds (10.0), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
// At 24us (end of L-SIG), STA PHY STATE should be unchanged because L-SIG reception should have succeeded.
|
|
|
|
|
Simulator::Schedule (Seconds (2.0) + MicroSeconds (24.0), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
// At 10 us, STA PHY STATE should be CCA_BUSY.
|
|
|
|
|
Simulator::Schedule (Seconds (2.0) + MicroSeconds (10.0), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
// At 44us (end of PHY header), STA PHY STATE should have moved to RX since PHY header reception should have succeeded.
|
|
|
|
|
Simulator::Schedule (Seconds (2.0) + NanoSeconds (43999), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
Simulator::Schedule (Seconds (2.0) + NanoSeconds (44000), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
// Since it takes 152.8us to transmit the packet, PHY should be back to IDLE at time 152.8us.
|
|
|
|
|
// However, since there is a second packet transmitted with a power above CCA-ED (-62 dBm), PHY should first be seen as CCA_BUSY for 10us.
|
|
|
|
|
Simulator::Schedule (Seconds (2.0) + NanoSeconds (152799), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
@@ -1243,11 +1282,11 @@ TestPhyHeadersReception::DoRun (void)
|
|
|
|
|
|
|
|
|
|
Simulator::Schedule (Seconds (3.0), &TestPhyHeadersReception::SendPacket, this, rxPowerDbm);
|
|
|
|
|
Simulator::Schedule (Seconds (3.0) + MicroSeconds (25), &TestPhyHeadersReception::SendPacket, this, rxPowerDbm);
|
|
|
|
|
// At 44 us (end of HE-SIG), STA PHY STATE should be RX (even though reception of HE-SIG failed)
|
|
|
|
|
Simulator::Schedule (Seconds (3.0) + MicroSeconds (44.0), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
// At 44us (end of PHY header), STA PHY STATE should not have moved to RX (HE-SIG failed) and be kept to CCA_BUSY.
|
|
|
|
|
Simulator::Schedule (Seconds (3.0) + MicroSeconds (44.0), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
// STA PHY STATE should move back to IDLE once the duration estimated from L-SIG has elapsed, i.e. at 152.8us.
|
|
|
|
|
// However, since there is a second packet transmitted with a power above CCA-ED (-62 dBm), PHY should first be seen as CCA_BUSY for 25us.
|
|
|
|
|
Simulator::Schedule (Seconds (3.0) + NanoSeconds (152799), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
Simulator::Schedule (Seconds (3.0) + NanoSeconds (152799), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
Simulator::Schedule (Seconds (3.0) + NanoSeconds (152800), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
Simulator::Schedule (Seconds (3.0) + NanoSeconds (177799), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
Simulator::Schedule (Seconds (3.0) + NanoSeconds (177800), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
@@ -1257,8 +1296,11 @@ TestPhyHeadersReception::DoRun (void)
|
|
|
|
|
|
|
|
|
|
Simulator::Schedule (Seconds (4.0), &TestPhyHeadersReception::SendPacket, this, rxPowerDbm);
|
|
|
|
|
Simulator::Schedule (Seconds (4.0) + MicroSeconds (25), &TestPhyHeadersReception::SendPacket, this, rxPowerDbm - 3);
|
|
|
|
|
// At 44 us (end of HE-SIG), STA PHY STATE should be RX.
|
|
|
|
|
Simulator::Schedule (Seconds (4.0) + MicroSeconds (44.0), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
// At 10 us, STA PHY STATE should be CCA_BUSY.
|
|
|
|
|
Simulator::Schedule (Seconds (4.0) + MicroSeconds (10.0), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
// At 44 us (end of HE-SIG), STA PHY STATE should move to RX since the PHY header reception should have succeeded.
|
|
|
|
|
Simulator::Schedule (Seconds (4.0) + NanoSeconds (43999), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
Simulator::Schedule (Seconds (4.0) + NanoSeconds (44000), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
// STA PHY STATE should move back to IDLE once the duration estimated from L-SIG has elapsed, i.e. at 152.8us.
|
|
|
|
|
// However, since there is a second packet transmitted with a power above CCA-ED (-62 dBm), PHY should first be seen as CCA_BUSY for 25us.
|
|
|
|
|
Simulator::Schedule (Seconds (4.0) + NanoSeconds (152799), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
@@ -1274,10 +1316,10 @@ TestPhyHeadersReception::DoRun (void)
|
|
|
|
|
|
|
|
|
|
Simulator::Schedule (Seconds (5.0), &TestPhyHeadersReception::SendPacket, this, rxPowerDbm);
|
|
|
|
|
Simulator::Schedule (Seconds (5.0) + MicroSeconds (10), &TestPhyHeadersReception::SendPacket, this, rxPowerDbm);
|
|
|
|
|
// At 10 us, STA PHY STATE should be RX.
|
|
|
|
|
Simulator::Schedule (Seconds (5.0) + MicroSeconds (10.0), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
// At 10 us, STA PHY STATE should be CCA_BUSY.
|
|
|
|
|
Simulator::Schedule (Seconds (5.0) + MicroSeconds (10.0), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
// At 24us (end of L-SIG), STA PHY STATE should go to IDLE because L-SIG reception failed and the total energy is below CCA-ED.
|
|
|
|
|
Simulator::Schedule (Seconds (5.0) + NanoSeconds (23999), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
Simulator::Schedule (Seconds (5.0) + NanoSeconds (23999), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
Simulator::Schedule (Seconds (5.0) + NanoSeconds (24000), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
|
|
|
|
|
// CASE 6: send one packet followed by a second one 3 dB weaker between the end of the 4us preamble detection window
|
|
|
|
|
@@ -1285,10 +1327,13 @@ TestPhyHeadersReception::DoRun (void)
|
|
|
|
|
|
|
|
|
|
Simulator::Schedule (Seconds (6.0), &TestPhyHeadersReception::SendPacket, this, rxPowerDbm);
|
|
|
|
|
Simulator::Schedule (Seconds (6.0) + MicroSeconds (10), &TestPhyHeadersReception::SendPacket, this, rxPowerDbm - 3);
|
|
|
|
|
// At 10 us, STA PHY STATE should be RX.
|
|
|
|
|
Simulator::Schedule (Seconds (6.0) + MicroSeconds (10.0), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
// At 10 us, STA PHY STATE should be CCA_BUSY.
|
|
|
|
|
Simulator::Schedule (Seconds (6.0) + MicroSeconds (10.0), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
// At 24us (end of L-SIG), STA PHY STATE should be unchanged because L-SIG reception should have succeeded.
|
|
|
|
|
Simulator::Schedule (Seconds (6.0) + MicroSeconds (24.0), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
Simulator::Schedule (Seconds (6.0) + MicroSeconds (24.0), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
// At 44 us (end of HE-SIG), STA PHY STATE should move to RX since the PHY header reception should have succeeded.
|
|
|
|
|
Simulator::Schedule (Seconds (6.0) + NanoSeconds (43999), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
Simulator::Schedule (Seconds (6.0) + NanoSeconds (44000), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
// Since it takes 152.8us to transmit the packet, PHY should be back to IDLE at time 152.8us.
|
|
|
|
|
Simulator::Schedule (Seconds (6.0) + NanoSeconds (152799), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
Simulator::Schedule (Seconds (6.0) + NanoSeconds (152800), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
@@ -1298,10 +1343,14 @@ TestPhyHeadersReception::DoRun (void)
|
|
|
|
|
|
|
|
|
|
Simulator::Schedule (Seconds (7.0), &TestPhyHeadersReception::SendPacket, this, rxPowerDbm);
|
|
|
|
|
Simulator::Schedule (Seconds (7.0) + MicroSeconds (25), &TestPhyHeadersReception::SendPacket, this, rxPowerDbm);
|
|
|
|
|
// At 44 us (end of HE-SIG), STA PHY STATE should be RX (even though reception of HE-SIG failed).
|
|
|
|
|
Simulator::Schedule (Seconds (7.0) + MicroSeconds (44.0), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
// At 10 us, STA PHY STATE should be CCA_BUSY.
|
|
|
|
|
Simulator::Schedule (Seconds (7.0) + MicroSeconds (10.0), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
// At 24us (end of L-SIG), STA PHY STATE should be unchanged because L-SIG reception should have succeeded.
|
|
|
|
|
Simulator::Schedule (Seconds (7.0) + MicroSeconds (24.0), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
// At 44 us (end of HE-SIG), STA PHY STATE should be not have moved to RX since reception of HE-SIG should have failed.
|
|
|
|
|
Simulator::Schedule (Seconds (7.0) + MicroSeconds (44.0), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
// STA PHY STATE should move back to IDLE once the duration estimated from L-SIG has elapsed, i.e. at 152.8us.
|
|
|
|
|
Simulator::Schedule (Seconds (7.0) + NanoSeconds (152799), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
Simulator::Schedule (Seconds (7.0) + NanoSeconds (152799), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
Simulator::Schedule (Seconds (7.0) + NanoSeconds (152800), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
|
|
|
|
|
// CASE 8: send one packet followed by a second one 3 dB weaker between the end of L-SIG and the start of HE-SIG of the first packet:
|
|
|
|
|
@@ -1309,8 +1358,13 @@ TestPhyHeadersReception::DoRun (void)
|
|
|
|
|
|
|
|
|
|
Simulator::Schedule (Seconds (8.0), &TestPhyHeadersReception::SendPacket, this, rxPowerDbm);
|
|
|
|
|
Simulator::Schedule (Seconds (8.0) + MicroSeconds (25), &TestPhyHeadersReception::SendPacket, this, rxPowerDbm - 3);
|
|
|
|
|
// At 44 us (end of HE-SIG), STA PHY STATE should be RX.
|
|
|
|
|
Simulator::Schedule (Seconds (8.0) + MicroSeconds (44.0), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
// At 10 us, STA PHY STATE should be CCA_BUSY.
|
|
|
|
|
Simulator::Schedule (Seconds (8.0) + MicroSeconds (10.0), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
// At 24us (end of L-SIG), STA PHY STATE should be unchanged because L-SIG reception should have succeeded.
|
|
|
|
|
Simulator::Schedule (Seconds (8.0) + MicroSeconds (24.0), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
// At 44 us (end of HE-SIG), STA PHY STATE should move to RX since the PHY header reception should have succeeded.
|
|
|
|
|
Simulator::Schedule (Seconds (8.0) + NanoSeconds (43999), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::CCA_BUSY);
|
|
|
|
|
Simulator::Schedule (Seconds (8.0) + NanoSeconds (44000), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
// STA PHY STATE should move back to IDLE once the duration estimated from L-SIG has elapsed, i.e. at 152.8us.
|
|
|
|
|
Simulator::Schedule (Seconds (8.0) + NanoSeconds (152799), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::RX);
|
|
|
|
|
Simulator::Schedule (Seconds (8.0) + NanoSeconds (152800), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::IDLE);
|
|
|
|
|
|