Hi,
ncs v1.7.1
IC:nRF9160
How do I set this time to network time?

Hi,
you can set the log timestamp using this function:
Here's a simple way of adding 1 second offset to the timestamp, just to show how you use the API:
#include <logging/log_ctrl.h>
#define TS_FREQ 10000
static uint32_t timestamp_func(void)
{
/* Append one second (define TS_FREQ) offset to the function */
return (TS_FREQ + (k_cycle_get_32() /
(sys_clock_hw_cycles_per_sec() / TS_FREQ)));
}
... in main()
log_set_timestamp_func(timestamp_func, TS_FREQ);
....
Kind regards,
Håkon
Hi,
you can set the log timestamp using this function:
Here's a simple way of adding 1 second offset to the timestamp, just to show how you use the API:
#include <logging/log_ctrl.h>
#define TS_FREQ 10000
static uint32_t timestamp_func(void)
{
/* Append one second (define TS_FREQ) offset to the function */
return (TS_FREQ + (k_cycle_get_32() /
(sys_clock_hw_cycles_per_sec() / TS_FREQ)));
}
... in main()
log_set_timestamp_func(timestamp_func, TS_FREQ);
....
Kind regards,
Håkon