This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C129XNCZAD: get host by name

Expert 1255 points
Part Number: TM4C129XNCZAD
Other Parts Discussed in Thread: CC3200, EK-TM4C129EXL

Hi 

i would like to know if there is a way to get the ip address of a server in network format from its name?

i am aware of such functions in cc3200. like 

lRetVal = sl_NetAppDnsGetHostByName((signed char *) g_acSNTPserver,strlen(g_acSNTPserver),&g_sAppData.ulDestinationIP, SL_AF_INET);

when you provide the server string as time-c.nist.gov u get the g_sAppData.ulDestinationIP value as 2164657950l .

for tm4c what is the corresponding function

thanks a lot

av

  • Hello av,

    If using lwIP, the API "dns_gethostbyname" in dns.c file can be used to resolve the URL to an IP address. Please refer "qs_weather" application for the DK-TM4C129X board to see how this can be done.

    If using TI-RTOS, refer the following example. This example is designed for EK-TM4C129EXL board but can be easily ported to the DK-TM4C129X board. 

    Thanks,
    Sai