9#include "ns3/callback.h" 
   10#include "ns3/constant-position-mobility-model.h" 
   12#include "ns3/object-factory.h" 
   13#include "ns3/pointer.h" 
   14#include "ns3/simulator.h" 
   16#include "ns3/uan-channel.h" 
   17#include "ns3/uan-mac-aloha.h" 
   18#include "ns3/uan-net-device.h" 
   19#include "ns3/uan-phy-gen.h" 
   20#include "ns3/uan-prop-model-ideal.h" 
   21#include "ns3/uan-transducer-hd.h" 
   36    void DoRun() 
override;
 
 
  107    dev->SetTxModeIndex(mode);
 
  108    dev->Send(pkt, dev->GetBroadcast(), 0);
 
 
  122    mobility->SetPosition(pos);
 
  123    node->AggregateObject(mobility);
 
  128    dev->SetChannel(chan);
 
  129    dev->SetTransducer(trans);
 
  130    node->AddDevice(dev);
 
 
  145    channel->SetAttribute(
"PropagationModel", 
PointerValue(prop));
 
 
  174    m_phyFac.SetTypeId(
"ns3::UanPhyGen");
 
  184                                       "Should have received 34 bytes from 2 disjoint packets");
 
  189                                       "Expected collision resulting in loss of both packets");
 
  198#ifdef UAN_PROP_BH_INSTALLED 
  205                                       "Should have received 34 bytes from 2 disjoint packets");
 
  210                                       "Should have received 17 bytes from first arriving packet");
 
  216        "Packets should collide, but received data");
 
  237    m1.AppendMode(mode01);
 
  238    m1.AppendMode(mode11);
 
  239    m1.AppendMode(mode21);
 
  242    m_phyFac.SetTypeId(
"ns3::UanPhyDual");
 
  249                                       "Expected no collision");
 
  253                                       "Expected collision with both packets lost");
 
  257                                       "Expected collision with only one packets lost");
 
  261                                       "Expected no collision");
 
  265                                       "Expected no collision");
 
 
  278#ifdef UAN_PROP_BH_INSTALLED 
  281    BellhopResp resp = propBh->GetResp(10000, 50, 50, 1000);
 
  286                              "Got BH Pathloss outside of tolerance");
 
  291                              "Got BH arrival outside of tolerance");
 
 
  309    void DoRun() 
override;
 
 
  321    std::string inputStr;
 
  322    std::istringstream iss;
 
  325    inputStr = 
"3|0|1|1|";
 
  338    inputStr = 
"|3|0|1|1|";
 
  344    inputStr = 
"3|0|1|1|0|";
 
  376    inputStr = 
"3|a|b|c|";
 
 
void DoRun() override
Implementation to actually run this TestCase.
bool RxPacket(Ptr< NetDevice > dev, Ptr< const Packet > pkt, uint16_t mode, const Address &sender)
Receive packet function.
Ptr< UanNetDevice > CreateNode(Vector pos, Ptr< UanChannel > chan)
Create node function.
void SendOnePacket(Ptr< UanNetDevice > dev, uint16_t mode)
Send one packet function.
uint32_t DoOnePhyTest(Time t1, Time t2, uint32_t r1, uint32_t r2, Ptr< UanPropModel > prop, uint16_t mode1=0, uint16_t mode2=0)
Do one Phy test function.
uint32_t m_bytesRx
byes received
ObjectFactory m_phyFac
Phy.
void DoRun() override
Implementation to actually run this TestCase.
bool DoPhyTests()
Phy test function.
a polymophic address class
static Mac8Address Allocate()
Allocates Mac8Address from 0-254.
Instantiate subclasses of ns3::Object.
AttributeValue implementation for Pointer.
Smart pointer class similar to boost::intrusive_ptr.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static void Run()
Run the simulation.
static void Stop()
Tell the Simulator the calling event should be the last one executed.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
TestCase(const TestCase &)=delete
@ UNIT
This test suite implements a Unit Test.
TestSuite(std::string name, Type type=Type::UNIT)
Construct a new test suite.
Simulation virtual time values and global simulation resolution.
Container for UanTxModes.
uint32_t GetNModes() const
Get the number of modes in this list.
void AppendMode(UanTxMode mode)
Add mode to this list.
AttributeValue implementation for UanModesList.
static UanModesList GetDefaultModes()
Get the default transmission modes.
Base class for UAN Phy models.
static UanTxMode CreateMode(UanTxMode::ModulationType type, uint32_t dataRateBps, uint32_t phyRateSps, uint32_t cfHz, uint32_t bwHz, uint32_t constSize, std::string name)
Abstraction of packet modulation information.
@ FSK
Frequency shift keying.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
#define NS_TEST_ASSERT_MSG_EQ_RETURNS_BOOL(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
#define NS_TEST_ASSERT_MSG_EQ_TOL(actual, limit, tol, msg)
Test that actual and expected (limit) values are equal to plus or minus some tolerance and report and...
Time Seconds(double value)
Construct a Time in the indicated unit.
const double m1
First component modulus, 232 - 209.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
static UanTestSuite g_uanTestSuite
the test suite