00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00023 #include <stdio.h>
00024 #include <eripc.h>
00025 #include <eripcclient.h>
00026 #include <eripctoolbar.h>
00027
00028 #include <stdio.h>
00029 #include <stddef.h>
00030 #include <stdlib.h>
00031 #include <string.h>
00032 #include <sys/types.h>
00033 #include <sys/socket.h>
00034 #include <netinet/in.h>
00035 #include <arpa/inet.h>
00036 #include <unistd.h>
00037
00038 main()
00039 {
00040 erClientChannel_t channel;
00041 char szBuffer[TB_MAXCHARONLINE];
00042 erIpcCmd_t cmd;
00043 int nRet;
00044
00045 printf("Starting clientTest.\n");
00046
00047 erIpcStartClient(ER_TEST_CHANNEL, &channel);
00048
00049
00050 while (fgets(szBuffer, TB_MAXCHARONLINE, stdin) != NULL)
00051 {
00052 int nLen;
00053
00054
00055
00056 if (szBuffer[0] == '#')
00057 {
00058
00059 continue;
00060 }
00061
00062 nLen = strlen(szBuffer);
00063 if (nLen > 0)
00064 {
00065 if (szBuffer[nLen - 1] == '\n')
00066 {
00067 szBuffer[nLen - 1] = '\0';
00068 }
00069 }
00070
00071
00072 if (nLen != 0)
00073 {
00074 nRet = tbParseCommand(szBuffer, &cmd);
00075 if ( nRet >= 0 )
00076 {
00077 erIpcSndCommand(channel, &cmd);
00078 }
00079 }
00080 }
00081
00082
00083 }