|
GPS ToolKit.NET
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
|