Non device-specific WiFi On/Off function. Does it exist?

G

Guest

Hello all,

I have or at least I think that I have seen ways to turn on/off WiFi using
the "coredll.dll" file.

What I am trying to do is this, I want to be able to turn on or turn off the
WiFi radio in a PPC using some code that is *NOT* device specific. I know how
to turn the radio on or off on a Ipaq but I do not want to limit myself.

Does anyone have any examples or can anyone offer me some suggestions?

Thanks in advance,
nb
 
P

Paul G. Tobey [eMVP]

That's not a very specific method. You can set a registry entry for the
wireless adapter, then unbind the adapter from the TCP/IP stack and you'll
be in a sort of disabled state. I can't promise that the adapter won't be
'on', but you won't get any network data through it and it will not be
'running' in the sense of detecting new networks and popping up
notifications.

You'll still have to figure out what adapter is the wireless adapter,
though, as it will be called different things, depending on the device, the
driver used for the adapter, etc. Using OpenNETCF, enumerate the adapters,
looking for a wireless Ethernet one. Once you've found it, find the
registry key HKLM/Comm/NdisPower. Under that key, you need to add a DWORD
value called by the adapter name ("Cisco1" or whatever). The value of that
registry entry should be 4 to disable the adapter and save the registry.
After you've made that entry, use OpenNETCF to unbind the adapter. There is
now effectively no WiFi adapter there any more, and since you've changed the
registry, the adapter will be kept in this disabled state after a soft
reboot.

To turn on the radio, you'll need to, again, figure out what it's name is
(searching the registry keys under NdisPower, this time). Once you've found
it, remove the NdisPower entry. Then, getting an Adapter reference to the
right adapter name, again, via OpenNETCF, bind the adapter and it should
start working. If you have problems with this, let me know. I've done the
disable step, but I don't recall whether I've tried to turn the adapter back
on without a reboot or not.

Paul T.
 
G

Guest

That is what I am reading too. But, I need the actual power to be turned off,
saving the battery life. Does this method actually save me battery life?

nb

------------------------------------------
Noble D. Bell
AgForest Partners, Inc.



Paul G. Tobey said:
That's not a very specific method. You can set a registry entry for the
wireless adapter, then unbind the adapter from the TCP/IP stack and you'll
be in a sort of disabled state. I can't promise that the adapter won't be
'on', but you won't get any network data through it and it will not be
'running' in the sense of detecting new networks and popping up
notifications.

You'll still have to figure out what adapter is the wireless adapter,
though, as it will be called different things, depending on the device, the
driver used for the adapter, etc. Using OpenNETCF, enumerate the adapters,
looking for a wireless Ethernet one. Once you've found it, find the
registry key HKLM/Comm/NdisPower. Under that key, you need to add a DWORD
value called by the adapter name ("Cisco1" or whatever). The value of that
registry entry should be 4 to disable the adapter and save the registry.
After you've made that entry, use OpenNETCF to unbind the adapter. There is
now effectively no WiFi adapter there any more, and since you've changed the
registry, the adapter will be kept in this disabled state after a soft
reboot.

To turn on the radio, you'll need to, again, figure out what it's name is
(searching the registry keys under NdisPower, this time). Once you've found
it, remove the NdisPower entry. Then, getting an Adapter reference to the
right adapter name, again, via OpenNETCF, bind the adapter and it should
start working. If you have problems with this, let me know. I've done the
disable step, but I don't recall whether I've tried to turn the adapter back
on without a reboot or not.

Paul T.
 
P

Paul G. Tobey [eMVP]

You'll have to experiment. If it doesn't, you could ask for the device
power for that device to be turned off, too, with SetDevicePower().

Paul T.

Noble Bell said:
That is what I am reading too. But, I need the actual power to be turned
off,
saving the battery life. Does this method actually save me battery life?

nb

------------------------------------------
Noble D. Bell
AgForest Partners, Inc.
 
N

nandakumar.gopalakrishnan

Hi all,

I too have been trying do the same with no sucess. I have tried with
SetDevicePower() and also DevicePowerNotify() too but dint work. Have
anyone tried with NDIS? I saw OID_PNP_SET_POWER can be used. But I have
no idea how to do this. Can anyone help me on this.

Thanks,
Nanda
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top