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.

RTOS/PROCESSOR-SDK-AM437X: NDK program for ioctl() function

Part Number: PROCESSOR-SDK-AM437X

Tool/software: TI-RTOS

I find  the NDK without the  ioctl() function. so if I want to get/set the Socket a (new) IP Address, how to implement it with existing commands?

  • Sorry,I looked at the website you mentioned, but I didn't find the information I wanted.
  • This link is for information required from the customer when posting a question about RTOS. Please provide the required information.
  • Hi,

    Please check the NDK TI Network Developer's Kit (NDK) v2.25 API Reference Guide for NIMUIOCTL. From Table A-2. IOCTL Commands, I don't think you can set/get an IP address.

    Regards, Eric
  • Hi Eric,

    can I use the CfgAddEntry() function to add a IP Address, if I use the CfgRemoveEntry() to delete it before, while I had used the CfgAddEntry() function to add a IP Address in the initialization phase at the beginning of the program?

    other questions:

    1. in the example:C:\ti\pdk_am437x_1_0_10\packages\ti\transport\ndk\nimu\example\src\main_AM57xx.c. int the stackInitHook(), it use the hCfg by parameter passing, if I want to use it by global variable in the task, how can I get it?

    2. If I want to get current IP address, whoch API can I use ?  can i use the CfgGetImmediate() to get it?

  • Hi, Eric

    I had implemented IP address change, it should to use the CfgRemoveEntry() to delete the original one ,and then use the  CfgAddEntry() to add the new one.

    but now, I have a new question:

    How to implement the function of attribute SOCKET_FIONBIO and SOCKET_FIONREAD of the Ioctl().

    in ioctl, the attribute SOCKET_FIONBIO mean to set socket to non-blocking; the attribute SOCKET_FIONREAD mean  to determine the amount of data pending in the network's input buffer.

  • Hi Eric,

    I studied the NDK API reference manual carefully and found that there are two functions to achieve these two functions.

    for non-blocking,use the setsockopt() as follow:

    setsockopt(hSocket, SOL_SOCKET, SO_BLOCKING, piParameter, sizeof(int))   

    for data length ,use the fdStatus() as follow:

    fdStatus(hSocket, FDSTATUS_RECV, piParameter);

    the piParameter is pointer to a int.

    Do I understand correctly?

  • Hi,

    What is the NDK release you used? I looked 2.26.0.8, the
    /*-------------------------------------------------------------------- */
    /* fdStatus() (USER FUNCTION) */
    /* Called to get the status of a file descriptor */
    /*-------------------------------------------------------------------- */
    int fdStatus( HANDLE fd, int request, int *presults )

    When you use FDSTATUS_RECV for the request, I thought it return socket status, either 0 or 1, not the data length.

    Let me check our expert for this.

    Regards, Eric
  • Hi Eric,

    I am using the ndk_2_26_00_08,I had tried this function, the data length is in the presults for return.

    thank you.