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?
Dear Bazza, could you please provide more information on how you are utilizing the BSD APIs and where the errors are occurring?
As far as I know, there are no specific files for each processor. To assist you better, I am sharing the links to the BSD socket and NetX duo BSD-related documents, which might be helpful.
https://web.mit.edu/macdev/Development/MITSupportLib/SocketsLib/Documentation/sockets.html
https://learn.microsoft.com/en-us/azure/rtos/netx-duo/netx-duo-bsd/chapter1
If this or any other user's response answers your concern, kindly verify the answer. Thank you!
Renesas Engineering Community Moderatorhttps://community.renesas.com/https://academy.renesas.com/en-support.renesas.com/.../
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.