CoAP Resource Handler API#

Modules#

Type definitions

Functions#

void

Initialization of the CoAP Resource Discovery internals.

bool
sl_wisun_coap_rhnd_is_request_packet(const sl_wisun_coap_packet_t *const packet)

Is request packet?

void

Print resources.

sl_status_t

Reset auto-response callback.

sl_status_t
sl_wisun_coap_rhnd_resource_add(const sl_wisun_coap_rhnd_resource_t *const src_resource)

Register a new resource into the CoAP Resource table.

__STATIC_INLINE void
sl_wisun_coap_rhnd_resource_init(sl_wisun_coap_rhnd_resource_t *const src_resource)

Initialise empty resource.

sl_status_t

Remove a resource from the CoAP Resource table referenced by name.

sl_status_t
sl_wisun_coap_rhnd_set_auto_response(const char *uri_path, sl_wisun_coap_rhnd_auto_resp_t response)

Set auto-response callback.

Function Documentation#

sl_wisun_coap_rhnd_get_resources#

const sl_wisun_coap_rhnd_resource_t * sl_wisun_coap_rhnd_get_resources (void )

Get resources.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Getting linked list of resources Returns

  • const sl_wisun_coap_rhnd_resource_t* Resource list, on error is NULL ptr


sl_wisun_coap_rhnd_init#

void sl_wisun_coap_rhnd_init (void )

Initialization of the CoAP Resource Discovery internals.

Parameters
TypeDirectionArgument NameDescription
voidN/A

sl_wisun_coap_rhnd_is_request_packet#

bool sl_wisun_coap_rhnd_is_request_packet (const sl_wisun_coap_packet_t *const packet)

Is request packet?

Parameters
TypeDirectionArgument NameDescription
const sl_wisun_coap_packet_t *const[in]packet

Packet

helper function Returns

  • true Request packet

  • false Response or Empty packet


sl_wisun_coap_rhnd_print_resources#

void sl_wisun_coap_rhnd_print_resources (void )

Print resources.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Print resource URI paths


sl_wisun_coap_rhnd_reset_auto_response#

sl_status_t sl_wisun_coap_rhnd_reset_auto_response (const char * uri_path)

Reset auto-response callback.

Parameters
TypeDirectionArgument NameDescription
const char *[in]uri_path

URI path

Set callback ptr to NULL in resource descriptor Returns

  • sl_status_t SL_STATUS_OK on success, SL_STATUS_FAIL on error


sl_wisun_coap_rhnd_resource_add#

sl_status_t sl_wisun_coap_rhnd_resource_add (const sl_wisun_coap_rhnd_resource_t *const src_resource)

Register a new resource into the CoAP Resource table.

Parameters
TypeDirectionArgument NameDescription
const sl_wisun_coap_rhnd_resource_t *const[in]src_resource

the new resource's descriptor

Returns

  • True if the registration is successful


sl_wisun_coap_rhnd_resource_init#

__STATIC_INLINE void sl_wisun_coap_rhnd_resource_init (sl_wisun_coap_rhnd_resource_t *const src_resource)

Initialise empty resource.

Parameters
TypeDirectionArgument NameDescription
sl_wisun_coap_rhnd_resource_t *const[in]src_resource

Resource descriptor

Set pointers to NULL and flags to false


sl_wisun_coap_rhnd_resource_remove_by_uri#

sl_status_t sl_wisun_coap_rhnd_resource_remove_by_uri (const char * uri_path)

Remove a resource from the CoAP Resource table referenced by name.

Parameters
TypeDirectionArgument NameDescription
const char *[in]uri_path

URI path of the resource to be removed

Returns

  • True if removal is successful


sl_wisun_coap_rhnd_set_auto_response#

sl_status_t sl_wisun_coap_rhnd_set_auto_response (const char * uri_path, sl_wisun_coap_rhnd_auto_resp_t response)

Set auto-response callback.

Parameters
TypeDirectionArgument NameDescription
const char *[in]uri_path

URI path

sl_wisun_coap_rhnd_auto_resp_t[in]response

Response callback

Set callback for resource Returns

  • sl_status_t SL_STATUS_OK on success, SL_STATUS_FAIL on error