#include <iostream>
#include "helper.hpp"
int main(int argc, char* argv[]) {
const CliParser parser(argc, argv);
if (parser.nargs() < 2 || parser.hasFlag("-h") || parser.hasFlag("--help")) {
std::cout
<< "usage: client_connect [options] opc.tcp://<host>:<port>\n"
<< "options:\n"
<< " --username <name>\n"
<< " --password <password>\n"
<< " --help, -h\n"
<< std::flush;
return 2;
}
const auto serverUrl = parser.args()[parser.nargs() - 1];
const auto username = parser.getValue("--username");
const auto password = parser.getValue("--password");
if (username) {
);
}
std::cout << "Server date (UTC): " << dt.format("%Y-%m-%d %H:%M:%S") << std::endl;
}
void setUserIdentityToken(const AnonymousIdentityToken &token)
Set anonymous identity token.
void disconnect()
Disconnect and close the connection to the server.
void connect(std::string_view endpointUrl)
Connect to the selected server.
ClientConfig & config() noexcept
UA_DateTime wrapper class.
High-level node class to access node attribute, browse and populate address space.
T readValueScalar()
Read scalar value from variable node.
UA_UserNameIdentityToken wrapper class.
@ Server_ServerStatus_CurrentTime