Condividi tramite


IotHubModuleClient Class

Definition

Contains methods that a module can use to send messages to and receive from the service and interact with module twins.

public class IotHubModuleClient : Microsoft.Azure.Devices.Client.IotHubBaseClient
type IotHubModuleClient = class
    inherit IotHubBaseClient
Public Class IotHubModuleClient
Inherits IotHubBaseClient
Inheritance
IotHubModuleClient

Constructors

IotHubModuleClient(String, IAuthenticationMethod, IotHubClientOptions)

Creates a disposable IotHubModuleClient from the specified parameters.

IotHubModuleClient(String, IotHubClientOptions)

Creates a disposable IotHubModuleClient from the specified connection string.

Properties

ConnectionStatusChangeCallback

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

(Inherited from IotHubBaseClient)
ConnectionStatusInfo

The latest connection status information since the last status change.

(Inherited from IotHubBaseClient)

Methods

CloseAsync(CancellationToken)

Close the client instance.

(Inherited from IotHubBaseClient)
CreateFromEnvironmentAsync(IotHubClientOptions)

Creates a disposable IotHubModuleClient instance in an IoT Edge deployment based on environment variables.

Dispose()

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

(Inherited from IotHubBaseClient)
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.

(Inherited from IotHubBaseClient)
InvokeMethodAsync(String, DirectMethodRequest, CancellationToken)

Interactively invokes a method from an edge module to an edge device. Both the edge module and the edge device need to be connected to the same edge hub. IotHubModuleClient instance must be opened already.

InvokeMethodAsync(String, String, DirectMethodRequest, CancellationToken)

Interactively invokes a method from an edge module to a different edge module. Both of the edge modules need to be connected to the same edge hub. IotHubModuleClient instance must be opened already.

OpenAsync(CancellationToken)

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

(Inherited from IotHubBaseClient)
SendTelemetryAsync(String, TelemetryMessage, CancellationToken)

Sends an event to IoT hub. IotHubModuleClient instance must be opened already.

SendTelemetryAsync(TelemetryMessage, CancellationToken)

Sends a telemetry message to IoT hub.

(Inherited from IotHubBaseClient)
SendTelemetryBatchAsync(IEnumerable<TelemetryMessage>, CancellationToken)

Sends a batch of telemetry message to IoT hub.

(Inherited from IotHubBaseClient)
SendTelemetryBatchAsync(String, IEnumerable<TelemetryMessage>, CancellationToken)

Sends a batch of events to IoT hub. Use AMQP or HTTPs for a true batch operation. MQTT will just send the messages one after the other. IotHubModuleClient instance must be opened already.

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.

(Inherited from IotHubBaseClient)
SetDirectMethodCallbackAsync(Func<DirectMethodRequest,Task<DirectMethodResponse>>, CancellationToken)

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

(Inherited from IotHubBaseClient)
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.

(Inherited from IotHubBaseClient)
UpdateReportedPropertiesAsync(ReportedProperties, CancellationToken)

Push reported property changes up to the service.

(Inherited from IotHubBaseClient)

Applies to