implement frequency settings compleetely
authorStricted <info@stricted.net>
Thu, 12 Jan 2017 06:30:26 +0000 (07:30 +0100)
committerStricted <info@stricted.net>
Thu, 12 Jan 2017 06:30:26 +0000 (07:30 +0100)
i dont know why i thought the connection to the lte modul is udp...

SpeedportHybridControl.Implementations/util.cs
SpeedportHybridControl/PageModel/LteInfoModel.cs

index ecb4c2c948e81f2e11541ba98c92b7436113254e..21344f69841d7508d402f08f8a20aa5870b889a4 100644 (file)
@@ -277,12 +277,12 @@ namespace SpeedportHybridControl.Implementations
                        {
                                try
                                {
-                                       Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
-                                       IPAddress serverAddr = IPAddress.Parse("172.10.10.1");
-                                       IPEndPoint endPoint = new IPEndPoint(serverAddr, 1280);
+                                       TcpClient client = new TcpClient("172.10.10.1", 1280);
+                                       NetworkStream stream = client.GetStream();
                                        byte[] cmd = Encoding.ASCII.GetBytes(Command);
-                                       sock.SendTo(cmd, endPoint);
-                                       sock.Close();
+                                       stream.Write(cmd, 0, cmd.Length);
+                                       stream.Close();
+                                       client.Close();
                                }
                                catch (Exception)
                                {
@@ -305,7 +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.Concat("AT^SYSCFGEX=\"03\",3FFFFFFF,3,1,", (int)band, ",,");
+                       string Command = string.Concat(@"AT^SYSCFGEX=""03"",3FFFFFFF,3,1,", (int)band, ",,", "\r");
 
                        sendCommandToLteModul(Command);
                }
index c9e357bb49b929679a33bca0ce7484a10c7ced38..134bcb8dcd6391d5d1ea51d9fcdd7f01974bd98c 100644 (file)
@@ -122,7 +122,41 @@ namespace SpeedportHybridControl.PageModel
 
                private void OnSaveFrequencyCommandExecute()
                {
-                       // @TODO:
+                       if (Object.Equals(SelectedFrequency, null).Equals(true))
+                       {
+                               return;
+                       }
+
+                       switch (SelectedFrequency.Name)
+                       {
+                               case "B1":
+                                       util.setLteFrequency(LTEBand.LTE800);
+                                       break;
+
+                               case "B2":
+                                       util.setLteFrequency(LTEBand.LTE1800);
+                                       break;
+
+                               case "B3":
+                                       util.setLteFrequency(LTEBand.LTE2600);
+                                       break;
+
+                               case "B4":
+                                       util.setLteFrequency(LTEBand.LTE800 | LTEBand.LTE1800 | LTEBand.LTE2600);
+                                       break;
+
+                               case "B5":
+                                       util.setLteFrequency(LTEBand.LTE800 | LTEBand.LTE1800);
+                                       break;
+
+                               case "B6":
+                                       util.setLteFrequency(LTEBand.LTE800 | LTEBand.LTE2600);
+                                       break;
+
+                               case "B7":
+                                       util.setLteFrequency(LTEBand.LTE1800 | LTEBand.LTE2600);
+                                       break;
+                       }
                }
 
         private void OnPopupCommandExecute()