Installation guide

74 DC 900-1325I
Freeway Server-Resident Application (SRA) Programmer Guide
Figure 5–1 shows an example of an SRA initialization text file. In this example file, each
text field is separated with a ‘|’ separator character making it easy to use UNIX string
extraction and conversion routines such as strtok_r and strtol.
5.2 Socket Interfaces
One of the most common methods of interfacing with SRAs on the Freeway server is to
use TCP/IP sockets. You can program the SRA to open a listening TCP socket using
standard UNIX socket routines. Client programs can then open a socket connection
directly to your SRA and send and receive data and/or commands.
Figure 5–1: Example SRA Initialization File
4023
################################################################
#
# SRA SERIAL PORT LIST (/tmp/boot/sra_init.dat)
#
# Field positions and lengths are fixed.
# The key field can hold 1-64.
# The name field is space-padded to 7 characters.
# The description field is space-padded to 31 characters.
# The type field is one of the following protocols:
# 0=UNUSED LINE, 1=AWS, 2=CUSTOM (SPS).
#
################################################################
#
# card (0-7)
# | port (0-7)
# key (1-64) | | type (0-2)
# | | | | enable on startup?
# | name description (31 characters) | | | | (0=no, 1=yes)
#-- ------- ------------------------------- - - - -
#
1|TTY-1 |TTY (AWS) line 1, icp0 port0 |0|0|1|1
2|TTY-2 |TTY (AWS) line 2, icp0 port1 |0|1|1|0
3|CUSTOM1|Custom line 1, icp1 port0 |1|0|2|1
4|UNUSED |Unused line, icp1 port1 |1|1|0|0