Hi
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?
Thanks
Aviv
Hi Aviv,
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:
http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/ndk/nsp_1_10_00_03/index_FDS.html
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().
Steve
Hi Steve,
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.
thanks,
Aviv,
Can you please zip up and attach your (entire) modified project (preferably built) to this thread so I can see your changes?