Kaa client C SDK
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Macros | Typedefs | Functions
kaa_notification_manager.h File Reference
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include "kaa_error.h"
#include "platform/ext_notification_receiver.h"
#include "collections/kaa_list.h"

Go to the source code of this file.

Macros

#define KAA_NOTIFICATION_MANAGER_T
 

Typedefs

typedef struct
kaa_notification_manager_t 
kaa_notification_manager_t
 Kaa notification manager structure. More...
 

Functions

kaa_error_t kaa_calculate_topic_listener_id (const kaa_topic_listener_t *listener, uint32_t *listener_id)
 Calculates the topic listener id to manage this topic listener. More...
 
kaa_error_t kaa_calculate_notification_listener_id (const kaa_notification_listener_t *listener, uint32_t *listener_id)
 Calculates the notification listener id to manage this notification listener. More...
 
kaa_error_t kaa_add_notification_listener (kaa_notification_manager_t *self, kaa_notification_listener_t *listener, uint32_t *listener_id)
 Adds a mandatory notification listener to receive notifications on mandatory topics. More...
 
kaa_error_t kaa_add_optional_notification_listener (kaa_notification_manager_t *self, kaa_notification_listener_t *listener, uint64_t *topic_id, uint32_t *listener_id)
 Adds an optional notification listener to receive notifications on optional topics. More...
 
kaa_error_t kaa_remove_notification_listener (kaa_notification_manager_t *self, uint32_t *listener_id)
 Removes the mandatory notification listener. More...
 
kaa_error_t kaa_remove_optional_notification_listener (kaa_notification_manager_t *self, uint64_t *topic_id, uint32_t *listener_id)
 Removes the optional notification listener. More...
 
kaa_error_t kaa_add_topic_list_listener (kaa_notification_manager_t *self, kaa_topic_listener_t *listener, uint32_t *topic_listener_id)
 Adds a topic list listener. More...
 
kaa_error_t kaa_remove_topic_list_listener (kaa_notification_manager_t *self, uint32_t *topic_listener_id)
 Removes the topic list listener. More...
 
kaa_error_t kaa_get_topics (kaa_notification_manager_t *self, kaa_list_t **topics)
 Retrieves the topic list. More...
 
kaa_error_t kaa_subscribe_to_topic (kaa_notification_manager_t *self, uint64_t *topic_id, bool force_sync)
 Subscribes to the topic. More...
 
kaa_error_t kaa_subscribe_to_topics (kaa_notification_manager_t *self, uint64_t *topic_ids, size_t size, bool force_sync)
 Subscribes to the topics. More...
 
kaa_error_t kaa_unsubscribe_from_topic (kaa_notification_manager_t *self, uint64_t *topic_id, bool force_sync)
 Unsubscribes from the topic. More...
 
kaa_error_t kaa_unsubscribe_from_topics (kaa_notification_manager_t *self, uint64_t *topic_ids, size_t size, bool force_sync)
 Unsubscribes from the topics. More...
 
kaa_error_t kaa_sync_topic_subscriptions (kaa_notification_manager_t *self)
 Sends the sync request to the server. More...
 

Macro Definition Documentation

#define KAA_NOTIFICATION_MANAGER_T

Typedef Documentation

Kaa notification manager structure.

Function Documentation

kaa_error_t kaa_add_notification_listener ( kaa_notification_manager_t self,
kaa_notification_listener_t listener,
uint32_t *  listener_id 
)

Adds a mandatory notification listener to receive notifications on mandatory topics.

Parameters
[in]selfThe pointer to the notification manager instance.
[in]listenerThe pointer to the listener whose callback is called as soon as a notification is received.
[out]listener_idThe pointer to the variable which is initialized with the calculated id.
Returns
The error code.
kaa_error_t kaa_add_optional_notification_listener ( kaa_notification_manager_t self,
kaa_notification_listener_t listener,
uint64_t *  topic_id,
uint32_t *  listener_id 
)

Adds an optional notification listener to receive notifications on optional topics.

Parameters
[in]selfThe pointer to the notification manager instance.
[in]listenerThe pointer to the listener whose callback is called as soon as a notification is received.
[in]topic_idThe pointer to the id of the topic about which the listener is notified.
[out]listener_idThe pointer to the variable which is initialized with the calculated id. If NULL, listener_id is not initialized.
Returns
The error code.
kaa_error_t kaa_add_topic_list_listener ( kaa_notification_manager_t self,
kaa_topic_listener_t listener,
uint32_t *  topic_listener_id 
)

Adds a topic list listener.

