Esempio n. 1
0
        private void DeserializeMessage()
        {
            UasMessage result = UasSummary.CreateFromId(MessageId);

            if (result == null)
            {
                return;                  // Unknown type
            }
            using (MemoryStream ms = new MemoryStream(Payload))
            {
                using (BinaryReader br = GetBinaryReader(ms))
                {
                    result.DeserializeBody(br);
                }
            }

            Message = result;
            IsValid = true;
        }
Esempio n. 2
0
        private void DeserializeMessage()
        {
            UasMessage result = UasSummary.CreateFromId(MessageId);

            if (result == null)
            {
                return;                                         // Unknown type
            }
            using (MemoryStream ms = new MemoryStream(Payload)) //在组装包的时候进行解密(未完成)
            {
                using (BinaryReader br = GetBinaryReader(ms))
                {
                    try
                    {
                        result.DeserializeBody(br);
                    }
                    catch { }//mavlinkv2会精简为0的包PayLoad从零开始就不发了
                }
            }

            Message = result;
            IsValid = true;
        }