Serial port and GPS

Serial2IP.oper Method 

Starts or stops copying serial port data

[Visual Basic]
Public Sub oper( _
   ByVal typ As ServerType, _
   ByVal port As Integer _
)
[C#]
public void oper(
   ServerType typ,
   int port
);

Parameters

typ
The type of the server or OFF for switching the server off. If whitching off, the serial port will be also closed.
port
The TCP or UDP port name. The server listenes on this port for types TCP and UDP or sends to this port for type BCAST. This variable has no meaning, if the the server is switched off.

Remarks

If switching on, the method opens the serial port and it starts copying data from it to TCP or UDP (also broadcast) using the callback method copyFkt(). For the type TCP the thread method listeningFktTCP() is started in order to receive incoming connections. For the type UDP the thread method listeningFktUDP() is started instead. In this case the client must send something in order to be recognized by this server. For broadcast (type BCAST) there is no listening method, the method builds an UDP client with a broadcast address instead and the callback method copyFkt() writes serial data to this client only. Windows broadcasts 255.255.255.255 are presently used rather than the real broadcast addresses of the networks currently defined in the system.

See Also

Serial2IP Class | serial Namespace