예제 #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)));
 }
 /// <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)));
 }
 /// <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)));
 }
 /// <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)));
 }
 /// <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)));
 }
 /// <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)));
 }