Automation api, 1 overview, 2 telnet server – Sensoray 2480 User Manual
Page 8: 3 commands

2480 Instruction Manual
6
Automation API
Automation API
5.1 Overview
The 2480’s embedded web interface is suitable for manual
control, but it is not well suited to automated control nor is it
recommended for use in automated client applications. Instead,
automation clients should communicate with the 2480 through
its telnet server and command line API.
5.2 Telnet Server
The 2480’s embedded telnet server provides the principal
means for controlling the 2480 from automated client
applications. Because it is based on plaintext messages, telnet
can also serve as an alternative to HTTP for manually
controlling the module.
The server supports concurrent telnet sessions, each with a
private, dedicated shell. Each shell, in turn, provides access to
a variety of shell commands. Network clients interact with the
module’s video subsystems by issuing shell commands, and
receiving associated replies, over telnet. In most cases, a client
will open a telnet session and leave it open until it has finished
communicating with the 2480 (e.g., when the client application
closes).
Applications may have any number of open telnet sessions on a
module, up to the maximum number supported by the module.
This is a flexible arrangement that makes possible a wide range
of configurations. For example:
• A host computer could use a telnet session for automated
control while, at the same time, a laptop computer employs
another session for diagnostic monitoring.
• Multiple host computers—each responsible for managing
specific resources on a 2480 (e.g., 16x4 crosspoint switch, or
a specific video input channel)—can concurrently
communicate with the module over separate telnet sessions.
• Telnet clients need not reside on different host computers; a
single host may run multiple threads or processes, each of
which has a private telnet session for controlling its assigned
resources on the 2480.
Each telnet session maintains a communication timer. If no
communications are received within the time-out interval, the
server will automatically close the session. If a client
terminates a telnet session in an “ungraceful” way (e.g.,
application crash) then the server will time-out the session,
thus freeing its resources.
5.3 Commands
Commands must be all lower case, while arguments are case
insensitive and may be upper case, lower case, or any
combination thereof.
Some commands return information while others do not. In
most cases, commands will return an error message if the
command function cannot be executed, or if illegal arguments
were specified in the command string. Unless otherwise
described, commands return only error messages.
Channel numbers used by the API match those printed on the
module’s back panel. Video input channel numbers range from
1 to 16, and output channel numbers range from 1 to 4.
Angled brackets are used to denote symbolic names of
arguments that are supplied to commands. For example, an
argument such as “
” is intended to be replaced with a
numeric channel number.
Square brackets are used to denote optional values. For
example, “
[
” indicates that the
caption
argument is not required.
5.3.1 Configure Video Input
Function
Configure a video input channel.
Command
vicfg
Notes
This configures a channel prior to streaming.
FULL
frame rate is 30 fps for NTSC and 25 fps
for PAL. Refer to Specifications (page 8) for
details of frame sizes.
Example
vin 1 NTSC 4CIF FULL RTP-TS
5.3.2 Adjust Video Input
Function
Set visual attributes for a video input channel.
Command
viadj
Argument
Description
ichan
Video input channel: 1-16
vstd
Video standard: NTSC or PAL
size
Frame size: 4CIF, 2CIF, or 1CIF
fps
Frame rate: FULL, 20, or 10
stream
Stream protocol:
HTTP
RTP-JPEG
RTP-TS
OFF
Argument Description
ichan
Video input channel: 1-16.
b
Brightness: 0-255.
c
Contrast: 0-255.