Click here to get back home

Detection of USB cable connection

 HomeNewsGroups | Search | About
 microsoft.public.smartphone.developer    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Detection of USB cable connection Danny Baumann 06-28-2005
Get Chitika Premium
Posted by Danny Baumann on June 28, 2005, 6:35 am
Please log in for more thread options
Hi,

is it possible on Smartphone 2003 to detect an USB cable connection? I had a
look and CreateEvent, SetEvent and friends, but the provided notifications
do not work for this case:

- NOTIFICATION_EVENT_NET_CONNECT and NOTIFICATION_EVENT_NET_CONNECT apply to
USB, bluetooth and GPRS connections
- NOTIFICATION_EVENT_OFF_AC_POWER and NOTIFICATION_EVENT_ON_AC_POWER do not
apply, as the USB cable is not recognized as a charger
- NOTIFICATION_EVENT_RS232_DETECTED and NOTIFICATION_EVENT_SYNC_END also
apply to USB and bluetooth

GetSystemPowerStatusEx does also not work correctly, as ACLineStatus is not
set to 1 when connected via USB, and with matching BatteryFlag and
BATTERY_FLAG_CHARGING I can not detect the connection if the battery is
fully charged.

I just want to know in my program when a charging device (and USB does
charge) is connected to the phone.

Does anybody know how to do this?

Thank you!

Regards,

Danny




Similar ThreadsPosted
Hand-Free Enable detection? August 24, 2006, 7:59 am
web page detection of mobile device November 26, 2007, 2:32 pm
cable presence May 3, 2007, 4:11 am
What connection type Connection Manager chose? December 19, 2006, 8:21 am
Connection Manager and Connection Flags August 24, 2005, 10:00 pm
Connection manager July 25, 2005, 7:08 am
Cannot use pIE via wifi connection June 7, 2006, 10:38 pm
wi-fi ad hoc connection problem March 29, 2007, 2:42 am
How to get connection type? June 9, 2007, 4:26 am
Obex Asynchroneous Connection June 1, 2005, 5:04 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap