36 bool connect(
const std::string& addr );
37 bool connect(
const std::string& addr,
const std::string& user,
const std::string& pass );
40 enum class VarType :
int
45 static VarType str2vtype( std::string_view s );
50 std::variant<int32_t, float> value = { 0 };
52 VarType type = { VarType::Int32 };
64 return std::get<VType>(value);
66 catch(
const std::bad_variant_access&) {}
72 using ErrorCode = int;
74 ErrorCode read( std::vector<UA_ReadValueId>& attrs, std::vector<ResultVar>& result );
75 ErrorCode write32( std::vector<UA_WriteValue>& values );
76 ErrorCode write32(
const std::string& attr, int32_t value );
77 ErrorCode set(
const std::string& attr,
bool set );
78 ErrorCode write(
const UA_WriteValue& val );
79 static UA_WriteValue makeWriteValue32(
const std::string& name, int32_t val );
80 static UA_ReadValueId makeReadValue32(
const std::string& name );
83 UA_Client* client = {
nullptr };
84 UA_Variant* val = {
nullptr };