Get the wifi phy mode used on received packet

50 views
Skip to first unread message

Charline

unread,
Dec 11, 2009, 5:42:53 AM12/11/09
to ns-3-users
Hello,

I would like to get the Phy mode of a received packet while using
callback, Iwould like to use the ‘GetStation’ method of MacLow but I
can’t retrieve the ‘maclow’ object.
Could you help, please?
Best Regards,
Charline

std::ostringstream oss_MacRxOk;
oss_MacRxOk << "/NodeList/" << staNodes.Get (0)->GetId () <<"/
DeviceList/0" << "/$ns3::WifiNetDevice/Mac/MacRx";
Config::Connect (oss_MacRxOk.str (), MakeCallback
(&MacRxOkCallback));


void
MacRxOkCallback (std::string context, Ptr<const Packet> packet)
{
//NS_LOG_INFO ("RxOk");
uint32_t i = atoi ((context.substr(10, 2)).c_str());
// NS_LOG_INFO (i);
Mac48Address address = wifiDeviceArray[i]->GetMac()->GetAddress();
WifiRemoteStation *station = MacLow.GetStation(address);
WifiMode phyMode = station->GetDataMode(packet, packet->GetSize());
NS_LOG_INFO (phyMode);
MacRxOkCnt +=1;
}

Mathieu Lacage

unread,
Dec 15, 2009, 6:34:52 AM12/15/09
to ns-3-...@googlegroups.com
I think that you should try hooking to the PHY-level trace sources. See examples/wireless/wifi-ap.cc for an example of how to do this.



--

You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To post to this group, send email to ns-3-...@googlegroups.com.
To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.





--
Mathieu Lacage <mathieu...@gmail.com>
Reply all
Reply to author
Forward
0 new messages