|
GPS ToolKit.NET
Open Method
Opens the communications port and begins reading GPS data.
Syntax
[Visual Basic]
object.Open(PortName)
[C#]
object.Open(PortName)
[C++]
object->Open(PortName)
[Visual Basic]
object.Open(PortName, BaudRate, Protocol)
[C#]
object.Open(PortName, BaudRate, Protocol)
[C++]
object->Open(PortName, BaudRate, Protocol)
Parameters
object
An object expression that evaluates to a GPSToolKit object.
PortName
A string containing the name of the communications port.
Protocol
A Protocol value specifying the protocol to be used when attempting communication with the GPS.
BaudRate
An integer representing the baud rate of the port.
Return Value
None
Remarks
- To automatically make a connection with a connected GPS, use the AutoDetectGPS method.
- If a baud rate parameter is not supplied, GPS ToolKit will try to autodetect the correct baud rate and protocol for the connected GPS.
Errors
- After opening a port or file using Open(), any subsequent call to Open() will cause
GPS ToolKit to throw PortAlreadyOpenException.
- An attempt to open a port that has already been opened by another application or
that does not exist will cause GPS ToolKit to throw PortOpenException
Example
[Visual Basic]
myGPSToolKit.Open("COM1")
[C#]
myGPSToolKit.Open("COM1");
[C++]
myGPSToolKit->Open("COM1");
See Also
BaudRate property, AutoDetectGPS method, Close method
|