[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [lwip-users] Sending UDP
From: |
Goldschmidt Simon |
Subject: |
RE: [lwip-users] Sending UDP |
Date: |
Tue, 11 Sep 2007 17:44:20 +0200 |
> I know i should not change the pointer, the code was what i
> would LIKE to do so i dont have to copy data from a fixed
> buffer to another fixed buffer.
>
> can i change the pointer if i do something like
>
> newBufHeader = pbuf_alloc( PBUF_TRANSPORT, 0, PBUF_RAM);
> newBuf = pbuf_alloc( PBUF_TRANSPORT, 1324, PBUF_REF);
> chain( newBufHeader, newBuf);
> while( bytesToSend)
> {
> newBuf->payload = currentBufferPointer);
> udp_send( outUdp, newBuf);
> currentBufferPointer += 1324;
> bytesToSend -= 1324;
> }
> pbuf_free( newBuf);
udp_send() can cope with PBUF_REF pbufs and allocates the PBUF_RAM space
for the header on its own, so no need to chain them yourself!
Simon