Contiki 3.x
Functions
er-coap-block1.h File Reference

 CoAP module for block 1 handling
More...

#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Functions

int coap_block1_handler (void *request, void *response, uint8_t *target, size_t *len, size_t max_len)
 Block 1 support within a coap-ressource. More...
 

Detailed Description

 CoAP module for block 1 handling
Author
Lars Schmertmann Small.nosp@m.Lars.nosp@m.@t-on.nosp@m.line.nosp@m..de

Definition in file er-coap-block1.h.

Function Documentation

int coap_block1_handler ( void *  request,
void *  response,
uint8_t *  target,
size_t *  len,
size_t  max_len 
)

Block 1 support within a coap-ressource.

   This function will help you to use block 1. If target is null
   error handling and response configuration is active. On return
   value 0, the last block was recived, while on return value 1
   more blocks will follow. With target, len and maxlen this
   function will assemble the blocks.

   You can find an example in:
   examples/er-rest-example/resources/res-b1-sep-b2.c
Parameters
requestRequest pointer from the handler
responseResponse pointer from the handler
targetPointer to the buffer where the request payload can be assembled
lenPointer to the variable, where the function stores the actual length
max_lenLength of the "target"-Buffer
Returns
0 if initialisation was successful -1 if initialisation failed

Definition at line 80 of file er-coap-block1.c.