CoAP Notification API#

Modules#

Type definitions

Functions#

sl_status_t
sl_wisun_coap_notify_add(const sl_wisun_coap_notify_t *const src_notify)

Register a new notification.

Get notification by ID.

void

Initialization of the CoAP notification service.

sl_status_t
sl_wisun_coap_notify_init_default_inst(sl_wisun_coap_notify_t *const notify, const char *id)

Init default notification instance.

void

Print notifications.

sl_status_t

Remove notification from the CoAP notification table referenced by name.

sl_status_t
sl_wisun_coap_notify_send_notification(const sl_wisun_coap_notify_t *const notify)

Send notification.

Function Documentation#

sl_wisun_coap_notify_add#

sl_status_t sl_wisun_coap_notify_add (const sl_wisun_coap_notify_t *const src_notify)

Register a new notification.

Parameters
[in]src_notify

the new notifcation's descriptor to add

Notification is added to the internal storage. Returns

  • sl_status_t SL_STATUS_OK if the notification is added successfully, otherwise SL_STATUS_FAIL


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

sl_wisun_coap_notify_get_by_id#

const sl_wisun_coap_notify_t * sl_wisun_coap_notify_get_by_id (const char * id)

Get notification by ID.

Parameters
[in]id

unique ID of the notification (custom string)

Get pointer to the notification instance in the storage. Returns

  • sl_wisun_coap_notify_t * pointer to notify instance if succeeded, otherwise NULL ptr


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

sl_wisun_coap_notify_init#

void sl_wisun_coap_notify_init (void )

Initialization of the CoAP notification service.

Parameters
N/A

If the service is enabled, the notification thread is initialized also.


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

sl_wisun_coap_notify_init_default_inst#

sl_status_t sl_wisun_coap_notify_init_default_inst (sl_wisun_coap_notify_t *const notify, const char * id)

Init default notification instance.

Parameters
[in]notify

notify descriptor for init

[in]id

unique ID of the notification (custom string)

Default remote address and port are defined in the config file. Returns

  • sl_status_t SL_STATUS_OK if the initialization is succeeded, otherwise SL_STATUS_FAIL


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

sl_wisun_coap_notify_print_notifications#

void sl_wisun_coap_notify_print_notifications (void )

Print notifications.

Parameters
N/A

Print content of the internal storage.

Print resource URI paths


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

sl_wisun_coap_notify_remove_by_id#

sl_status_t sl_wisun_coap_notify_remove_by_id (const char * id)

Remove notification from the CoAP notification table referenced by name.

Parameters
[in]id

Notification ID

Remove notification from the internal storage. Returns

  • sl_status_t SL_STATUS_OK if the notification is removed successfully, otherwise SL_STATUS_FAIL


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

sl_wisun_coap_notify_send_notification#

sl_status_t sl_wisun_coap_notify_send_notification (const sl_wisun_coap_notify_t *const notify)

Send notification.

Parameters
[in]notify

Notification instance. It includes all the necessary information about destination.

Notification should be initialised properly before sending. Returns

  • sl_status_t SL_STATUS_OK if the notification is sent successfully, otherwise SL_STATUS_FAIL


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