Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Wiki MarkupThe LUA engine of the NETx BMS Core Server provides different runtime functions for network communication, e.g. e-mail, TCP, or FTP. In order to correctly send e-mails, the outgoing SMTP server has to be configured within the System Configuration file (cf. Section 4.2.2.5). <file name="xcon.Close"> <h1>Description</h1> <h1>Signature</h1> xcon.Close (string) <p>Closes a connection.</p> <h1>Parameters</h1> <table> <colgroup> <col/> <col/> <col/> <col/> </colgroup> <tbody> <tr> <th>Name</th> <th>Type</th> <th>Mandatory/Optional</th> <th>Description</th> </tr> <tr><td></td><td>string</td><td>M</td><td>Handle that identifies the connection within the LUA script.</td></tr> </tbody> </table> <h1>Return</h1> None. </file> <file name="xcon.Create"> <h1>Description</h1> <h1>Signature</h1> xcon.Create (string, number, string, number, string, number) <p>This function can be used to create a socket in LUA. </p> <h1>Parameters</h1> <table> <colgroup> <col/> <col/> <col/> <col/> </colgroup> <tbody> <tr> <th>Name</th> <th>Type</th> <th>Mandatory/Optional</th> <th>Description</th> </tr> <tr><td></td><td>string</td><td>M</td><td>Handle that identifies the connection within the LUA script.</td></tr> <tr><td></td><td>number</td><td>M</td><td>Socket type. Allowed values are nxa.xcon.UDP = 1, nxa.xcon.TCPClient = 2, nxa.xcon.HTTP = 4, nxa.xcon.RSS = 5, nxa.xcon.COM = 6, nxa.FTPClient = 8 TODO XXXX </td></tr> <tr><td></td><td>string</td><td>M</td><td>the IP address of the local interface. If empty, the IP is detected by the system.</td></tr> <tr><td></td><td>number</td><td>M</td><td>the local port that is used for the connection. If zero, the system selects one.</td></tr> <tr><td></td><td>string</td><td>M</td><td>the IP address or host name of the remote server.</td></tr> <tr><td></td><td>number</td><td>M</td><td>the remote port that is used to connect to.</td></tr> </tbody> </table> <h1>Return</h1> None. </file> <file name="xcon.CreateCOM"> <h1>Description</h1> <h1>Signature</h1> xcon.CreateCOM (string, string, number, number, number, number, number, number) <p>This function can be used to create a serial connection in LUA. </p> <h1>Parameters</h1> <table> <colgroup> <col/> <col/> <col/> <col/> </colgroup> <tbody> <tr> <th>Name</th> <th>Type</th> <th>Mandatory/Optional</th> <th>Description</th> </tr> <tr><td></td><td>string</td><td>M</td><td>Handle that identifies the connection within the LUA script.</td></tr> <tr><td></td><td>string</td><td>M</td><td>The name of the COM port in the system (e.g. "COM1").</td></tr> <tr><td></td><td>number</td><td>M</td><td>The baud rate of the serial port.</td></tr> <tr><td></td><td>number</td><td>M</td><td>The amount of data bits of the serial port.</td></tr> <tr><td></td><td>number</td><td>M</td><td>The used parity of the serial port.</td></tr> <tr><td></td><td>number</td><td>M</td><td>The amount of stop bits of the serial port.</td></tr> <tr><td></td><td>number</td><td>M</td><td>The used handshake protocol of the serial port.</td></tr> <tr><td></td><td>number</td><td>M</td><td>The used event char of the serial port.</td></tr> </tbody> </table> <h1>Return</h1> None. </file> <file name="xcon.CreateFTP"> <h1>Description</h1> <h1>Signature</h1> bool xcon.CreateFTP (string, string, number, string, string) <p>This function creates an FTP client socket.</p> <h1>Parameters</h1> <table> <colgroup> <col/> <col/> <col/> <col/> </colgroup> <tbody> <tr> <th>Name</th> <th>Type</th> <th>Mandatory/Optional</th> <th>Description</th> </tr> <tr><td></td><td>string</td><td>M</td><td>Handle that identifies the connection within the LUA script.</td></tr> <tr><td></td><td>string</td><td>M</td><td>host name</td></tr> <tr><td></td><td>number</td><td>M</td><td>port number</td></tr> <tr><td></td><td>string</td><td>M</td><td>user name</td></tr> <tr><td></td><td>string</td><td>M</td><td>password</td></tr> </tbody> </table> <h1>Return</h1> <table> <colgroup> <col/> <col/> </colgroup> <tbody> <tr> <th>Type</th> <th>Description</th> </tr> <tr><td>bool</td><td>initiation status; true if successful, otherwise NIL.</td></tr> </tbody> </table> </file> <file name="xcon.CreateHTTP"> <h1>Description</h1> <h1>Signature</h1> xcon.CreateHTTP (string) <p>This function can be used to create an HTTP connection in LUA. </p> <h1>Parameters</h1> <table> <colgroup> <col/> <col/> <col/> <col/> </colgroup> <tbody> <tr> <th>Name</th> <th>Type</th> <th>Mandatory/Optional</th> <th>Description</th> </tr> <tr><td></td><td>string</td><td>M</td><td>Handle that identifies the connection within the LUA script.</td></tr> </tbody> </table> <h1>Return</h1> None. </file> <file name="xcon.CreateTCP"> <h1>Description</h1> <h1>Signature</h1> xcon.CreateTCP (string, string, number, string, number) <p>This function can be used to create a TCP socket in LUA. </p> <h1>Parameters</h1> <table> <colgroup> <col/> <col/> <col/> <col/> </colgroup> <tbody> <tr> <th>Name</th> <th>Type</th> <th>Mandatory/Optional</th> <th>Description</th> </tr> <tr><td></td><td>string</td><td>M</td><td>Handle that identifies the connection within the LUA script.</td></tr> <tr><td></td><td>string</td><td>M</td><td>the IP address of the local interface. If empty, the IP is detected by the system.</td></tr> <tr><td></td><td>number</td><td>M</td><td>the local port that is used for the connection. If zero, the system selects one.</td></tr> <tr><td></td><td>string</td><td>M</td><td>the IP address or host name of the remote server.</td></tr> <tr><td></td><td>number</td><td>M</td><td>the remote port that is used to connect to.</td></tr> </tbody> </table> <h1>Return</h1> None. </file> <file name="xcon.CreateRSS"> <h1>Description</h1> <h1>Signature</h1> xcon.CreateRSS (string) <p>This function can be used to create an RSS feed in LUA. </p> <h1>Parameters</h1> <table> <colgroup> <col/> <col/> <col/> <col/> </colgroup> <tbody> <tr> <th>Name</th> <th>Type</th> <th>Mandatory/Optional</th> <th>Description</th> </tr> <tr><td></td><td>string</td><td>M</td><td>Handle that identifies the RSS feed within the LUA script.</td></tr> </tbody> </table> <h1>Return</h1> None. </file> <file name="xcon.CreateUDP"> <h1>Description</h1> <h1>Signature</h1> xcon.CreateUDP (string, string, number, string, number) <p>This function can be used to create a UDP socket in LUA. </p> <h1>Parameters</h1> <table> <colgroup> <col/> <col/> <col/> <col/> </colgroup> <tbody> <tr> <th>Name</th> <th>Type</th> <th>Mandatory/Optional</th> <th>Description</th> </tr> <tr><td></td><td>string</td><td>M</td><td>Handle that identifies the connection within the LUA script.</td></tr> <tr><td></td><td>string</td><td>M</td><td>the IP address of the local interface. If empty, the IP is detected by the system.</td></tr> <tr><td></td><td>number</td><td>M</td><td>the local port that is used for the connection. If zero, the system selects one.</td></tr> <tr><td></td><td>string</td><td>M</td><td>the IP address or host name of the remote server.</td></tr> <tr><td></td><td>number</td><td>M</td><td>the remote port that is used to connect to.</td></tr> </tbody> </table> <h1>Return</h1> None. </file> <file name="xcon.Download"> <h1>Description</h1> <h1>Signature</h1> bool xcon.Download (string, string, number) <p>This function initiates an asynchronous FTP download. If a download is already taking place on this connection (identified by host, port, user, and password), the transfer is enqueued and commenced once the current transfer is finished. Provide _OnDoneEvent and _OnErrorEvent callback functions to be notified on transfer completion and errors (ref. section 4.6.11).</p> <h1>Parameters</h1> <table> <colgroup> <col/> <col/> <col/> <col/> </colgroup> <tbody> <tr> <th>Name</th> <th>Type</th> <th>Mandatory/Optional</th> <th>Description</th> </tr> <tr><td></td><td>string</td><td>M</td><td>connection handle</td></tr> <tr><td></td><td>string</td><td>M</td><td>remote file name</td></tr> <tr><td></td><td>number</td><td>M</td><td>local file name</td></tr> </tbody> </table> <h1>Return</h1> <table> <colgroup> <col/> <col/> </colgroup> <tbody> <tr> <th>Type</th> <th>Description</th> </tr> <tr><td>bool</td><td>initiation status; true if successful, otherwise NIL.</td></tr> </tbody> </table> </file> <file name="xcon.IsConnected"> <h1>Description</h1> <h1>Signature</h1> bool xcon.IsConnected (string) <p>This function determines whether the connection is established. </p> <h1>Parameters</h1> <table> <colgroup> <col/> <col/> <col/> <col/> </colgroup> <tbody> <tr> <th>Name</th> <th>Type</th> <th>Mandatory/Optional</th> <th>Description</th> </tr> <tr><td></td><td>string</td><td>M</td><td>Handle of the connection.</td></tr> </tbody> </table> <h1>Return</h1> <table> <colgroup> <col/> <col/> </colgroup> <tbody> <tr> <th>Type</th> <th>Description</th> </tr> <tr><td>bool</td><td>Connection state.</td></tr> </tbody> </table> </file> <file name="xcon.Send"> <h1>Description</h1> <h1>Signature</h1> bool xcon.Send (string, string, number) <p>This function can be used to send data via an established connection. </p> <h1>Parameters</h1> <table> <colgroup> <col/> <col/> <col/> <col/> </colgroup> <tbody> <tr> <th>Name</th> <th>Type</th> <th>Mandatory/Optional</th> <th>Description</th> </tr> <tr><td></td><td>string</td><td>M</td><td>Handle that identifies the connection within the LUA script.</td></tr> <tr><td></td><td>string</td><td>M</td><td>Data to be sent</td></tr> <tr><td></td><td>number</td><td>M</td><td>number of characters to be sent</td></tr> </tbody> </table> <h1>Return</h1> <table> <colgroup> <col/> <col/> </colgroup> <tbody> <tr> <th>Type</th> <th>Description</th> </tr> <tr><td>bool</td><td>true when server is initialized, otherwise false.</td></tr> </tbody> </table> </file> <file name="xcon.SendTo"> <h1>Description</h1> <h1>Signature</h1> bool xcon.SendTo (string, string, number, string, number) <p>This function can be used to send data via an established connection. </p> <h1>Parameters</h1> <table> <colgroup> <col/> <col/> <col/> <col/> </colgroup> <tbody> <tr> <th>Name</th> <th>Type</th> <th>Mandatory/Optional</th> <th>Description</th> </tr> <tr><td></td><td>string</td><td>M</td><td>Handle that identifies the connection within the LUA script.</td></tr> <tr><td></td><td>string</td><td>M</td><td>Data to be sent</td></tr> <tr><td></td><td>number</td><td>M</td><td>number of characters to be sent</td></tr> <tr><td></td><td>string</td><td>M</td><td>the IP address or host name of the remote server.</td></tr> <tr><td></td><td>number</td><td>M</td><td>the remote port that is used to connect to.</td></tr> </tbody> </table> <h1>Return</h1> <table> <colgroup> <col/> <col/> </colgroup> <tbody> <tr> <th>Type</th> <th>Description</th> </tr> <tr><td>bool</td><td>true when server is initialized, otherwise false.</td></tr> </tbody> </table> </file> <file name="xcon.SendAdminEmail"> <h1>Description</h1> <h1>Signature</h1> xcon.SendAdminEmail (string, string, string) <p>This function can be used to directly send an e-mail to the specified admin e-mail address. </p> <h1>Parameters</h1> <table> <colgroup> <col/> <col/> <col/> <col/> </colgroup> <tbody> <tr> <th>Name</th> <th>Type</th> <th>Mandatory/Optional</th> <th>Description</th> </tr> <tr><td></td><td>string</td><td>M</td><td>e-mail subject</td></tr> <tr><td></td><td>string</td><td>M</td><td>e-mail body</td></tr> <tr><td></td><td>string</td><td>O</td><td>absolute file path to an e-mail attachment (optional)</td></tr> </tbody> </table> <h1>Return</h1> None. </file> <file name="xcon.SendEmailTo"> <h1>Description</h1> <h1>Signature</h1> xcon.SendEmailTo (string, string, string, string) <p>This function can be used to directly send an e-mail within LUA. </p> <h1>Parameters</h1> <table> <colgroup> <col/> <col/> <col/> <col/> </colgroup> <tbody> <tr> <th>Name</th> <th>Type</th> <th>Mandatory/Optional</th> <th>Description</th> </tr> <tr><td></td><td>string</td><td>M</td><td>e-mail address of the recipient</td></tr> <tr><td></td><td>string</td><td>M</td><td>e-mail subject</td></tr> <tr><td></td><td>string</td><td>M</td><td>e-mail body</td></tr> <tr><td></td><td>string</td><td>O</td><td>absolute file path to an e-mail attachment (optional)</td></tr> </tbody> </table> <h1>Return</h1> None. </file> <file name="xcon.SendHex"> <h1>Description</h1> <h1>Signature</h1> bool xcon.SendHex (string, string) <p>Sends binary data given as hex-bytes via an established connection.</p> <h1>Parameters</h1> <table> <colgroup> <col/> <col/> <col/> <col/> </colgroup> <tbody> <tr> <th>Name</th> <th>Type</th> <th>Mandatory/Optional</th> <th>Description</th> </tr> <tr><td></td><td>string</td><td>M</td><td>Handle that identifies the connection within the LUA script.</td></tr> <tr><td></td><td>string</td><td>M</td><td>Data to be sent, has to be in the format "xx xx xx \[...\]" where x denotes any hex digit.</td></tr> </tbody> </table> <h1>Return</h1> <table> <colgroup> <col/> <col/> </colgroup> <tbody> <tr> <th>Type</th> <th>Description</th> </tr> <tr><td>bool</td><td>true when server is initialized, otherwise false.</td></tr> </tbody> </table> </file> <file name="xcon.SendTextTo"> <h1>Description</h1> <h1>Signature</h1> bool xcon.SendTextTo (string, string, string, number) <p>Sends binary data given as hex-bytes via an established connection.</p> <h1>Parameters</h1> <table> <colgroup> <col/> <col/> <col/> <col/> </colgroup> <tbody> <tr> <th>Name</th> <th>Type</th> <th>Mandatory/Optional</th> <th>Description</th> </tr> <tr><td></td><td>string</td><td>M</td><td>Handle that identifies the connection within the LUA script.</td></tr> <tr><td></td><td>string</td><td>M</td><td>Data to be sent, has to be in the format "xx xx xx \[...\]" where x denotes any hex digit.</td></tr> <tr><td></td><td>string</td><td>M</td><td>the IP address or host name of the remote server.</td></tr> <tr><td></td><td>number</td><td>M</td><td>the remote port that is used to connect to.</td></tr> </tbody> </table> <h1>Return</h1> <table> <colgroup> <col/> <col/> </colgroup> <tbody> <tr> <th>Type</th> <th>Description</th> </tr> <tr><td>bool</td><td>true when server is initialized, otherwise false.</td></tr> </tbody> </table> </file> <file name="xcon.SendSystemEmail"> <h1>Description</h1> <h1>Signature</h1> xcon.SendSystemEmail (string, string, string) <p>This function can be used to directly send an e-mail to the specified systen e-mail address.</p> <h1>Parameters</h1> <table> <colgroup> <col/> <col/> <col/> <col/> </colgroup> <tbody> <tr> <th>Name</th> <th>Type</th> <th>Mandatory/Optional</th> <th>Description</th> </tr> <tr><td></td><td>string</td><td>M</td><td>e-mail subject</td></tr> <tr><td></td><td>string</td><td>M</td><td>e-mail body</td></tr> <tr><td></td><td>string</td><td>O</td><td>absolute file path to an e-mail attachment (optional)</td></tr> </tbody> </table> <h1>Return</h1> None. </file> <file name="xcon.SendText (plain string over socket connection)"> <h1>Description</h1> <h1>Signature</h1> bool xcon.SendText (plain string over socket connection) (string, string) <p>This function can be used to send data via an established connection.</p> <h1>Parameters</h1> <table> <colgroup> <col/> <col/> <col/> <col/> </colgroup> <tbody> <tr> <th>Name</th> <th>Type</th> <th>Mandatory/Optional</th> <th>Description</th> </tr> <tr><td></td><td>string</td><td>M</td><td>Handle that identifies the connection within the LUA script.</td></tr> <tr><td></td><td>string</td><td>M</td><td>Data to be sent</td></tr> </tbody> </table> <h1>Return</h1> <table> <colgroup> <col/> <col/> </colgroup> <tbody> <tr> <th>Type</th> <th>Description</th> </tr> <tr><td>bool</td><td>true when server is initialized, otherwise false.</td></tr> </tbody> </table> </file> <file name="xcon.SendText (HTTP POST with JSON string)"> <h1>Description</h1> <h1>Signature</h1> bool xcon.SendText (HTTP POST with JSON string) (string, string, number, number, string) <p>This function can be used to send data via an established connection.</p> <h1>Parameters</h1> <table> <colgroup> <col/> <col/> <col/> <col/> </colgroup> <tbody> <tr> <th>Name</th> <th>Type</th> <th>Mandatory/Optional</th> <th>Description</th> </tr> <tr><td></td><td>string</td><td>M</td><td>Handle that identifies the connection within the LUA script.</td></tr> <tr><td></td><td>string</td><td>M</td><td>URL</td></tr> <tr><td></td><td>number</td><td>M</td><td>3 (constant)</td></tr> <tr><td></td><td>number</td><td>M</td><td>0 (constant)</td></tr> <tr><td></td><td>string</td><td>M</td><td>the JSON text to be sent</td></tr> </tbody> </table> <h1>Return</h1> <table> <colgroup> <col/> <col/> </colgroup> <tbody> <tr> <th>Type</th> <th>Description</th> </tr> <tr><td>bool</td><td>true when server is initialized, otherwise false.</td></tr> </tbody> </table> </file> <file name="xcon.SendText (HTTP POST with JSON string and MIME type provided)"> <h1>Description</h1> <h1>Signature</h1> bool xcon.SendText (HTTP POST with JSON string and MIME type provided) (string, string, number, number, string, string) <p>This function can be used to send data via an established connection.</p> <h1>Parameters</h1> <table> <colgroup> <col/> <col/> <col/> <col/> </colgroup> <tbody> <tr> <th>Name</th> <th>Type</th> <th>Mandatory/Optional</th> <th>Description</th> </tr> <tr><td></td><td>string</td><td>M</td><td>Handle that identifies the connection within the LUA script.</td></tr> <tr><td></td><td>string</td><td>M</td><td>URL</td></tr> <tr><td></td><td>number</td><td>M</td><td>4 (constant)</td></tr> <tr><td></td><td>number</td><td>M</td><td>0 (constant)</td></tr> <tr><td></td><td>string</td><td>M</td><td>MIME type, e.g. "application/json"</td></tr> <tr><td></td><td>string</td><td>M</td><td>the JSON text to be sent</td></tr> </tbody> </table> <h1>Return</h1> <table> <colgroup> <col/> <col/> </colgroup> <tbody> <tr> <th>Type</th> <th>Description</th> </tr> <tr><td>bool</td><td>true when server is initialized, otherwise false.</td></tr> </tbody> </table> </file> <file name="xcon.SendText (HTTP POST with XML string)"> <h1>Description</h1> <h1>Signature</h1> bool xcon.SendText (HTTP POST with XML string) (string, string, number, number, string, string) <p>This function can be used to send data via an established connection.</p> <h1>Parameters</h1> <table> <colgroup> <col/> <col/> <col/> <col/> </colgroup> <tbody> <tr> <th>Name</th> <th>Type</th> <th>Mandatory/Optional</th> <th>Description</th> </tr> <tr><td></td><td>string</td><td>M</td><td>Handle that identifies the connection within the LUA script.</td></tr> <tr><td></td><td>string</td><td>M</td><td>URL</td></tr> <tr><td></td><td>number</td><td>M</td><td>5 (constant)</td></tr> <tr><td></td><td>number</td><td>M</td><td>0 (constant)</td></tr> <tr><td></td><td>string</td><td>M</td><td>the XML text to be sent</td></tr> <tr><td></td><td>string</td><td>O</td><td>character set, e.g. "utf-8" (optional)</td></tr> </tbody> </table> <h1>Return</h1> <table> <colgroup> <col/> <col/> </colgroup> <tbody> <tr> <th>Type</th> <th>Description</th> </tr> <tr><td>bool</td><td>true when server is initialized, otherwise false.</td></tr> </tbody> </table> </file> <file name="xcon.SendTextTo"> <h1>Description</h1> <h1>Signature</h1> bool xcon.SendTextTo (string, string, string, number) <p>This function can be used to send data via an established connection. </p> <h1>Parameters</h1> <table> <colgroup> <col/> <col/> <col/> <col/> </colgroup> <tbody> <tr> <th>Name</th> <th>Type</th> <th>Mandatory/Optional</th> <th>Description</th> </tr> <tr><td></td><td>string</td><td>M</td><td>Handle that identifies the connection within the LUA script.</td></tr> <tr><td></td><td>string</td><td>M</td><td>Data to be sent</td></tr> <tr><td></td><td>string</td><td>M</td><td>the IP address or host name of the remote server.</td></tr> <tr><td></td><td>number</td><td>M</td><td>the remote port that is used to connect to.</td></tr> </tbody> </table> <h1>Return</h1> <table> <colgroup> <col/> <col/> </colgroup> <tbody> <tr> <th>Type</th> <th>Description</th> </tr> <tr><td>bool</td><td>true when server is initialized, otherwise false.</td></tr> </tbody> </table> </file> <file name="xcon.SendUserEmail"> <h1>Description</h1> <h1>Signature</h1> xcon.SendUserEmail (string, string, string) <p>This function can be used to directly send an e-mail to the specified user e-mail address.</p> <h1>Parameters</h1> <table> <colgroup> <col/> <col/> <col/> <col/> </colgroup> <tbody> <tr> <th>Name</th> <th>Type</th> <th>Mandatory/Optional</th> <th>Description</th> </tr> <tr><td></td><td>string</td><td>M</td><td>e-mail subject</td></tr> <tr><td></td><td>string</td><td>M</td><td>e-mail body</td></tr> <tr><td></td><td>string</td><td>O</td><td>absolute file path to an e-mail attachment (optional)</td></tr> </tbody> </table> <h1>Return</h1> None. </file> <file name="xcon.Upload"> <h1>Description</h1> <h1>Signature</h1> bool xcon.Upload (string, string, number) <p>This function initiates an asynchronous FTP upload. If an upload is already taking place on this connection (identified by host, port, user, and password), the transfer is enqueued and commenced once the current transfer is finished. Provide _OnDoneEvent and _OnErrorEvent callback functions to be notified on transfer completion and errors (ref. section 4.6.11).</p> <h1>Parameters</h1> <table> <colgroup> <col/> <col/> <col/> <col/> </colgroup> <tbody> <tr> <th>Name</th> <th>Type</th> <th>Mandatory/Optional</th> <th>Description</th> </tr> <tr><td></td><td>string</td><td>M</td><td>connection handle</td></tr> <tr><td></td><td>string</td><td>M</td><td>local file name</td></tr> <tr><td></td><td>number</td><td>M</td><td>remote file name</td></tr> </tbody> </table> <h1>Return</h1> <table> <colgroup> <col/> <col/> </colgroup> <tbody> <tr> <th>Type</th> <th>Description</th> </tr> <tr><td>bool</td><td>initiation status; true if successful, otherwise NIL.</td></tr> </tbody> </table> </file>

