set udpserial
Purpose
Use this command to set up the UDP serial feature, or display current UDP serial settings.
The UDP serial feature allows you to send data between the serial port and one or more remote network destinations using the UDP protocol. When this feature is enabled for a given serial port, data sent to the serial port will be sent out to the configured destinations. Also any time data is sent to the UDP serial service (IP port) and the serial port is not being used by another service, the data is sent to the serial port 2101.
Required permissions
For Digi products with two or more users, to use this command, permissions must be set to one of the following:
- For a user to display the UDP serial settings for the line on which they are logged in: set permissions s-udpserial=r-self.
- For a user to display the UDP serial settings for any line: set permissions s‑udpserial=read.
- For a user to display and set the UDP serial settings for the line on which they are logged in: set permissions s-udpserial=rw-self.
- For a user to display the UDP serial settings for any line, and set UDP serial settings for the line on which the user is logged in: set permissions s‑udpserial=w-self-r.
- For a user to display and set the UDP serial settings on any line: set permissions s-udpserial=rw.
See set permissions for details on setting user permissions for commands.
Syntax
Set general UDP serial forwarding characteristics for a serial port
set udpserial port=range [state={on|off}]
[sendcount=bytes]
[sendtime={0|time}]
[endpattern=string]
[strippattern={on|off}]
[sid={on|off}]
[sidstring=string}
[closetime=time]
Set UDP destinations for a given serial port
set udpserial port=range range=1-64
[description=string]
[active={on|off}
[ipaddress=ip address}]
[ipport=ip port]
Display current UDP serial settings
set udpserial [port=range [range=range]]
Options
Options for setting general UDP serial forwarding characteristics
port=range
Used to specify the serial port. Optional on a single-port device.
state={on|off}
Used to enable or disable sending data from the serial port to remote network destinations. The default is off.
sendcount=bytes
The number of bytes received from the serial port that causes the data to be sent on to the network destinations. This trigger cannot be disabled. The default is 1024 bytes.
sendtime={0|time}
The amount of idle time, in milliseconds, allowed before sending data to the network. If no data is received on the serial port for the time specified by this option, any buffered data is sent on to the network destinations. A value of 0 (zero) disables this trigger.
endpattern=string
If this string is set, any pattern match of data received from the serial port causes the data to be sent on to the network destinations. The maximum length of this string is 16 characters, including escape sequences for special characters. For more details on the escape sequences, see Entering Special Characters in String Values. The maximum parsed length of this string is 4 characters. That is, this string must reduce down to a 4-character string when the escape sequences are processed.
strippattern={on|off}
Determines how the data specified by the endpattern option is handled.
on
The endpattern that is found is stripped from the stream before any data is to be sent on to the network destinations.
off
The endpattern is not stripped from the stream before data is sent on to network destinations.
The default is off.
sid={on|off}
Determines how the socket ID (SID) string in the sidstring option is handled; that is, whether the string specified by the sidstring option is sent at the beginning of each UDP packet.
on
The value of sidstring is sent at the beginning of each UDP packet.
off
The value of sidstring is not sent at the beginning of each UDP packet.
The default is off.
sidstring=string
The string sent at the beginning of each UDP packet if the “sid” option is set to on. The maximum length of this string is 256 characters, including escape sequences for special characters. For more details on the escape sequences, see Entering Special Characters in String Values. The maximum parsed length of this string is 256 characters. That is, this string must reduce down to a 256-character string when the escape sequences are processed.
closetime=time
The amount of idle time before closing the serial port, in milliseconds. If no data is sent or received on the serial port for the specified amount of time, the serial port is closed. This allows the serial port to be used by other things such as TCP socket or RealPort. If a value of 0 is set, the closetime option recalculates internally to be 1000 milliseconds or twice the send time, whichever is greater. The default is 0 milliseconds.
Options for setting UDP destinations for a given serial port
The following options require a specific range to be specified by the range option.
port=range
Specifies the serial port. Optional on a single-port device.
range={1-64}
Specifies the UDP destination to be configured.
description=string
A string for descriptive purposes only.
active={on|off}
Specifies whether data from the serial port is sent to this destination.
on
Data from the serial port is sent to this destination.
off
This destination is not sent any data.
The default is off.
ipaddress=ip address
The IP address of the network destination to which data is sent.
ipport=ip port
The UDP port of the destination to which data is sent.
Options for displaying current UDP serial settings
port=range
Used to specify the serial port. Optional on a single-port device.
range=range
Identifies the range of UDP destinations to be displayed.
Examples
Set general UDP serial forwarding based on bytes received
In this example, the amount of bytes received from the serial port causes the data to be sent on to the network destination:
#> set udpserial port=1 state=on sendcount=2
Set UDP destinations for a given serial port
In this example, data is sent to the specified destination:
#> set udpserial port=1 range=1 ipaddress=10.0.0.1 ipport=2101 active=on
Display current UDP serial settings
The following are all valid ways of using set udpserial to display current UDP serial settings:
#> set udpserial
#> set udpserial port=1
#> set udpserial port=1 range=1-12