CoAP Notification API#
Modules#
Functions#
Register a new notification.
Get notification by ID.
Initialization of the CoAP notification service.
Init default notification instance.
Print notifications.
Remove notification from the CoAP notification table referenced by name.
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.
Type | Direction | Argument Name | Description |
---|---|---|---|
const sl_wisun_coap_notify_t *const | [in] | src_notify | the new notification'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
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.
Type | Direction | Argument Name | Description |
---|---|---|---|
const char * | [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
sl_wisun_coap_notify_init#
void sl_wisun_coap_notify_init (void )
Initialization of the CoAP notification service.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
If the service is enabled, the notification thread is initialized also.
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.
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_wisun_coap_notify_t *const | [in] | notify | notify descriptor for init |
const char * | [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
sl_wisun_coap_notify_print_notifications#
void sl_wisun_coap_notify_print_notifications (void )
Print notifications.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Print content of the internal storage.
Print resource URI paths
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.
Type | Direction | Argument Name | Description |
---|---|---|---|
const char * | [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
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.
Type | Direction | Argument Name | Description |
---|---|---|---|
const sl_wisun_coap_notify_t *const | [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