コード例 #1
0
 /// <summary>
 /// Creates a disposable DeviceClient from the specified connection string using the specified transport type
 /// </summary>
 /// <param name="connectionString">Connection string for the IoT hub (including DeviceId)</param>
 /// <param name="transportType">Specifies whether Http1, AMQP or MQTT transport is used, <see cref="TransportType"/></param>
 /// <param name="options">The options that allow configuration of the device client instance during initialization.</param>
 /// <returns>A disposable DeviceClient instance</returns>
 public static DeviceClient CreateFromConnectionString(string connectionString, TransportType transportType, ClientOptions options = default)
 {
     return(Create(() => ClientFactory.CreateFromConnectionString(connectionString, transportType, options)));
 }
コード例 #2
0
 /// <summary>
 /// Creates a disposable DeviceClient from the specified connection string using the prioritized list of transports
 /// </summary>
 /// <param name="connectionString">Connection string for the IoT hub (without DeviceId)</param>
 /// <param name="deviceId">Id of the device</param>
 /// <param name="transportSettings">Prioritized list of transportTypes and their settings</param>
 /// <param name="options">The options that allow configuration of the device client instance during initialization.</param>
 /// <returns>A disposable DeviceClient instance</returns>
 public static DeviceClient CreateFromConnectionString(string connectionString, string deviceId,
                                                       ITransportSettings[] transportSettings, ClientOptions options = default)
 {
     return(Create(() => ClientFactory.CreateFromConnectionString(connectionString, deviceId, transportSettings, options)));
 }
コード例 #3
0
 /// <summary>
 /// Create an Amqp ModuleClient from individual parameters
 /// </summary>
 /// <param name="hostname">The fully-qualified DNS hostname of IoT Hub</param>
 /// <param name="authenticationMethod">The authentication method that is used</param>
 /// <returns>ModuleClient</returns>
 public static ModuleClient Create(string hostname, IAuthenticationMethod authenticationMethod)
 {
     return(Create(() => ClientFactory.Create(hostname, authenticationMethod)));
 }
コード例 #4
0
 /// <summary>
 /// Create a ModuleClient from individual parameters
 /// </summary>
 /// <param name="hostname">The fully-qualified DNS hostname of IoT Hub</param>
 /// <param name="gatewayHostname">The fully-qualified DNS hostname of Gateway</param>
 /// <param name="authenticationMethod">The authentication method that is used</param>
 /// <param name="transportType">The transportType used (Http1 or Amqp)</param>
 /// <returns>ModuleClient</returns>
 public static ModuleClient Create(string hostname, string gatewayHostname, IAuthenticationMethod authenticationMethod, TransportType transportType)
 {
     return(Create(() => ClientFactory.Create(hostname, gatewayHostname, authenticationMethod, transportType)));
 }
コード例 #5
0
 /// <summary>
 /// Create ModuleClient from the specified connection string using a prioritized list of transports
 /// </summary>
 /// <param name="connectionString">Connection string for the IoT hub (with DeviceId)</param>
 /// <param name="transportSettings">Prioritized list of transports and their settings</param>
 /// <returns>ModuleClient</returns>
 public static ModuleClient CreateFromConnectionString(string connectionString,
                                                       ITransportSettings[] transportSettings)
 {
     return(Create(() => ClientFactory.CreateFromConnectionString(connectionString, transportSettings)));
 }
コード例 #6
0
 /// <summary>
 /// Creates a ModuleClient instance in an IoT Edge deployment
 /// based on environment variables.
 /// </summary>
 /// <param name="transportType">Specifies whether Amqp or Http transport is used</param>
 /// <returns>ModuleClient instance</returns>
 public static Task <ModuleClient> CreateFromEnvironmentAsync(TransportType transportType)
 {
     return(CreateFromEnvironmentAsync(ClientFactory.GetTransportSettings(transportType)));
 }
コード例 #7
0
 /// <summary>
 /// Create a ModuleClient using Amqp transport from the specified connection string
 /// </summary>
 /// <param name="connectionString">Connection string for the IoT hub (including DeviceId)</param>
 /// <returns>ModuleClient</returns>
 public static ModuleClient CreateFromConnectionString(string connectionString)
 {
     return(Create(() => ClientFactory.CreateFromConnectionString(connectionString)));
 }
コード例 #8
0
 /// <summary>
 /// Creates a ModuleClient instance in an IoT Edge deployment
 /// based on environment variables.
 /// </summary>
 /// <param name="transportType">Specifies whether Amqp or Http transport is used</param>
 /// <param name="options">The options that allow configuration of the module client instance during initialization.</param>
 /// <returns>ModuleClient instance</returns>
 public static Task <ModuleClient> CreateFromEnvironmentAsync(TransportType transportType, ClientOptions options = default)
 {
     return(CreateFromEnvironmentAsync(ClientFactory.GetTransportSettings(transportType), options));
 }
コード例 #9
0
 /// <summary>
 /// Create an Amqp DeviceClient from individual parameters
 /// </summary>
 /// <param name="hostname">The fully-qualified DNS hostname of IoT Hub</param>
 /// <param name="authenticationMethod">The authentication method that is used</param>
 /// <param name="gatewayHostname">The fully-qualified DNS hostname of Gateway</param>
 /// <returns>DeviceClient</returns>
 public static DeviceClient Create(string hostname, string gatewayHostname, IAuthenticationMethod authenticationMethod)
 {
     return(Create(() => ClientFactory.Create(hostname, gatewayHostname, authenticationMethod)));
 }
