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.

adding sntp request to HTTP server

Other Parts Discussed in Thread: SYSBIOS

Hello,

i'm using tirtos_tivac_2_16_00_08 on TM4C129 and i'm trying to to add the sntp request to the HTTP server example but i'm getting the following errors and warning:

Description Resource Path Location Type
#20 identifier "CONTENT_TYPE_HTML" is undefined empty.c /httpServer line 194 C/C++ Problem
#20 identifier "CRLF" is undefined empty.c /httpServer line 195 C/C++ Problem
#20 identifier "HTTP_OK" is undefined empty.c /httpServer line 194 C/C++ Problem
#20 identifier "httpsTask" is undefined empty.c /httpServer line 174 C/C++ Problem
<a href="file:/c:/ti/ccsv6/tools/compiler/dmed/HTML/225.html">#225-D</a> function "efs_createfile" declared implicitly empty.c /httpServer line 209 C/C++ Problem
<a href="file:/c:/ti/ccsv6/tools/compiler/dmed/HTML/225.html">#225-D</a> function "efs_destroyfile" declared implicitly empty.c /httpServer line 217 C/C++ Problem
<a href="file:/c:/ti/ccsv6/tools/compiler/dmed/HTML/225.html">#225-D</a> function "httpSendClientStr" declared implicitly empty.c /httpServer line 195 C/C++ Problem
<a href="file:/c:/ti/ccsv6/tools/compiler/dmed/HTML/225.html">#225-D</a> function "httpSendStatusLine" declared implicitly empty.c /httpServer line 194 C/C++ Problem

please advise, which include file should be added to remove the errors. the code is attached with post.

Thanks,

Mohammed Fawzy7318.http server modified.zip

  • It appears that ti/ndk/inc/nettools/inc should be added to your include file search paths.
    Is the NDK product installation (ie "C:/ti/tirtos_tivac_2_16_00_08/products/ndk_2_25_00_09/packages") in your include search path at all?

    Alan
  • as shown in the attached example in the first post that the include search path has the following:
    "${COM_TI_RTSC_TIRTOSTIVAC_INSTALL_DIR}/products/ndk_2_25_00_09/packages/ti/ndk/inc/bsd"
    "${CG_TOOL_ROOT}/include"
    "${workspace_loc:/${ProjName}}"
    "${COM_TI_RTSC_TIRTOSTIVAC_INSTALL_DIR}/products/TivaWare_C_Series-2.1.1.71b"
    "${COM_TI_RTSC_TIRTOSTIVAC_INSTALL_DIR}/products/bios_6_45_01_29/packages/ti/sysbios/posix"
    "C:\ti\wolfssl"

    and i added 

    "${COM_TI_RTSC_TIRTOSTIVAC_INSTALL_DIR}/products/ndk_2_25_00_09/packages/ti/ndk/inc/bsd"

    but it didn't make any difference


    Thanks,
    Mohammed Faawzy

  • 1) in empty.c, you need to add this #include


    #include < ti/ndk/inc/netmain.h>

    and remove these 2 includes:


    #include <sys/socket.h>

    #include <ti/net/sntp/sntp.h>

    Add these function prototypes:

    extern void SNTP_forceTimeSync(void);
    extern int SNTP_start(uint32_t (*get)(void), void (*set)(uint32_t newtime),
    void (*timeUpdatedHook)(void *), struct sockaddr *servers,
    unsigned int numservers, size_t stacksize);

    2) you need to add a function prototype for the httpsTask() function above your reference to it in the Task_create() call.

  • I'm sorry for this back and forth thread, i followed your depicted instruction but i'm still getting the below error, did i miss something?
    Description Resource Path Location Type
    #10010 errors encountered during linking; "httpServer.out" not built httpServer C/C++ Problem
    <a href="file:/c:/ti/ccsv6/tools/compiler/dmed/HTML/10234.html">#10234-D</a> unresolved symbols remain httpServer C/C++ Problem
    unresolved symbol SNTP_forceTimeSync, first referenced in ./empty.obj httpServer C/C++ Problem
    unresolved symbol SNTP_start, first referenced in ./empty.obj httpServer C/C++ Problem
  • As mentioned in the sntp.h file, you need to add the appropriate sntp library to your project's link options.

    I was able to link your application by adding this line to the "ARM Linker->File Search Path->Include library file or command file as input" list:

    -l"C:/ti/tirtos_tivac_2_16_00_08/products/ndk_2_25_00_09/packages/ti/ndk/nettools/lib/sntp.aem4f"

    Alan