-
-
Save effektsvk/35af3bc41b2c782797ce283eefacb58e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <unistd.h> | |
#import "PTSLC_CPP.framework/Headers/CppPTSLClient.h" | |
namespace PTSLC_CPP { | |
int getSessionName() { | |
ClientConfig config { "localhost:31416", false }; | |
std::unique_ptr<CppPTSLClient> client = std::make_unique<CppPTSLClient>(config); | |
sleep(5); | |
CommandRequest request; | |
request.commandType = CommandType::GetSessionPath; | |
// request.commandType = CommandType::GetSessionName; | |
// std::shared_ptr<GetSessionNameResponse> response = client->GetSessionName(request); | |
std::shared_ptr<GetSessionPathResponse> response = client->GetSessionPath(request); | |
if (response) { | |
if (response->status.type == CommandStatusType::Completed) { | |
std::cout << response->sessionPath.path << std::endl; | |
} else if (response->status.type == PTSLC_CPP::CommandStatusType::Failed) | |
std::cout << "GetSessionPath Request Failed: " << response->error->errorMessage << std::endl; | |
} | |
std::cout << "test"; | |
return 0; | |
} | |
} | |
int main(int argc, const char * argv[]) { | |
PTSLC_CPP::getSessionName(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment