Skip to first unread message

ee16...@smail.iitm.ac.in

unread,
Jun 1, 2018, 4:04:59 AM6/1/18
to ns-3-users
Hello ns3 users,

Can anyone help me to find how many packets are standing in WifiMacQueue? I am trying following code but zero(0) packets are showing every time.


static void GetMacQueue_pkts(NetDeviceContainer wifiapDevice)
{
PointerValue ptr;
wifiapDevice.Get(0)->GetAttribute ("Mac",ptr); // get the attribute Mac and store in ptr
Ptr<ApWifiMac> mac1 = ptr.Get<ApWifiMac> ();
mac1->GetAttribute ("DcaTxop",ptr);
Ptr<DcaTxop> dca = ptr.Get<DcaTxop> ();
Ptr<WifiMacQueue> mac_queue = dca->GetQueue ();
//Ptr<EdcaTxopN> edca = ptr.Get<EdcaTxopN> ();
//Ptr<WifiMacQueue> mac_queue = edca->GetQueue ();
uint32_t pkts_mq = mac_queue->GetNPackets();
std::cout << "packets in mac queue" << " : " << pkts_mq << std::endl;
Simulator::Schedule (Seconds(0.5), &GetMacQueue_pkts, wifiapDevice);
}

I am currently using ns3.27. Thanks in advance!!
Reply all
Reply to author
Forward
0 new messages