NETX DUO BSD Sockets for RX Processor

I am trying to get BSD style sockets working with Netx Duo on the R5F572NN processor.

I am using the GNU compiler.

I cannot find any specific files for the RX processor, so have obtained the Microsoft nxd_bsd.c and nxd_bsd.h files to add to my project.

However, these give errors when compiled.

Conflicting types for "fd_set"

Conflicting types for "select"

Redefinition of 'struct timeval'

select uses both fd_set and timeval so is likely impacted by these two conflicts.

INT select(INT nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);

I want to make sure any fix is valid rather than a hack.

Has anyone got the BSD sockets working for Netx Duo and RX processor?

Parents Reply
  • I now have the bsd code compiling and linking without error, I just need to find a suitable example as to how to initialise.

    I know I need to call bsd_initialize but need to know where this is called as part of the

    nextduo initialisation and if the NX_PACKET_POOL is in addition to the

    one normally initialised for netxduo or instead of.

    To get code compiling I needed to:

    1 - Add "_WINSOCK_H" to the Macro Defines. By doing so, the "fd_set" structure will not be defined by select.h, and the "timeval.h" will not be included.

    2 - Add bsd_errno to one of the TX_THREAD_EXTENSIONS, I added as TX_THREAD_EXTENSION_1

    3 - NX_ENABLE_EXTENDED_NOTIFY_SUPPORT needs to be enabled in the netxduo component.

    Once these three things were done, I could compile the code with nxd_bsd.c and nxd_bsd.h added in.

No Data