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.

TM4C1294KCPDT: Implementing SNTP in tm4c1294kcpdt using lwip 2

Part Number: TM4C1294KCPDT

Hello Everyone, 

I am trying to implement sntp for RTC read from ntp server (time.windows.com) using lwip 2. But it is not giving me callback (i.e. sntp_recv()) when time read from ntp server. 

Though I am getting callback for dns server in which i am initialising sntp.

Check my piece of code for the same.

//get ip of ntp server 

dns_gethostbyname((const char *)"time.windows.com",&SNTP_ipaddr,NTP_DNSServerFound, 0);

//DNS server callback function

static void NTP_DNSServerFound(const char *pcName, struct ip_addr *psIPAddr, void *vpArg)
{
if(psIPAddr != NULL)
{
sntp_setoperatingmode(SNTP_OPMODE_POLL);

sntp_setserver(0, psIPAddr);

sntp_init();

}

}