This is a wrapper that covers some of open62541's functionality. Currently it is based on the v0.3.0 single-file-distribution.
git submodule update --init --recursive
./scripts/build.sh
cd examples/simple-client/
./build.sh
or
cd examples/simple-client/
./run.sh
#include "client.hpp"
using namespace open62541;
struct EventHandler : public ClientEventHandler {
void on_state_changed(ClientState state) override {
// ...
}
void on_subscription_inactivity(u_int32_t id) override {
// ...
}
void on_inactivity(ClientState state) override {
// ...
}
};
int main() {
std::string url = "opc.tcp://opcua.demo-this.com:51210/UA/SampleServer";
auto handler = std::make_unique<EventHandler>();
Client client(std::move(handler));
client.connect(url);
auto endpoints = client.get_endpoints(url);
}