Quantcast
Channel: Forum - Recent Threads
Viewing all articles
Browse latest Browse all 5781

SNTP

$
0
0

Hi

I am working on DK board for SNTP.

I am checking it on Ethernet port 1.ping works fine but I always get SERVER_STATUS as 0 .

So the IF condition gets fails and SNTP time does not print.

Same code works fine with SK board.I am not getting what could be the issue

while (1)
{
SERVER_STATUS = 0;
volatile status_receiving = nx_sntp_client_receiving_updates(&g_sntp_client, &SERVER_STATUS);

ULONG seconds = 0;
ULONG milliseconds = 0;
char buffer[50] = {0};


if (NX_SUCCESS == status_receiving && NX_TRUE == SERVER_STATUS)
{
status = nx_sntp_client_get_local_time(&g_sntp_client, &seconds, &milliseconds, &buffer[0]);
status = nx_sntp_client_utility_display_date_time(&g_sntp_client, &buffer[0], sizeof(buffer));
if (status == NX_SUCCESS)
{
printf("Date1: %s\n", &buffer[0]);
}
}


Viewing all articles
Browse latest Browse all 5781


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>