- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
undefined reference to `sntp_start_auto_time_sync'. It's the error when i include "sntp.h" in application.c. I don't understand about eclipse
- Labels:
-
SPI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Perhaps you need to include libraries as well.
Include "$(NAME)_COMPONENTS +=protocols/SNTP" in the make file and add ' #include "sntp.h" ' to the source.
For sample code perhaps you can look at .../apps/snip/email sample application or Email State Changes Of Input (Push2Email) application sample codes.
Seyhan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
By including the "sntp.h" file, the system *assumes* that you will also be compiling the "sntp.c" and including that into your app.
Apart from the "ntp_timestamp_t" typedef, that .h file does nothing other than define 3 functions that either you must provide or you include with the "sntp.c" code.
I'm running in to a similar problem in that I want to use the SNTP capabilities of the NetX network from my own code (I want to read the time once and not every 'x' seconds) and finidng the right combination of includes and libraries etc. is (currently) a bit of a challenge (for me - still at the steep part of the learning curve).
Susan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Copy the attached get_time_once directory to /app/snip directory.
Add following lines to .../libraries/protocols/SNTP/sntp.c
wiced_result_t sntp_get_time_once( void )
{
/* Synchronise time with NTP server once */
return ( sync_ntp_time( NULL ) );
}
Add following line to .../libraries/protocols/SNTP/sntp.h
wiced_result_t sntp_get_time_once( void );
Build and run the GetTimeOnce application.
snip.get_time_once-<YourTargetPlatform> download run
Eg:
snip.get_time_once-BCM943362WCD4 download run
Hope it helps.
Seyhan