Description

Signature

xcon.Close (string)

Closes a connection.

Parameters

NameTypeMandatory/OptionalDescription
 stringMHandle that identifies the connection within the LUA script.

Return

None.

Description

Signature

xcon.Create (string, number, string, number, string, number)

This function can be used to create a socket in LUA.

Parameters

NameTypeMandatory/OptionalDescription
 stringMHandle that identifies the connection within the LUA script.
 numberMSocket type. Allowed values are nxa.xcon.UDP = 1, nxa.xcon.TCPClient = 2, nxa.xcon.HTTP = 4, nxa.xcon.RSS = 5, nxa.xcon.COM = 6, nxa.FTPClient = 8 TODO XXXX
 stringMthe IP address of the local interface. If empty, the IP is detected by the system.
 numberMthe local port that is used for the connection. If zero, the system selects one.
 stringMthe IP address or host name of the remote server.
 numberMthe remote port that is used to connect to.

Return

None.

Description

Signature

xcon.CreateCOM (string, string, number, number, number, number, number, number)

This function can be used to create a serial connection in LUA.

Parameters

NameTypeMandatory/OptionalDescription
 stringMHandle that identifies the connection within the LUA script.
 stringMThe name of the COM port in the system (e.g. "COM1").
 numberMThe baud rate of the serial port.
 numberMThe amount of data bits of the serial port.
 numberMThe used parity of the serial port.
 numberMThe amount of stop bits of the serial port.
 numberMThe used handshake protocol of the serial port.
 numberMThe used event char of the serial port.

