client-cpp  0.6.3
Kaa client C++ sdk

Table of contents

Quick start

Compiling C++ sdk

Before compiling, ensure that all required libraries are installed.
To compile Kaa client C++ sdk use shell script build.sh distributed within sdk archive.

$ ./avrogen.sh
$ ./build.sh install

Link Kaa library to your project

If you use GNU Compiler add linker flag -lkaacpp to link against dynamic library or -lkaacpp_s to link against static library.

Initializing Kaa library

Kaa client C++ sdk requires kaa::AbstractProfileContainer implementation for successful endpoint registration. See Profile management for details.

Optionally you may set configuration and configuration schema persistent storages by providing instances of kaa::IConfigurationStorage and kaa::ISchemaStorage. See Setting configuration persistent storage and Setting configuration schema persistent storage for the details.

NOTE: These options MUST be set after Kaa::init(); is called.

Use Kaa::start(); when Kaa C++ sdk is tuned to start Kaa client-server communication.

All Kaa functionality MUST be accessed through kaa::IKaaClient interface.

using namespace kaa;
// Initializing profile container, persistent storages etc.

Collecting C++ sdk debug information

By default Kaa client C++ sdk uses Boost::Log library to collect debug information.

If it is needed to integrate Kaa logs into existing debug info collecting system - provide implementation of kaa::ILogger interface and use kaa::LoggerFactory::initLogger(LoggerPtr logger) to reset default logger.

using namespace kaa;
class MyLogger : public ILogger {
public:
// implement pure virtual functions from interface.
};
...
LoggerFactory::initLogger(LoggerPtr(new MyLogger()));