diff options
Diffstat (limited to 'CommonAPI-Examples/E05Manager/src')
-rw-r--r-- | CommonAPI-Examples/E05Manager/src/E05ManagerClient.cpp | 4 | ||||
-rw-r--r-- | CommonAPI-Examples/E05Manager/src/E05ManagerService.cpp | 10 |
2 files changed, 8 insertions, 6 deletions
diff --git a/CommonAPI-Examples/E05Manager/src/E05ManagerClient.cpp b/CommonAPI-Examples/E05Manager/src/E05ManagerClient.cpp index 983601c..51c7d57 100644 --- a/CommonAPI-Examples/E05Manager/src/E05ManagerClient.cpp +++ b/CommonAPI-Examples/E05Manager/src/E05ManagerClient.cpp @@ -34,7 +34,9 @@ int main() { const std::string &domain = "local"; const std::string &instance = "commonapi.examples.Manager"; - std::shared_ptr<E05ManagerProxy<>> myProxy = runtime->buildProxy<E05ManagerProxy>(domain, instance); + const std::string connectionIdClient = "client-sample"; + + std::shared_ptr<E05ManagerProxy<>> myProxy = runtime->buildProxy<E05ManagerProxy>(domain, instance, connectionIdClient); while (!myProxy->isAvailable()) { usleep(10); } diff --git a/CommonAPI-Examples/E05Manager/src/E05ManagerService.cpp b/CommonAPI-Examples/E05Manager/src/E05ManagerService.cpp index c32faa0..a1626c3 100644 --- a/CommonAPI-Examples/E05Manager/src/E05ManagerService.cpp +++ b/CommonAPI-Examples/E05Manager/src/E05ManagerService.cpp @@ -16,20 +16,20 @@ using namespace v1_0::commonapi::examples; static unsigned int cnt = 0; // counter for simulating external events const static unsigned int maxDeviceNumber = 3; const static std::string managerInstanceName = "commonapi.examples.Manager"; +const std::string connectionIdService = "service-sample"; int main() { - CommonAPI::Runtime::setProperty("LogContext", "E05S"); - CommonAPI::Runtime::setProperty("LibraryBase", "E05Manager"); - + CommonAPI::Runtime::setProperty("LogContext", "E05S"); + CommonAPI::Runtime::setProperty("LibraryBase", "E05Manager"); std::shared_ptr<CommonAPI::Runtime> runtime = CommonAPI::Runtime::get(); std::shared_ptr<E05ManagerStubImpl> myService = std::make_shared < E05ManagerStubImpl > (managerInstanceName); - bool successfullyRegistered = runtime->registerService("local", managerInstanceName, myService); + bool successfullyRegistered = runtime->registerService("local", managerInstanceName, myService, connectionIdService); while (!successfullyRegistered) { std::cout << "Register Service failed, trying again in 100 milliseconds..." << std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(100)); - successfullyRegistered = runtime->registerService("local", managerInstanceName, myService); + successfullyRegistered = runtime->registerService("local", managerInstanceName, myService, connectionIdService); } std::cout << "Successfully Registered Service!" << std::endl; |