Return

None.

Description

Signature

bool xcon.CreateFTP (string, string, number, string, string)

This function creates an FTP client socket.

Parameters

NameTypeMandatory/OptionalDescription
 stringMHandle that identifies the connection within the LUA script.
 stringMhost name
 numberMport number
 stringMuser name
 stringMpassword

Return

TypeDescription
boolinitiation status; true if successful, otherwise NIL.

Description

Signature

xcon.CreateHTTP (string)

This function can be used to create an HTTP connection in LUA.

Parameters

NameTypeMandatory/OptionalDescription
 stringMHandle that identifies the connection within the LUA script.

Return

None.

Description

Signature

xcon.CreateTCP (string, string, number, string, number)

This function can be used to create a TCP socket in LUA.

Parameters

NameTypeMandatory/OptionalDescription
 stringMHandle that identifies the connection within the LUA script.
 stringMthe IP address of the local interface. If empty, the IP is detected by the system.
 numberMthe local port that is used for the connection. If zero, the system selects one.
 stringMthe IP address or host name of the remote server.
 numberMthe remote port that is used to connect to.

Return

None.

Description

Signature

xcon.CreateRSS (string)

This function can be used to create an RSS feed in LUA.

Parameters

NameTypeMandatory/OptionalDescription
 stringMHandle that identifies the RSS feed within the LUA script.

