Bug 487 - [contribution] Association and de-association hooks for Wifi
[contribution] Association and de-association hooks for Wifi
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: wifi
pre-release
All All
: P5 normal
Assigned To: Mathieu Lacage
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-02-05 03:50 EST by Francesco Malandrino
Modified: 2009-02-24 03:18 EST (History)
1 user (show)

See Also:


Attachments
The patch mentioned above. Adds the Assoc and DeAssoc trace sources to NqstaWifiMac (4.67 KB, patch)
2009-02-05 03:50 EST, Francesco Malandrino
Details | Diff
Patch, second version (3.90 KB, patch)
2009-02-10 13:56 EST, Francesco Malandrino
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Francesco Malandrino 2009-02-05 03:50:21 EST
Created attachment 370 [details]
The patch mentioned above. Adds the Assoc and DeAssoc trace sources to NqstaWifiMac

The attached patch adds two trace sources, Assoc and DeAssoc (feel free to change the names ;)) to NqstaWifiMac.
They are invoked when the station reaches and leaves the ASSOCIATED state. I feel this may be of general utility.
Comment 1 Mathieu Lacage 2009-02-05 04:10:35 EST
Comment on attachment 370 [details]
The patch mentioned above. Adds the Assoc and DeAssoc trace sources to NqstaWifiMac

>+void
>+NqstaWifiMac::setState(MacState value){
>+  if(value==ASSOCIATED && m_state!=ASSOCIATED) m_assocLogger(GetBssid());
>+  else if(value!=ASSOCIATED && m_state==ASSOCIATED) m_deAssocLogger(GetBssid());
>+  m_state=value;
>+}

Coding style:

setState -> SetState
if(x) do
to:
if (x)
  {
    //do
  }
and:
void Foo(x){
to:
void Foo (x)
{
  //do
}

All of the above is hopefully documented on http://www.nsnam.org/codingstyle.html


Other than that, looks good to me.
Comment 2 Rajib Bhattacharjea 2009-02-10 11:50:40 EST
Marking assignee.  Mathieu, feel free to not comment further if this concludes your input on the matter.
Comment 3 Francesco Malandrino 2009-02-10 13:56:18 EST
Created attachment 374 [details]
Patch, second version

This patch should be (more) compliant with the ns-3 coding style.
Comment 4 Mathieu Lacage 2009-02-24 03:18:24 EST
It would be really helpful if you could try to follow the coding style.

Anyway, changeset: a21c19c4cd81