[En-Nut-Discussion] Problems with the uIP structure and a client application

Lorenzo Lombardo lorenzo.lombardo at satbn.com
Fri Mar 31 14:06:51 CEST 2006


Hi,
I'm having some problems with the Ethernut board and the uIP structure.
While I can successfully run a server application, I'm having problem in developing a client application.

This is a simple code to get a page and I know if the page is called, because it writes a file:


void example1_init(void)
{
 struct uip_conn *conn;
 u16_t ipaddr[2];
 uip_ipaddr(ipaddr, 192,168,0,234);
 if (ipaddr != NULL) ledFlash(1);
 extDelay_ms(500);
 conn = uip_connect(ipaddr, HTONS(80));
 if (conn != NULL) ledFlash(2);
 extDelay_ms(500);
 example1_app();
}

void example1_app(void) 
{
  if(uip_connected() || uip_rexmit()) 
  {
      ledFlash(3);
      uip_send("GET /admin/Atmel/prova.php HTTP/1.1\r\nHost: 192.168.0.99\r\nConnection: Close\r\n\r\n", strlen("GET /admin/Atmel/prova.php HTTP/1.1\r\nHost: 192.168.0.99\r\nConnection: Close\r\n\r\n"));
   }
}



ledFlash is a function that writes all 1s in a port and I've attacched a led to it, so I can use a primitive debugging method. The parameter is the number of flashes for the led.
extDelay_ms is an extended version of delay_ms that allow me to set any integer value instead of a limited number (only 255 ms).

It seems that the init is ok, the ipaddr and the conn value are set, but with a packet sniffer software I've seen that I don't receive any connection from the device. In fact the example1_app function doesn't do anything...

Moreover this is an example taken from the "uIP Reference Manual" by Doxygen and I assume that the example shown here are ok, but I still got problems.


Am I missing something?


More information about the En-Nut-Discussion mailing list