client-c
0.8.1
|
#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... | |
#define KAA_NOTIFICATION_MANAGER_T |
Copyright 2014-2016 CyberVision, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Definition at line 35 of file kaa_notification_manager.h.
typedef struct kaa_notification_manager_t kaa_notification_manager_t |
Kaa notification manager structure.
Definition at line 39 of file kaa_notification_manager.h.
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.
[in] | self | The pointer to the notification manager instance. |
[in] | listener | The pointer to the listener whose callback is called as soon as a notification is received. |
[out] | listener_id | The pointer to the variable which is initialized with the calculated id. |
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.
[in] | self | The pointer to the notification manager instance. |
[in] | listener | The pointer to the listener whose callback is called as soon as a notification is received. |
[in] | topic_id | The pointer to the id of the topic about which the listener is notified. |
[out] | listener_id | The pointer to the variable which is initialized with the calculated id. If NULL , listener_id is not initialized. |
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.
[in] | self | The pointer to the notification manager instance. |
[in] | listener | The pointer to the listener whose callback is called as soon as a notification is received. |
[out] | topic_listener_id | The pointer to the variable which is initialized with the calculated id. |
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.
[in] | listener | The pointer to the listener whose id is calculated. |
[out] | listener_id | The pointer to the variable which is initialized with the calculated id. |
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.
[in] | listener | The pointer to the listener whose id is calculated. |
[out] | listener_id | The pointer to the variable which is initialized with the calculated id. |
kaa_error_t kaa_get_topics | ( | kaa_notification_manager_t * | self, |
kaa_list_t ** | topics | ||
) |
Retrieves the topic list.
[in] | self | The pointer to the notification manager instance. |
[out] | topics | The pointer to the pointer that is initialized with the topic list. |
kaa_error_t kaa_remove_notification_listener | ( | kaa_notification_manager_t * | self, |
uint32_t * | listener_id | ||
) |
Removes the mandatory notification listener.
[in] | self | The pointer to the notification manager instance. |
[in] | listener_id | The 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 |
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.
[in] | self | The pointer to the notification manager instance. |
[in] | topic_id | The pointer to the id of the topic the listener should not be notified about anymore. |
[in] | listener_id | The pointer to the variable which is used to find the listener that should be removed from the notification listeners list. |
kaa_error_t kaa_remove_topic_list_listener | ( | kaa_notification_manager_t * | self, |
uint32_t * | topic_listener_id | ||
) |
Removes the topic list listener.
[in] | self | The pointer to the notification manager instance. |
[in] | topic_listener_id | The 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. |
kaa_error_t kaa_subscribe_to_topic | ( | kaa_notification_manager_t * | self, |
uint64_t * | topic_id, | ||
bool | force_sync | ||
) |
Subscribes to the topic.
[in] | self | The pointer to the notification manager instance. |
[in] | topic_id | The pointer to the id of the topic to which the endpoint should be subscribed. |
[in] | force_sync | Indicates whether subscription should be performed immediately (true) or should be postponed (false). |
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.
[in] | self | The pointer to the notification manager instance. |
[in] | topic_ids | An array of the ids of the topics to which the endpoint should be subscribed. |
[in] | size | The size of the topic ids array. |
[in] | force_sync | Indicates whether subscription should be performed immediately (true) or should be postponed (false). |
kaa_error_t kaa_sync_topic_subscriptions | ( | kaa_notification_manager_t * | self | ) |
Sends the sync request to the server.
[in] | self | The pointer to the notification manager instance. |
kaa_error_t kaa_unsubscribe_from_topic | ( | kaa_notification_manager_t * | self, |
uint64_t * | topic_id, | ||
bool | force_sync | ||
) |
Unsubscribes from the topic.
[in] | self | The pointer to the notification manager instance. |
[in] | topic_id | The pointer to the id of the topic from which the endpoint should be unsubscribed. |
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.
[in] | self | The pointer to the notification manager instance. |
[in] | topic_ids | An array of the ids of the topics from which the endpoint should be unsubscribed. |
[in] | size | The size of the topic ids array. |
[in] | force_sync | Indicates whether unsubscription should be performed immediately (true) or should be postponed (false). |