From ebf81ea8a1f9ccba3c5fe4fd6ffb9836f4edcc41 Mon Sep 17 00:00:00 2001 From: xu Date: Mon, 16 Mar 2020 14:13:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=8C=E9=A2=91=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=8F=91=E9=80=81=E6=95=B0=E6=8D=AE=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PlaneGcsSdk_Shared/Communication/TcpConnection.cs | 4 +++- PlaneGcsSdk_Shared/CommunicationManagement/CommModule.cs | 4 ++-- .../CommunicationManagement/CommModuleGenerateMavLink.cs | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/PlaneGcsSdk_Shared/Communication/TcpConnection.cs b/PlaneGcsSdk_Shared/Communication/TcpConnection.cs index a4f3736..cc713a9 100644 --- a/PlaneGcsSdk_Shared/Communication/TcpConnection.cs +++ b/PlaneGcsSdk_Shared/Communication/TcpConnection.cs @@ -68,6 +68,7 @@ namespace Plane.Communication public override async Task OpenAsync() { + string logstr; if (!IsOpen) { try @@ -77,8 +78,9 @@ namespace Plane.Communication //屏蔽掉异常处理 //CreateClientAndConnectAsync会new一个TcpClient并且重新连接 //之前设置的TcpClient中Socket Bind会无效,在多网卡工作时会导致断线重连的时间特别长 - catch (SocketException) + catch (SocketException e) { + logstr= e.Message; //await CreateClientAndConnectAsync(); } catch (ObjectDisposedException) diff --git a/PlaneGcsSdk_Shared/CommunicationManagement/CommModule.cs b/PlaneGcsSdk_Shared/CommunicationManagement/CommModule.cs index da4f2cd..7564286 100644 --- a/PlaneGcsSdk_Shared/CommunicationManagement/CommModule.cs +++ b/PlaneGcsSdk_Shared/CommunicationManagement/CommModule.cs @@ -19,8 +19,8 @@ namespace Plane.CommunicationManagement public TcpConnection Connection = null; public bool CommOK = false; - private const string MODULE_IP = "192.168.199.51"; - private const string LOCAL_IP = "192.168.199.50"; + private const string MODULE_IP = "192.168.199.51"; // "192.168.199.51"; + private const string LOCAL_IP = "192.168.199.50"; //"192.168.199.50"; private const int PORT = 9551; private bool _disposed; public int CommModuleCopterCount = 0; diff --git a/PlaneGcsSdk_Shared/CommunicationManagement/CommModuleGenerateMavLink.cs b/PlaneGcsSdk_Shared/CommunicationManagement/CommModuleGenerateMavLink.cs index c8937d6..c7ace55 100644 --- a/PlaneGcsSdk_Shared/CommunicationManagement/CommModuleGenerateMavLink.cs +++ b/PlaneGcsSdk_Shared/CommunicationManagement/CommModuleGenerateMavLink.cs @@ -1085,7 +1085,8 @@ namespace Plane.CommunicationManagement byte[] packet = GeneratePacket(MAVLink.MAVLINK_MSG_ID_GPS_RTCM_DATA, gps); //Windows.Messages.Message.Show($"{DateTime.Now.ToString("HH:mm:ss:fff")} 单次长度 = {packet.Length}"); - //await WriteCommPacketAsync(0, MavComm.COMM_DOWNLOAD_COMM, packet).ConfigureAwait(false); + //老版本在这发送,新版本在StartRtcmLoop里面一次性打包4个180字节发送了 + await WriteCommPacketAsync(0, MavComm.COMM_DOWNLOAD_COMM, packet).ConfigureAwait(false); lock (lock_rtcm) {