libcoap  4.1.1
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
Macros | Functions | Variables
examples/block.c File Reference
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <ctype.h>
#include <sys/select.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <sys/stat.h>
#include <dirent.h>
#include <errno.h>
#include <signal.h>
#include "config.h"
#include "resource.h"
#include "coap.h"

Go to the source code of this file.

Macros

#define COAP_RESOURCE_CHECK_TIME   2
 
#define min(a, b)   ((a) < (b) ? (a) : (b))
 
#define INDEX
 

Functions

void handle_sigint (int signum)
 
void hnd_get_index (coap_context_t *ctx, struct coap_resource_t *resource, coap_address_t *peer, coap_pdu_t *request, str *token, coap_pdu_t *response)
 
void hnd_get_time (coap_context_t *ctx, struct coap_resource_t *resource, coap_address_t *peer, coap_pdu_t *request, str *token, coap_pdu_t *response)
 
void hnd_put_time (coap_context_t *ctx, struct coap_resource_t *resource, coap_address_t *peer, coap_pdu_t *request, str *token, coap_pdu_t *response)
 
void hnd_delete_time (coap_context_t *ctx, struct coap_resource_t *resource, coap_address_t *peer, coap_pdu_t *request, str *token, coap_pdu_t *response)
 
void hnd_get_async (coap_context_t *ctx, struct coap_resource_t *resource, coap_address_t *peer, coap_pdu_t *request, str *token, coap_pdu_t *response)
 
void check_async (coap_context_t *ctx, coap_tick_t now)
 
void init_resources (coap_context_t *ctx)
 
void usage (const char *program, const char *version)
 
coap_context_tget_context (const char *node, const char *port)
 
int main (int argc, char **argv)
 

Variables

static int quit = 0
 
static time_t my_clock_base = 0
 
static coap_async_state_tasync = NULL
 

Macro Definition Documentation

#define COAP_RESOURCE_CHECK_TIME   2

Definition at line 30 of file examples/block.c.

#define INDEX
Value:
"This is a test server made with libcoap (see http://libcoap.sf.net)\n" \
"Copyright (C) 2010--2013 Olaf Bergmann <bergmann@tzi.org>\n\n"

Definition at line 54 of file examples/block.c.

#define min (   a,
 
)    ((a) < (b) ? (a) : (b))

Definition at line 33 of file examples/block.c.

Function Documentation

void check_async ( coap_context_t ctx,
coap_tick_t  now 
)

Definition at line 214 of file examples/block.c.

coap_context_t* get_context ( const char *  node,
const char *  port 
)

Definition at line 306 of file examples/block.c.

void handle_sigint ( int  signum)

Definition at line 50 of file examples/block.c.

void hnd_delete_time ( coap_context_t ctx,
struct coap_resource_t resource,
coap_address_t *  peer,
coap_pdu_t request,
str token,
coap_pdu_t response 
)

Definition at line 171 of file examples/block.c.

void hnd_get_async ( coap_context_t ctx,
struct coap_resource_t resource,
coap_address_t *  peer,
coap_pdu_t request,
str token,
coap_pdu_t response 
)

Definition at line 182 of file examples/block.c.

void hnd_get_index ( coap_context_t ctx,
struct coap_resource_t resource,
coap_address_t *  peer,
coap_pdu_t request,
str token,
coap_pdu_t response 
)

Definition at line 58 of file examples/block.c.

void hnd_get_time ( coap_context_t ctx,
struct coap_resource_t resource,
coap_address_t *  peer,
coap_pdu_t request,
str token,
coap_pdu_t response 
)

Definition at line 75 of file examples/block.c.

void hnd_put_time ( coap_context_t ctx,
struct coap_resource_t resource,
coap_address_t *  peer,
coap_pdu_t request,
str token,
coap_pdu_t response 
)

Definition at line 139 of file examples/block.c.

void init_resources ( coap_context_t ctx)

Definition at line 253 of file examples/block.c.

int main ( int  argc,
char **  argv 
)

Definition at line 348 of file examples/block.c.

void usage ( const char *  program,
const char *  version 
)

Definition at line 289 of file examples/block.c.

Variable Documentation

coap_async_state_t* async = NULL
static

Definition at line 45 of file examples/block.c.

time_t my_clock_base = 0
static

Definition at line 40 of file examples/block.c.

int quit = 0
static

Definition at line 37 of file examples/block.c.