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
N/A

Getting linked list of resources Returns

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


Definition at line 155 of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/app/wisun/component/coap/sl_wisun_coap_rhnd.h

sl_wisun_coap_rhnd_init#

void sl_wisun_coap_rhnd_init (void )

Initialization of the CoAP Resource Discovery internals.

Parameters
N/A

Definition at line 117 of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/app/wisun/component/coap/sl_wisun_coap_rhnd.h

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
[in]packet

Packet

helper function Returns

  • true Request packet

  • false Response or Empty packet


Definition at line 248 of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/app/wisun/component/coap/sl_wisun_coap_rhnd.h

sl_wisun_coap_rhnd_print_resources#

void sl_wisun_coap_rhnd_print_resources (void )

Print resources.

Parameters
N/A

Print resource URI paths


Definition at line 179 of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/app/wisun/component/coap/sl_wisun_coap_rhnd.h

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
[in]uri_path

URI path

Set callback ptr to NULL in resource descriptor Returns

  • sl_status_t SL_STATUS_OK on succes, SL_STATUS_FAIL on error


Definition at line 173 of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/app/wisun/component/coap/sl_wisun_coap_rhnd.h

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
[in]src_resource

the new resource's descriptor

Returns

  • True if the registration is successful


Definition at line 141 of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/app/wisun/component/coap/sl_wisun_coap_rhnd.h

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
[in]src_resource

Resource descriptor

Set pointers to NULL and flags to false


Definition at line 124 of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/app/wisun/component/coap/sl_wisun_coap_rhnd.h

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
[in]uri_path

URI path of the resource to be removed

Returns

  • True if removal is successful


Definition at line 148 of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/app/wisun/component/coap/sl_wisun_coap_rhnd.h

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
[in]uri_path

URI path

[in]response

Response callback

Set callback for resource Returns

  • sl_status_t SL_STATUS_OK on succes, SL_STATUS_FAIL on error


Definition at line 164 of file /mnt/raid/workspaces/ws.obQFDUprC/overlay/gsdk/app/wisun/component/coap/sl_wisun_coap_rhnd.h