All Forums
 Microsoft Windows CE
 General CE
 Powering down Wi-fi cards and other hardware
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Author Topic  

ctacke

877 Posts

Posted - 30 Mar 2004 :  11:46:22  Show Profile  Email Poster
Q: I'd like to minimize power consumption for my system. Is it possible to shut off an installed device, like an 802.11b card, when I'm not using it though code?

That depends on the OS and the driver. Windows CE 4.2 does support device power management, and some device drivers do as well. If you have both, then you're in luck.

The simple way to determine if your device itself supports the required power management APIs, use the Power Control Panel applet. The Device Status tab shows all installed devices that have API support. In the image to the left I've inserted a Cisco PCM340/350 card into a BitsyX running build 4.20.05. You'll see that it comes up as "CISCO1". That name is important, as you'll need to pass it to the power management API (see below).

If you'd like more information on just what the driver needs to support the power management calls, see this MSDN topic.

If your device has power management support, all that is needed to turn it off and back on is the SetDevicePower API. The code below is an example that shuts of the Cisco card for 5 seconds, then turns it back on. Notice the bolded name of the device we retrieved above.

Note that BitsyX build 4.20.05 uses Microsoft's PCX500.dll 802.11 driver, not Cisco's. We've not tested to see if Cisco's driver has the necessary API support.

#include "windows.h"
#include

DWORD PowerOffCisco3X0()
{
// note that the clsid GUID here is from
// [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\Interfaces]
// which is set by OS version in platform.reg
return SetDevicePower(_T("{98C5250D-C29A-4985-AE5F-AFE5367E5006}\\CISCO1"), POWER_NAME, D3);
}

BOOL PowerOnCisco3X0()
{
return SetDevicePower(_T("{98C5250D-C29A-4985-AE5F-AFE5367E5006}\\CISCO1"), POWER_NAME, D0);
}

int WINAPI WinMain( HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
RETAILMSG(1, (_T("ret = 0x%x\\r\\n"), PowerOffCisco3X0()));
Sleep(5000);
RETAILMSG(1, (_T("ret = 0x%x\\r\\n"), PowerOnCisco3X0()));
return 0;
}

kurtwl

28 Posts

Posted - 26 Aug 2004 :  11:56:41  Show Profile  Email Poster
Is it possible to turn off the display at run time?
Display to off, blank screen etc, not just the backlight.

I am specifically thinking of the point where a BITSYX goes from 'external power' to running off supercaps.
Go to Top of Page
  Topic  
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Jump To:
Eurotech Support Forums © Eurotech Inc. Go To Top Of Page
This page was generated in 0.02 seconds. Snitz Forums 2000