/********************************************************************** * Project : Unix/Linux Socket2air Example Applications * Description : notify * compiler for Unix : gcc -o notify -lsocket s2a_gcc.c * compiler for Linux : gcc -o notify s2a_gcc.c **********************************************************************/ #include #include #include #include #include #include #define SERV_PORT 8000 #define MAX_SEND_QUEUE_LEN 255 #define MAX_RET_MSG_LEN 128 #define INTERFACE_TYPE 0 char IpAddr[20] = ""; char Login[20] = ""; char Pw[20] = ""; char TelNum[20] = ""; char MsgId[50]= ""; char Msg[300] = ""; char TmpStr[300]; struct Send_Msg{ unsigned char interface_type; unsigned char msg_type; unsigned char msg_content_len; char msg_content[MAX_SEND_QUEUE_LEN]; }; struct Ret_Msg{ unsigned char ret_code; char ret_description[MAX_RET_MSG_LEN]; }; int FillMsg(char *src, char *target, int n) { int i,len; len = strlen(target); for(i=0; i "); printf("\n : notify 203.66.172.131 test test1 0932xxxxxx System Crit Alarm"); printf("\nOutput: notify.log"); printf("\n : \n"); LogMessage("Fail:Argument_Error"); exit(0); } strcpy(IpAddr, argv[1]); strcpy(Login, argv[2]); strcpy(Pw, argv[3]); strcpy(TelNum, argv[4]); strcpy(Msg, ""); for(i=5; i