This stops to listen for data on the specified connection ID.
Input:
id : SINT
ID for the connection.
Returns: INT
0 if successful, -1 indicates that the passed ID is illegal.
Declaration:
FUNCTION udpStopListen : INT;
VAR_INPUT
id : SINT;
END_VAR;
Example:
INCLUDE rtcu.inc
VAR_INPUT
server_active : BOOL;
END_VAR;
PROGRAM udp_server;
VAR
port : INT := 2500;
udp_id : SINT;
rip : DINT := 0;
status : RF_TRIG ;
END_VAR;
gsmPower(power := ON);
gprsOpen();
BEGIN
status(trig := server_active);
IF status.rq THEN
udp_id := udpStartListen(port := port, rip := rip);
ELSIF status.fq THEN
udpStopListen(id := udp_id);
END_IF;
END;
END_PROGRAM;
|