Tool/software: TI-RTOS
I am able to change the Static IP address at run time by these functions
bzero(&NA, sizeof(NA));
NA.IPAddr = inet_addr("172.19.23.142");
NA.IPMask = inet_addr("255.255.254.0");
NA.NetType = 0;
/* get the current static IP entry */
CfgGetEntry(0, CFGTAG_IPNET, 1, 1, &hCfgIpAddr);
/* remove the current static IP entry */
CfgRemoveEntry(0, hCfgIpAddr);
/* add a new static IP entry */
CfgAddEntry(0, CFGTAG_IPNET, 1, 0,
sizeof(CI_IPNET), (UINT8 *)&NA, 0);
I need to change two more parameters, which I am unable to do so. Those are Ip.gatewayIpAddr and externDnsServIp.
I am setting these parameters in the .cnf file as
Ip.gatewayIpAddr = "172.19.23.129";
var Dns = xdc.useModule('ti.ndk.config.Dns');
Need this fix as soon as possible.
Also how to change from Static to DHCP setting at run time?
Thanks
Dns.externDnsServIp = "172.19.23.129";