Documentation

Documentation

Includes

stdint.h

#include <stdint.h>
#include 

lwip/sys.h

#include <lwip/sys.h>
#include 

clock.h

#include "clock.h"
#include "clock.h"

stdint.h

#include <stdint.h>
#include 

Macros

Marco COAP_TIME_H_

#define COAP_TIME_H_


      

Marco COAP_TICKS_PER_SECOND

#define COAP_TICKS_PER_SECOND 1000
/* lwIP provides ms in sys_now */

Marco coap_clock_init

#define coap_clock_init coap_clock_init_impl


      

Marco coap_ticks

#define coap_ticks coap_ticks_impl


      

Marco COAP_TICKS_PER_SECOND

#define COAP_TICKS_PER_SECOND CLOCK_SECOND


      

Marco COAP_TICKS_PER_SECOND

#define COAP_TICKS_PER_SECOND ((coap_tick_t)(1000U))
/** Use ms resolution on POSIX systems */

Functions

Func coap_clock_init

void coap_clock_init(void);
/**
 * Initializes the internal clock.
 */

Func coap_ticks

void coap_ticks(coap_tick_t *t);
/**
 * Sets @p t to the internal time with COAP_TICKS_PER_SECOND resolution.
 */

Func coap_ticks_to_rt

coap_time_t coap_ticks_to_rt(coap_tick_t t);
/**
 * Helper function that converts coap ticks to wallclock time. On POSIX, this
 * function returns the number of seconds since the epoch. On other systems, it
 * may be the calculated number of seconds since last reboot or so.
 *
 * @param t Internal system ticks.
 *
 * @return  The number of seconds that has passed since a specific reference
 *          point (seconds since epoch on POSIX).
 */

Func coap_ticks_from_rt_us

coap_tick_t coap_ticks_from_rt_us(uint64_t t);
/**
* Helper function that converts POSIX wallclock time in us to coap ticks.
*
* @param t POSIX time is us
*
* @return  coap ticks
*/

Vars

Variable uint64_t

uint64_t coap_ticks_to_rt_us(coap_tick_t t);
/**
* Helper function that converts coap ticks to POSIX wallclock time in us.
*
* @param t Internal system ticks.
*
* @return  The number of seconds that has passed since a specific reference
*          point (seconds since epoch on POSIX).
*/

Consts

Types

Typedefs

Typedef coap_tick_t

typedef uint32_t coap_tick_t;


      

Typedef coap_time_t

typedef uint32_t coap_time_t;


      

Typedef coap_tick_diff_t

typedef int32_t coap_tick_diff_t;


      

Typedef coap_tick_t

typedef clock_time_t coap_tick_t;


      

Typedef coap_time_t

typedef clock_time_t coap_time_t;


      

Typedef coap_tick_diff_t

typedef int coap_tick_diff_t;
/**
 * This data type is used to represent the difference between two clock_tick_t
 * values. This data type must have the same size in memory as coap_tick_t to
 * allow wrapping.
 */

Typedef coap_tick_t

typedef uint64_t coap_tick_t;
/**
 * This data type represents internal timer ticks with COAP_TICKS_PER_SECOND
 * resolution.
 */

Typedef coap_time_t

typedef uint32_t coap_time_t;
/**
 * CoAP time in seconds since epoch.
 */

Typedef coap_tick_diff_t

typedef int64_t coap_tick_diff_t;
/**
 * This data type is used to represent the difference between two clock_tick_t
 * values. This data type must have the same size in memory as coap_tick_t to
 * allow wrapping.
 */