update setLteFrequency method
authorStricted <info@stricted.net>
Thu, 12 Jan 2017 04:59:28 +0000 (05:59 +0100)
committerStricted <info@stricted.net>
Thu, 12 Jan 2017 05:02:06 +0000 (06:02 +0100)
SpeedportHybridControl.Implementations/Enum/Band.cs [deleted file]
SpeedportHybridControl.Implementations/LTEBand.cs [new file with mode: 0644]
SpeedportHybridControl.Implementations/SpeedportHybridControl.Implementations.csproj
SpeedportHybridControl.Implementations/util.cs

diff --git a/SpeedportHybridControl.Implementations/Enum/Band.cs b/SpeedportHybridControl.Implementations/Enum/Band.cs
deleted file mode 100644 (file)
index a18fe43..0000000
+++ /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 (file)
index 0000000..aa61c9f
--- /dev/null
@@ -0,0 +1,9 @@
+namespace SpeedportHybridControl.Implementations
+{
+       public enum LTEBand : int
+       {
+               LTE800 = 80000,
+               LTE1800 = 4,
+               LTE2600 = 40
+       }
+}
index 263347a009a271af2dfda65eccdcba1accb5ff7c..60904c661639b391a4361a147c4b225cfa80278b 100644 (file)
@@ -54,6 +54,7 @@
     <Compile Include="Cryptography.cs" />
     <Compile Include="DelegateCommand.cs" />
     <Compile Include="LogManager.cs" />
+    <Compile Include="LTEBand.cs" />
     <Compile Include="NumberTextBox.cs" />
     <Compile Include="PasswordHelper.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
index 39259fdcd73f339651d273e7cd13381bac238db6..ecb4c2c948e81f2e11541ba98c92b7436113254e 100644 (file)
@@ -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);
                }