QA: How can I soft reset Pocket PC device?
Andrey Yatsyk (andrew@softspb.com), October 08, 2001.
Question
How can I soft reset Pocket PC device from my embedded Visual C++ program?
Answer
You should use KernelIoControl(...) function. Insert following code into your
program and you could easily reset Pocket PC device calling ResetPocketPC():
#include
#define IOCTL_HAL_REBOOT CTL_CODE(FILE_DEVICE_HAL, 15, METHOD_BUFFERED, FILE_ANY_ACCESS)
extern "C" __declspec(dllimport) BOOL KernelIoControl(
DWORD dwIoControlCode,
LPVOID lpInBuf,
DWORD nInBufSize,
LPVOID lpOutBuf,
DWORD nOutBufSize,
LPDWORD lpBytesReturned);
BOOL ResetPocketPC()
{
return KernelIoControl(IOCTL_HAL_REBOOT, NULL, 0, NULL, 0, NULL);
}
I regret to say that this functionality implementation is subject of concrete OEM good
will. I.e. not all devises can be restarted by this function. To be sure your devise
supports this control code visit http://nsbasic.com/s309/.
The author of this page supports a list of devises that can be soft restarted similar way.
The most widespread Pocket PC devices such as Compaq iPAQ, HP Jornada and,
Cassio Cassiopea support this function (and it seems that all Pocket PC 2002 devices support it).
Related resources:
-
http://www.pocketpcdn.com/sections/power.html
Section: Power
-
http://www.pocketpcdn.com/articles/poweroff.html
QA: How to suspend Pocket PC device?
-
http://www.pocketpcdn.com/articles/hardreset.html
QA: How to perform hard reset?
- http://www.microsoft.com/mobile/developer/technicalarticles/displayoff.asp
Article: Turn Off the Display While Running Applications
- http://www.innovativedss.com/Resource/PowerOff.asp
Article: Turn the device power off in eVB
- http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnppc2k/html/ppc_otification.asp
Article: Power Notification