error: ‘class ns3::EdcaTxopN’ has no member named ‘GetCw’

299 views
Skip to first unread message

nabil torjemen

unread,
Aug 16, 2015, 4:14:39 PM8/16/15
to ns-3-users
Hi for all,
I write the following code to get the CW:
Ptr<Node> ue = mesh.uewifiNodes.Get(1);
Ptr<NetDevice> uedevice = ue->GetDevice(0); 
Ptr<WifiNetDevice> uewifiDevice = DynamicCast<WifiNetDevice> (uedevice);
Ptr<WifiMac> uewifimac = uewifiDevice->GetMac();
            
uewifimac->GetAttribute ("EdcaTxopN", ptr);
Ptr<EdcaTxopN> edca = ptr.Get<EdcaTxopN> ();
cw=edca->GetCw();

but I get the error : 
 error: ‘class ns3::EdcaTxopN’ has no member named ‘GetCw’
what is the problem ? the code assistance allow to use the method GetCW().
Best regards.

Tommaso Pecorella

unread,
Aug 16, 2015, 4:29:41 PM8/16/15
to ns-3-users
Perhaps you should b*tchslap your code assistance system. There's no "GetCw" function in the EdcaTxopN function, point.
The GetCw function is in DcaTxop::Dcf, which is a completely different class.
I'm deeply sorry if the class names did lead you to some confusion, but you're kindly invited to trust less the code assistance and read more the code that you should have on your HD.

T.

nabil torjemen

unread,
Aug 16, 2015, 4:40:09 PM8/16/15
to ns-3-users
Hi Tommaso;
Thanks for your reply.
however, even I use class DcaTxop, I get the same error : 
error: ‘class ns3::DcaTxop’ has no member named ‘GetCw
Best regards.

Konstantinos

unread,
Aug 16, 2015, 4:56:21 PM8/16/15
to ns-3-users
Hi Nabil,

Please read Tomasso's reply more carefully. He also may have confused you. Hope that I can clarify it now.
The class that provides the method "GetCw()" is the "ns3::DcaTxop::Dcf" or "ns3::EdcaTxopN::Dcf"
The pointer that you get from the MAC attribute is either the DcaTxop or the EdcaTxopN, not the corresponding Dcf.

Regards,
K.

nabil torjemen

unread,
Aug 17, 2015, 4:48:59 AM8/17/15
to ns-3-users
Hi Kostantinos;
Thanks for your reply.
However, can you help me and tell me how can I access to the corresponding Dcf ?
Best regards.

Konstantinos

unread,
Aug 17, 2015, 5:14:51 AM8/17/15
to ns-3-users
As far as I know, there is no public API to access the private member class Dcf.
You can create you own function in the EdcaTxopN/Dca, similar to the GetMin/GetMaxCw to get the current Cw.

Regards,
K.

Sahar

unread,
Aug 18, 2015, 12:50:11 PM8/18/15
to ns-3-users

Hi,

i do this:i print the value of cw as soon as cw changing
in src->model->wifi->dcf-manager.cc->ResetCw() function
&&
in src->model->wifi->dcf-manager.cc->UpdateFailedCw() function
and i run code of myself network topology. try now!
but i wanna print one idetifier instantly from owner of printed cw(associated node)in my topology.
for example:
nodeid       cw
0                 31
0                 63
1                 31
1                  63
...

could anyone help me?


Tommaso Pecorella

unread,
Aug 18, 2015, 5:45:26 PM8/18/15
to ns-3-users
Hi,

I'm sorry but...
1) the message seems unrelated (or only vaguely related) to the thread topic, and
2) I really didn't understand the question.

Mind to take your time (eventually asking some friend's help) and explain clearly what is the problem ?

Thanks,

T.

Sahar

unread,
Aug 19, 2015, 2:52:44 AM8/19/15
to ns-3-users
Hi,

i'm sorry for bad english!
i mean, if someone wants to see values of CW continuously
(when he/she is running his/her simulation and cw is updated to the new value), it's sufficient print the value of CW

( cout<<m_cw  at two function '
ResetCw()' and 'UpdateFailedCw()', without using  any  API  and  Trace  , ... simply
but now i dont know how to specify a printed cw is associated to which node? i'm wanna print both of 'the vaue of the cw
' and 'nodeid' related to it,beside each other(because i have infrastructure mac from many nodes).
i prefer to print the id(of node) at dcfstate,but
i think that it's not possible(at dcfstate).what do i do?

i hope to my
explanation be clear
ThankU.

Reply all
Reply to author
Forward
0 new messages