The text of a manual · part 16 of 18
6950 Enterprise Gateway Server User's Guide, pages 122 to 130
Pages 122 to 130 of 144
The original document is the PDF (617 KB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Norand 6950 EGS
Page 122
Host Application Program
SECTION 10
Native Mode Responses from the 6950 EGS The 6950 EGS sends the following codes in the wireless station number field returned to the application. Table 10-4 Codes in Wireless Station Number Field Code or Message
ÑÑÑÑÑÑ ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ ÑÑÑÑÑÑ ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ ÑÑÑÑÑÑ ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ ÑÑÑÑÑÑ ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ ÑÑÑÑÑÑ ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ ÑÑÑÑÑÑ ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ ÑÑÑÑÑÑ ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ ÑÑÑÑÑÑ ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ ÑÑÑÑÑÑ ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ ÑÑÑÑÑÑ ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ ÑÑÑÑÑÑ ÑÑÑÑÑÑ ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ ÑÑÑÑÑÑ ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ ÑÑÑÑÑÑ ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ ÑÑÑÑÑÑ ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ 800
998
999
NUI_OK NUI_STOP NUI_DEAD
NUI_TIMEOUT
NUI_BAD
NUI_BOOT
10-8
Meaning to the Application Program
No messages are available for the application. The application can perform housekeeping tasks or go back to waiting for a message (same as that follows). The wireless station has not passed a message for a predetermined length of time. The application can either ignore the message or act on it. For example, this code could be returned if the wireless station is left unattended with the application running (same as that follows). The 6950 EGS wants it to terminate. If the application does not terminate within 15 seconds, it is terminated automatically. The application receives this message when the 6950 EGS shuts down or is reset, or if the 6950 EGS detects an error (same as that follows). The 6950 EGS completion was normal. The 6950 EGS wants to terminate (same as 999 Ċ see preceding message). The associated wireless station has not been passed a message for a predetermined length of time (same as 998 Ċ see preceding message). No data available from the application to be read from the 6950 EGS (same as 800 Ċ see preceding message). A fatal error occurred which prevents continued execution. The associated wireless station is powered on and can be used to reload data into the wireless station or it can be ignored.
6950 Enterprise Gateway Server User’s Guide
Page 123
SECTION 10
Host Application Program
Program interfaces return the wireless station number and the controller or wireless station response. If one of these codes is not set, the field contains the number of the wireless station.
Configuration You must configure IP, RF communication, and wireless station parameters to support Native Sockets. To configure IP and RF communication parameters: 1. For IP setup, see page 5-4, the IP Menu." 2. At the Config Menu, press to configure RF communication. On the Comm Setup menu, do the following: " "
Set the type to E for an Ethernet connection. Use the same host name configured in the wireless stations. The host name must be four or fewer letters and is case sensitive.
"
Set automatic log in to the host.
"
Set the LAN ID.
The following RF communication setup is properly configured for internet sockets:
Comm Setup 1. Type: E (E,R) 2. Lan: 0 (0–7) 3. Host: HOST 4. Rec: 0 (0,1) 5. Auto: 1 (0,1) 6. Dbg: 0 (0,1) Option: (1–6,E)
6950 Enterprise Gateway Server User’s Guide
10-9
Page 124
Host Application Program
SECTION 10
For help with setting these parameters, see Section 6, Radio Frequency Communication." 3. Exit the Comm Setup menu and then press to configure the RF units (wireless stations). Modify the IP Host and port information for each wireless station so it corresponds to the host where your NORAND Native application resides and the <portno> in the stream sockets application. is the port defined on your host (usually in the services file) for the wireless stations. The following shows a setup for one wireless station, number 42. nui_cfg--Wire Network Access Server Configuration--Modlvl <version> RF Unit Setup: 1. Unit number: 42 3. Comment.....:Native Terminal 5. IP Host name: DEMO 6. Port........: 3325 7. User ID.....: 8. Password ...: 9. Copy setup from unit ???. 10. Duplicate this setup to unit ??? thru unit ???. CTRL-> Enter option: (E=exit, N=next,P=Previous or item number to change) HELP->
10-10
6950 Enterprise Gateway Server User’s Guide
Page 125
SECTION 10
Host Application Program
Press: 1
To assign a unique number from 0ć126 for each wireless station.
3
To enter a comment (optional) to identify the type.
5
To enter the name of the computer running the Native Sockets program.
6
To configure a different port number for Native Sockets. Port 23 is the wellĆknown port for telnet. Supply the new number.
7&8
The user ID and password are not used with Native Sockets. To use a configured wireless station number in option 9 to copy that configuration to this wireless station. To copy this setup to other wireless station.
9
10
For help, see page 5-25, Up the RF Units." Once everything is configured correctly and the wireless station is powered on, a unique connection (socket) is established between the wireless station and your socketsĆbased Native emulation program. Commands to the wireless stations must be in appropriate syntax for their Native mode. A good source for these commands is the programmer's guide available from us. Contact your Intermec representative to order the guide. The instructions for the wireless stations are helpful, but the commands for the controllers and bases should be ignored.
6950 Enterprise Gateway Server User’s Guide
10-11
Page 126
Host Application Program
SECTION 10
The following Write Display command is a sample startup menu for a wireless station with viewing screen size set to 16. DBCDNL1H2P15/01 – STDIO TEST 02 – DIRECT TEST
Notice that this message does not have the at the beginning, nor does it contain the wireless station number. The communication driver in the 6950 EGS adds the and the wireless station number.
Demonstration Program Following is a demonstration host program for Native sockets. The program uses internet sockets to send Native mode syntax to an INTERMEC wireless station via the 6950 EGS. The program sends key presses made by a wireless station user back to their display.
10-12
6950 Enterprise Gateway Server User’s Guide
Page 127
SECTION 10
Host Application Program
/***************************************************************** ****************************************************************** ** ** ** nui_sock.c ** ** ** ** This is a demo program that uses sockets to send/receive data** ** to/from a Native Mode terminal via the nui_tlnt redirector ** ** application. ** ** ** ** Usage: ./nui_sock <portno> ** ** ** ****************************************************************** *****************************************************************/ #include <stdio.h> #include <errno.h> #ifdef WIN32 #include <windows.h> #define FD_SETSIZE 256 #include <winsock.h> #else #include <sys/time.h> #include <sys/types.h> #include <sys/socket.h> #include <unistd.h> #include <netinet/in.h> #include <netdb.h> #include <arpa/inet.h> #endif #define
VERSION
/* set to number of sockets to open */
”1.00” unsigned int listen_fd; unsigned short ipport; char work_buf[1024]; char tdata[4096]; unsigned char param[]=”eD/@
OG00”;
int shut_down=0;
/* true if program shutdown requested */ struct sockaddr_in struct hostent cli_addr; host_rec;
fd_set read_fd_set; fd_set main_fd_set; 6950 Enterprise Gateway Server User’s Guide
10-13
Page 128
Host Application Program
/* ** */
SECTION 10 linked list management stuff struct LIST { unsigned int unsigned int char char char unsigned short unsigned struct LIST };
fdin; fdout; host[32]; ip[32]; sic[8]; port; msgcount; *next;
struct struct
LIST LIST
*head; *tail;
/* first pointer in linked list */ /* last pointer in linked list */ struct
LIST
*curr;
int int int int int
/* always points to the current socket pointer */ main(int argc,char **argv ); process_port(void); process_socket(void); add_fd(unsigned int fd,char *host,char *ip); delete_fd(unsigned int fd);
/*****/ main(argc, argv) int argc; char *argv[]; { struct sockaddr_in serv_addr;
int x=0; #ifdef WIN32 WSADATA WsaData; #endif
10-14
6950 Enterprise Gateway Server User’s Guide
Page 129
SECTION 10
/* ** */
Host Application Program check the command line arguments if(argc < 2) { printf(”\nnui_sock: Wrong number of arguments.”); printf(”\nnui_sock: Usage: nui_sock <portno>\n\n”); fflush(stdout); exit(1); }
/* ** */ get the port number strcpy(work_buf,argv[1]); if(strlen(work_buf) < 1) { printf(”\nnui_sock: Invalid portno! Must be numeric and > 0.”); printf(”\nnui_sock: Usage: nui_sock <portno>\n\n”); fflush(stdout); exit(1); } ipport=atoi(work_buf);
/* ** set up curses */ for(x=0;x<53;x++) { printf(”\n”); } fflush(stdout); printf(”\nnui_sock: Native Socket Demo – Version %s ”,VERSION); fflush(stdout);
6950 Enterprise Gateway Server User’s Guide
10-15
Page 130
Host Application Program
SECTION 10
/* ** startup sockets */ #ifdef WIN32 x = WSAStartup (0x0101, &WsaData); if(x==SOCKET_ERROR) { printf(”\nnui_sock: can’t init winsock interface %d.”,errno); fflush(stdout); exit(1); } #endif /* * Open a TCP socket (an Internet stream socket). */ FD_ZERO(&main_fd_set); if((listen_fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) { perror(”\nnui_sock: can’t open local socket”); exit(1); } /* * Fill in the structure ”serv_addr” with the address of the * server that we want to connect with. */ memset(&serv_addr,0x00,sizeof(serv_addr)); serv_addr.sin_family = AF_INET; serv_addr.sin_addr.s_addr = htonl(INADDR_ANY); serv_addr.sin_port = htons(ipport); if (bind(listen_fd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) { perror(”\nnui_sock: can’t bind to local socket”); exit(1); } listen(listen_fd, 5); /* ** */ add this fd to our work list so we know when clients connect FD_SET(listen_fd, &main_fd_set);
10-16
6950 Enterprise Gateway Server User’s Guide