lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] UDP transmission question


From: Ben Bobbitt
Subject: [lwip-users] UDP transmission question
Date: Thu, 7 Feb 2008 21:17:54 -0600

At the risk of asking a foolish question, is there something I’m not doing correctly here to get a simple UDP transmit using the api layer of lwip?  I’m new to using lwip ( and FreeRTOS) so this has been a bit of a steep learning curve. 

 

In my Ethernet module, the setup has occurred:

  sys_init();

  mem_init();

  memp_init();

  pbuf_init();

  netif_init();

  ip_init();

  udp_init(); 

  tcpip_init( prvEthernetConfigureInterface, NULL );

 

where in the prvEthernetConfigureInterface func:

 

netif_add(&MACB_if, &xIpAddr, &xNetMask, &xGateway, NULL, ethernetif_init, tcpip_input);

/* make it the default interface */

netif_set_default(&MACB_if);

 /* bring it up */

 netif_set_up(&MACB_if);

dhcp_start(&MACB_if);

 

After a few seconds time to give DHCP a chance ( which does get an ip address ), I spawn another task, where I do the following:

 

portTASK_FUNCTION( vUDPListener, pvParameters )

{

  struct netbuf *pxRxBuffer,*pxTxBuffer;

  struct netconn *pxUDPConnection;

  struct ip_addr* addr;

  char* data;

  err_t err;

  u16_t len;

  u16_t portnum;

  char text[] = "A TEXT STRING";

 

  /* Create a new udp connection handle */

  pxUDPConnection = netconn_new( NETCONN_UDP );

  netconn_bind(pxUDPConnection, NULL, (u16_t)UDP_DEFAULT_PORT ); 

  pxTxBuffer = netbuf_new();

  netbuf_ref(pxTxBuffer,text,sizeof(text));

  err= netconn_send(pxUDPConnection,pxTxBuffer);

 

 

}

 

Not only does this not send any data, it seems to lock up the rest of the app.  This is a task that I have added to an existing demo app for the Atmel AVR32UC3A, on the EVK1100.  

 

Thanks for anyone who points out the stupid thing I’ve done/not done  here…….

 

-Ben

 

 

   

 


No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.516 / Virus Database: 269.19.21/1265 - Release Date: 2/7/2008 11:17 AM


reply via email to

[Prev in Thread] Current Thread [Next in Thread]