Interface IMessagingClientWrapper
A wrapper for ServiceMessagingClient that can be used to send and/or receive messages related to devices, telemetries, alerts, workspaces, facilities, and connectors.
Namespace: Unity.DigitalTwins.Live.Sdk.Interfaces
Assembly: solution.dll
Syntax
public interface IMessagingClientWrapper : IAsyncDisposable, IDisposable
Properties
State
Reference to the wrapped messaging client's current state of the connection
Declaration
ConnectionState State { get; }
Property Value
Type | Description |
---|---|
ConnectionState |
Methods
ConnectAsync(String)
Opens a connection to a server and prepare validation parameters for other class methods.
Declaration
Task ConnectAsync(string cloudServicesAccessToken)
Parameters
Type | Name | Description |
---|---|---|
String | cloudServicesAccessToken | Validates access to cloud services. |
Returns
Type | Description |
---|---|
Task |
DisconnectAsync()
Disconnects from the server.
Declaration
Task DisconnectAsync()
Returns
Type | Description |
---|---|
Task |
SendAsync(IEnumerable<Message>)
Awaitable method to send a message to a server
Declaration
Task SendAsync(IEnumerable<Message> messages)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Message> | messages | Messages to be sent. |
Returns
Type | Description |
---|---|
Task |
Events
OnDeviceTelemetriesAvailable
Returns updated device telemetries.
Declaration
event Action<DeviceTelemetriesResource> OnDeviceTelemetriesAvailable
Event Type
Type | Description |
---|---|
Action<DeviceTelemetriesResource> |
OnNotificationReceived
Returns received notifications.
Declaration
event Action<NotificationResource> OnNotificationReceived
Event Type
Type | Description |
---|---|
Action<NotificationResource> |
OnTelemetryAggregateAvailable
Returns updated telemetry aggregates.
Declaration
event Action<TelemetryAggregateResource> OnTelemetryAggregateAvailable
Event Type
Type | Description |
---|---|
Action<TelemetryAggregateResource> |