Method: createConnection
Adds new connection. The following parameters are used:
- serialPort – string parameter specifying serial port to be shared. If the port is virtual, serialPort is a name of symbolic link to the slave side of the created virtual port. Note that a virtual port’s name must not coincide with the name of already existing file. The folder where virtual port is created should exist, and you should have the right to create a file in this folder. It is recommended to use /tmp folder.
- virtualPort – boolean parameter describing whether the port is a real physical serial port (false) or a virtual one (true)
- netMode – unsigned integer 32-bit parameter, describing connection type. It can have one of the following values:
0 = TCP server
1 = TCP client
2 = UDP
Returns D-Bus node name if connection was successful, or blank line if an error occurred (for example, if the required serial port is already shared).
Examples:
In the following example, real serial port # 0 is shared in TCP server mode:
evesec call /SEC manager createConnection \
string:'/dev/ttyS0' \
boolean:false \
uint32:0
Returned value:
string "__dev__ttyS0"
In this example, virtual port is shared in TCP client mode:
evesec call /SEC manager createConnection \
string:'/tmp/virt1' \
boolean:true \
uint32:1
Returned value:
string "__tmp__virt1"
Method: destroyConnection
Removes already created connection. The following parameters are used:
- serialPort – string parameter specifying serial port to be unshared
Returns true if connection was successfully destroyed, and false otherwise.
See also ‘destroy‘ method below.
Example:
In the following example we unshare real serial port # 0:
evesec call /SEC manager destroyConnection \
string:'/dev/ttyS0'
Method: getConnectionsList
Returns the list of available connections (shared serial ports).
Example:
evesec call /SEC manager getConnectionsList
Returned value:
array [
string "/dev/ttyS0"
string "/tmp/virt1"
]
Method: connectionName
Verifies whether the required serial port is shared. The following parameters are used:
- serialPort – string parameter specifying serial port name
Returns D-Bus node name if the required port is shared. Otherwise blank line is returned.
Example:
evesec call /SEC manager connectionName \
string:'/dev/ttyS0'
Returned value:
string "__dev__ttyS0"
Method: saveScript
Allows saving shell script which restores the current state of the program. The following parameters are used:
- filename – string parameter specifying the name of the file (with absolute path to it), where shell script will be saved
Returns true if the script file was created successfully.
Example:
evesec call /SEC manager saveScript \
string:'/home/user/Documents/script.sh'
Method: version
Returns the information about the current version of Serial to Ethernet Connector.
Example:
evesec call /SEC manager version
Method: changeRegistration
Allows registering your copy of Serial to Ethernet Connector.
The following parameters are used:
- userName – string parameter specifying the user name
- registrationKey – string parameter specifying registration key
Returns true if your copy of Serial to Ethernet Connector was registered successfully.
Example:
evesec call /SEC manager changeRegistration \
string:'User' \
string:'XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX'
Method: registeredTo
Returns registration info. If Trial version of Serial to Ethernet Connector is currently used, “Demo” value is returned.
Example:
evesec call /SEC manager registeredTo
Method: licenseType
Returns the information about license type of your copy of Serial to Ethernet Connector.
Example:
evesec call /SEC manager licenseType
Method: trialExpiryUnixTime
Returns the date (in seconds since the Unix epoch) of Trial version license expiration or zero if you have OEM license.
Example:
evesec call /SEC manager trialExpiryUnixTime
Method: trialPeriodLeft
Returns the number of seconds that are left before Trial period expires or zero if you have OEM license.
Example:
evesec call /SEC manager trialPeriodLeft
Method: quit
Stops Serial to Ethernet Connector daemon without saving its state. Use saveScript method before quitting to save its state.
Returns no value.
Example:
evesec call /SEC manager quit