- _UPNP_Connect fun [Chn] I Tries to find a UPnP compliant device on network (precisely an Internet Gateway Device) and connects to it. This function should be called once before using any other one. It will freeze the application during a few seconds (3-5). Params: Chn Channel, usually _channel. Returns: 1 or nil if it fails. - _UPNP_Disconnect fun [] I Closes the link with the Internet Gateway Device. Params: - Returns: 1 - _UPNP_OpenPort fun [S S I I I] I Opens a port on the Internet Gateway Device. Params: S Name, like Application Name. S IP address of the PC to which messages should be routed. Ex: _hostIP() I Port number (0-65535: 0-1023:WellKnown, 1024-49151:Registered, 49152-65535:Dynamic&Private) I Protocol, should be either UPNP_TCP or UPNP_UDP I Mode, should be either UPNP_SAFE or UPNP_FORCE. The second one will overwrite any existing similar port mapping (Port+Protocol) Returns: Port number if successful, nil if it fails - _UPNP_ClosePort fun [I I] I Removes a port on the Internet Gateway Device. Params: I Port number I Protocol Returns: Port number if successful, nil if it fails - _UPNP_IsPortUsed fun [I I] I Checks if a port is already used on the Internet Gateway Device. Params: I Port number I Protocol Returns: 1 if port is already defined, 0 if it's free to use. - _UPNP_GetExternalIP fun [] S Returns the external IP address of the Internet Gateway Device. Params: - Returns: S External IP address.