Commit Graph

30 Commits

Author SHA1 Message Date
Julius Pfrommer
928931ec36 refactor(core): Move architecture-specific definition out of the public headers 2023-07-28 21:42:56 +02:00
keba-uso
779e6b7902 feat(plugin): Integration of nodesetLoader functionality within open62541 (#5371) 2022-10-18 21:46:54 +02:00
Andreas Eckerstorfer
13af9b8688
refactor(core): Remove trailing spaces in code (#5221) 2022-06-24 11:03:25 +02:00
Andreas Ebner
b459d6fd9f feat(core) use pointers within the DataTypeMember structure
Co-authored-by: Pavel Ivanov <pavel.ivanov@enmtech.ru>
Co-authored-by: Julius Pfrommer <julius.pfrommer@web.de>
2021-06-28 08:20:26 +02:00
basyskom-jvoe
d2312157a7
Support self containing structs in the nodeset compiler (#3979)
feat(server) Support self containing structs in the source and nodeset compiler, cascade nodeset keywords as literals, adjusted the padding calculation in the nodeset compiler for unions
2021-02-04 15:55:22 +01:00
Julius Pfrommer
d02dbfd9d6 fix(examples): Remove warnings in newer cppcheck versions 2021-01-04 11:20:23 +01:00
Julius Pfrommer
691a7af9ac refactor(core): Reorder UA_DataType members (improve cachelines) 2020-07-30 15:01:25 +02:00
Julius Pfrommer
9f9b0ca57e feat(core): Allow all types of NodeId for the binary encoding identifier 2020-07-30 15:01:25 +02:00
andreasebner
3410e045e3
feat(core) Support for structures with optional fields and unions (#3503)
* initial implementation approch for the handling of structures with optional fields and unions

implemented printing structs with optional fields. Tested with optstructs.bsd file.

implemented calculating binary size of structures with optional fields and encoding them. Also implemented printing the right padding for the first member of types with optional fields. Tested with optStructs_test.c

implemented decoding structures with optional fields. Tested with optStructs_test.c

Implemented calculating the binary size of unions. Tested in optStructs_test.c

Implemented encoding and decoding unions. Added returning 4 as binary size, if the SwitchField is too large to avoid later segmentation faults while en-/decoding. Tested with optStructs_test.c

Tested encoding and decoding structs with optional fields and unions with the RtlsLocationResult type from the AutoID nodeset. Works with other clients like UAExpert too now.

Implemented copying and clearing structures with optional fields and unions.

* extended unit testing and examples for unions and optstructs, fixes and cleanups on optstruct and union implementation

* extended custom type example with OPTSTRUCT and UNION

* updated ua-nodeset deps to Tag Errata-1.04.5

* extended nodeset-compiler test with the AutoID companion specification

* reimplemented union representation to match the OPC UA Standard sugestion Part 5 5.2.8 (1.04)

added nodeset compiler support for the new internal union structure

* reimplemented optional struct with internal pointer based representation

added support for the new internal optstruct representation to the nodeset compiler, removed unnecessary type export of union enum field

extended clearStructure function to handle structures with optional fields

* added support for the use of arrays as an optional field

* fixed encoding mask issue, extended read service type-description with the isOptional field and the union type, extended custom types client and server example with arrays, OptStruct and union, removed implementation comments

* added the union datatype to the reduced information model (enables the usage of unions in combination with the reduced information model)

* added UA_ prefix to enum, moved mask copy operation before bail out the funtion

* reduced checks in critical path, added some comments

* fixed horizontal comment alignment

created defined for the binary encoding id for each type

* unify redundant padding logic

Co-authored-by: Grigory Fridman <grigoryfridman@gmail.com>
Co-authored-by: Julius Pfrommer <julius.pfrommer@web.de>
2020-05-02 10:20:10 +02:00
matkonnerth
fb7b841ffe add Datatype Node 2020-02-21 23:35:59 +01:00
Julius Pfrommer
fd08d012d9 Server: Initialize the config in the server 2019-04-23 00:41:32 +02:00
Stefan Profanter
63f3653ff1 Additional header cleanup and consistent name of ns generated files 2019-03-21 20:16:31 +01:00
Julius Pfrommer
c9c818868f Move header files to a more unix-like structure
This commit drops the 'ua_' prefix and changes the public includes
to the form `#include <open62541/server.h>` instead of the old
`#include <ua_server.h>`
2019-03-21 20:16:31 +01:00
Frank Meerkoetter
3b020131c7 Free all allocations before exiting
Makes this example run valgrind clean.

==7424== HEAP SUMMARY:
==7424==     in use at exit: 0 bytes in 0 blocks
==7424==   total heap usage: 96,908 allocs, 96,908 frees, 190,708,768 bytes allocated

vs.

==5408== HEAP SUMMARY:
==5408==     in use at exit: 96 bytes in 2 blocks
==5408==   total heap usage: 96,908 allocs, 96,906 frees, 190,708,768 bytes allocated
==5408==
==5408== 96 (48 direct, 48 indirect) bytes in 1 blocks are definitely lost in loss record 2 of 2
==5408==    at 0x4C2DBF6: malloc (vg_replace_malloc.c:299)
==5408==    by 0x40312A: main (server_types_custom.c:68)
==5408==
==5408== LEAK SUMMARY:
==5408==    definitely lost: 48 bytes in 1 blocks
==5408==    indirectly lost: 48 bytes in 1 blocks

before
2019-02-20 11:22:26 +01:00
Frank Meerkoetter
1648fb8aaa Use EXIT_SUCCESS/FAILURE for the examples
Make use of EXIT_SUCCESS and EXIT_FAILURE from stdlib.h.
The previous approach of returning a value from UA_StatusCode
was often broken as an exit code can (portably) only be between 0 and 125.
2019-02-09 09:34:46 +01:00
Julius Pfrommer
c75efc25cb Stack: Tag DataTypes with a "kind" for explicit dispatch in jumptables 2019-02-02 21:45:20 +01:00
Julius Pfrommer
b4c9fc37eb Client: Initialize client config inside the client structure
Temporarily disable encyrption
2019-01-30 18:45:42 +01:00
Stefan Profanter
d715db1057
Stack: Use non-amalgamated headers in all the examples
For consistency we recommend using non-amalgamation install, thus the
examples should also use the non-amalgamated headers.
2018-12-17 22:40:07 +01:00
Julius Pfrommer
eb9409b435 Examples: Use _clear instead of _deleteMembers for the examples 2018-12-09 19:40:02 +01:00
Stefan Profanter
e2d4b0bf03
Merge pull request #2085 from open62541/runtime_custom_types
Custom types at runtime
2018-10-23 10:21:16 +02:00
Martin Lang
4b9cb3c034 Replace ValueRanks by defines (#2124)
* Replace ValueRanks by defines

* Update tests/client/check_client_highlevel.c
2018-10-20 15:46:30 +02:00
Julius Pfrommer
49e0a0bb1e Types: Add UA_DataTypeArray as a linked list for client/server 2018-09-28 17:09:22 +02:00
Julius Pfrommer
3f438c47cc Use custom datatypes from the heap only 2018-08-15 20:10:58 +00:00
Jose Cabral
1605455a74 Fixes #1925 and clean examples 2018-07-25 08:17:51 +02:00
Julius Pfrommer
78538baae7 add server-config to the docs 2018-01-24 17:51:03 +01:00
StalderT
7e30f66b0b fix if/while/for/switch typo 2018-01-22 22:00:55 +01:00
Julius Pfrommer
5ec8dd51ec fix tests with UA_ENABLE_MULTITHREADING and UA_ENABLE_TYPENAMES disabled 2017-09-21 17:46:30 +02:00
Stefan Profanter
e80f16b1d0
Fix locale 2017-09-09 00:50:55 +02:00
Stefan Profanter
cd8b0c8a82
Untabify 2017-09-09 00:48:56 +02:00
Muddasir-Shakil
02f31d972a
Create examples for custom datatypes
Includes examples for client and server. The data type used is 3D point example.
2017-09-07 09:42:43 +02:00