68 lines
1.5 KiB
C
Raw Normal View History

2017-10-08 16:46:14 +02:00
/*******************************************************************************
*
* Copyright (c) 2013, 2014, 2015 Intel Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v1.0 which accompany this distribution.
*
* The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html
* The Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* Contributors:
* David Navarro, Intel Corporation - initial API and implementation
*******************************************************************************/
#include <liblwm2m.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdarg.h>
#include <sys/time.h>
#include <delay.h>
#include <math.h>
#ifndef LWM2M_MEMORY_TRACE
void * lwm2m_malloc(size_t s)
{
return malloc(s);
}
void lwm2m_free(void * p)
{
return free(p);
}
char * lwm2m_strdup(const char * str)
{
return strdup(str);
}
#endif
int lwm2m_strncmp(const char * s1,
const char * s2,
size_t n)
{
return strncmp(s1, s2, n);
}
time_t lwm2m_gettime(void)
{
time_t seconds = floor(millis() / 1000);
return seconds;
}
//void lwm2m_printf(const char * format, ...)
//{
// va_list ap;
//
// va_start(ap, format);
//
// SerialUSB.println(format, ap);
//
// va_end(ap);
//}