From 386e7f26dee6ebd03a4d8e7df5fc702222e2fd5c Mon Sep 17 00:00:00 2001 From: "R. de Veen" Date: Sat, 21 May 2022 15:53:33 +0200 Subject: [PATCH] Fix wrong spelled event name TwinUpated (#185) --- README.md | 6 +++--- nanoFramework.Azure.Devices.Client/DeviceClient.cs | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a6e2514..98b05ea 100644 --- a/README.md +++ b/README.md @@ -116,7 +116,7 @@ Reporting Plug & Play properties is supported. He is a comprehensive example and ```csharp const string TargetTemerature = "targetTemperature"; DeviceClient azureIoT = new DeviceClient(Secrets.IotHub, Secrets.DeviceName, Secrets.SasKey, azureCert: new X509Certificate(Resource.GetBytes(Resource.BinaryResources.AzureRoot)), modelId: "dtmi:com:example:Thermostat;1"); -azureIoT.TwinUpated += AzureTwinUpdated; +azureIoT.TwinUpdated += AzureTwinUpdated; azureIoT.Open(); void AzureTwinUpdated(object sender, TwinUpdateEventArgs e) @@ -192,11 +192,11 @@ Note: the function will return false if the twin reception confirmation is not c You can also register for any twin update: ```csharp -azureIoT.TwinUpated += TwinUpdatedEvent; +azureIoT.TwinUpdated += TwinUpdatedEvent; void TwinUpdatedEvent(object sender, TwinUpdateEventArgs e) { - Debug.WriteLine($"Twin update received: {e.Twin.Count}"); + Debug.WriteLine($"Twin update received: {e.Twin.Count}"); } ``` diff --git a/nanoFramework.Azure.Devices.Client/DeviceClient.cs b/nanoFramework.Azure.Devices.Client/DeviceClient.cs index e3039db..2d2271b 100644 --- a/nanoFramework.Azure.Devices.Client/DeviceClient.cs +++ b/nanoFramework.Azure.Devices.Client/DeviceClient.cs @@ -44,7 +44,7 @@ public class DeviceClient : IDisposable /// /// Device twin updated event. /// - public event TwinUpdated TwinUpated; + public event TwinUpdated TwinUpdated; /// /// Status change event. @@ -67,7 +67,6 @@ public class DeviceClient : IDisposable /// Azure certificate for the connection to Azure IoT Hub. /// Azure Plug and Play model ID. public DeviceClient(string iotHubName, string deviceId, string moduleId, string sasKey, MqttQoSLevel qosLevel = MqttQoSLevel.AtLeastOnce, X509Certificate azureCert = null, string modelId = null) - { _clientCert = null; _iotHubName = iotHubName; @@ -416,7 +415,7 @@ private void ClientMqttMsgReceived(object sender, MqttMsgPublishEventArgs e) } else if (e.Topic.StartsWith("$iothub/twin/PATCH/properties/desired/")) { - TwinUpated?.Invoke(this, new TwinUpdateEventArgs(new TwinCollection(message))); + TwinUpdated?.Invoke(this, new TwinUpdateEventArgs(new TwinCollection(message))); _ioTHubStatus.Status = Status.TwinUpdateReceived; _ioTHubStatus.Message = string.Empty; StatusUpdated?.Invoke(this, new StatusUpdatedEventArgs(_ioTHubStatus));