#include "define.h" #include "TCPServer.h" #ifdef USE_WINC1500 #else #include "TCPIP_Stack/TCPIP.h" #endif #include BYTE vTelnetSession; WORD w, w2; #ifdef USE_WINC1500 #else TCP_SOCKET MyTCPSocket; #endif int OpenTCPServer() { #ifdef USE_WINC1500 return 0; #else MyTCPSocket = TCPOpen(0, TCP_OPEN_SERVER, 1212, TCP_PURPOSE_GENERIC_TCP_SERVER); if (MyTCPSocket == INVALID_SOCKET) return 0; return 1; #endif } void TickTCPServer() { BYTE i; #ifdef USE_WINC1500 #else WORD size = TCPIsGetReady(MyTCPSocket); if (size != 0) { printf("Server Rx %d bytes\n",size); BYTE buf[100]; TCPGetArray(MyTCPSocket, buf,size); TCPPutArray(MyTCPSocket,buf,size); // switch (i) // { // case 'q': // case 'Q': // { // TCPPutString(MySocket, "Bye\n"); // TCPDisconnect(MySocket); // break; // } // default: // { // TCPPut(MySocket,i); // }f // } } #endif }