About GPS ToolKit.NET
Introduction
Purchasing GPS ToolKit.NET
Redistributing GPS ToolKit.NET
License Agreement
Support
Getting Started
Getting Started
Setting up the GPS
Basic Concepts
GPS ToolKit Sample Projects
About GPS ToolKit Errors
Reference
GPSToolKit Class
Properties
BaudRate
ExtendedFixData
IsGPSConnected
IsPortOpen
LastPositionUpdateTime
NavigationData
PortName
Protocol
Position
Satellites
Speed
TrueCourse
Methods
AddRoute
AddTrack
AddWaypoint
AutoDetectGPS
Close
GetAvailableSystemPorts
GetGPSInfo
GetRoutes
GetSystemPorts
GetTracks
GetWaypoints
Open
ShutOffGPS
WriteRawBinaryToGPS
WriteRawToGPS
Events
FileComplete
GPSConnected
GPSDisconnected
NavigationUpdate
PositionUpdate
RawDataReceived
SatelliteUpdate
Supporting Classes
Altitude
Angle
Distance
ExtendedFixData
Properties
DGPSRefStationID
EstimatedHorizontalError
EstimatedPositionError
EstimatedVerticalError
FixMode
GeoidHeightAboveWGS84
HDOP
MagneticVariation
NumSatellitesInView
PDOP
TimeSinceLastDGPSUpdate
VDOP
GPSInfo
Latitude
Methods
ToDecimalDegreesString
ToDegreesMinutesString
ToDegreesMinutesSecondsString
Longitude
Methods
ToDecimalDegreesString
ToDegreesMinutesString
ToDegreesMinutesSecondsString
NavData
Properties
ActiveRoute
ArrivedAtDest
CrossTrackError
DestWptName
DestWptPosition
IsValid
MagBearingFromOriginToDest
OriginWptName
TrueBearingFromOriginToDest
TrueBearingToDestWpt
VelocityTowardDestWpt
Position
Methods
BearingFrom
BearingTo
DistanceTo
Route
Properties
Name
Waypoints
Satellite
Speed
Track
Properties
Color
DisplayTrack
Name
TrackPoints
TrackPoint
Waypoint
Collections
RouteCollection
SatelliteCollection
TrackCollection
TrackPointCollection
WaypointCollection

AutoDetectGPS Method

Opens a connection with a GPS.

Syntax

[Visual Basic]
object.AutoDetectGPS()

[C#]
object.AutoDetectGPS()

[C++]
object->AutoDetectGPS()

Parameters

object

An object expression that evaluates to a GPSToolKit object.

Return Value

A string containing the name of the COM port opened

Remarks

This method sequentially opens each available COM port on the system and determines if a Garmin or GPS supporting NMEA 0183 is connected. If a GPS is not detected, the current port is closed and the next port opened. When a GPS is found, the method returns the name of the port and leaves the port open. It is, therefore, unnecessary to call Open() after calling AutoDetectGPS().

Errors

If no GPS is detected, GPS ToolKit throws GPSAutoDetectException.

Example

[Visual Basic]
Dim PortName As string
PortName = myGPSToolKit.AutoDetectGPS()


[C#]
string PortName = myGPSToolKit.AutoDetectGPS();


[C++]
String *PortName = myGPSToolKit->AutoDetectGPS();

See Also

Open method, OpenFile method, Close method