diff --git a/PlaneGcsSdk_Shared/CommunicationManagement/CommModule.cs b/PlaneGcsSdk_Shared/CommunicationManagement/CommModule.cs index 196479f..da4f2cd 100644 --- a/PlaneGcsSdk_Shared/CommunicationManagement/CommModule.cs +++ b/PlaneGcsSdk_Shared/CommunicationManagement/CommModule.cs @@ -413,6 +413,8 @@ namespace Plane.CommunicationManagement /// public async Task WriteCommPacketAsync(short copterId, short messageType, byte[] data = null, byte[] batchPacket = null) { + //新盒子的协议--暂时不用-需要问张伟 + /* if (messageType == MavComm.COMM_DOWNLOAD_COMM && copterId == 0) { short byteNum; @@ -430,6 +432,7 @@ namespace Plane.CommunicationManagement batchPacket = BitConverter.GetBytes(length).Concat(batchPacket).ToArray(); } } + */ if (data != null && batchPacket != null) data = batchPacket.Concat(data).ToArray(); int packetlength = data == null ? 0 : data.Length; @@ -483,6 +486,16 @@ namespace Plane.CommunicationManagement { int dataLength = 6 + 2 + indata.Length * 32; byte[] data = new byte[dataLength]; + + byte[] uses = new byte[] { 0, 0, 1, 0, 0, 0 }; + Array.Copy(uses, 0, data, 0, 6); + + Int16 countNum = (Int16)indata.Length; + Array.Copy(BitConverter.GetBytes(countNum), 0, data, 6, 2); + + + //新盒子的协议--暂时不用-需要问张伟 + /* Int16 countNum = (Int16)indata.Length; byte[] uses = new byte[] { 0, 1, 0, 0, 0, 0 }; @@ -491,6 +504,10 @@ namespace Plane.CommunicationManagement Array.Copy(BitConverter.GetBytes(countNum), 0, data, 2, 2); Array.Copy(BitConverter.GetBytes(countNum), 0, data, 6, 2); + */ + + + int offset = 8;