Condividi tramite


IotHubBaseClient Class

Definition

Contains methods that a client can use to send messages to and receive messages from the service, respond to direct method invocations from the service, and send and receive twin property updates.

public abstract class IotHubBaseClient : IDisposable
type IotHubBaseClient = class
    interface IDisposable
Public MustInherit Class IotHubBaseClient
Implements IDisposable
Inheritance
IotHubBaseClient
Derived
Implements

Properties

ConnectionStatusChangeCallback

The callback to be executed each time connection status change notification is received.

ConnectionStatusInfo

The latest connection status information since the last status change.

Methods

CloseAsync(CancellationToken)

Close the client instance.

Dispose()

Releases the unmanaged resources used by the client and optionally disposes of the managed resources.

Dispose(Boolean)

Releases the unmanaged resources used by the client and allows for any derived class to override and provide custom implementation.

GetTwinPropertiesAsync(CancellationToken)

Retrieve the twin properties for the current client.

OpenAsync(CancellationToken)

Open the client instance. Must be done before any operation can begin.

SendTelemetryAsync(TelemetryMessage, CancellationToken)

Sends a telemetry message to IoT hub.

SendTelemetryBatchAsync(IEnumerable<TelemetryMessage>, CancellationToken)

Sends a batch of telemetry message to IoT hub.

SetDesiredPropertyUpdateCallbackAsync(Func<DesiredProperties,Task>, CancellationToken)

Set a callback that will be called whenever the client receives a desired state update from the service. The client instance must be opened already.

SetDirectMethodCallbackAsync(Func<DirectMethodRequest,Task<DirectMethodResponse>>, CancellationToken)

Sets the callback for all direct method calls from the service. This instance must be opened already.

SetIncomingMessageCallbackAsync(Func<IncomingMessage,Task<MessageAcknowledgement>>, CancellationToken)

Sets a callback for receiving a message from the device or module queue using a cancellation token. This instance must be opened already.

UpdateReportedPropertiesAsync(ReportedProperties, CancellationToken)

Push reported property changes up to the service.

Applies to