Hi
You can try the high level network interface management API: ipcfg_get_ip, it returns ip mask and gateway.
Please refer to MQX_RTCS_User_Guide.pdf
Have a great day,
Daniel
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Rajesh,
When the DHCP is used the gateway and DNS data is fulfilled automatically. If are using a fix IP then you need to set those values with the functions ipcfg_add_dns_ip() and RTCS_gate_add(). Then the function ipcfg_get_ip() will be able to return all that. The function ipcfg_task_create() is used to know if the Ethernet link is active.
Regards,
-Garabo
Thank you. Garabo. Did not work for me with static info.
Here is what the function looks like(in ipcfg.c source file).
/*FUNCTION*--------------------------------------------------------------
*
* Function Name : ipcfg_get_ip()
* Returned Value : TRUE and IP, mask and gateway, if successful
* Comments : Returns actual ip information from DHCP response, if any. <<=====
*
*END--------------------------------------------------------------------*/
boolean ipcfg_get_ip
(
uint_32 device,
IPCFG_IP_ADDRESS_DATA_PTR data
)
{
if (device < IPCFG_DEVICE_COUNT)
{
if (ipcfg_data[device].actual_state != IPCFG_STATE_INIT)
{
*data = ipcfg_data[device].actual_ip_data;
return TRUE;
}
}
return FALSE;
}
Hi Rajesh,
Try the example code I am attaching here. Code is in httpdsrv.c. It is working as explained before.
Regards,
Garabo
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------