Does python can set wifi standard?

6 views
Skip to first unread message

JIECONG WANG

unread,
Mar 28, 2012, 2:08:21 PM3/28/12
to EEL 6591
I want to set wifi standard as WIFI_PHY_STANDARD_80211b using
python ,I use wifi.setStandard(WIFI_PHY_STANDARD_80211b), There is a
error : can not find global name WIFI_PHY_STANDARD_80211b.

Gokul Bhat

unread,
Mar 28, 2012, 2:32:51 PM3/28/12
to eel65...@googlegroups.com
Try wifi.SetStandard(ns3.WIFI_PHY_STANDARD_80211b)
If that does not work, then try
wifi.SetStandard(ns.WIFI_PHY_STANDARD_80211b)

JIECONG WANG

unread,
Mar 28, 2012, 3:25:27 PM3/28/12
to EEL 6591
It does not work, because it is enum data structure. I tried to use 2,
it works because 2 is the WIFI_PHY_STANDARD_80211b in wifiphystandard

On Mar 29, 2:32 am, Gokul Bhat <bhatgo...@gmail.com> wrote:
> Try wifi.SetStandard(ns3.WIFI_PHY_STANDARD_80211b)
> If that does not work, then try
> wifi.SetStandard(ns.WIFI_PHY_STANDARD_80211b)
>

Gokul Bhat

unread,
Mar 28, 2012, 3:28:08 PM3/28/12
to eel65...@googlegroups.com
Send me your code. It works on my system.

Gokul Bhat

unread,
Mar 28, 2012, 3:30:32 PM3/28/12
to eel65...@googlegroups.com
The command  wifi.SetStandard(ns3.WIFI_PHY_STANDARD_80211b) should work because it is a typedef enum, i.e. the names of the standard should work.
Message has been deleted

Gokul Bhat

unread,
Mar 28, 2012, 3:46:10 PM3/28/12
to eel65...@googlegroups.com
The reason why what I suggested did not work is because you had not imported the ns3 module in the script. 
 
Since, you have import ns.core, ns.network and so on in your script, you will have to use the wifi module in order to use the enum definition.

So, you should use  wifi.SetStandard(ns.wifi.WIFI_PHY_STANDARD_80211b)

Instead of adding each of the modules individually, you could use import ns3 and it adds all the modules in ns3 to your script. 

2012/3/28 jiecong wang <wangjie...@gmail.com>

At the 25 line. you can try it

JIECONG WANG

unread,
Mar 28, 2012, 3:51:20 PM3/28/12
to EEL 6591
I add "import ns"
it works
Thanks.

On Mar 29, 3:46 am, Gokul Bhat <bhatgo...@gmail.com> wrote:
> The reason why what I suggested did not work is because you had not
> imported the ns3 module in the script.
>
> Since, you have import ns.core, ns.network and so on in your script, you
> will have to use the wifi module in order to use the enum definition.
>
> So, you should use  wifi.SetStandard(ns.wifi.WIFI_PHY_STANDARD_80211b)
>
> Instead of adding each of the modules individually, you could use import
> ns3 and it adds all the modules in ns3 to your script.
>
> 2012/3/28 jiecong wang <wangjiecong1...@gmail.com>
>
>
>
>
>
>
>
>
>
> > At the 25 line. you can try it
> > 在 2012年3月29日 上午3:30,Gokul Bhat <bhatgo...@gmail.com>写道:
>
> > The command  wifi.SetStandard(ns3.WIFI_PHY_STANDARD_80211b) should work
> >> because it is a typedef enum, i.e. the names of the standard should work.
>
> >> On Wed, Mar 28, 2012 at 3:28 PM, Gokul Bhat <bhatgo...@gmail.com> wrote:
>
> >>> Send me your code. It works on my system.
>
> >>> On Wed, Mar 28, 2012 at 3:25 PM, JIECONG WANG <wangjiecong1...@gmail.com
Reply all
Reply to author
Forward
0 new messages