I have c6678, NDK 2.20.04.26, SYS/BIOS 6.32.05.54,
I am trying to change IP address in client example after connection has made. (in dtask_tcp_echo function):
That doesn't work, how can I do it?
You would need to add the new IP address you want to the NDK's configuration database, save the configuration, reboot the stack and then load the saved configuration.
For example, to add a static IP to the NDK configuration, the code would look something like the following:
// Setup manual IP address bzero( &NA, sizeof(NA) ); NA.IPAddr = IpAddr; NA.IPMask = IpMask; strcpy( NA.Domain, Domainname ); NA.NetType = 0; // Add the address to interface 1 CfgAddEntry( hCfg, CFGTAG_IPNET, 1, 0, sizeof(CI_IPNET), (UINT8 *)&NA, 0 );
Have you seen the NDK example "cfgdemo"?
That example shows how to change the IP address of a running application via a web browser interface. Do you have that example sitting next to your "client" example?
If not, you can get the cfgdemo application from the evmOMAPL138 NSP. This is for a different platform, but you can still view the example code or even port it to the 6678 if you like.
You can find the NSP download here:
The file you will be interested in is "webpage.c" and the function that handles the new IP address received from the web page is cgiCfgDone().
I did My project based on client example, in dtask_tcp_echo I created a task (with lower priority than the current task priority) that calls BuildConfig() as in webpage.c in cfgdemo,
and then in dtask_tcp_echo function i wrote the following code:
fdClose( ) // Close the socket
NC_NetStop(1) // Request stack reboot
TaskDestroy() //Destroy the current task
that doesn't work.
Can you please zip up and attach your (entire) modified project (preferably built) to this thread so I can see your changes?
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.