Hello,
I would like to implement the network time synchronization from the Openthread API to the existing simple_coap_client example from the Thread and Zigbee SDK. I'm currently using the SDK with SES. I added the include path, added the preprocessor definition (OPENTHREAD_CONFIG_TIME_SYNC_ENABLE) and tried to use the API functions but I get an error from SES: main.c:226: undefined reference to `otNetworkTimeSyncSetCallback'.
I am very new to Openthread and the SDK, are there any other settings I have to make?
#include <openthread/instance.h> #include <openthread/thread.h> #include <openthread/platform/time.h> #include <openthread/network_time.h>
/**@brief Function for initializing the Thread Time Synchronizationt Package */ static void thread_time_sync_init(void) { otNetworkTimeSetSyncPeriod(thread_ot_instance_get(), 60); otNetworkTimeSetXtalThreshold(thread_ot_instance_get(), otPlatTimeGetXtalAccuracy()); otNetworkTimeSyncSetCallback(thread_ot_instance_get(), thread_time_sync_callback, NULL); }
Thank you very much for your help.
Best regards
Rouben