Return

None.

Description

Signature

xcon.CreateUDP (string, string, number, string, number)

This function can be used to create a UDP socket in LUA.

Parameters

NameTypeMandatory/OptionalDescription
 stringMHandle that identifies the connection within the LUA script.
 stringMthe IP address of the local interface. If empty, the IP is detected by the system.
 numberMthe local port that is used for the connection. If zero, the system selects one.
 stringMthe IP address or host name of the remote server.
 numberMthe remote port that is used to connect to.

Return

None.

Description

Signature

bool xcon.Download (string, string, number)

This function initiates an asynchronous FTP download. If a download is already taking place on this connection (identified by host, port, user, and password), the transfer is enqueued and commenced once the current transfer is finished. Provide _OnDoneEvent and _OnErrorEvent callback functions to be notified on transfer completion and errors (ref. section 4.6.11).

Parameters

NameTypeMandatory/OptionalDescription
 stringMconnection handle
 stringMremote file name
 numberMlocal file name

Return

TypeDescription
boolinitiation status; true if successful, otherwise NIL.

Description

Signature

bool xcon.IsConnected (string)

This function determines whether the connection is established.

Parameters

NameTypeMandatory/OptionalDescription
 stringMHandle of the connection.

Return

TypeDescription
boolConnection state.

Description

