-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: main
Are you sure you want to change the base?
Conversation
StephanKa
commented
Nov 20, 2024
- 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
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)); } |
There was a problem hiding this comment.
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)); } |
There was a problem hiding this comment.
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}) |
There was a problem hiding this comment.
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