.NET Components for Mobility

GPS - How to tell if there is one present?

Last post 07-25-2008 3:29 AM by PeterFoot. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 07-24-2008 1:05 PM

    GPS - How to tell if there is one present?

    Hi There

    I have a question about GPS

    How can I interrogate any device so that I can quickly determine if there is a GPS unit so that if not, I won't even attempt to connect and get a position in my code.

    I have looked into using the ServiceStatus and I can use this with a timeout that will fail if a connection just time-outs (Which it will if no GPS is present!) but its not very elegant.

    What i am looking for is something that does the following:

    1.  Has device got GPS device

    - if YES do the usual connecting and use the eventhandlers when position info starts coming etc etc

    - If NO then just return a failed due to there not being a GPS device so that the software can carry on and not bother about getting GPS positions.

    Is there a way to do this?

    Regards

    DaveK17

  • 07-24-2008 3:42 PM In reply to

    Re: GPS - How to tell if there is one present?

    If you want to check if a GPS is setup with the GPS Intermediate Driver you can query the registry. I will find out the specific key and post back with it

     

    Peter

    Peter Foot
    Microsoft Device Application Development MVP
    www.peterfoot.net | www.inthehand.com
  • 07-25-2008 3:29 AM In reply to

    Re: GPS - How to tell if there is one present?

    First read the "CurrentDriver" value in

    [HKEY_LOCAL_MACHINE\System\CurrentControlSet\GPS Intermediate Driver\Drivers]

    Then open the subkey with the name of the currently selected driver e.g.

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

    Here you can check that a valid COM port has been selected.

    Peter

    Peter Foot
    Microsoft Device Application Development MVP
    www.peterfoot.net | www.inthehand.com
Page 1 of 1 (3 items)
Copyright © 2001-2008 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy.