From: Stricted Date: Thu, 12 Jan 2017 06:30:26 +0000 (+0100) Subject: implement frequency settings compleetely X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2a0e9bbff1bc3daffa5dfbe170992b0d73a44f2f;p=GitHub%2FStricted%2FSpeedportHybridControl.git implement frequency settings compleetely i dont know why i thought the connection to the lte modul is udp... --- diff --git a/SpeedportHybridControl.Implementations/util.cs b/SpeedportHybridControl.Implementations/util.cs index ecb4c2c..21344f6 100644 --- a/SpeedportHybridControl.Implementations/util.cs +++ b/SpeedportHybridControl.Implementations/util.cs @@ -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); } diff --git a/SpeedportHybridControl/PageModel/LteInfoModel.cs b/SpeedportHybridControl/PageModel/LteInfoModel.cs index c9e357b..134bcb8 100644 --- a/SpeedportHybridControl/PageModel/LteInfoModel.cs +++ b/SpeedportHybridControl/PageModel/LteInfoModel.cs @@ -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()