C++#
This page covers using the kRPC C++ client with the KSA service. The
kRPC C++ client guide covers the client in full.
Note
kRPC for KSA is experimental, and the client package does not yet include the KSA
service stubs. You add them from the release archive, as below, until a later release makes
this easier.
Installing#
Install the kRPC C++ client 0.7.0, for example from vcpkg:
vcpkg install krpc
Add cpp/include from the stubs folder of the release archive to the include
path.
The kRPC C++ client guide covers other ways to install the client.
Connecting to the Server#
The service is krpc::services::KSA:
#include <iostream>
#include <krpc.hpp>
#include <krpc/services/ksa.hpp>
krpc::Client conn = krpc::connect("Example");
krpc::services::KSA ksa(&conn);
std::cout << ksa.active_vehicle()->name() << std::endl;
The kRPC C++ client guide covers connecting, streams, events and the client’s other features.