Re: WM5 to WM6 GPSID Problem on HTC P3300
- From: João Paulo Figueira <joao.figueira@xxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 2 Nov 2007 15:38:16 -0000
Hi Mike,
I believe this is an issue with the HTC device or GPSID implementation. My code ran fine on an Asus P535 both in WM5 and after it was upgraded to WM6.
What other devices are displaying this behavior?
Regards,
João Paulo Figueira
DAD MVP
"Mike" <mike.sharp_no_spam_please@xxxxxxxxxx> wrote in message news:13ii1lfr35q3f0d@xxxxxxxxxxxxxxxxxxxxx
Hi João,
Thanks for the reply.
So, it is possibly an issue in the GPSID_HTC.dll (or whatever DLL is being used on the HTC).
WM5 worked fine. WM6 does not!
Also, I am having issues on other WM6 devices as well, so it is not restricted to the HTC 3300.
Thanks
Mike
"João Paulo Figueira" <joao.figueira@xxxxxxxxxxxxxxxxxxxxx> wrote in message news:1A819DDA-C84F-4A2F-8318-53B637E1A098@xxxxxxxxxxxxxxxxI confirm this behavior on the HTC P3300 after having a day-long struggle to get this beast to work with the GPSID in native code. The GPSReadPosition always returns 87 (ERROR_INVALID_PARAMETER) no matter what. This device has an interesting history of having poor GPS support. Earlier this year I found out that the GPS COM port does not generate COM events, so the WaitCommEvent function is useless:
http://nativemobile.blogspot.com/2007/01/reading-gps-port-on-htc-p3300.html
There seems to be no way around it: use ReadFile with reasonable timeout settings...
Regards,
João Paulo Figueira
DAD MVP
"Mike" <mike.sharp_no_spam_please@xxxxxxxxxx> wrote in message news:13iffugbc93l46b@xxxxxxxxxxxxxxxxxxxxxI have been using the Windows mobile 5 GPS Intermediate driver sample kit for well over a year now successfully.
I recently upgraded my HTC 3300 from Windows mobile 5 to Windows mobile 6.
Now, the sample kit (and my software) will not get any GPS data.
I have even tried the Windows Mobile 6 GPS Intermediate driver sample kit and that does not work.
TomTom6 still works fine on the Com4 virtual port though.
The line of code in fault is in the gps.cs module is:
int result = GPSGetPosition(gpsHandle, ptr, 10000, 0);
The result is always 87.
Does anyone have any ideas?
Thanks
The full procedure is:
public GpsPosition GetPosition(TimeSpan maxAge)
{
GpsPosition gpsPosition = null;
if (Opened)
{
// allocate the necessary memory on the native side. We have a class (GpsPosition) that
// has the same memory layout as its native counterpart
IntPtr ptr = Utils.LocalAlloc(Marshal.SizeOf(typeof(GpsPosition)));
// fill in the required fields
gpsPosition = new GpsPosition();
gpsPosition.dwVersion = 1;
gpsPosition.dwSize = Marshal.SizeOf(typeof(GpsPosition));
// Marshal our data to the native pointer we allocated.
Marshal.StructureToPtr(gpsPosition, ptr, false);
// call native method passing in our native buffer
int result = GPSGetPosition(gpsHandle, ptr, 10000, 0);
if (result == 0)
{
// native call succeeded, marshal native data to our managed data
gpsPosition = (GpsPosition)Marshal.PtrToStructure(ptr, typeof(GpsPosition));
if (maxAge != TimeSpan.Zero)
{
// check to see if the data is recent enough.
if (!gpsPosition.TimeValid || DateTime.Now - maxAge > gpsPosition.Time)
{
gpsPosition = null;
}
}
}
// free our native memory
Utils.LocalFree(ptr);
}
return gpsPosition;
}
.
- Follow-Ups:
- Re: WM5 to WM6 GPSID Problem on HTC P3300
- From: John Spaith [MS]
- Re: WM5 to WM6 GPSID Problem on HTC P3300
- References:
- Re: WM5 to WM6 GPSID Problem on HTC P3300
- From: Mike
- Re: WM5 to WM6 GPSID Problem on HTC P3300
- Prev by Date: Re: Building DLL for Windows Mobile 6 SDK
- Next by Date: DeadLock In WM5 OS ?
- Previous by thread: Re: WM5 to WM6 GPSID Problem on HTC P3300
- Next by thread: Re: WM5 to WM6 GPSID Problem on HTC P3300
- Index(es):
Relevant Pages
|