ctrlX Data Layer API for .NET 5  2.1.0
IClient Interface Reference

The client interface. More...

Inheritance diagram for IClient:
INativeDisposable

Public Member Functions

DLR_RESULT IVariant value Browse (string address)
 
Task< IClientAsyncResultBrowseAsync (string address)
 Browses a node asynchronously. More...
 
DLR_RESULT Create (string address, IVariant args)
 Creates a node with arguments. More...
 
Task< IClientAsyncResultCreateAsync (string address, IVariant args)
 Creates a node asynchronously with arguments. More...
 
DLR_RESULT ISubscription subscription CreateSubscription (IVariant subscriptionPropertiesFlatbuffers, object userData)
 
Task< ISubscriptionAsyncResultCreateSubscriptionAsync (IVariant subscriptionPropertiesFlatbuffers, object userData)
 Creates an asynchronously subscription. More...
 
DLR_RESULT Ping ()
 Pings the remote. More...
 
Task< IClientAsyncResultPingAsync ()
 Pings the remote asynchronously. More...
 
DLR_RESULT IVariant value Read (string address)
 
DLR_RESULT IVariant value Read (string address, IVariant args)
 
Task< IClientAsyncResultReadAsync (string address)
 Reads a node value asynchronously. More...
 
Task< IClientAsyncResultReadAsync (string address, IVariant args)
 Reads a node value asynchronously with arguments. More...
 
DLR_RESULT IVariant value ReadJson (string address, int indentStep=0)
 
DLR_RESULT IVariant value ReadMetadata (string address)
 
Task< IClientAsyncResultReadMetadataAsync (string address)
 Reads the metadata of a node asynchronously. More...
 
DLR_RESULT Remove (string address)
 Removes a node. More...
 
Task< IClientAsyncResultRemoveAsync (string address)
 Removes a node asynchronously. More...
 
DLR_RESULT SetTimeout (DLR_TIMEOUT_SETTING timeout, uint value)
 Sets the timeout of each request. More...
 
DLR_RESULT Write (string address, IVariant writeValue)
 Writes the value to a node. More...
 
Task< IClientAsyncResultWriteAsync (string address, IVariant writeValue)
 Writes a value to a node asynchronously. More...
 
IVariant error WriteJson (string address, string json)
 

Public Attributes

 DLR_RESULT
 Writes a JSON value to a node. More...
 
DLR_RESULT result
 Browses a node. More...
 

Properties

IVariant AuthToken [get]
 Gets the authentication token (JWT) as string. More...
 
bool IsConnected [get]
 Checks the connection. More...
 
IDatalayerSystem System [get]
 Gets the system. More...
 
- Properties inherited from INativeDisposable
bool IsDisposed [get]
 Checks disposed More...
 

Detailed Description

The client interface.

Definition at line 9 of file IClient.cs.

Member Function Documentation

◆ BrowseAsync()

Task<IClientAsyncResult> BrowseAsync ( string  address)

Browses a node asynchronously.

Parameters
addressAddress of the node
Returns
Result of method call
Exceptions
ObjectDisposedExceptionCannot access a disposed object
ArgumentNullExceptionArgument cannot be null.

◆ Create()

DLR_RESULT Create ( string  address,
IVariant  args 
)

Creates a node with arguments.

Parameters
addressAddress of the node
argsRequest arguments
Returns
Result of method call
Exceptions
ObjectDisposedExceptionCannot access a disposed object
ArgumentNullExceptionArgument cannot be null.

◆ CreateAsync()

Task<IClientAsyncResult> CreateAsync ( string  address,
IVariant  args 
)

Creates a node asynchronously with arguments.

Parameters
addressAddress of the node
argsRequest arguments
Returns
Result of method call
Exceptions
ObjectDisposedExceptionCannot access a disposed object
ArgumentNullExceptionArgument cannot be null.

Example

var userData = new Variant(42);
var task = client.CreateAsync(string, userData);

◆ CreateSubscriptionAsync()

Task<ISubscriptionAsyncResult> CreateSubscriptionAsync ( IVariant  subscriptionPropertiesFlatbuffers,
object  userData 
)

Creates an asynchronously subscription.

Parameters
subscriptionPropertiesFlatbuffersProperties of the flatbuffers subscription
userDataOptional user data can be provided, which is available in the subscription data changed event context
Returns
Result of method call
Exceptions
ObjectDisposedExceptionCannot access a disposed object
ArgumentNullExceptionArgument cannot be null.

Example

var userData = new Variant(42);
var builder = new FlatBufferBuilder(Variant.DefaultFlatbuffersInitialSize);
var properties = SubscriptionProperties.CreateSubscriptionProperties(
builder: builder,
idOffset: builder.CreateString("mySubscription"),
keepaliveInterval: KeepLiveIntervalMillis,
publishInterval: PublishIntervalMillis,
rulesOffset: default,
errorInterval: ErrorIntervalMillis);
builder.Finish(properties.Value);
var propertiesFlatbuffers = new Variant(builder);
var task = client.CreateSubscriptionAsync(propertiesFlatbuffers, userData);

◆ Ping()

