But it started throwing the below issues. https://github.com/Azure/azure-iot-sdk-c/issues/210 "Device Twin over AMQP failure: The link address did not match any of the expected formats". I updated the reference within the protocol gateway to the latest version within the ProtocolGateway.IotHubClient.NetStandard.csproj<PackageReference` Include="Microsoft.Azure.Devices.Client" Version="1.18.0" />
and the errors went away.
I have added Device Twin trigger.
await client.SetDesiredPropertyUpdateCallbackAsync(iHc.OnDesiredPropertyChanged, null);
see below
` public static async Task CreateFromConnectionStringAsync(string deviceId, string connectionString,
int connectionPoolSize, TimeSpan? connectionIdleTimeout, IotHubClientSettings settings, IByteBufferAllocator allocator, IMessageAddressConverter messageAddressConverter)
{
int maxPendingOutboundMessages = settings.MaxPendingOutboundMessages;
var tcpSettings = new AmqpTransportSettings(TransportType.Amqp_Tcp_Only);
var webSocketSettings = new AmqpTransportSettings(TransportType.Amqp_WebSocket_Only);
webSocketSettings.PrefetchCount = tcpSettings.PrefetchCount = (uint)maxPendingOutboundMessages;
if (connectionPoolSize > 0)
{
var amqpConnectionPoolSettings = new AmqpConnectionPoolSettings
{
MaxPoolSize = unchecked ((uint)connectionPoolSize),
Pooling = connectionPoolSize > 0
};
if (connectionIdleTimeout.HasValue)
{
amqpConnectionPoolSettings.ConnectionIdleTimeout = connectionIdleTimeout.Value;
}
tcpSettings.AmqpConnectionPoolSettings = amqpConnectionPoolSettings;
webSocketSettings.AmqpConnectionPoolSettings = amqpConnectionPoolSettings;
}
DeviceClient client = DeviceClient.CreateFromConnectionString(connectionString, new ITransportSettings[]
{
tcpSettings,
webSocketSettings
});
But it started throwing the below issues. https://github.com/Azure/azure-iot-sdk-c/issues/210 "Device Twin over AMQP failure: The link address did not match any of the expected formats". I updated the reference within the protocol gateway to the latest version within the ProtocolGateway.IotHubClient.NetStandard.csproj
<PackageReference` Include="Microsoft.Azure.Devices.Client" Version="1.18.0" />
and the errors went away.