Modules | Data Structures | Functions | Variables
Server

Modules

 Logging
 

Custom logging solutions can be "plugged in" with this interface.


 NodeStore
 

Stores the nodes in the address space. Internally, it is based on a hash-map that maps nodes to their nodeid.


 Services
 

The UA services that can be called from a remote user.


Data Structures

struct  UA_ServerConfig
struct  UA_DataSource
 A datasource is the interface to interact with a local data provider. More...
struct  UA_WorkItem
union  UA_WorkItem.work
struct  UA_WorkItem.work.binaryMessage
struct  UA_WorkItem.work.methodCall
struct  UA_ServerNetworkLayer

Functions

UA_Server UA_EXPORTUA_Server_new (UA_ServerConfig config)
void UA_EXPORT UA_Server_setServerCertificate (UA_Server *server, UA_ByteString certificate)
void UA_EXPORT UA_Server_delete (UA_Server *server)
void UA_EXPORT UA_Server_setLogger (UA_Server *server, UA_Logger logger)
UA_Logger UA_EXPORTUA_Server_getLogger (UA_Server *server)
UA_StatusCode UA_EXPORT UA_Server_run (UA_Server *server, UA_UInt16 nThreads, UA_Boolean *running)
UA_UInt16 UA_EXPORT UA_Server_addNamespace (UA_Server *server, const char *name)
 Add a new namespace to the server. Returns the index of the new namespace.
UA_StatusCode UA_EXPORT UA_Server_addReference (UA_Server *server, const UA_AddReferencesItem *item)
UA_StatusCode UA_EXPORT UA_Server_addVariableNode (UA_Server *server, UA_Variant *value, const UA_QualifiedName browseName, UA_NodeId nodeId, const UA_NodeId parentNodeId, const UA_NodeId referenceTypeId)
UA_StatusCode UA_EXPORT UA_Server_addObjectNode (UA_Server *server, const UA_QualifiedName browseName, UA_NodeId nodeId, const UA_NodeId parentNodeId, const UA_NodeId referenceTypeId, const UA_NodeId typeDefinition)
UA_StatusCode UA_EXPORT UA_Server_addDataSourceVariableNode (UA_Server *server, UA_DataSource dataSource, const UA_QualifiedName browseName, UA_NodeId nodeId, const UA_NodeId parentNodeId, const UA_NodeId referenceTypeId)
UA_StatusCode UA_EXPORT UA_Server_addTimedWorkItem (UA_Server *server, const UA_WorkItem *work, UA_DateTime executionTime, UA_Guid *resultWorkGuid)
UA_StatusCode UA_EXPORT UA_Server_addRepeatedWorkItem (UA_Server *server, const UA_WorkItem *work, UA_UInt32 interval, UA_Guid *resultWorkGuid)
void UA_EXPORT UA_ServerNetworkLayer_init (UA_ServerNetworkLayer *nl)
void UA_EXPORT UA_Server_addNetworkLayer (UA_Server *server, UA_ServerNetworkLayer networkLayer)

Variables

UA_EXPORT const UA_ServerConfig UA_ServerConfig_standard

Data Structure Documentation

struct UA_ServerConfig
Data Fields
char * Application_applicationName
char * Application_applicationURI
UA_Boolean Login_enableAnonymous
UA_Boolean Login_enableUsernamePassword
UA_UInt32 Login_loginsCount
char ** Login_passwords
char ** Login_usernames
union UA_WorkItem.work
Data Fields
work binaryMessage
UA_Connection * closeConnection
work methodCall
struct UA_WorkItem.work.binaryMessage
Data Fields
UA_Connection * connection
UA_ByteString message

Function Documentation

UA_StatusCode UA_EXPORT UA_Server_addDataSourceVariableNode ( UA_Server server,
UA_DataSource  dataSource,
const UA_QualifiedName  browseName,
UA_NodeId  nodeId,
const UA_NodeId  parentNodeId,
const UA_NodeId  referenceTypeId 
)
UA_UInt16 UA_EXPORT UA_Server_addNamespace ( UA_Server server,
const char *  name 
)

Add a new namespace to the server. Returns the index of the new namespace.

void UA_EXPORT UA_Server_addNetworkLayer ( UA_Server server,
UA_ServerNetworkLayer  networkLayer 
)

Adds a network layer to the server. The network layer is destroyed together with the server. Do not use it after adding it as it might be moved around on the heap.

UA_StatusCode UA_EXPORT UA_Server_addObjectNode ( UA_Server server,
const UA_QualifiedName  browseName,
UA_NodeId  nodeId,
const UA_NodeId  parentNodeId,
const UA_NodeId  referenceTypeId,
const UA_NodeId  typeDefinition 
)

Add a reference to the server's address space

UA_StatusCode UA_EXPORT UA_Server_addRepeatedWorkItem ( UA_Server server,
const UA_WorkItem work,
UA_UInt32  interval,
UA_Guid resultWorkGuid 
)
Parameters:
serverThe server object.
workPointer to the WorkItem that shall be added. The pointer is not freed but copied to an internal representation.
intervalThe work that is executed repeatedly with the given interval (in ms). If work with the same repetition interval already exists, the first execution might occur sooner.
resultWorkGuidUpon success, the pointed value is set to the guid of the workitem in the server queue. This can be used to cancel the work later on. If the pointer is null, the guid is not set.
Returns:
Upon sucess, UA_STATUSCODE_GOOD is returned. An error code otherwise.
UA_StatusCode UA_EXPORT UA_Server_addTimedWorkItem ( UA_Server server,
const UA_WorkItem work,
UA_DateTime  executionTime,
UA_Guid resultWorkGuid 
)
Parameters:
serverThe server object.
workPointer to the WorkItem that shall be added. The pointer is not freed but copied to an internal representation.
executionTimeThe time when the work shall be executed. If the time lies in the past, the work will be executed in the next iteration of the server's main loop
resultWorkGuidUpon success, the pointed value is set to the guid of the workitem in the server queue. This can be used to cancel the work later on. If the pointer is null, the guid is not set.
Returns:
Upon sucess, UA_STATUSCODE_GOOD is returned. An error code otherwise.
UA_StatusCode UA_EXPORT UA_Server_addVariableNode ( UA_Server server,
UA_Variant value,
const UA_QualifiedName  browseName,
UA_NodeId  nodeId,
const UA_NodeId  parentNodeId,
const UA_NodeId  referenceTypeId 
)
void UA_EXPORT UA_Server_delete ( UA_Server server)
UA_StatusCode UA_EXPORT UA_Server_run ( UA_Server server,
UA_UInt16  nThreads,
UA_Boolean running 
)

Runs the main loop of the server. In each iteration, this calls into the networklayers to see if work have arrived and checks if timed events need to be triggered.

Parameters:
serverThe server object
nThreadsThe number of worker threads. Is ignored if MULTITHREADING is not activated.
runningPoints to a booloean value on the heap. When running is set to false, the worker threads and the main loop close and the server is shut down.
Returns:
Indicates whether the server shut down cleanly
void UA_EXPORT UA_Server_setLogger ( UA_Server server,
UA_Logger  logger 
)

Sets the logger used by the server

void UA_EXPORT UA_Server_setServerCertificate ( UA_Server server,
UA_ByteString  certificate 
)

Initializes server network layer with save values


Variable Documentation