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?
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.
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?
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?