Charline
unread,Dec 11, 2009, 5:42:53 AM12/11/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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;
}