diff --git a/LoRaEngine/modules/LoRaWanNetworkSrvModule/LoraTools/IoTHubImpl/IoTHubRegistryManager.cs b/LoRaEngine/modules/LoRaWanNetworkSrvModule/LoraTools/IoTHubImpl/IoTHubRegistryManager.cs index 5808b551e8..df9b16803d 100644 --- a/LoRaEngine/modules/LoRaWanNetworkSrvModule/LoraTools/IoTHubImpl/IoTHubRegistryManager.cs +++ b/LoRaEngine/modules/LoRaWanNetworkSrvModule/LoraTools/IoTHubImpl/IoTHubRegistryManager.cs @@ -4,19 +4,13 @@ namespace LoRaTools.IoTHubImpl { using System; - using System.Collections.Generic; using System.Globalization; using System.Net.Http; - using System.Runtime.CompilerServices; - using System.Text; using System.Threading; using System.Threading.Tasks; using LoRaWan; using Microsoft.Azure.Devices; - using Microsoft.Azure.Devices.Shared; using Microsoft.Extensions.Logging; - using Newtonsoft.Json; - using Newtonsoft.Json.Linq; public sealed class IoTHubRegistryManager : IDeviceRegistryManager, IDisposable { @@ -83,9 +77,6 @@ public IRegistryPageResult GetAllLoRaDevices() return new IoTHubLoRaDeviceTwinPageResult(q); } - public async Task GetStationTwinAsync(StationEui stationEui, CancellationToken? cancellationToken = null) - => new IoTHubStationTwin(await this.instance.GetTwinAsync(stationEui.ToString(), cancellationToken ?? CancellationToken.None)); - public IRegistryPageResult GetLastUpdatedLoRaDevices(DateTime lastUpdateDateTime) { var formattedDateTime = lastUpdateDateTime.ToString(Constants.RoundTripDateTimeStringFormat, CultureInfo.InvariantCulture); @@ -116,5 +107,7 @@ public async Task GetLoRaDeviceTwinAsync(string deviceId, Cance public async Task GetTwinAsync(string deviceId, CancellationToken? cancellationToken = null) => await this.instance.GetTwinAsync(deviceId, cancellationToken ?? CancellationToken.None) is { } twin ? new IoTHubDeviceTwin(twin) : null; + public async Task GetStationTwinAsync(StationEui stationEui, CancellationToken? cancellationToken = null) + => await this.instance.GetTwinAsync(stationEui.ToString(), cancellationToken ?? CancellationToken.None) is { } twin ? new IoTHubStationTwin(twin) : null; } }