The 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> Wiki Markup
Description
Signature
xcon.Close (string)
Closes a connection.
Parameters
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
string | M | Handle 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
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
string | M | Handle that identifies the connection within the LUA script. | |
number | M | 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 | |
string | M | the IP address of the local interface. If empty, the IP is detected by the system. | |
number | M | the local port that is used for the connection. If zero, the system selects one. | |
string | M | the IP address or host name of the remote server. | |
number | M | the 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
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
string | M | Handle that identifies the connection within the LUA script. | |
string | M | The name of the COM port in the system (e.g. "COM1"). | |
number | M | The baud rate of the serial port. | |
number | M | The amount of data bits of the serial port. | |
number | M | The used parity of the serial port. | |
number | M | The amount of stop bits of the serial port. | |
number | M | The used handshake protocol of the serial port. | |
number | M | The 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
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
string | M | Handle that identifies the connection within the LUA script. | |
string | M | host name | |
number | M | port number | |
string | M | user name | |
string | M | password |
Return
Type | Description |
---|---|
bool | initiation status; true if successful, otherwise NIL. |
Description
Signature
xcon.CreateHTTP (string)
This function can be used to create an HTTP connection in LUA.
Parameters
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
string | M | Handle 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
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
string | M | Handle that identifies the connection within the LUA script. | |
string | M | the IP address of the local interface. If empty, the IP is detected by the system. | |
number | M | the local port that is used for the connection. If zero, the system selects one. | |
string | M | the IP address or host name of the remote server. | |
number | M | the 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
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
string | M | Handle 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
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
string | M | Handle that identifies the connection within the LUA script. | |
string | M | the IP address of the local interface. If empty, the IP is detected by the system. | |
number | M | the local port that is used for the connection. If zero, the system selects one. | |
string | M | the IP address or host name of the remote server. | |
number | M | the 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
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
string | M | connection handle | |
string | M | remote file name | |
number | M | local file name |
Return
Type | Description |
---|---|
bool | initiation status; true if successful, otherwise NIL. |
Description
Signature
bool xcon.IsConnected (string)
This function determines whether the connection is established.
Parameters
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
string | M | Handle of the connection. |
Return
Type | Description |
---|---|
bool | Connection state. |
Description
Signature
bool xcon.Send (string, string, number)
This function can be used to send data via an established connection.
Parameters
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
string | M | Handle that identifies the connection within the LUA script. | |
string | M | Data to be sent | |
number | M | number of characters to be sent |
Return
Type | Description |
---|---|
bool | true 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
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
string | M | Handle that identifies the connection within the LUA script. | |
string | M | Data to be sent | |
number | M | number of characters to be sent | |
string | M | the IP address or host name of the remote server. | |
number | M | the remote port that is used to connect to. |
Return
Type | Description |
---|---|
bool | true 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
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
string | M | e-mail subject | |
string | M | e-mail body | |
string | O | absolute 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
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
string | M | e-mail address of the recipient | |
string | M | e-mail subject | |
string | M | e-mail body | |
string | O | absolute 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
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
string | M | Handle that identifies the connection within the LUA script. | |
string | M | Data to be sent, has to be in the format "xx xx xx \[...\]" where x denotes any hex digit. |
Return
Type | Description |
---|---|
bool | true 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
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
string | M | Handle that identifies the connection within the LUA script. | |
string | M | Data to be sent, has to be in the format "xx xx xx \[...\]" where x denotes any hex digit. | |
string | M | the IP address or host name of the remote server. | |
number | M | the remote port that is used to connect to. |
Return
Type | Description |
---|---|
bool | true 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
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
string | M | e-mail subject | |
string | M | e-mail body | |
string | O | absolute 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
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
string | M | Handle that identifies the connection within the LUA script. | |
string | M | Data to be sent |
Return
Type | Description |
---|---|
bool | true 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
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
string | M | Handle that identifies the connection within the LUA script. | |
string | M | URL | |
number | M | 3 (constant) | |
number | M | 0 (constant) | |
string | M | the JSON text to be sent |
Return
Type | Description |
---|---|
bool | true 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
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
string | M | Handle that identifies the connection within the LUA script. | |
string | M | URL | |
number | M | 4 (constant) | |
number | M | 0 (constant) | |
string | M | MIME type, e.g. "application/json" | |
string | M | the JSON text to be sent |
Return
Type | Description |
---|---|
bool | true 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
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
string | M | Handle that identifies the connection within the LUA script. | |
string | M | URL | |
number | M | 5 (constant) | |
number | M | 0 (constant) | |
string | M | the XML text to be sent | |
string | O | character set, e.g. "utf-8" (optional) |
Return
Type | Description |
---|---|
bool | true 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
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
string | M | Handle that identifies the connection within the LUA script. | |
string | M | Data to be sent | |
string | M | the IP address or host name of the remote server. | |
number | M | the remote port that is used to connect to. |
Return
Type | Description |
---|---|
bool | true 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
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
string | M | e-mail subject | |
string | M | e-mail body | |
string | O | absolute 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
Name | Type | Mandatory/Optional | Description |
---|---|---|---|
string | M | connection handle | |
string | M | local file name | |
number | M | remote file name |
Return
Type | Description |
---|---|
bool | initiation status; true if successful, otherwise NIL. |