#include <uuid/uuid.h>
#endif
+#if !defined(__ANDROID__) || defined(__linux__) || defined(__APPLE__) || defined(__TIZEN__)
+#define NANO_SEC 1000000000
+#endif
+
#ifdef ARDUINO
#include "Arduino.h"
#ifdef __ANDROID__
struct timespec getTs;
clock_gettime(CLOCK_MONOTONIC, &getTs);
- currentTime = (getTs.tv_sec * (uint64_t)1000000000 + getTs.tv_nsec)/1000;
+ currentTime = (getTs.tv_sec * (uint64_t)NANO_SEC + getTs.tv_nsec)/1000;
#elif _POSIX_TIMERS > 0
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
- currentTime = ts.tv_sec * 1000000 + ts.tv_nsec / 1000;
+ currentTime = (ts.tv_sec * (uint64_t)NANO_SEC + ts.tv_nsec)/ 1000;
#else
struct timeval tv;
gettimeofday(&tv, NULL);
- currentTime = tv.tv_sec * 1000000 + tv.tv_usec;
+ currentTime = tv.tv_sec * (uint64_t)1000000 + tv.tv_usec;
#endif
int32_t fd = open("/dev/urandom", O_RDONLY);
caglobals.ip.nm.numIfItems = 0;
for (size_t i = 0; i < interfaces; i++)
{
- CAResult_t result = CA_STATUS_OK;
struct ifreq* item = &ifr[i];
char *name = item->ifr_name;
struct sockaddr_in *sa4 = (struct sockaddr_in *)&item->ifr_addr;
}
// Add IPv4 interface
- result = CAAddInterfaceItem(iflist, ifindex, name, AF_INET, ipv4addr, flags);
+ CAResult_t result = CAAddInterfaceItem(iflist, ifindex, name, AF_INET, ipv4addr, flags);
if (CA_STATUS_OK != result)
{
goto exit;