Kaa client C SDK
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Macros | Typedefs | Functions
kaa_event.h File Reference

Kaa event subsystem API. More...

#include <stddef.h>
#include "kaa_error.h"
#include "platform/ext_event_listeners_callback.h"

Go to the source code of this file.

Macros

#define KAA_EVENT_MANAGER_T
 

Typedefs

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)
 
typedef size_t kaa_event_block_id
 
typedef struct kaa_event_manager_t kaa_event_manager_t
 

Functions

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. More...
 
kaa_error_t kaa_event_create_transaction (kaa_event_manager_t *self, kaa_event_block_id *trx_id)
 Start a new event block. More...
 
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. More...
 
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. More...
 
const char * kaa_find_class_family_name (const char *fqn)
 Find class family name of the event by its fully-qualified name. More...
 

Detailed Description

Kaa event subsystem API.

Supplies API for Kaa event subsystem

Macro Definition Documentation

#define KAA_EVENT_MANAGER_T

Typedef Documentation

typedef size_t kaa_event_block_id
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)

Function Documentation

kaa_error_t kaa_event_create_transaction ( kaa_event_manager_t self,
kaa_event_block_id trx_id 
)

Start a new event block.

Returns a new id which must be used to add an event to the block.

Parameters
[in]selfValid pointer to the event manager instance.
[in,out]trx_idPointer to the kaa_event_block_id instance which will be fulfilled with a corresponding ID.
Returns
Error code.
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.

The event block is identified by the given trx_id.

Parameters
[in]selfValid pointer to the event manager instance.
[in]trx_idThe ID of the event block to be sent.
Returns
Error code.
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.

Parameters
[in]selfValid pointer to the event manager instance.
[in]fqnsList of FQN strings.
[in]fqns_countNumber of FQNs in the list.
[in]callbackPointer to callback structure.
Returns
Error code.
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.

Parameters
[in]selfValid pointer to the event manager instance.
[in]trx_idThe ID of the event block to be sent.
Returns
Error code.
const char* kaa_find_class_family_name ( const char *  fqn)

Find class family name of the event by its fully-qualified name.

Parameters
[in]fqnFully-qualified name of the event (null-terminated string).
Returns
Null-terminated string if corresponding event class family was found, NULL otherwise.