Skip to content

Commit 8d489b1

Browse files
committed
fixed review comments
1 parent e6808ce commit 8d489b1

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

src/open62541/client.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#include <open62541/client_highlevel.h>
33
#include <open62541/client_config_default.h>
44

5+
// This example is the original one from the open62541 examples
6+
57
int main()
68
{
79
/* Create a client and connect */
@@ -18,8 +20,10 @@ int main()
1820
UA_Variant value;/* Variants can hold scalar values and arrays of any type */
1921
UA_Variant_init(&value);
2022
status = UA_Client_readValueAttribute(client, UA_NODEID_STRING(1, "the.answer"), &value);
21-
if (status == UA_STATUSCODE_GOOD &&
22-
UA_Variant_hasScalarType(&value, &UA_TYPES[UA_TYPES_INT32])) { printf("the value is: %i\n", *static_cast<UA_Int32 *>(value.data)); }
23+
if (status == UA_STATUSCODE_GOOD && UA_Variant_hasScalarType(&value, &UA_TYPES[UA_TYPES_INT32]))
24+
{
25+
printf("the value is: %i\n", *static_cast<UA_Int32 *>(value.data));
26+
}
2327

2428
/* Clean up */
2529
UA_Variant_clear(&value);

src/open62541/server.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#include <open62541/server.h>
22
#include <open62541/server_config_default.h>
33

4+
// This example is the original one from the open62541 examples
5+
46
int main()
57
{
68
UA_Server *server = UA_Server_new();

src/open62541pp/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ FETCHCONTENT_DECLARE(
77
)
88
FETCHCONTENT_MAKEAVAILABLE(open62541pp)
99

10-
INCLUDE_DIRECTORIES(${open62541pp_SOURCE_DIR})
11-
1210
ADD_EXECUTABLE(open62541pp_client client.cpp)
1311
TARGET_LINK_LIBRARIES(open62541pp_client PRIVATE open62541pp::open62541pp)
12+
TARGET_INCLUDE_DIRECTORIES(open62541pp_client PUBLIC ${open62541pp_SOURCE_DIR})
1413

1514
ADD_EXECUTABLE(open62541pp_server server.cpp)
1615
TARGET_LINK_LIBRARIES(open62541pp_server PRIVATE open62541pp::open62541pp)
16+
TARGET_INCLUDE_DIRECTORIES(open62541pp_server PUBLIC ${open62541pp_SOURCE_DIR})

0 commit comments

Comments
 (0)