Hello,
I'm using HTTPSRV MQX4.0.2.
I have a USB interface to change IP settings;
When changing the IP address the web server will intermittently fail to host the webpages, but all other RTCS applications work appropriately. (IE SNMP, PING). The code I use to change the IP address of the stack is below. It calls HTTPSRV_release, ipcfg_unbind, RTCS_if_unbind. And than calls RTCS_if_bind, ipcfg_bind, and HTTPSRV_init with the new IP data. However, it also works just using the ipcfg functions. The problem I experience only occurs when changing the IP settings multiple times...
My question is am I changing the IP settings appropriately. If not than it's most likely unrelated to this and i can look elsewhere. Any hints are appreciated.
uint32 WebReset(){
int_64 ret = (WEBSERVER_COMMAND_ERR | WEBSERVER_ERR_OK);
//AppFlashSaveStruct(ipData);
HTTPSRV_release(g_ServerPtr->server);
ipcfg_unbind(g_ServerPtr->phy_addr);
RTCS_if_unbind(g_ServerPtr->ihandle,g_ServerPtr->ip_data.ip);
g_ServerPtr->ip_addr = (uint32)ipData.ip0;
g_ServerPtr->ip_data.ip = (uint32)ipData.ip0;
g_ServerPtr->ip_data.mask = (uint32)ipData.ip1;
g_ServerPtr->ip_data.gateway = (uint32)ipData.ip2;
RTCS_if_bind(g_ServerPtr->ihandle, g_ServerPtr->ip_data.ip, g_ServerPtr->ip_data.mask);
ipcfg_bind_staticip(g_ServerPtr->phy_addr, &g_ServerPtr->ip_data);
g_ServerPtr->server = HTTPSRV_init(&g_ServerPtr->params);
syslogResetServer(0);
UserSnmp_updateTrapIp();
return ret;
}