mobility usage anywhere in the code.

37 views
Skip to first unread message

pp

unread,
May 10, 2018, 11:36:33 AM5/10/18
to ns-3-users
Hello,

After looking in the google group I found the following lines
Ptr<MobilityModel> NodePosition = this->GetObject<MeshPointDevice>()->GetNode()->GetObject<MobilityModel>();
std::cout<<NodePosition->GetPosition().x<<" "<<NodePosition->GetPosition().y<<std::endl;

theses can be used in HWMP protocol.I am trying to use same lines in Mesh-wifi-interface-mac.cc.Does anyone know how to do it?

jared...@gmail.com

unread,
May 12, 2018, 5:46:27 PM5/12/18
to ns-3-users
The MeshWifiInterfaceMac has a pointer to the PHY which in turn has a pointer to the device which has a pointer to the node.  So it appears you could:

Ptr<MobilityModel> NodePosition = this->GetWifiPhy ()->GetDevice ()->GetNode ()->GetObject <MobilityModel> ();

or something like that.

pp

unread,
May 12, 2018, 9:10:14 PM5/12/18
to ns-3-users
That did work!!!Thank you so much!!!!

pp

unread,
May 16, 2018, 1:16:00 PM5/16/18
to ns-3-users
Thanks jared that did work, just wondering how would I use the same in mesh-wifi-beacon.cc.

pp

unread,
May 16, 2018, 1:33:04 PM5/16/18
to ns-3-users
I dont think thats possible .anyway just wanted to know how would you know that "The MeshWifiInterfaceMac has a pointer to the PHY which in turn has a pointer to the device which has a pointer to the node."?
Reply all
Reply to author
Forward
Message has been deleted
0 new messages