This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

What library is the network API select(...) call found?

Other Parts Discussed in Thread: CC3200

Dear Support:

I am using the Tiva TM4C1294 and needing to use the network select(...) call, but the linker can't find it when using driverlib.lib.  Can you tell me what library I need to add so that the linker will find the network API select(...) call and allow me to use it?  Please advise.

Thanks,
Tim Simerly 

  • Are you using LWIP?

    If so, in LWIP the actual select function is called lwip_select.

    I think you can either:

    a) Call lwip_select, instead of select, in the code.

     b) Enable LWIP_COMPAT_SOCKETS in the lwipopts.h include file, which causes macros to be defined in the lwip-1.4.1/src/include/lwip/sockets.h which map the standard socket function names to the LWIP equivalent names. i.e. sockets.h contains:

    #if 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)
    

  • Hey Chester:

    Thanks for your response, but no I am not using LWIP.  I am using TI-RTOS and using standard Berkeley socket calls like socket, accept, recv, etc, but can't use select for some reason.   I found out that there is a fdSelect call that is available.  Do you know if this is the proper method to call and if so, why it isn't a standard select(...) call like the other network API calls are?

    Thanks,
    Tim

  • Tim Simerly said:
    I found out that there is a fdSelect call that is available.  Do you know if this is the proper method to call and if so, why it isn't a standard select(...) call like the other network API calls are?

    Section 3.4 BSD Sockets Compatibility API Layer of TI Network Developer's Kit (NDK) v2.24 API Reference Guide SPRU524I explains how to "paste" existing BSD code into a TI-RTOS NDK application, and the associated restrictions.

    Section 3.2 File Descriptor Programming Interface explains that functions which operated on file descriptors in the Unix file system have been re-named in the NDK sockets API to avoid conflicts.

    Hope this helps.

    [I haven't yet used the TI-RTOS NDK]

  • Ok, thanks - reckon that's just the way it is. Would be nice to have the same network calls when using TI-RTOS when using different MCUs (i.e., CC3200 vs Tiva). Just confused why the standard API calls like select(...) would have their names changed when using the same RTOS across difference MCUs. Not a big deal - thanks for the document reference.