Re: WM5 to WM6 GPSID Problem on HTC P3300
- From: "Mike" <mike.sharp_no_spam_please@xxxxxxxxxx>
- Date: Wed, 31 Oct 2007 22:50:21 -0000
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@xxxxxxxxxxxxxxxx
I 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@xxxxxxxxxxxxxxxxxxxxx
I 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: João Paulo Figueira
- Re: WM5 to WM6 GPSID Problem on HTC P3300
- Next by Date: Repainting problem in Pause state
- Next by thread: Re: WM5 to WM6 GPSID Problem on HTC P3300
- Index(es):
Relevant Pages
|