Skip to content

Instantly share code, notes, and snippets.

@effektsvk
Last active March 8, 2023 18:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save effektsvk/35af3bc41b2c782797ce283eefacb58e to your computer and use it in GitHub Desktop.
Save effektsvk/35af3bc41b2c782797ce283eefacb58e to your computer and use it in GitHub Desktop.
#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