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.

RTOS: NDK - SNTP implemented fixed issue

Guru 10750 points

Tool/software: TI-RTOS

Hi,

I'm using SNTP on NDK 2.24.2.31, I have seen the issue "Fixed a bug in the SNTP Client, in which another Task's socket could be closed by SNTP" was solved in NDK 2.25.0.9, what was the fix as I would like to implement it using NDK 2.24.2.31 or I must move to NDK 2.25.0.9?

Thanks,

HRi

  • HRi said:
    I have seen the issue "Fixed a bug in the SNTP Client, in which another Task's socket could be closed by SNTP" was solved in NDK 2.25.0.9

    I can't find any issue in either our bug database or the NDK git change log that matches that description.  Can you provide more info?  A bug ID, or git commit associated with it?

    Thanks & Regards,

    - Rob

  • Prasad Jondhale said:
    Please look for SDOCM00118042

    Thank you for that pointer.

    Here is the "gitk" entry for that fix:

    (SDOCM00118042) reset sntpSocket after close

    ----------------------- src/ti/ndk/nettools/sntp/sntp.c -----------------------
    index a46ca09..9c8a209 100644
    @@ -738,6 +738,7 @@ CONTINUE:
             /* Clean up and wait until it's time to sync with server again */
             if (sntpSocket != -1) {
                 close(sntpSocket);
    +            sntpSocket = -1;
             }
         }

    You can see the filename and the '+' line that you need to add to that file.

    Regards,

    - Rob

  • Hi Rob,

    Just to confirm I have changed the file sntp.c in NDK ver 2.24.02.31 

    from:

    CONTINUE:

    /* Clean up and wait until it's time to sync with server again */

    if (sntpSocket) {

    fdClose(sntpSocket);

    }

    to:

    CONTINUE:

    /* Clean up and wait until it's time to sync with server again */

    if (sntpSocket){

    fdClose(sntpSocket);

    sntpSocket = NULL; // Add this to solve the Fixed a bug in the SNTP Client, in which another Task's socket could be closed by SNTP

    }

    Thanks,

    HRi

  • HRi said:
    sntpSocket = NULL; // Add this to solve the Fixed a bug in the SNTP Client, in which another Task's socket could be closed by SNTP

    That looks correct.

    The git commit entry that I posted above was just for that bug.  Apparently, the sntp.c file has changed in other ways (-1 instead of NULL initializer and close indicator), so you did the right thing by modifying that change to suit the 2.24 code stream.

    Regards,

    - Rob

  • Rob,

    OK, Thanks,

    HRi