Commit Graph

21 Commits

Author SHA1 Message Date
Julius Pfrommer
705801a55c refactor(examples): Use the NS0ID shorthand in the examples 2024-07-26 08:30:16 +02:00
Julius Pfrommer
8439c500aa refactor(examples): Clean up arch-dependent API usage in examples 2023-07-28 21:42:56 +02:00
Julius Pfrommer
4b8ec01827 refactor(examples): Use UA_Server_runUntilInterrupt in examples 2023-01-15 17:34:17 +01:00
kimim
2faa87567b fix(typo): HellWorld -> HelloWorld 2021-09-29 14:28:52 +02:00
Christian von Arnim
bceeee6150 Replace unnecessary UA_NS0ID_HASORDEREDCOMPONENT with UA_NS0ID_HASCOMPONENT 2020-06-08 14:10:50 +02:00
Franz Hollerer
84f499b932 Server tutorial: change variable running to static volatile (see Issue … …#2683 (#2684) 2019-04-29 22:21:52 +02: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
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
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
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
Jose Cabral
1605455a74 Fixes #1925 and clean examples 2018-07-25 08:17:51 +02:00
Jonas Green
7a58e6c0a5 Corrected format of LocaleId in LocalizedText attributes
The LocaleIds was formatted with an underscore as separator between
the language and region. According to the OPC UA specification the
language and the region shall be separated by a hyphen.
Also removed LocaleId in those cases where a specific language is not
addressed, i.e. when presenting a type name.
2017-08-29 10:08:15 +02:00
Julius Pfrommer
394df3be8d finish nodeContext pointer for every node 2017-08-18 15:00:00 +02:00
Infinity95
a8012d3040 endpoints in the server config; new/delete functions for the server config 2017-08-15 09:52:34 +02:00
Stefan Profanter
369103e793 Use proper defines for malloc, free, calloc, realloc 2017-07-21 15:39:17 +02:00
Stefan Profanter
14df336430 Code review: @Pro's MDNS implementation (#732)
* Service RegisterServer and Discovery (#687)

* New RegisterServer service

Add support for Discovery Server (LDS/GDS) by providing RegisterServer service.
FindServers service is updated to return the registered servers.

* Add examples for discovery server

* Use compile switch for LDS

* Use periodic jobs for server register

* Add lastSeen for registered servers and fix compilation errors

* Add cleanup of stale registrations

* Fix UA_string output with printf (use `%.*s`)

* Use correct port number

* LDS customizable timeout for automatic de-register (#695)

* Enable valgrind for unit tests and fix memory leaks

* Fix build errors introduced by cmake rewrite in current master

* LDS customizable timeout for automatic de-register

* LDS-ME (using mDNS) (#730)

* Enable coveralls for Pro/open62541

* Move periodic server register functionality into core implementation

* Add mDNS library as dependency

* Cleanup and enable Mingw x64 on Appveyor

* Set define for mDNS dll

* Fix memory leak

* Check for defined variable to aviod deleting root dir

* Add LDS-ME

LDS Multicast Extension using mDNS for service discovery according to OPC UA Part 12
To be implemented:
- RegisterServer2
- FindServersOnNetwork
- GDS has to call FindServers on all known LDS

* Update to most recent schema definition from https://opcfoundation.org/UA/schemas/Opc.Ua.Types.bsd.xml

* Update to most recent node ids from https://opcfoundation.org/UA/schemas/NodeIds.csv

* Implement RegisterServer2 and FindServersOnNetwork

* Fix memory leak

* Use clang-3.7 because older scan build finds invalid bug

* Fix for mDNS class comparison if value is signed

* cosmetic cleanup (untabify, indention)

* fix after rebase

* Use monotonic clock for timeouts

* Fix crash of register server caused by invalid memory

* Set correct job id for periodic server register

* Use valid SD DNS name ([servername]._opcua-tcp._tcp.[hostname]. -> [servername]-[hostname]._opcua-tcp._tcp.local.)
Set A record for SD DNS

* Remove output of last seen time, since it is now monotonic and thus not human readable

* Fix removal of all remaining DNS records

* Fix discovery test due to previous changes

* Get interface ip addresses for windows

* Update mdnsd submodule

* Additional check output

* Also set A record for hostname

* Send multicast query to _opcua-tcp._tcp.local to find other servers after startup

* Update mdnsd

* Update mdnsd

* Limit mDNS label to max 63 chars according to DNS RFC

* Fix rebase issues

* fix a cppcheck issue for unreachable code

* Untabify

* Check if path or caps is set in TXT record

* Do not remove (TTL=0) `_services._dns-sd._udp.local.` because it may still be used by other PC in the net.

* Update mdnsd

* Fix correct construction of hostname if it is shorter than 63 chars

* Fix correct construction of hostname if it is shorter than 63 chars

* fixup

* Fix correct construction of hostname if it is shorter than 63 chars

* fixup

* Fix correct construction of hostname if it is shorter than 63 chars

* Fix correct construction of hostname if it is shorter than 63 chars

* fixup

* RegisterServer does not require a session

* untabify where it lead to compiler-warnings (if-guards)

* Update mdnsd

* Allow changing the LDS URL for RegisterServer and set default value if NULL

* Typo

* add Callbacks for RegisterServer and mDNS detection

* untabify

* Setting correct port for DiscoveryServer using NetworkLayer information. Better use of UA_EndpointUrl_split

* Include isTxtReceived parameter in callback

* Fix access after free

* Add EndpointUrl to CreateSessionRequest

* Copy&Paste error

* Fix #769: Wrong NodeIDs offset for BinaryEncoding

* fixup

* Fix #769: Wrong NodeIDs offset for BinaryEncoding

* Add additional node ids for previous change of binary encoding offset

* Also check for UA_STATUSCODE_BADSERVICEUNSUPPORTED

* Check correct response code

* Avoid double loops for finding correct node id

* Remove findDataType

* Disable xmlEncodingId for now

* Use UA_UInt64 for repeated job interval

UA_UInt32 for interval in nsec means maximum interval of 429 seconds -> too small

* Fix conversion to UInt64

* Move SplitEndoint into ua_connection.h

* Create specific method for splitting endpoint url. Fix #778

* Windows wants strncpy_s

* Port is max 6 chars

* Fix uninitialized parameter warning

* Handle path without leading slash

* Additional unit tests to cover discovery functionalities

* Untabify

* Fix broken build after merge

* Fix after merge

* fix after merge

* fix after merge

* Removed undef SLIST

* Readd missing BSD_SOURCE define needed for mdns

* Use correct define for amalgamation

* Add missing header for cygwin on Windows

* Fix compilation errors on windows using Visual Studio

* Fix double free

* If applicationType is set to DiscoveryServer, set it to Server

See http://forum.unified-automation.com/topic1987.html

* Fixup for merge

* fix output of UA_String

* Small bug fixes

* Fixup after merge

* Fixup 2 after merge

* Add missing library if win32 compile

* Delete server after test

* Fix wrong positive clang warnings

* Add additional assert for NULL

* Add additional assert for NULL

* Fix MS build

* Additional NULL check for clang analyzer

* Fix MS Build

* Fix #950 wrong requestServer structure passed to registerServer callback.

Thanks @XB32Z

* Reintegrate concepts of PR #932 which were removed in previous merge

Don't copy elements for RegisterServer call

* Fix build on appveyor

* Update mdns

* make mdns non-default; cosmetic improvements

* Enable discovery for unit tests

* Fix missing semicolon

* Travis fold log

* Travis fold log

* Avoid variable exit of local scope

* Refactor: move mdns functions into separate header

* Refactor: simplify and extract functions

* Add UA_ENABLE_DISCOVERY_SEMAPHORE to disable semaphore support on emedded devices

* Fix bug introduced in commit 83edcef3c1

* Enable mdns for unit tests

* Cleaner travis outpu and build separation

* Untabify

Command used:
`find . \( -name '*.c' -o -name '*.h' \) -not \( -path "./deps/*" -prune \) ! -type d -exec bash -c 'expand -t 4 "$0" > /tmp/e && mv /tmp/e "$0"' {} \;`

* Untabify master

Command used:
`find . \( -name '*.c' -o -name '*.h' \) -not \( -path "./deps/*" -prune \) ! -type d -exec bash -c 'expand -t 4 "$0" > /tmp/e && mv /tmp/e "$0"' {} \;`

* Untabify

Command used:
`find . \( -name '*.c' -o -name '*.h' \) -not \( -path "./deps/*" -prune \) ! -type d -exec bash -c 'expand -t 4 "$0" > /tmp/e && mv /tmp/e "$0"' {} \;`

* Client must not create a session for FindServer calls.

Non-Multicast functionalities tested with OPC Foundation LDS Server. Fix #938

* Fix memleak

* Use correct uri

* untabify

* merge changes by @Pro

* split out mdns service functionality into separate file

* make local functions static

* split a large function, mark malloc that needs to be return-checked

* split large functions

* Return valid status code

* Add service description

* untabify

* Update mdns library

* Split loop into separate function

* Split overlong line

* Use correct define

* Fix build on VS2008

* fixup merge

* fixup merge

* Fix build on VS 2008

* Hide no_session connect for cleaner public api
2017-03-07 23:10:22 +01:00
Julius Pfrommer
430b510c12 Merge branch '0.2' 2017-03-06 18:47:36 +01:00
Julius Pfrommer
68402c5ff6 use compilable examples for the tutorials 2017-03-05 15:23:45 +01:00