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) {