windows-mobilegpsregistrywindows-mobile-gps

how programatically set com ports for GPS in windows mobile


In windows mobile, the GPS com port settings are done in start\settings\system\External GPS. However i want to make the above changes programatically. For this I compared the registry settings of the mobile before and after the settings, and now set them programatically:

[HKEY_LOCAL_MACHINE\System\CurrentControlSet\GPS Intermediate Driver]
"IsEnabled"=dword:00000001

[HKEY_LOCAL_MACHINE\System\CurrentControlSet\GPS Intermediate Driver\Drivers]
"CurrentDriver"="Control Panel Configured Device"

[HKEY_LOCAL_MACHINE\System\CurrentControlSet\GPS Intermediate Driver\Drivers\Control Panel Configured Device]
"Baud"=dword:0000e100
"CommPort"="COM8:"
"InterfaceType"="COMM"

[HKEY_LOCAL_MACHINE\System\CurrentControlSet\GPS Intermediate Driver\Multiplexer]
"DriverInterface"="COM0:"

[HKEY_LOCAL_MACHINE\System\CurrentControlSet\GPS Intermediate Driver\Multiplexer\ActiveDevice]
"Index"=dword:00000000
"Prefix"="COM"
"Context"=dword:12344160
"Flags"=dword:00000002
"Keep"=dword:00000001
"Dll"="GPSID.dll"

But even after doing these registry settings, the GPS port settings do not show in the "start\settings\system\External GPS", but I can still see them in the registry.

How do i make the changes to "start\settings\system\External GPS" settings programatically?


Solution

  • You have to call IOCTL_SERVICE_REFRESH on the intermediate driver after changing the registry settings. http://msdn.microsoft.com/en-us/library/bb202088.aspx

    Also, you may find the MSDN documentation on the registry values themselves useful: http://msdn.microsoft.com/en-us/library/bb202016.aspx

    -PaulH