client-c  0.9.0
kaa_notification_manager.h
Go to the documentation of this file.
1 /*
2  * Copyright 2014-2016 CyberVision, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef KAA_KAA_NOTIFICATION_H_
18 #define KAA_KAA_NOTIFICATION_H_
19 
20 #include <stdint.h>
21 #include <stdbool.h>
22 #include <stddef.h>
23 
24 #include "kaa_error.h"
26 #include "collections/kaa_list.h"
27 
28 
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 #ifndef KAA_NOTIFICATION_MANAGER_T
35 # define KAA_NOTIFICATION_MANAGER_T
36 
40 #endif
41 
42 
43 
52 kaa_error_t kaa_calculate_topic_listener_id(const kaa_topic_listener_t *listener, uint32_t *listener_id);
53 
63 
74 
86  , uint64_t *topic_id, uint32_t *listener_id);
87 
97 
107 kaa_error_t kaa_remove_optional_notification_listener(kaa_notification_manager_t *self, uint64_t *topic_id, uint32_t *listener_id);
108 
118 kaa_error_t kaa_add_topic_list_listener(kaa_notification_manager_t *self, kaa_topic_listener_t *listener, uint32_t *topic_listener_id);
119 
128 kaa_error_t kaa_remove_topic_list_listener(kaa_notification_manager_t *self, uint32_t *topic_listener_id);
129 
139 
149 kaa_error_t kaa_subscribe_to_topic(kaa_notification_manager_t *self, uint64_t *topic_id, bool force_sync);
150 
161 kaa_error_t kaa_subscribe_to_topics(kaa_notification_manager_t *self, uint64_t *topic_ids, size_t size, bool force_sync);
162 
172 kaa_error_t kaa_unsubscribe_from_topic(kaa_notification_manager_t *self, uint64_t *topic_id, bool force_sync);
173 
184 kaa_error_t kaa_unsubscribe_from_topics(kaa_notification_manager_t *self, uint64_t *topic_ids, size_t size, bool force_sync);
185 
194 
195 #ifdef __cplusplus
196 } /* extern "C" */
197 #endif
198 
199 #endif /* KAA_KAA_NOTIFICATION_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.
kaa_error_t kaa_remove_notification_listener(kaa_notification_manager_t *self, uint32_t *listener_id)
Removes the mandatory notification listener.
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.
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.
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.
kaa_error_t
Definition: kaa_error.h:31
struct kaa_list_t kaa_list_t
Definition: kaa_list.h:30
kaa_error_t kaa_subscribe_to_topic(kaa_notification_manager_t *self, uint64_t *topic_id, bool force_sync)
Subscribes to the topic.
Kaa error codes.
kaa_error_t kaa_unsubscribe_from_topic(kaa_notification_manager_t *self, uint64_t *topic_id, bool force_sync)
Unsubscribes from the topic.
kaa_error_t kaa_sync_topic_subscriptions(kaa_notification_manager_t *self)
Sends the sync request to the server.
kaa_error_t kaa_get_topics(kaa_notification_manager_t *self, kaa_list_t **topics)
Retrieves the topic list.
struct kaa_notification_manager_t kaa_notification_manager_t
Kaa notification manager structure.
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.
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.
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.
kaa_error_t kaa_remove_topic_list_listener(kaa_notification_manager_t *self, uint32_t *topic_listener_id)
Removes the topic list listener.
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.