Technorati Tags:
windows mobile,
gps In my previous blog (yes I know it's been a while!) I mentioned that there is a bug in the MSDN GPS sample for windows mobile.
Turns out that is not the end of the story.
There is a further bug relating to the way the code deals with degrees when the longitude or latitude is -0.xxx which requires a refactoring to sort out. The refactoring essential needs to make sure the DegreesMinutesSeconds class returns whether the Degrees element is negative. If anyone wants the code let me know.
In addition to this Simon Jones contacted me via this blog to explain his similar problems and also came up with the following to get the GPS to accept a test file; thus making it much easier to unit test this sort of code:
FYI I've managed to get the GPS Intermediate Driver to accept a test file as it's input as per the instructions on
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mobilesdk5/html/wce51conGPSIntermediateDriverFileRegistrySettings.asp. This means you can unit test your code in the emulator.
Here are the steps to get it working:
1. Using the Remote Registry Editor ccrededt.exe (C:\Program Files\CE RemoteTools\5.01\bin) create a new key in [HKEY_LOCAL_MACHINE\System\CurrentControlSet\GPS IntermediateDriver\Drivers] to hold your GPS settings e.g "Test"
2. In [HKEY_LOCAL_MACHINE\System\CurrentControlSet\GPS IntermediateDriver\Drivers] create a string value called "CurrentDriver" with value "Test"
3. In [HKEY_LOCAL_MACHINE\System\CurrentControlSet\GPS IntermediateDriver\Drivers\Test] create a string value called "InterfaceType" with value "File"
4. In [HKEY_LOCAL_MACHINE\System\CurrentControlSet\GPS IntermediateDriver\Drivers\Test] create a string value called "FriendlyName" with value "Test GPS"
5. In [HKEY_LOCAL_MACHINE\System\CurrentControlSet\GPS IntermediateDriver\Drivers\Test] create a string value called "File1" with value "\temp\gps.nmea"
6. Using the Remote File Viewer ccfilevw.exe (C:\Program Files\CE RemoteTools\5.01\bin) copy an NMEA file to "\temp" and name it according to the filename in step 5
7. Run your app through the emulator and the dummy GPS data *should* stream as if it were coming from an attached device...
HTH
Ian