OpenWSN Firmware
rreg.c File Reference
#include "openwsn.h"
#include "rreg.h"
#include "opentimers.h"
#include "opencoap.h"
#include "openqueue.h"
#include "packetfunctions.h"
#include "openserial.h"
#include "idmanager.h"
#include "board.h"
#include "scheduler.h"

Data Structures

struct  rreg_vars_t
 

Macros

#define RREGPERIOD   30000
 A CoAP resource which registers the CoAP resources with a CoAP resource directory. More...
 

Functions

owerror_t rreg_receive (OpenQueueEntry_t *msg, coap_header_iht *coap_header, coap_option_iht *coap_options)
 Called when a CoAP message is received for this resource. More...
 
void rreg_timer ()
 The timer elapsed; time to register with the CoAP RD. More...
 
void rreg_sendDone (OpenQueueEntry_t *msg, owerror_t error)
 The stack indicates that the packet was sent. More...
 
uint8_t hexToAscii (uint8_t hex)
 converts a hex number into its ASCII representation. More...
 
void rreg_init ()
 

Variables

rreg_vars_t rreg_vars
 
const uint8_t rreg_path0 [] = "r"
 

Macro Definition Documentation

#define RREGPERIOD   30000

A CoAP resource which registers the CoAP resources with a CoAP resource directory.

Function Documentation

port_INLINE uint8_t hexToAscii ( uint8_t  hex)

converts a hex number into its ASCII representation.

For example: 0x0a -> 'a'

Parameters
[in]hexA number between 0x00 and 0x0f.
Returns
The ASCII representation of the number, between '0' and 'f'.
owerror_t rreg_receive ( OpenQueueEntry_t msg,
coap_header_iht coap_header,
coap_option_iht coap_options 
)

Called when a CoAP message is received for this resource.

Parameters
[in]msgThe received message. CoAP header and options already parsed.
[in]coap_headerThe CoAP header contained in the message.
[in]coap_optionsThe CoAP options contained in the message.
Returns
Whether the packet could be parsed successfully.
void rreg_sendDone ( OpenQueueEntry_t msg,
owerror_t  error 
)

The stack indicates that the packet was sent.

Parameters
[in]msgThe CoAP message just sent.
[in]errorThe outcome of sending it.
void rreg_timer ( void  )

The timer elapsed; time to register with the CoAP RD.

Variable Documentation

const uint8_t rreg_path0[] = "r"
rreg_vars_t rreg_vars