PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

WiFi development

I am about to start a WiFi project which will need to poll a server on a regular basis. To prolong battery life I would like to turn on the WiFi capability only while polling. Does anyone know whether it is possible to turn on and off WiFi programatically?

Thanks,

Fred
If it is possible it would probably be WiFi device / driver specific.

Dan East
Thanks for the reply. If I find out anything else I'll try to remember to post here.

Fred
Sergey Chaban · 25 Mar 2003, 22:15 UTC
On Toshiba e740 you could turn built-in WiFi on/off with the code like this:

Code:

#include <uniqueid.h> /* KernelIoControl declaration */

void SwitchWiFi(int on) {
int inbuff = !!on;
unsigned ctlcode = CTL_CODE(FILE_DEVICE_HAL, on ? 0xC02 : 0xC03, METHOD_BUFFERED, FILE_ANY_ACCESS);
KernelIoControl(ctlcode, &inbuff, 1, 0, 0, 0);
}