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

Lorenzo Lombardo lorenzo.lombardo at satbn.com
Fri Mar 31 14:22:37 CEST 2006


In my previous message there is an errata.

The line: uip_ipaddr(ipaddr, 192,168,0,234);

is: uip_ipaddr(ipaddr, 192,168,0,99);


Just to make sure you don't say that i connect to a server, but the http get 
is towards another machine.

----- Original Message ----- 
From: "Lorenzo Lombardo" <lorenzo.lombardo at satbn.com>
Sent: Friday, March 31, 2006 2:15 PM
Subject: [En-Nut-Discussion] Problems with the uIP structure and a 
clientapplication


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?
_______________________________________________
En-Nut-Discussion mailing list
En-Nut-Discussion at egnite.de
http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion


__________ Informazione NOD32 1.1464 (20060331) __________

Questo messaggio  è stato controllato dal Sistema Antivirus NOD32
http://www.nod32.it





-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.385 / Virus Database: 268.3.3/298 - Release Date: 30/03/2006





More information about the En-Nut-Discussion mailing list