Signature

bool xcon.Send (string, string, number)

This function can be used to send data via an established connection.

Parameters

NameTypeMandatory/OptionalDescription
 stringMHandle that identifies the connection within the LUA script.
 stringMData to be sent
 numberMnumber of characters to be sent

Return

TypeDescription
booltrue when server is initialized, otherwise false.

Description

Signature

bool xcon.SendTo (string, string, number, string, number)

This function can be used to send data via an established connection.

Parameters

NameTypeMandatory/OptionalDescription
 stringMHandle that identifies the connection within the LUA script.
 stringMData to be sent
 numberMnumber of characters to be sent
 stringMthe IP address or host name of the remote server.
 numberMthe remote port that is used to connect to.

Return

TypeDescription
booltrue when server is initialized, otherwise false.

Description

Signature

xcon.SendAdminEmail (string, string, string)

This function can be used to directly send an e-mail to the specified admin e-mail address.

Parameters

NameTypeMandatory/OptionalDescription
 stringMe-mail subject
 stringMe-mail body
 stringOabsolute file path to an e-mail attachment (optional)

Return

None.

Description

Signature

xcon.SendEmailTo (string, string, string, string)

This function can be used to directly send an e-mail within LUA.

Parameters

NameTypeMandatory/OptionalDescription
 stringMe-mail address of the recipient
 stringMe-mail subject
 stringMe-mail body
 stringOabsolute file path to an e-mail attachment (optional)

