Pocket PC FAQ Forums Forum Index Pocket PC FAQ Forums
The place to discuss Windows Mobile, Pocket PCs, Smartphones, Handheld PCs, Windows CE and More!
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

allow auto suspend WITH LAN card in HP360 on battery power

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Pocket PC FAQ Forums Forum Index -> Handheld PC Questions/Comments
View previous topic :: View next topic  
Author Message
ronwca
Pocketeer


Joined: 30 Dec 2010
Posts: 3
Location: San Francisco, California

PostPosted: Fri Dec 31, 2010 12:09 am    Post subject: allow auto suspend WITH LAN card in HP360 on battery power Reply with quote

Is there a way to allow a HP360LX with a SMC EZ PC card (or any LAN card in general) to auto suspend if the external power fails?

The machine runs unattended, and I'd rather it suspends if the power fails, and turns back on with the return of external power. The alternative is that the battery can be rundown to the point where even if the power is restored, the machine is out cold - A physical reset is needed.

Any simple CE 2.0 registry entries for this, or does my program need to just poll the System Power Status?
_________________
Ron W
Back to top
View user's profile Send private message
ChrisDeHerrera
Site Admin


Joined: 01 Feb 2000
Posts: 7017
Location: Los Angeles, CA, USA

PostPosted: Fri Dec 31, 2010 9:21 am    Post subject: Reply with quote

Hi,
I do not know of a registry setting to have the device suspend automatically when the power fails. So you would have to create an app to do it.
_________________
Chris De Herrera
Microsoft MVP - Mobile Devices & Tablet PC
http://www.pocketpcfaq.com- The most complete set of FAQs on Windows CE
http://www.tabletpctalk.com - Get the latest Tablet PC News
http://www.pocketpctalk.com - Get the latest Pocket PC News
http://www.mobilitytalk.com - Quickly view all the Pocket PC & Tablet PC News on one page
Back to top
View user's profile Send private message Visit poster's website
ronwca
Pocketeer


Joined: 30 Dec 2010
Posts: 3
Location: San Francisco, California

PostPosted: Fri Dec 31, 2010 12:45 pm    Post subject: allow auto suspend WITH LAN card in HP360 on battery power Reply with quote

Thanks Chris, I was afraid of that. Any tips on power management API calls available on a CE 2.0 system? I have loaded PocketC and CEAPI on my HP...never had to use the CEAPI yet though!
_________________
Ron W
Back to top
View user's profile Send private message
ronwca
Pocketeer


Joined: 30 Dec 2010
Posts: 3
Location: San Francisco, California

PostPosted: Thu Jan 06, 2011 5:01 pm    Post subject: allow auto suspend WITH LAN card in HP360 on battery power Reply with quote

In PocketC with CEAPI, I found that the following codes in loop would work nicely:

definitions:
#include "/pocketc/winbase.h" //CEAPI definitions
#include "/pocketc/winuser.h"
#define VK_OFF 0xDF

portion of a loop called every second:

GetSystemPowerStatusEx(&rStatus,FALSE); // check line power
if (rStatus.ACLineStatus==AC_LINE_OFFLINE) {
keybd_event(VK_OFF, 0, 0, 0); // down
keybd_event(VK_OFF, 0, 2, 0); } // up

The FALSE lets it just check the cached value, rather than taking the time to do the inquiry from the device driver. I don't need it taking any more time than necessary.
_________________
Ron W
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Pocket PC FAQ Forums Forum Index -> Handheld PC Questions/Comments All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Copyright 2001-2010, Chris De Herrera, All Rights Reserved

Powered by phpBB © 2001, 2005 phpBB Group