From: Stricted Date: Thu, 12 Jan 2017 04:59:28 +0000 (+0100) Subject: update setLteFrequency method X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3f1e484ebd92300ff686b2305adf1081a557df7d;p=GitHub%2FStricted%2FSpeedportHybridControl.git update setLteFrequency method --- diff --git a/SpeedportHybridControl.Implementations/Enum/Band.cs b/SpeedportHybridControl.Implementations/Enum/Band.cs deleted file mode 100644 index a18fe43..0000000 --- a/SpeedportHybridControl.Implementations/Enum/Band.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace SpeedportHybridControl.Implementations.Enum -{ - public enum Band - { - - LTE800 = (1 << 1), - LTE1800 = (1 << 2), - LTE2600 = (1 << 3) - } -} diff --git a/SpeedportHybridControl.Implementations/LTEBand.cs b/SpeedportHybridControl.Implementations/LTEBand.cs new file mode 100644 index 0000000..aa61c9f --- /dev/null +++ b/SpeedportHybridControl.Implementations/LTEBand.cs @@ -0,0 +1,9 @@ +namespace SpeedportHybridControl.Implementations +{ + public enum LTEBand : int + { + LTE800 = 80000, + LTE1800 = 4, + LTE2600 = 40 + } +} diff --git a/SpeedportHybridControl.Implementations/SpeedportHybridControl.Implementations.csproj b/SpeedportHybridControl.Implementations/SpeedportHybridControl.Implementations.csproj index 263347a..60904c6 100644 --- a/SpeedportHybridControl.Implementations/SpeedportHybridControl.Implementations.csproj +++ b/SpeedportHybridControl.Implementations/SpeedportHybridControl.Implementations.csproj @@ -54,6 +54,7 @@ + diff --git a/SpeedportHybridControl.Implementations/util.cs b/SpeedportHybridControl.Implementations/util.cs index 39259fd..ecb4c2c 100644 --- a/SpeedportHybridControl.Implementations/util.cs +++ b/SpeedportHybridControl.Implementations/util.cs @@ -1,6 +1,5 @@ using Microsoft.Win32; using Newtonsoft.Json.Linq; -using SpeedportHybridControl.Implementations.Enum; using System; using System.Linq; using System.Net; @@ -293,10 +292,10 @@ namespace SpeedportHybridControl.Implementations } } - public static void setLteFrequency (Band band) + public static void setLteFrequency (LTEBand band) { /** - * pissible lte frequency band commands: + * possible lte frequency band commands: * * AT^SYSCFGEX="03",3FFFFFFF,3,1,80000,, # 800 * AT^SYSCFGEX="03",3FFFFFFF,3,1,4,, # 1800 @@ -306,37 +305,7 @@ namespace SpeedportHybridControl.Implementations * AT^SYSCFGEX="03",3FFFFFFF,3,1,80040,, # 800 | 2600 * AT^SYSCFGEX="03",3FFFFFFF,3,1,44,, # 1800 | 2600 */ - - string Command = string.Empty; - - if ((band & Band.LTE800) == Band.LTE800) - { - Command = "AT^SYSCFGEX=\"03\",3FFFFFFF,3,1,80000,,"; - } - else if ((band & Band.LTE1800) == Band.LTE1800) - { - Command = "AT^SYSCFGEX=\"03\",3FFFFFFF,3,1,4,,"; - } - else if ((band & Band.LTE2600) == Band.LTE2600) - { - Command = "AT^SYSCFGEX=\"03\",3FFFFFFF,3,1,40,,"; - } - else if ((band & (Band.LTE800 | Band.LTE1800 | Band.LTE2600)) == (Band.LTE800 | Band.LTE1800 | Band.LTE2600)) - { - Command = "AT^SYSCFGEX=\"03\",3FFFFFFF,3,1,80044,,"; - } - else if ((band & (Band.LTE800 | Band.LTE1800)) == (Band.LTE800 | Band.LTE1800)) - { - Command = "AT^SYSCFGEX=\"03\",3FFFFFFF,3,1,80004,,"; - } - else if ((band & (Band.LTE800 | Band.LTE2600)) == (Band.LTE800 | Band.LTE2600)) - { - Command = "AT^SYSCFGEX=\"03\",3FFFFFFF,3,1,80040,,"; - } - else if ((band & (Band.LTE1800 | Band.LTE2600)) == (Band.LTE1800 | Band.LTE2600)) - { - Command = "AT^SYSCFGEX=\"03\",3FFFFFFF,3,1,44,,"; - } + string Command = string.Concat("AT^SYSCFGEX=\"03\",3FFFFFFF,3,1,", (int)band, ",,"); sendCommandToLteModul(Command); }