Tool/software: TI-RTOS
How can I change the static IP?
I gathered this code from other posts:
HANDLE hCfg; CI_IPNET newIP; newIP.NetType = 0; newIP.IPAddr = inet_addr("192.168.0.100"); newIP.IPMask = inet_addr("255.255.255.0"); newIP.hBind = 0; CfgGetEntry(0, CFGTAG_IPNET, 1, 1, &hCfg); CfgRemoveEntry(0, hCfg); int resp = CfgAddEntry(0, CFGTAG_IPNET, 1, 0, sizeof(CI_IPNET), &newIP, 0);
This works, but I seem to be deleting a configuration handle that had many settings applied to it in the generated code from XGCONF:
ti_ndk_config_ip_init(hCfg); /* add the Tcp module configuration settings. */ ti_ndk_config_tcp_init(hCfg); /* add the configuration settings for NDK low priority tasks stack size. */ rc = 1280; CfgAddEntry(hCfg, CFGTAG_OS, CFGITEM_OS_TASKSTKLOW, CFG_ADDMODE_UNIQUE, sizeof(uint), (UINT8 *)&rc, 0 );
This generated initialization code is setting TCP and priority settings by using the same handle used to set the IP. Am I deleting all these settings in the IP change code?
Should I be giving CfgAddEntry() a configuration handle? The API reference claims giving 0 for the handle changes the default configuration. Im not sure if that should be changed.