client-c  0.7.0
kaa_platform_protocol.h File Reference

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

#include "kaa_error.h"
#include "kaa_context.h"
#include "kaa_common.h"
+ Include dependency graph for kaa_platform_protocol.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  kaa_serialize_info_t
 

Typedefs

typedef char *(* kaa_buffer_alloc_fn )(void *context, size_t buffer_size)
 

Functions

kaa_error_t kaa_platform_protocol_serialize_client_sync (kaa_platform_protocol_t *self, const kaa_serialize_info_t *info, char **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 returned by the allocator function. More...
 
kaa_error_t kaa_platform_protocol_process_server_sync (kaa_platform_protocol_t *self, const char *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 sync messages to Operations server and processing server sync messages.

Definition in file kaa_platform_protocol.h.

Typedef Documentation

typedef char*(* kaa_buffer_alloc_fn)(void *context, size_t buffer_size)

Kaa platform protocol state structure Buffer allocation callback

Definition at line 47 of file kaa_platform_protocol.h.

Function Documentation

kaa_error_t kaa_platform_protocol_process_server_sync ( kaa_platform_protocol_t self,
const char *  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 Operations 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_serialize_info_t info,
char **  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 returned by the allocator function.

The required buffer size only becomes known after compiling a non-serialized sync request structure. Thus, the function expects the memory allocation callback, allocator, to return a buffer of the requested size. It is perfectly acceptable to return a pointer to a previously allocated buffer (even on the stack) if its size is sufficient.

Parameters
[in]selfPointer to a kaa_platform_protocol_t instance.
[in]infoPointer to a kaa_serialize_info_t instance.
[out]bufferThe buffer with serialized data.
[out]buffer_sizeThe buffer's actual size.
Returns
Error code.