DLR_RESULT Ping ( )

Pings the remote.

Returns
Result of method call
Exceptions
ObjectDisposedExceptionCannot access a disposed object

◆ PingAsync()

Task<IClientAsyncResult> PingAsync ( )

Pings the remote asynchronously.

Returns
Result of method call
Exceptions
ObjectDisposedExceptionCannot access a disposed object

◆ ReadAsync() [1/2]

Task<IClientAsyncResult> ReadAsync ( string  address)

Reads a node value asynchronously.

Parameters
addressAddress of the node
Returns
Result of method call
Exceptions
ObjectDisposedExceptionCannot access a disposed object
ArgumentNullExceptionArgument cannot be null.

◆ ReadAsync() [2/2]

Task<IClientAsyncResult> ReadAsync ( string  address,
IVariant  args 
)

Reads a node value asynchronously with arguments.

Parameters
addressAddress of the node
argsRequest arguments
Returns
Result of method call
Exceptions
ObjectDisposedExceptionCannot access a disposed object
ArgumentNullExceptionArgument cannot be null.

◆ ReadMetadataAsync()

Task<IClientAsyncResult> ReadMetadataAsync ( string  address)

Reads the metadata of a node asynchronously.

Parameters
addressAddress of the node
Returns
Result of method call
Exceptions
ObjectDisposedExceptionCannot access a disposed object
ArgumentNullExceptionArgument cannot be null.

◆ Remove()

DLR_RESULT Remove ( string  address)

Removes a node.

Parameters
addressAddress of the node
Returns
Result of method call
Exceptions
ObjectDisposedExceptionCannot access a disposed object
ArgumentNullExceptionArgument cannot be null.

◆ RemoveAsync()

Task<IClientAsyncResult> RemoveAsync ( string  address)

Removes a node asynchronously.

Parameters
addressAddress of the node
Returns
Result of method call
Exceptions
ObjectDisposedExceptionCannot access a disposed object
ArgumentNullExceptionArgument cannot be null.

◆ SetTimeout()

DLR_RESULT SetTimeout ( DLR_TIMEOUT_SETTING  timeout,
uint  value 
)

Sets the timeout of each request.

Parameters
timeoutTimeout to set
valueValue to set
Returns
Result of method call
Exceptions
ObjectDisposedExceptionCannot access a disposed object

◆ Write()

DLR_RESULT Write ( string  address,
IVariant  writeValue 
)

Writes the value to a node.

Parameters
addressAddress of the node
writeValueValue to write
Returns
Result of method call
Exceptions
ObjectDisposedExceptionCannot access a disposed object
ArgumentNullExceptionArgument cannot be null.

◆ WriteAsync()

Task<IClientAsyncResult> WriteAsync ( string  address,
IVariant  writeValue 
)

Writes a value to a node asynchronously.

Parameters
addressAddress of the node
writeValueValue to set
Returns
Result of method call
Exceptions
ObjectDisposedExceptionCannot access a disposed object
ArgumentNullExceptionArgument cannot be null.

Member Data Documentation

◆ DLR_RESULT

Writes a JSON value to a node.

Parameters
addressAddress of the node
jsonJSON value to write
Returns
Result of method call
Exceptions
ObjectDisposedExceptionCannot access a disposed object
ArgumentNullExceptionArgument cannot be null.

Definition at line 72 of file IClient.cs.

◆ result

DLR_RESULT result

Browses a node.

Creates a subscription.

Reads metadata of a node.

Reads a node value as JSON.

Reads a node value with arguments.

Reads a node value.

Parameters
addressAddress of the node
Returns
Result of method call
Exceptions
ObjectDisposedExceptionCannot access a disposed object
ArgumentNullExceptionArgument cannot be null.
Parameters
addressAddress of the node
argsRequest arguments
Returns
Result of method call
Exceptions
ObjectDisposedExceptionCannot access a disposed object
ArgumentNullExceptionArgument cannot be null.
Parameters
addressAddress of the node
indentStepIndentation length for json string
Returns
Result of method call
Exceptions
ObjectDisposedExceptionCannot access a disposed object
ArgumentNullExceptionArgument cannot be null.
Parameters
subscriptionPropertiesFlatbuffersProperties of the flatbuffers subscription
userDataOptional user data can be provided, which is available in the subscription data changed event context
Returns
Result of method call
Exceptions
ObjectDisposedExceptionCannot access a disposed object
ArgumentNullExceptionArgument cannot be null.

Definition at line 52 of file IClient.cs.

Property Documentation

◆ AuthToken

IVariant AuthToken
get

Gets the authentication token (JWT) as string.

Exceptions
ObjectDisposedExceptionCannot access a disposed object
InvalidOperationExceptionOperation not allowed

Definition at line 27 of file IClient.cs.

◆ IsConnected

bool IsConnected
get

Checks the connection.

Exceptions
ObjectDisposedExceptionCannot access a disposed object

Definition at line 20 of file IClient.cs.

◆ System

IDatalayerSystem System
get

Gets the system.

Definition at line 14 of file IClient.cs.


The documentation for this interface was generated from the following file: