Bug 1677

Summary: The annotation of YansWifiPhy needs correction
Product: ns-3 Reporter: Junling Bu <linlinjavaer>
Component: wifiAssignee: Nicola Baldo <nicola>
Status: RESOLVED FIXED    
Severity: normal CC: ns-bugs, ruben
Priority: P5    
Version: ns-3-dev   
Hardware: All   
OS: All   
Attachments: update comments for yans-wifi-phy

Description Junling Bu 2013-05-08 08:39:57 UTC
on src/wifi/model/yans-wifi-phy.h line 74
 * Channel center frequency = Channel starting frequency + 5 MHz * (nch - 1)
but as IEEE 802.11-2007 17.3.8.3.2 defines
Channel center frequency = Channel starting frequency + 5 × nch (MHz)
where nch = 0,1,…200
I don't know why here is nch-1. 

on src/wifi/model/yan-wifi-phy.c line 112
 "Delay between two short frames transmitted on different frequencies. NOTE: Unused now.",
but on line 363
m_state->SwitchToChannelSwitching (m_channelSwitchDelay);
here m_channelSwitchDelay is used actually.

because I think annotation is very important, so I want to correct them.
If I misunderstood here, sorry to report this.
Comment 1 Nicola Baldo 2013-05-25 15:49:37 UTC
Hi Junling,

thanks for your bug report! You're right in both cases: about the formula for the channel frequency, in fact YansWifiPhy::GetChannelFrequencyMhz () implements the formula as you reported. About ChannelSwitchDelay, the comment is clearly obsolete. Would you mind creating a patch updating the attribute descriptions and the comments in the code as needed?
Comment 2 Junling Bu 2013-05-27 07:41:56 UTC
Created attachment 1603 [details]
update comments for yans-wifi-phy
Comment 3 Nicola Baldo 2013-05-27 07:53:42 UTC
Thanks! Just pushed:

changeset:   9818:cfb12f56257a
tag:         tip
user:        Junling Bu <linlinjavaer@gmail.com>
date:        Mon May 27 13:45:39 2013 +0200
summary:     fixed Bug 1677 - The annotation of YansWifiPhy needs correction