コード例 #10
0
 /// <summary>
 /// Create a ModuleClient from individual parameters
 /// </summary>
 /// <param name="hostname">The fully-qualified DNS hostname of IoT Hub</param>
 /// <param name="authenticationMethod">The authentication method that is used</param>
 /// <param name="transportSettings">Prioritized list of transportTypes and their settings</param>
 /// <returns>ModuleClient</returns>
 public static ModuleClient Create(string hostname, IAuthenticationMethod authenticationMethod,
                                   ITransportSettings[] transportSettings)
 {
     return(Create(() => ClientFactory.Create(hostname, authenticationMethod, transportSettings)));
 }
コード例 #11
0
 /// <summary>
 /// Create DeviceClient from the specified connection string using the specified transport type
 /// </summary>
 /// <param name="connectionString">IoT Hub-Scope Connection string for the IoT hub (without DeviceId)</param>
 /// <param name="deviceId">Id of the device</param>
 /// <param name="transportType">The transportType used (Http1 or Amqp)</param>
 /// <returns>DeviceClient</returns>
 public static DeviceClient CreateFromConnectionString(string connectionString, string deviceId, TransportType transportType)
 {
     return(Create(() => ClientFactory.CreateFromConnectionString(connectionString, deviceId, transportType)));
 }
コード例 #12
0
 /// <summary>
 /// Create a DeviceClient using Amqp transport from the specified connection string
 /// </summary>
 /// <param name="connectionString">IoT Hub-Scope Connection string for the IoT hub (without DeviceId)</param>
 /// <param name="deviceId">Id of the Device</param>
 /// <returns>DeviceClient</returns>
 public static DeviceClient CreateFromConnectionString(string connectionString, string deviceId)
 {
     return(Create(() => ClientFactory.CreateFromConnectionString(connectionString, deviceId)));
 }
コード例 #13
0
 /// <summary>
 /// Create an Amqp ModuleClient from individual parameters
 /// </summary>
 /// <param name="hostname">The fully-qualified DNS hostname of IoT Hub</param>
 /// <param name="authenticationMethod">The authentication method that is used</param>
 /// <param name="gatewayHostname">The fully-qualified DNS hostname of Gateway</param>
 /// <param name="options">The options that allow configuration of the module client instance during initialization.</param>
 /// <returns>ModuleClient</returns>
 public static ModuleClient Create(string hostname, string gatewayHostname, IAuthenticationMethod authenticationMethod, ClientOptions options = default)
 {
     return(Create(() => ClientFactory.Create(hostname, gatewayHostname, authenticationMethod, options)));
 }
コード例 #14
0
 /// <summary>
 /// Create a disposable DeviceClient from the specified parameters
 /// </summary>
 /// <param name="hostname">The fully-qualified DNS host name of IoT Hub</param>
 /// <param name="gatewayHostname">The fully-qualified DNS host name of Gateway</param>
 /// <param name="authenticationMethod">The authentication method that is used</param>
 /// <param name="transportType">The transportType used (Http1, AMQP or MQTT), <see cref="TransportType"/></param>
 /// <param name="options">The options that allow configuration of the device client instance during initialization.</param>
 /// <returns>A disposable DeviceClient instance</returns>
 public static DeviceClient Create(string hostname, string gatewayHostname, IAuthenticationMethod authenticationMethod, TransportType transportType, ClientOptions options = default)
 {
     return(Create(() => ClientFactory.Create(hostname, gatewayHostname, authenticationMethod, transportType, options)));
 }
コード例 #15
0
 /// <summary>
 /// Create ModuleClient from the specified connection string using the specified transport type
 /// </summary>
 /// <param name="connectionString">Connection string for the IoT hub (including DeviceId)</param>
 /// <param name="transportType">Specifies whether Amqp or Http transport is used</param>
 /// <returns>ModuleClient</returns>
 public static ModuleClient CreateFromConnectionString(string connectionString, TransportType transportType)
 {
     return(Create(() => ClientFactory.CreateFromConnectionString(connectionString, transportType)));
 }
コード例 #16
0
 /// <summary>
 /// Creates a disposable DeviceClient from the specified parameters
 /// </summary>
 /// <param name="hostname">The fully-qualified DNS host name of IoT Hub</param>
 /// <param name="authenticationMethod">The authentication method that is used</param>
 /// <param name="transportSettings">Prioritized list of transportTypes and their settings</param>
 /// <param name="options">The options that allow configuration of the device client instance during initialization.</param>
 /// <returns>A disposable DeviceClient instance</returns>
 public static DeviceClient Create(string hostname, IAuthenticationMethod authenticationMethod,
                                   ITransportSettings[] transportSettings, ClientOptions options = default)
 {
     return(Create(() => ClientFactory.Create(hostname, authenticationMethod, transportSettings, options)));
 }
コード例 #17
0
 /// <summary>
 /// Create a ModuleClient using Amqp transport from the specified connection string
 /// </summary>
 /// <param name="connectionString">Connection string for the IoT hub (including DeviceId)</param>
 /// <param name="options">The options that allow configuration of the module client instance during initialization.</param>
 /// <returns>ModuleClient</returns>
 public static ModuleClient CreateFromConnectionString(string connectionString, ClientOptions options = default)
 {
     return(Create(() => ClientFactory.CreateFromConnectionString(connectionString, options)));
 }