Serial port and GPS

SerialForm Class

The main form of the application sg.exe

For a list of all members of this type, see SerialForm Members.


[Visual Basic]
Public Class SerialForm
    Inherits Form
public class SerialForm : Form

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.


m_ports Combo box for selecting the GPS serial port. Contains all serial ports available on the system, see also Serial.COMPORTS.
m_baud Combo box for selecting a baud rate of the GPS serial port. Usually 9600 or 4800 are a good choice.
m_databits Combo box for selecting the number of databits for communicating through the serial port. Usually 8 is good choice.
m_parities Combo box for selecting the parity for the serial port. No parity (None) is the mostly used default.
m_stopbits Combo box for selecting the number of stopbits for the serial port. 1 stop bit (One) could be a reasonable default.
m_type IP client type, may be either OFF, TCP, UDP or BCAST. For OFF the serial port is used. Refer to the documentation of the class IPClient for more details on using IP rather than the serial port.
m_server Name or IP of the server, if m_type is TCP or UDP. For m_type BCAST the settings in this control are ignored.
m_ipport The TCP or UDP port on which the server is listening for connections for m_type TCP or UDP. The UDP port, on which this client is listening for broadcasts for m_type BCAST.
m_status Shows some informations about the type of the current connection, serial or IP, if opened using menu item Port/Open.
m_input Only if using serial port, no meaning for IP based connections. String to send to the serial port, escape sequences according to System.Text.RegularExpressions.Regex.Escape() can be used for non alphanumeric characters. On desktop computers the strings may be entered directly from the keyboard or read from a file using menu item Config/Read file. On PDAs there is no oportunity to enter the strings from keyboard, only the file option is possible.
m_answer Data sent by the serial port or the IP server. This control showns all line strings sent to the callback Serial.RdLineCb, which in this class is implemented in the method SerialPortCb.
Port/Open, m_menuopen Opens the serial port or a connection to an IP server specified in the controls m_ports, m_type, m_server, m_ipport. Opening the serial port or connection doesn't automatically cause reading the stream from there. You have additionally to activate reading using the menu item Port/Read.
Port/Close Closes connection to the serial port or IP server.
Port/Read, m_menurdport Switches reading from the serial port or IP server on or off. Reading must be explicitely switched on after Port/Open, else the application ignores any information coming from there.
Port/Send, m_menusend Sends string from m_input to the serial port. Sending to IP servers is not possible.
Port/Filter, m_menufilter Switch filtering on or off. If switched on, then only NMEA 0183 GGA sequences are recognized by the application, any other strings from the serial port or IP are ignored.
Port/Exit Exits the application.
Config/Read file Reads lines from a text file into m_input.
Config/Log, m_menulog Switches logging on or off. May be used in order to trace application errors. Each time the logging is switched on, a new log file named sg.log is opened or created in the append mode.


Namespace: serial

Assembly: sg (in sg.exe)

See Also

SerialForm Members | serial Namespace | IPClient | Serial | SerialGUI