[Top][All Lists]

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

Re: [lwip-users] basic introduction example design starting point for a

From: sirnails
Subject: Re: [lwip-users] basic introduction example design starting point for a beginner
Date: Wed, 7 Oct 2009 03:07:52 -0700 (PDT)

so - this is the simplest UDP send that I have been able to come up with - i
just thought i would share this so anyone in the same position as me could
use this as a place to get started.

I welcome criticism / suggestions / improvements etc...

int main(void)
struct udp_pcb * pcb;
struct pbuf * data1, * data2;
struct ip_addr boardip;

outgoing = "hello";
boardip.addr = 0xC0A82199; // - the destination ip address

// ...
// setup system, memory, pbufs, udp, ipaddresses, netif, timer etc...
//  ...

                data1 = pbuf_alloc(PBUF_LINK, sizeof(outgoing), PBUF_REF);
                pcb = udp_new();
                udp_connect(pcb, &boardip, 10017); // 10017 - the destination 
UDP port
                data1->payload = &outgoing;
                extern void ethernetif_input(struct netif *netif);
                udp_send(pcb, data1);

Thanks for any help!

View this message in context: 
Sent from the lwip-users mailing list archive at Nabble.com.

reply via email to

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