Hi,
I am trying to implement serial_wifi example using static ip. I have edited the code in 'ConfigureSimpleLinkToDefaultState()' function in 'network_if.c' file and in 'InitDevice()' function in 'serial_wifi.c' file.
// Enable DHCP client // lRetVal = sl_NetCfgSet(SL_IPV4_STA_P2P_CL_DHCP_ENABLE,1,1,&ucVal); // Commented to disable DHCP mode // ASSERT_ON_ERROR(lRetVal); //*** Added to enable static IP mode SlNetCfgIpV4Args_t ipV4; ipV4.ipV4 = (unsigned long)SL_IPV4_VAL(192,168,0,90); // unsigned long IP address ipV4.ipV4Mask = (unsigned long)SL_IPV4_VAL(255,255,255,0); // unsigned long Subnet mask for this AP/P2P ipV4.ipV4Gateway = (unsigned long)SL_IPV4_VAL(255,255,255,255); // unsigned long Default gateway address ipV4.ipV4DnsServer = (unsigned long)SL_IPV4_VAL(255,255,255,255); // unsigned long DNS server address lRetVal = sl_NetCfgSet(SL_IPV4_STA_P2P_CL_STATIC_ENABLE, IPCONFIG_MODE_ENABLE_IPV4, sizeof(SlNetCfgIpV4Args_t), (unsigned char *) &ipV4); sl_Stop(0); sl_Start(NULL,NULL,NULL); ASSERT_ON_ERROR(lRetVal); //***
I am not able to ping my device. Can anyone please guide me to configure my device for static IP?