savannah-hackers
[Top][All Lists]
Advanced

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

[savannah-help-public] Regarding LWIP


From: nilesh thakare
Subject: [savannah-help-public] Regarding LWIP
Date: Mon, 16 Mar 2015 15:25:09 +0530

Hi,

         I am trying to broadcast the data using lwip netconn api.I use the following example to check the broadcast data but its not working .I want to send the data on ip 255.255.255.255.

 struct netconn *conn; 
char msg[]="testing" ;
struct netbuf *buf;
char * data,sample; 
conn = netconn_new( NETCONN_UDP ); 
sample=netconn_bind(conn, IP_ADDR_ANY, 1234 ); //local port
printf("bind:%d",sample);
sample=netconn_connect(conn, IP_ADDR_BROADCAST, 1235 );
printf("conn:%d",sample);
vTaskDelay( 2000 ); //some delay!
for( ;; )
buf = netbuf_new();
data ="" sizeof(msg)); 
memcpy (data, msg, sizeof (msg));
sample= netconn_send(conn, buf); 
printf("sample:%d",sample);
netbuf_delete(buf); // De-allocate packet buffer 
vTaskDelay( 2000 ); //some delay!
}
netconn_send(conn, buf); always return 250.please help me.

thanks in advance 
 

reply via email to

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