Return

None.

Description

Signature

bool xcon.SendHex (string, string)

Sends binary data given as hex-bytes via an established connection.

Parameters

NameTypeMandatory/OptionalDescription
 stringMHandle that identifies the connection within the LUA script.
 stringMData to be sent, has to be in the format "xx xx xx \[...\]" where x denotes any hex digit.

Return

TypeDescription
booltrue when server is initialized, otherwise false.

Description

Signature

bool xcon.SendTextTo (string, string, string, number)

Sends binary data given as hex-bytes via an established connection.

Parameters

NameTypeMandatory/OptionalDescription
 stringMHandle that identifies the connection within the LUA script.
 stringMData to be sent, has to be in the format "xx xx xx \[...\]" where x denotes any hex digit.
 stringMthe IP address or host name of the remote server.
 numberMthe remote port that is used to connect to.

Return

TypeDescription
booltrue when server is initialized, otherwise false.

Description

Signature

xcon.SendSystemEmail (string, string, string)

This function can be used to directly send an e-mail to the specified systen e-mail address.

Parameters

NameTypeMandatory/OptionalDescription
 stringMe-mail subject
 stringMe-mail body
 stringOabsolute file path to an e-mail attachment (optional)

Return

None.

Description

Signature

bool xcon.SendText (plain string over socket connection) (string, string)