Parameters
[in]selfThe pointer to the notification manager instance.
[in]listenerThe pointer to the listener whose callback is called as soon as a notification is received.
[out]topic_listener_idThe pointer to the variable which is initialized with the calculated id.
Returns
The error code.
kaa_error_t kaa_calculate_notification_listener_id ( const kaa_notification_listener_t listener,
uint32_t *  listener_id 
)

Calculates the notification listener id to manage this notification listener.

Parameters
[in]listenerThe pointer to the listener whose id is calculated.
[out]listener_idThe pointer to the variable which is initialized with the calculated id.
Returns
The error code.
kaa_error_t kaa_calculate_topic_listener_id ( const kaa_topic_listener_t listener,
uint32_t *  listener_id 
)

Calculates the topic listener id to manage this topic listener.

Parameters
[in]listenerThe pointer to the listener whose id is calculated.
[out]listener_idThe pointer to the variable which is initialized with the calculated id.
Returns
The error code.
kaa_error_t kaa_get_topics ( kaa_notification_manager_t self,
kaa_list_t **  topics 
)

Retrieves the topic list.

Parameters
[in]selfThe pointer to the notification manager instance.
[out]topicsThe pointer to the pointer that is initialized with the topic list.
Returns
The error code.
kaa_error_t kaa_remove_notification_listener ( kaa_notification_manager_t self,
uint32_t *  listener_id 
)

Removes the mandatory notification listener.

Parameters
[in]selfThe pointer to the notification manager instance.
[in]listener_idThe pointer to the listener id which is used to find the listener that should be removed from the notification listeners list. If NULL, listener_id is not initialized
Returns
The error code.
kaa_error_t kaa_remove_optional_notification_listener ( kaa_notification_manager_t self,
uint64_t *  topic_id,
uint32_t *  listener_id 
)

Removes the optional notification listener.

Parameters
[in]selfThe pointer to the notification manager instance.
[in]topic_idThe pointer to the id of the topic the listener should not be notified about anymore.
[in]listener_idThe pointer to the variable which is used to find the listener that should be removed from the notification listeners list.
Returns
The error code.
kaa_error_t kaa_remove_topic_list_listener ( kaa_notification_manager_t self,
uint32_t *  topic_listener_id 
)

Removes the topic list listener.

Parameters
[in]selfThe pointer to the notification manager instance.
[in]topic_listener_idThe pointer to the variable which is used to find the listener that should be removed from the topic listeners list. If NULL, topic_listener_id is not initialized.
Returns
The error code.
kaa_error_t kaa_subscribe_to_topic ( kaa_notification_manager_t self,
uint64_t *  topic_id,
bool  force_sync 
)

Subscribes to the topic.

Parameters
[in]selfThe pointer to the notification manager instance.
[in]topic_idThe pointer to the id of the topic to which the endpoint should be subscribed.
[in]force_syncIndicates whether subscription should be performed immediately (true) or should be postponed (false).
Returns
The error code.
kaa_error_t kaa_subscribe_to_topics ( kaa_notification_manager_t self,
uint64_t *  topic_ids,
size_t  size,
bool  force_sync 
)

Subscribes to the topics.

Parameters
[in]selfThe pointer to the notification manager instance.
[in]topic_idsAn array of the ids of the topics to which the endpoint should be subscribed.
[in]sizeThe size of the topic ids array.
[in]force_syncIndicates whether subscription should be performed immediately (true) or should be postponed (false).
Returns
The error code.
kaa_error_t kaa_sync_topic_subscriptions ( kaa_notification_manager_t self)

Sends the sync request to the server.

Parameters
[in]selfThe pointer to the notification manager instance.
Returns
The error code.
kaa_error_t kaa_unsubscribe_from_topic ( kaa_notification_manager_t self,
uint64_t *  topic_id,
bool  force_sync 
)

Unsubscribes from the topic.

Parameters
[in]selfThe pointer to the notification manager instance.
[in]topic_idThe pointer to the id of the topic from which the endpoint should be unsubscribed.
[in]force_syncSync topic unsubscription
Returns
The error code.
kaa_error_t kaa_unsubscribe_from_topics ( kaa_notification_manager_t self,
uint64_t *  topic_ids,
size_t  size,
bool  force_sync 
)

Unsubscribes from the topics.

Parameters
[in]selfThe pointer to the notification manager instance.
[in]topic_idsAn array of the ids of the topics from which the endpoint should be unsubscribed.
[in]sizeThe size of the topic ids array.
[in]force_syncIndicates whether unsubscription should be performed immediately (true) or should be postponed (false).
Returns
The error code.