Loading...
Searching...
No Matches
CoRE RD Endpoint Standalone Extension

Run a CoRE Resource Directory endpoint standalone. More...

Detailed Description

Run a CoRE Resource Directory endpoint standalone.

This sub-module enables a CoRE RD endpoint to manage is registration state with a RD autonomously by periodically running the update procedure. This is implemented by running a dedicated thread.

Files

file  ep_standalone.h
 CoRE Resource Directory endpoint standalone extension.
 

Typedefs

typedef void(* cord_ep_standalone_cb_t) (cord_ep_standalone_event_t event)
 Callback function signature for RD endpoint state synchronization.
 

Enumerations

enum  cord_ep_standalone_event_t { CORD_EP_REGISTERED , CORD_EP_DEREGISTERED , CORD_EP_UPDATED }
 Possible types of events triggered by the cord_ep_standalone module. More...
 

Functions

void cord_ep_standalone_run (void)
 Spawn a new thread that takes care of sending periodic updates to an active RD entry.
 
void cord_ep_standalone_reg_cb (cord_ep_standalone_cb_t cb)
 Register a callback to be notified about RD endpoint state changes.
 
void cord_ep_standalone_signal (bool connected)
 Signal the cord_ep thread about connection status change.
 

Typedef Documentation

◆ cord_ep_standalone_cb_t

typedef void(* cord_ep_standalone_cb_t) (cord_ep_standalone_event_t event)

Callback function signature for RD endpoint state synchronization.

The registered callback function is executed in the context of the dedicated standalone RD endpoint's thread.

Parameters
[in]eventtype of event

Definition at line 50 of file ep_standalone.h.

Enumeration Type Documentation

◆ cord_ep_standalone_event_t

Possible types of events triggered by the cord_ep_standalone module.

Definition at line 36 of file ep_standalone.h.

Function Documentation

◆ cord_ep_standalone_reg_cb()

void cord_ep_standalone_reg_cb ( cord_ep_standalone_cb_t  cb)

Register a callback to be notified about RD endpoint state changes.

Only a single callback can be active at any point in time, so setting a new callback will override the existing one.

Precondition
cb != NULL
Parameters
[in]cbcallback to execute on RD endpoint state changes

◆ cord_ep_standalone_run()

void cord_ep_standalone_run ( void  )

Spawn a new thread that takes care of sending periodic updates to an active RD entry.

Warning
This function must only be called once (typically during system initialization)

◆ cord_ep_standalone_signal()

void cord_ep_standalone_signal ( bool  connected)

Signal the cord_ep thread about connection status change.

Note
This function should not be called by a user, but it is called from within the cord_ep implementation
Parameters
[in]connectedset to true if we are connected to a RD