ALL the aws sdk get the device time from this API(clock_gettime), right? #2267
-
Unfortunately I have a linux camera which when i call the gettimeofday, it will return local time not UTC time. That is why i need modify the aws sdk code to change the local time to UTC time. otherwise the aws cloud will reset the connection since the time is not sync. So the following code is the only place i need to modify, right?The aws sdk API definition is here: _int aws_sys_clock_get_ticks(uint64_t *timestamp) {
int ret_val = 0;
struct timespec ts;
ret_val = clock_gettime(CLOCK_REALTIME, &ts);
if (ret_val) {
return aws_raise_error(AWS_ERROR_CLOCK_FAILURE);
}
uint64_t secs = (uint64_t)ts.tv_sec;
uint64_t n_secs = (uint64_t)ts.tv_nsec;
*timestamp = (secs * NS_PER_SEC) + n_secs;
return AWS_OP_SUCCESS;
}_ |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
This should be handled automatically for you by the sdk so you don't need to make any changes. This was fixed back in 2016:
This is enabled with the |
Beta Was this translation helpful? Give feedback.
-
Hi Jmklix, ok. thanks for your support! |
Beta Was this translation helpful? Give feedback.
This should be handled automatically for you by the sdk so you don't need to make any changes. This was fixed back in 2016:
This is enabled with the
enableClockSkewAdjustment
in the client configuration, but this defaults to true. So you don't need to make any changes. Here is the code that makes the changes if you are inte…