Skip to content

Commit

Permalink
add server-config to the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jpfr committed Jan 24, 2018
1 parent 24176ff commit 1e23bd9
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 16 deletions.
9 changes: 7 additions & 2 deletions doc/CMakeLists.txt
Expand Up @@ -21,6 +21,7 @@ generate_rst(${PROJECT_SOURCE_DIR}/include/ua_types.h ${DOC_SRC_DIR}/types.rst)
generate_rst(${PROJECT_SOURCE_DIR}/include/ua_constants.h ${DOC_SRC_DIR}/constants.rst)
generate_rst(${PROJECT_BINARY_DIR}/src_generated/ua_types_generated.h ${DOC_SRC_DIR}/types_generated.rst)
generate_rst(${PROJECT_SOURCE_DIR}/include/ua_server.h ${DOC_SRC_DIR}/server.rst)
generate_rst(${PROJECT_SOURCE_DIR}/include/ua_server_config.h ${DOC_SRC_DIR}/server_config.rst)
generate_rst(${PROJECT_SOURCE_DIR}/include/ua_client.h ${DOC_SRC_DIR}/client.rst)
generate_rst(${PROJECT_SOURCE_DIR}/include/ua_client_highlevel.h ${DOC_SRC_DIR}/client_highlevel.rst)
generate_rst(${PROJECT_SOURCE_DIR}/include/ua_plugin_log.h ${DOC_SRC_DIR}/plugin_log.rst)
Expand All @@ -42,10 +43,12 @@ generate_rst(${PROJECT_SOURCE_DIR}/examples/tutorial_client_firststeps.c ${DOC_S
add_custom_target(doc_latex ${SPHINX_EXECUTABLE}
-b latex "${DOC_SRC_DIR}" "${DOC_LATEX_DIR}"
DEPENDS ${DOC_SRC_DIR}/types.rst ${DOC_SRC_DIR}/constants.rst ${DOC_SRC_DIR}/types_generated.rst
${DOC_SRC_DIR}/server.rst ${DOC_SRC_DIR}/client.rst ${DOC_SRC_DIR}/client_highlevel.rst
${DOC_SRC_DIR}/server.rst ${DOC_SRC_DIR}/server_config.rst
${DOC_SRC_DIR}/client.rst ${DOC_SRC_DIR}/client_highlevel.rst
${DOC_SRC_DIR}/plugin_log.rst ${DOC_SRC_DIR}/plugin_network.rst
${DOC_SRC_DIR}/services.rst ${DOC_SRC_DIR}/plugin_access_control.rst
${DOC_SRC_DIR}/nodestore.rst
${DOC_SRC_DIR}/tutorials.rst
${DOC_SRC_DIR}/tutorial_datatypes.rst
${DOC_SRC_DIR}/tutorial_client_firststeps.rst
${DOC_SRC_DIR}/tutorial_server_firststeps.rst
Expand All @@ -68,10 +71,12 @@ add_dependencies(doc_pdf doc_latex)
add_custom_target(doc ${SPHINX_EXECUTABLE}
-b html "${DOC_SRC_DIR}" "${DOC_HTML_DIR}"
DEPENDS ${DOC_SRC_DIR}/types.rst ${DOC_SRC_DIR}/constants.rst ${DOC_SRC_DIR}/types_generated.rst
${DOC_SRC_DIR}/server.rst ${DOC_SRC_DIR}/client.rst ${DOC_SRC_DIR}/client_highlevel.rst
${DOC_SRC_DIR}/server.rst ${DOC_SRC_DIR}/server_config.rst
${DOC_SRC_DIR}/client.rst ${DOC_SRC_DIR}/client_highlevel.rst
${DOC_SRC_DIR}/plugin_log.rst ${DOC_SRC_DIR}/plugin_network.rst
${DOC_SRC_DIR}/services.rst ${DOC_SRC_DIR}/plugin_access_control.rst
${DOC_SRC_DIR}/nodestore.rst
${DOC_SRC_DIR}/tutorials.rst
${DOC_SRC_DIR}/tutorial_datatypes.rst
${DOC_SRC_DIR}/tutorial_client_firststeps.rst
${DOC_SRC_DIR}/tutorial_server_firststeps.rst
Expand Down
2 changes: 2 additions & 0 deletions doc/tutorials.rst
@@ -1,3 +1,5 @@
.. _tutorials:

Tutorials
=========

Expand Down
11 changes: 2 additions & 9 deletions examples/custom_datatype/server_types_custom.c
Expand Up @@ -26,15 +26,12 @@ add3PointDataType(UA_Server *server) {
p.z = 0.0;
UA_Variant_setScalar(&dattr.value, &p, &PointType);


UA_Server_addVariableTypeNode(server, PointType.typeId,
UA_NODEID_NUMERIC(0, UA_NS0ID_BASEDATAVARIABLETYPE),
UA_NODEID_NUMERIC(0, UA_NS0ID_HASSUBTYPE),
UA_QUALIFIEDNAME(1, "3D.Point"),
UA_NODEID_NUMERIC(0, UA_NS0ID_BASEDATAVARIABLETYPE),
dattr,
NULL, NULL
);
dattr, NULL, NULL);

}

Expand All @@ -55,11 +52,7 @@ add3DPointVariable(UA_Server *server) {
UA_NODEID_NUMERIC(0, UA_NS0ID_OBJECTSFOLDER),
UA_NODEID_NUMERIC(0, UA_NS0ID_ORGANIZES),
UA_QUALIFIEDNAME(1, "3D.Point"),
PointType.typeId,
vattr,
NULL,
NULL
);
PointType.typeId, vattr, NULL, NULL);
}

int main(void) {
Expand Down
2 changes: 2 additions & 0 deletions include/ua_plugin_access_control.h
Expand Up @@ -12,6 +12,8 @@ extern "C" {
#include "ua_types.h"

/**
* .. _access-control:
*
* Access Control Plugin API
* =========================
* The access control callback is used to authenticate sessions and grant access
Expand Down
2 changes: 2 additions & 0 deletions include/ua_server.h
Expand Up @@ -25,6 +25,8 @@ typedef struct UA_Server UA_Server;
* Server
* ======
*
* .. include:: server_config.rst
*
* .. _server-lifecycle:
*
* Server Lifecycle
Expand Down
35 changes: 32 additions & 3 deletions include/ua_server_config.h
Expand Up @@ -18,9 +18,26 @@ extern "C" {
#include "ua_plugin_nodestore.h"

/**
* .. _server-configuration:
*
* Server Configuration
* ====================
* The configuration structure is passed to the server during initialization. */
* --------------------
* The configuration structure is passed to the server during initialization.
* The server expects that the configuration is not modified during runtime.
* Currently, only one server can use a configuration at a time. During
* shutdown, the server will clean up the parts of the configuration that are
* modified at runtime through the provided API.
*
* Examples for configurations are provided in the ``/plugins`` folder.
* The usual usage is as follows:
*
* 1. Create a server configuration with default settings as a starting point
* 2. Modifiy the configuration, e.g. by adding a server certificate
* 3. Instantiate a server with it
* 4. After shutdown of the server, clean up the configuration (free memory)
*
* The :ref:`tutorials` provide a good starting point for this. */

typedef struct {
UA_UInt32 min;
Expand All @@ -40,6 +57,8 @@ struct UA_ServerConfig {
UA_BuildInfo buildInfo;
UA_ApplicationDescription applicationDescription;
UA_ByteString serverCertificate;

/* MDNS Discovery */
#ifdef UA_ENABLE_DISCOVERY
UA_String mdnsServerName;
size_t serverCapabilitiesSize;
Expand All @@ -49,6 +68,10 @@ struct UA_ServerConfig {
/* Custom DataTypes */
size_t customDataTypesSize;
UA_DataType *customDataTypes;
/**
* .. note:: See the section on :ref:`generic-types`. Examples for working
* with custom data types are provided in
* ``/examples/custom_datatype/``. */

/* Nodestore */
UA_Nodestore nodestore;
Expand All @@ -62,11 +85,17 @@ struct UA_ServerConfig {
size_t endpointsSize;
UA_Endpoint *endpoints;

/* Global Node Lifecycle */
/* Node Lifecycle callbacks */
UA_GlobalNodeLifecycle nodeLifecycle;
/**
* .. note:: See the section for :ref:`node lifecycle
* handling<node-lifecycle>`. */

/* Access Control */
UA_AccessControl accessControl;
/**
* .. note:: See the section for :ref:`access-control
* handling<access-control>`. */

/* Certificate Verification */
UA_CertificateVerification certificateVerification;
Expand Down
4 changes: 2 additions & 2 deletions tools/c2rst.py
Expand Up @@ -22,7 +22,7 @@
" UA_FUNC_ATTR_MALLOC", " UA_RESTRICT "]

def clean_comment(line):
m = re.search("^( \* |/\*\* )(.*?)( \*/)?$", line)
m = re.search("^\s*(\* |/\*\* )(.*?)( \*/)?$", line)
if not m:
return "\n"
return m.group(2) + "\n"
Expand All @@ -33,7 +33,7 @@ def clean_line(line):
return line

def comment_start(line):
m = re.search("^/\*\*[ \n]", line)
m = re.search("^\s*/\*\*[ \n]", line)
if not m:
return False
return True
Expand Down

0 comments on commit 1e23bd9

Please sign in to comment.