Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added standard examples for open62541(pp) #39

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

StephanKa
Copy link
Collaborator

  • added simple client & server example for using open62541 (OPC-UA)
  • added simple client & server example for using open62541pp which is kind of a C++ wrapper of open6251

@StephanKa StephanKa requested a review from arnemertz November 20, 2024 21:58
@StephanKa StephanKa self-assigned this Nov 20, 2024
UA_Variant_init(&value);
status = UA_Client_readValueAttribute(client, UA_NODEID_STRING(1, "the.answer"), &value);
if (status == UA_STATUSCODE_GOOD &&
UA_Variant_hasScalarType(&value, &UA_TYPES[UA_TYPES_INT32])) { printf("the value is: %i\n", *static_cast<UA_Int32 *>(value.data)); }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting?

UA_Variant_init(&value);
status = UA_Client_readValueAttribute(client, UA_NODEID_STRING(1, "the.answer"), &value);
if (status == UA_STATUSCODE_GOOD &&
UA_Variant_hasScalarType(&value, &UA_TYPES[UA_TYPES_INT32])) { printf("the value is: %i\n", *static_cast<UA_Int32 *>(value.data)); }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we really want to show the C API with C printf in the C++ example project?

at least add a comment with explanation that this is the official C example and we might want to use (or write!) a C++ wrapper if possible.

)
FETCHCONTENT_MAKEAVAILABLE(open62541pp)

INCLUDE_DIRECTORIES(${open62541pp_SOURCE_DIR})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use target_include_directories instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants