News | Articles | Libraries | Developer Tools | Books | Forum Links | Search   
Sections:
 

QA: How can I soft reset Pocket PC device?

By Andrey Yatsyk, October 08, 2001.
Print version

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 <winioctl.h> #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:

Discuss

Discuss this article. Here you can write your comments and read comments of other developers.
Rate this article:     Poor Excellent    
 12345 
© 2001-2005 Pocket PC Developer Network, a division of Spb Software House