This function can be used to send data via an established connection.

Parameters

NameTypeMandatory/OptionalDescription
 stringMHandle that identifies the connection within the LUA script.
 stringMData to be sent

Return

TypeDescription
booltrue when server is initialized, otherwise false.

Description

Signature

bool xcon.SendText (HTTP POST with JSON string) (string, string, number, number, string)

This function can be used to send data via an established connection.

Parameters

NameTypeMandatory/OptionalDescription
 stringMHandle that identifies the connection within the LUA script.
 stringMURL
 numberM3 (constant)
 numberM0 (constant)
 stringMthe JSON text to be sent

Return

TypeDescription
booltrue when server is initialized, otherwise false.

Description

Signature

bool xcon.SendText (HTTP POST with JSON string and MIME type provided) (string, string, number, number, string, string)

This function can be used to send data via an established connection.

Parameters

NameTypeMandatory/OptionalDescription
 stringMHandle that identifies the connection within the LUA script.
 stringMURL
 numberM4 (constant)
 numberM0 (constant)
 stringMMIME type, e.g. "application/json"
 stringMthe JSON text to be sent

Return

TypeDescription
booltrue when server is initialized, otherwise false.

Description

Signature

bool xcon.SendText (HTTP POST with XML string) (string, string, number, number, string, string)

