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

Kaa binary platform level protocol implementation (org.kaaproject.protocol.platform.binary). More...

#include <stdint.h>
#include <stddef.h>
#include "kaa_error.h"
#include "kaa_context.h"
#include "kaa_common.h"

Go to the source code of this file.

Data Structures

struct  kaa_serialize_info_t
 Serialize info structure. More...
 

Macros

#define KAA_PLATFORM_PRTOCOL_T
 

Typedefs

typedef struct
kaa_platform_protocol_t 
kaa_platform_protocol_t
 Kaa platform protocol state structure. More...
 

Functions

kaa_error_t kaa_platform_protocol_serialize_client_sync (kaa_platform_protocol_t *self, const kaa_extension_id *services, size_t services_count, uint8_t *buffer, size_t *buffer_size)
 Constructs a sync request for the specified list of services based on the current state of Kaa context and serializes it into the buffer. More...
 
kaa_error_t kaa_platform_protocol_alloc_serialize_client_sync (kaa_platform_protocol_t *self, const kaa_extension_id *services, size_t services_count, uint8_t **buffer, size_t *buffer_size)
 Allocates the buffer of the needed size and calls kaa_platform_protocol_serialize_client_sync(). More...
 
kaa_error_t kaa_platform_protocol_process_server_sync (kaa_platform_protocol_t *self, const uint8_t *buffer, size_t buffer_size)
 Processes downstream data received from Operations server. More...
 

Detailed Description

Kaa binary platform level protocol implementation (org.kaaproject.protocol.platform.binary).

Supplies API for serializing client and server sync messages.

Macro Definition Documentation

#define KAA_PLATFORM_PRTOCOL_T

Typedef Documentation

Kaa platform protocol state structure.

Function Documentation

kaa_error_t kaa_platform_protocol_alloc_serialize_client_sync ( kaa_platform_protocol_t self,
const kaa_extension_id services,
size_t  services_count,
uint8_t **  buffer,
size_t *  buffer_size 
)

Allocates the buffer of the needed size and calls kaa_platform_protocol_serialize_client_sync().

Note
The caller must deallocate the buffer.
Deprecated:
You should maintain buffer yourself and call kaa_platform_protocol_serialize_client_sync() directly. The function is defined as a transition to the new approach.
kaa_error_t kaa_platform_protocol_process_server_sync ( kaa_platform_protocol_t self,
const uint8_t *  buffer,
size_t  buffer_size 
)

Processes downstream data received from Operations server.

Parameters
[in]selfPointer to a kaa_platform_protocol_t instance.
[in]bufferPointer to a data buffer for processing received from server.
[in]buffer_sizeSize of buffer.
Returns
Error code.
kaa_error_t kaa_platform_protocol_serialize_client_sync ( kaa_platform_protocol_t self,
const kaa_extension_id services,
size_t  services_count,
uint8_t *  buffer,
size_t *  buffer_size 
)

Constructs a sync request for the specified list of services based on the current state of Kaa context and serializes it into the buffer.

If buffer size is not enough, KAA_ERR_BUFFER_IS_NOT_ENOUGH is returned. You should reallocate buffer and repeat the call.

Parameters
[in]selfPointer to a kaa_platform_protocol_t instance.
[in]servicesA list of services to serialize.
[in]services_countA number of services.
[out]bufferThe buffer with serialized data.
[out]buffer_sizeThe buffer's actual size.
Returns
Error code.
Return values
KAA_ERR_BUFFER_IS_NOT_ENOUGHThe buffer size is not enough. In that case, buffer_size is updated to the required buffer size.