lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] lwip and udp client


From: Haori Yang
Subject: Re: [lwip-users] lwip and udp client
Date: Wed, 4 Oct 2006 15:10:26 -0400

Hi, Sathya

can you be more specific? what connect function? do you mean these two?

xilnet_udp_init_conns();
xilnet_udp_open_conn(addr.sin_port);

when should the light of the router/RJ45 be lighten? after open a connection?
I tried to put these two functions into my code, the light of the RJ45 is still off.

I want to switch to lwIP, but I just think I am so close to figure it out....

In case of lwIP, how to setup the MAC?
 
is it just like this

xemacif_setmac(0, (u8_t *) fullmac); //Set MAC


or I have to set it up using API from emac?

Thanks, Sathya.

Looking forward to your anser.

On 10/4/06, Sathya Thammanur <address@hidden> wrote:
Haori,
In you xilnet code, you are missing the connect function that will connect to the server before the client can send/receive any data. It is better to use lwIP as it is a more stable stack.

Sathya


On 10/3/06, Haori Yang < address@hidden> wrote:
Hi, guys
 
   after struggling with xilnet for a few weeks, I decided to give lwip a try. I think I was so close to make this udp design work, however I need some help.

   can  you give me a rough draft of how udp client work with lwip? what do I need to setup? can I use raw API?

  if you know some about xilnet. could you take a look at my code? I can't figure out what's wrong. plus, I am using AVnet Virtex4 LX evaluation board + microBlaze. the program stops while it enter xilsock_sendto.

  Thanks.

Haori



******************************************************************************
  xilnet_eth_init_hw_addr("00:60:08:11:27:7b");

xilnet_eth_init_hw_addr_tbl();
         
xilnet_ip_init("1.2.3.4");
                
xilnet_mac_init(XPAR_ETHERNET_MAC_BASEADDR);
                 
XEmac_mSetMacAddress(XPAR_ETHERNET_MAC_BASEADDR, mb_hw_addr);
                
XEmac_mEnable(XPAR_ETHERNET_MAC_BASEADDR);

s = xilsock_socket(AF_INET, SOCK_DGRAM, 0);
  

if (s == -1)
  {
        return XST_FAILURE;
  }
 
 
/* Clear out server struct */
memset((void *)&addr, '\0', sizeof(struct sockaddr_in)); 
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = (unsigned int)0x00000000;
addr.sin_port = 8080;

err = xilsock_bind(s, (struct sockaddr *)&addr, sizeof(struct sockaddr));

if (err == -1)
  {
        return XST_FAILURE;
  }

memset((void *)&remote, '\0', sizeof(struct sockaddr_in)); 
remote.sin_family = AF_INET;
remote.sin_addr.s_addr = (unsigned int)0x01020309;
remote.sin_port = 8080;

unsigned int size;
size = (unsigned int)sizeof(struct sockaddr);

for(;;)
{  

xilsock_sendto(s, (unsigned char*)TxFrame, 20,(struct sockaddr *)&remote, size);

}

_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users



_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users



reply via email to

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