client-c
0.9.0
|
#include <kaa_extension.h>
Public Attributes | |
kaa_extension_id | id |
kaa_error_t(* | init )(struct kaa_context_s *kaa_context, void **context) |
kaa_error_t(* | deinit )(void *context) |
kaa_error_t(* | request_serialize )(void *context, uint32_t request_id, uint8_t *buffer, size_t *size, bool *sync_needed) |
kaa_error_t(* | server_sync )(void *context, uint32_t request_id, uint16_t extension_options, const uint8_t *buffer, size_t size) |
An extension interface facing Kaa core.
Definition at line 40 of file kaa_extension.h.
kaa_error_t(* kaa_extension::deinit)(void *context) |
A reverse of init(). Must deinit all allocated resources.
It's guaranteed to be called only once per init() call and with output of init().
[in] | context | Context returned by call to init. |
Definition at line 60 of file kaa_extension.h.
kaa_extension_id kaa_extension::id |
Definition at line 41 of file kaa_extension.h.
kaa_error_t(* kaa_extension::init)(struct kaa_context_s *kaa_context, void **context) |
Init function must initialize resource or return error code. In case of error all resources should be freed.
[in] | kaa_context | Kaa client context. |
[out] | context | Opaque extension context. |
Definition at line 50 of file kaa_extension.h.
kaa_error_t(* kaa_extension::request_serialize)(void *context, uint32_t request_id, uint8_t *buffer, size_t *size, bool *sync_needed) |
Serialize request.
buffer
may be NULL
. In that case the function must return the required size of the buffer in size
.[in] | context | The context of the extension, as returned by init(). |
[in] | request_id | The id of the currently serializing request. |
[out] | buffer | Serialized request. |
[in,out] | size | Size of the buffer. The function must set to the actual size used (or required). |
[out] | sync_needed | Extension must set it to true if it requires syncing. If set to false , the extension's buffer is ignored and not synced. |
KAA_ERR_BUFFER_IS_NOT_ENOUGH | Should be returned if size is smaller than needed. |
KAA_ERR_NONE
will result in abort of transaction; extension must set sync_needed
to false
if extension has nothing to say. Definition at line 92 of file kaa_extension.h.
kaa_error_t(* kaa_extension::server_sync)(void *context, uint32_t request_id, uint16_t extension_options, const uint8_t *buffer, size_t size) |
Extension's action in response to the server's sync message.
[in] | context | The extension context, as returned by init(). |
[in] | request_id | The id of the request server is responding. |
[in] | extension_options | Protocol-dependent options. |
[in] | buffer | The message. |
[in] | size | Size of the buffer . |
Definition at line 115 of file kaa_extension.h.