Kaa client C SDK
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
kaa_event.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 
24 #ifndef KAA_EVENT_H_
25 #define KAA_EVENT_H_
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 #include <stddef.h>
32 #include "kaa_error.h"
34 
35 typedef void (*kaa_event_callback_t)(const char *event_fqn, const char *event_data, size_t event_data_size, kaa_endpoint_id_p event_source);
36 typedef size_t kaa_event_block_id;
37 
38 #ifndef KAA_EVENT_MANAGER_T
39 # define KAA_EVENT_MANAGER_T
41 #endif
42 
43 
55 kaa_error_t kaa_event_manager_find_event_listeners(kaa_event_manager_t *self, const char *fqns[], size_t fqns_count, const kaa_event_listeners_callback_t *callback);
56 
57 
68 kaa_error_t kaa_event_create_transaction(kaa_event_manager_t *self, kaa_event_block_id *trx_id);
69 
70 
81 kaa_error_t kaa_event_finish_transaction(kaa_event_manager_t *self, kaa_event_block_id trx_id);
82 
83 
92 kaa_error_t kaa_event_remove_transaction(kaa_event_manager_t *self, kaa_event_block_id trx_id);
93 
102 const char *kaa_find_class_family_name(const char *fqn);
103 
104 #ifdef __cplusplus
105 } // extern "C"
106 #endif
107 #endif /* KAA_EVENT_H_ */
void(* kaa_event_callback_t)(const char *event_fqn, const char *event_data, size_t event_data_size, kaa_endpoint_id_p event_source)
Definition: kaa_event.h:35
size_t kaa_event_block_id
Definition: kaa_event.h:36
kaa_error_t
Definition: kaa_error.h:31
kaa_error_t kaa_event_create_transaction(kaa_event_manager_t *self, kaa_event_block_id *trx_id)
Start a new event block.
Kaa error codes.
External interface for receiving event listeners responses used by Kaa Event subsystem.
kaa_error_t kaa_event_remove_transaction(kaa_event_manager_t *self, kaa_event_block_id trx_id)
Removes the event block without sending events.
Interface for the event listeners response receiver.
Definition: ext_event_listeners_callback.h:61
const uint8_t * kaa_endpoint_id_p
Definition: kaa_common.h:96
kaa_error_t kaa_event_manager_find_event_listeners(kaa_event_manager_t *self, const char *fqns[], size_t fqns_count, const kaa_event_listeners_callback_t *callback)
Initiates a request to the server to search for available event listeners by given FQNs...
struct kaa_event_manager_t kaa_event_manager_t
Definition: kaa_event.h:40
const char * kaa_find_class_family_name(const char *fqn)
Find class family name of the event by its fully-qualified name.
kaa_error_t kaa_event_finish_transaction(kaa_event_manager_t *self, kaa_event_block_id trx_id)
Send all the events from the event block at once.