This function can be used to send data via an established connection.

Parameters

NameTypeMandatory/OptionalDescription
 stringMHandle that identifies the connection within the LUA script.
 stringMURL
 numberM5 (constant)
 numberM0 (constant)
 stringMthe XML text to be sent
 stringOcharacter set, e.g. "utf-8" (optional)

Return

TypeDescription
booltrue when server is initialized, otherwise false.

Description

Signature

bool xcon.SendTextTo (string, string, string, number)

This function can be used to send data via an established connection.

Parameters

NameTypeMandatory/OptionalDescription
 stringMHandle that identifies the connection within the LUA script.
 stringMData to be sent
 stringMthe IP address or host name of the remote server.
 numberMthe remote port that is used to connect to.

Return

TypeDescription
booltrue when server is initialized, otherwise false.

Description

Signature

xcon.SendUserEmail (string, string, string)

This function can be used to directly send an e-mail to the specified user e-mail address.

Parameters

NameTypeMandatory/OptionalDescription
 stringMe-mail subject
 stringMe-mail body
 stringOabsolute file path to an e-mail attachment (optional)

Return

None.

Description

Signature

bool xcon.Upload (string, string, number)

This function initiates an asynchronous FTP upload. If an upload is already taking place on this connection (identified by host, port, user, and password), the transfer is enqueued and commenced once the current transfer is finished. Provide _OnDoneEvent and _OnErrorEvent callback functions to be notified on transfer completion and errors (ref. section 4.6.11).

Parameters

NameTypeMandatory/OptionalDescription
 stringMconnection handle
 stringMlocal file name
 numberMremote file name

Return

TypeDescription
boolinitiation status; true if successful, otherwise NIL.