--- trunk/PIC/TCP-IP stack/main.c 2007/05/01 13:02:59 63 +++ trunk/PIC/TCP-IP stack/main.c 2007/05/01 13:47:27 64 @@ -3,15 +3,42 @@ #include "StackTsk.h" #include "tick.h" -#include "dhcp.h" +#include "Tcp.h" APP_CONFIG AppConfig; -void main() +int global_network_int; +char global_network_char; + +void network_send_hello( unsigned char termid) { - while(1); + + switch(smState) + { + case SM_CONNECT: + Sock = TCPConnect(, 1234); + if( Sock == INVALID_SOCKET ){ + return 1; + } + else + smState = SM_CONNECT_WAIT; + return; + case SM_CONNECT_WAIT: + if( TCPISConnected(Sock) ){ + smState = SM_CONNECTED; + } + return; + } } -void network_send_hello( unsigned char termid) + +void main() { - + TickInit(); + StackInit(); // tcp,ud,mac,arp Init happends in StackInit(); + while(1) + { + TickUpdate(); + StackTask(); + TCPTick(); + } }