An extension interface facing Kaa core.
More...
#include <kaa_extension.h>
An extension interface facing Kaa core.
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().
- Parameters
-
[in] | context | Context returned by call to init. |
Init function must initialize resource or return error code.
In case of error all resources should be freed.
- Parameters
-
[in] | kaa_context | Kaa client context. |
[out] | context | Opaque extension context. |
kaa_error_t(* kaa_extension::request_serialize)(void *context, uint32_t request_id, uint8_t *buffer, size_t *size, bool *sync_needed) |
Serialize request.
- Note
buffer
may be NULL
. In that case the function must return the required size of the buffer in size
.
- Parameters
-
[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. |
- Returns
- Error code.
- Return values
-
KAA_ERR_BUFFER_IS_NOT_ENOUGH | Should be returned if size is smaller than needed. |
- Note
- Error codes other than
KAA_ERR_NONE
will result in abort of transaction; extension must set sync_needed
to false
if extension has nothing to say.
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.
- Parameters
-
[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.
|
- Note
- Don't rely on it, as it may be removed in the future.
- Parameters
-
[in] | buffer | The message. |
[in] | size | Size of the buffer . |
- Returns
- Error code.
The documentation for this struct was generated from the following file: