libcoap  4.1.2
Macros | Functions | Variables
coap_time.c File Reference
#include <time.h>
#include <sys/time.h>
#include <unistd.h>
#include "coap_config.h"
#include "coap_time.h"
Include dependency graph for coap_time.c:

Go to the source code of this file.

Macros

#define Q(frac, fval)   ((coap_tick_t)(((1 << (frac)) * (fval))))
 
#define FRAC   10
 
#define SHR_FP(val, frac)   (((val) + (1 << ((frac) - 1))) >> (frac))
 

Functions

void coap_clock_init (void)
 Initializes the internal clock. More...
 
void coap_ticks (coap_tick_t *t)
 Sets t to the internal time with COAP_TICKS_PER_SECOND resolution. More...
 
coap_time_t coap_ticks_to_rt (coap_tick_t t)
 Helper function that converts coap ticks to wallclock time. More...
 

Variables

static coap_time_t coap_clock_offset = 0
 

Macro Definition Documentation

§ FRAC

#define FRAC   10

Definition at line 43 of file coap_time.c.

§ Q

#define Q (   frac,
  fval 
)    ((coap_tick_t)(((1 << (frac)) * (fval))))

Definition at line 40 of file coap_time.c.

§ SHR_FP

#define SHR_FP (   val,
  frac 
)    (((val) + (1 << ((frac) - 1))) >> (frac))

Definition at line 46 of file coap_time.c.

Variable Documentation

§ coap_clock_offset

coap_time_t coap_clock_offset = 0
static

Definition at line 17 of file coap_time.c.