Contiki 3.x
Functions
rest-engine.h File Reference

 An abstraction layer for RESTful Web services (Erbium).
More...

#include <stdio.h>
#include "contiki.h"
#include "contiki-lib.h"
#include "rest-constants.h"

Go to the source code of this file.

Functions

void rest_init_engine (void)
 Initializes REST framework and starts the HTTP or CoAP process. More...
 
void rest_activate_resource (resource_t *resource, char *path)
 Resources wanted to be accessible should be activated with the following code. More...
 
list_t rest_get_resources (void)
 Returns the list of registered RESTful resources. More...
 

Detailed Description

 An abstraction layer for RESTful Web services (Erbium).
 Inspired by RESTful Contiki by Dogan Yazar.
Author
Matthias Kovatsch kovat.nosp@m.sch@.nosp@m.inf.e.nosp@m.thz..nosp@m.ch

Definition in file rest-engine.h.

Function Documentation

void rest_activate_resource ( resource_t *  resource,
char *  path 
)

Resources wanted to be accessible should be activated with the following code.

Parameters
resourceA RESTful resource defined through the RESOURCE macros.
pathThe local URI path where to provide the resource.

Resources wanted to be accessible should be activated with the following code.

Parameters
resourceA pointer to a resource implementation
pathThe URI path string for this resource

The resource implementation must be imported first using the extern keyword. The build system takes care of compiling every *.c file in the ./resources/ sub-directory (see example Makefile).

Definition at line 94 of file rest-engine.c.

References list_add().

list_t rest_get_resources ( void  )

Returns the list of registered RESTful resources.

Returns
The resource list.

Definition at line 79 of file rest.c.

void rest_init_engine ( void  )

Initializes REST framework and starts the HTTP or CoAP process.

Initializes REST framework and starts the HTTP or CoAP process.

This function must be called by server processes before any resources are registered through rest_activate_resource().

Definition at line 71 of file rest-engine.c.

References list_init(), NULL, and process_start().