barryandrews wrote on Monday, November 05, 2012:
Really appreciate your help so far, have downloaded the example you suggest, unfortunately cannot import this into ccsV5, gives an error, so have been going through and comparing what they have done, vs my attempt based on TI project.
None of these files have a makefile, so hard to see what the compiler/linker is actually including in the build.
In the TI example they have a file called lwiplib.c which includes just the files it wants from the lwip build.
I went through the options they use for this example but hit a snag.
in the sockets.h file there are macros for LWIP_COMPAT_SOCKETS
#define accept(a,b,c) lwip_accept(a,b,c)
#define bind(a,b,c) lwip_bind(a,b,c)
#define shutdown(a,b) lwip_shutdown(a,b)
#define closesocket(s) lwip_close(s)
#define connect(a,b,c) lwip_connect(a,b,c)
#define getsockname(a,b,c) lwip_getsockname(a,b,c)
#define getpeername(a,b,c) lwip_getpeername(a,b,c)
#define setsockopt(a,b,c,d,e) lwip_setsockopt(a,b,c,d,e)
#define getsockopt(a,b,c,d,e) lwip_getsockopt(a,b,c,d,e)
#define listen(a,b) lwip_listen(a,b)
#define recv(a,b,c,d) lwip_recv(a,b,c,d)
#define recvfrom(a,b,c,d,e,f) lwip_recvfrom(a,b,c,d,e,f)
#define send(a,b,c,d) lwip_send(a,b,c,d)
#define sendto(a,b,c,d,e,f) lwip_sendto(a,b,c,d,e,f)
#define socket(a,b,c) lwip_socket(a,b,c)
#define select(a,b,c,d,e) lwip_select(a,b,c,d,e)
#define ioctlsocket(a,b,c) lwip_ioctl(a,b,c)
#define read(a,b,c) lwip_read(a,b,c)
#define write(a,b,c) lwip_write(a,b,c)
#define close(s) lwip_close(s)
#endif /* LWIP_POSIX_SOCKETS_IO_NAMES */
#endif /* LWIP_COMPAT_SOCKETS */
Trouble is that this is causing an issue in the lwip udp.c and tcp.c because the compiler replaces pcb->rcv with
pcb->lwip_recv and says that TCP_PCB and UDP_PCB both don’t contain a fiels lwip_recv
Is there anywhere which defines what files should be included in the project.
The lwip is confusing because includes say “lwip/xxx” and the directory structure has a couple of different lwip/directories, so unless your compiler is setup for the correct include directories it is hard to know if you are actually including the correct file?
Any suggestion how to overcome this one?