CoRE RD Simple Registration Endpoint

CoRE Resource Directory endpoint using the simple registration procedure. More...

Detailed Description

CoRE Resource Directory endpoint using the simple registration procedure.

This module is designed to provide nodes with the possibility to register with resource directories without having to allocate a lot of resources. All the user has to do, is to call the cord_epsim_register() function in periodic intervals, depending on the value of the CONFIG_CORD_LT variable.

Files

file  epsim.h
 Interface for the CoRE RD simple registration endpoint.
 

Enumerations

enum  { CORD_EPSIM_OK = 0, CORD_EPSIM_ERROR = -1, CORD_EPSIM_BUSY = -2 }
 Error codes used by the cord_epsim implementation. More...
 

Functions

int cord_epsim_register (const sock_udp_ep_t *remote)
 Initiate the node registration by sending an empty CoAP POST message to the RD server's /.well-known/core resource. More...
 
int cord_epsim_state (void)
 Get the status of the latest registration procedure. More...
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Error codes used by the cord_epsim implementation.

Enumerator
CORD_EPSIM_OK 

all good

CORD_EPSIM_ERROR 

on failing to send POST request

CORD_EPSIM_BUSY 

endpoint registration is in progress

Definition at line 40 of file epsim.h.

Function Documentation

◆ cord_epsim_register()

int cord_epsim_register ( const sock_udp_ep_t remote)

Initiate the node registration by sending an empty CoAP POST message to the RD server's /.well-known/core resource.

Precondition
remote != NULL
Parameters
[in]remoteaddress and port of the target resource directory
Returns
CORD_EPSIM_OK on success
CORD_EPSIM_BUSY if registration is already in progress
CORD_EPSIM_ERROR if something goes wrong preparing or sending the registration request

◆ cord_epsim_state()

int cord_epsim_state ( void  )

Get the status of the latest registration procedure.

Returns
CORD_EPSIM_OK if last registration was triggered successfully
CORD_EPSIM_BUSY if a registration is currently in progress
CORD_EPSIM_ERROR if latest registration attempt failed