Hi Jaume,
> I'm still trying to find the way of using different CWmin in different
> AdhocWifiMac stations.
I am, as well, struggling to set the contention window, but, alas, in
vain.
Here I report my experience, and hope it can shed some light on the
Attribute system.
> I use the example
> wifi-hidden-terminal and I insert the line
>
> Config::Set ("/NodeList/0/DeviceList/0/Mac/Dcf/MinCw", UintegerValue
> (15));
>
> since there is an attribute called MinCw in Dcf.
Actually, the Dcf class is more of an interface (as contains all pure
virtual methods).
So, you want to see what classes, if any, inherit from the Dcf class.
Trying
egrep -nRIe 'public.*Dcf' src/
shows that there are:
./src/devices/wifi/edca-txop-n.h:72:class EdcaTxopN : public Dcf
./src/devices/wifi/dca-txop.h:66:class DcaTxop : public Dcf
(among other irrelevant matches)
Based on the type of standard you want to simulate (.11e or !.11e) you
pick one of those classes.
Now, to trace the contention window you can add a TraceSource (let's
assume you name it 'Cw') in the *dca-txop.cc file, under the GetTypeId
method and, using a path similar to the following one:
"/NodeList/0/DeviceList/0/Mac/DcaTxop/Cw"
you should be able to track your variable.
To get back on topic (about setting and not about tracing the
variable), much to my surprise, I couldn't find a way to use any of
the Setters defined in the Dcf class.
I also tried to explicitly specify the attribute (under the
DcaTxop::GetTypeId method) but nothing happened.
Turning on the 'Config' LogComponent, I got the following:
0s -1 Config:ParsePath(/NodeList/0/DeviceList/0/Mac/DcaTxop/MinCw, /
NodeList/0/DeviceList/0/Mac/DcaTxop, MinCw)
0s -1 Config:LookupMatches(/NodeList/0/DeviceList/0/Mac/DcaTxop)
0s -1 Config:DoResolve(/NodeList/0/DeviceList/0/Mac/DcaTxop/,
0x80883f0)
0s -1 GetAttribute(vector)=NodeList on path=/
0s -1 Array 0 matches 0
0s -1 Config:DoResolve(/DeviceList/0/Mac/DcaTxop/, 0x80883a8)
0s -1 GetAttribute(vector)=DeviceList on path=/NodeList/0/
0s -1 Array 0 matches 0
0s -1 Config:DoResolve(/Mac/DcaTxop/, 0x80ab868)
0s -1 GetAttribute(ptr)=Mac on path=/NodeList/0/DeviceList/0/
0s -1 Config:DoResolve(/DcaTxop/, 0x80ab988)
0s -1 GetAttribute(ptr)=DcaTxop on path=/NodeList/0/DeviceList/0/Mac/
0s -1 Config:DoResolve(/, 0x80abf18)
0s -1 resolved=/NodeList/0/DeviceList/0/Mac/DcaTxop/
0s -1 Array 1 does not match 0
0s -1 Array 2 does not match 0
0s -1 Array 3 does not match 0
0s -1 Array 4 does not match 0
0s -1 Config:DoResolve(/NodeList/0/DeviceList/0/Mac/DcaTxop/,
0x80ab2e0)
0s -1 Requested item=NodeList does not exist on path=/
0s -1 Config:DoResolve(/NodeList/0/DeviceList/0/Mac/DcaTxop/, 0)
As far as I understand, the simulator is able to climb up to the
'DcaTxop' object, and then it silently fails.
What puzzles me more is the fact that I can reach a TraceSource but
not an Attribute, even though both are defined in the same class.
Any suggestion on what could be the next move is most welcome. :)
Cheers,
Chris