예제 #1
0
 public MavLink4Net.Messages.IMessage Deserialize(System.IO.BinaryReader reader)
 {
     MavLink4Net.Messages.Common.TerrainDataMessage message = new MavLink4Net.Messages.Common.TerrainDataMessage();
     message.Lat         = reader.ReadInt32();
     message.Lon         = reader.ReadInt32();
     message.GridSpacing = reader.ReadUInt16();
     message.Data[0]     = reader.ReadInt16();
     message.Data[1]     = reader.ReadInt16();
     message.Data[2]     = reader.ReadInt16();
     message.Data[3]     = reader.ReadInt16();
     message.Data[4]     = reader.ReadInt16();
     message.Data[5]     = reader.ReadInt16();
     message.Data[6]     = reader.ReadInt16();
     message.Data[7]     = reader.ReadInt16();
     message.Data[8]     = reader.ReadInt16();
     message.Data[9]     = reader.ReadInt16();
     message.Data[10]    = reader.ReadInt16();
     message.Data[11]    = reader.ReadInt16();
     message.Data[12]    = reader.ReadInt16();
     message.Data[13]    = reader.ReadInt16();
     message.Data[14]    = reader.ReadInt16();
     message.Data[15]    = reader.ReadInt16();
     message.Gridbit     = reader.ReadByte();
     return(message);
 }
예제 #2
0
 public void Serialize(System.IO.BinaryWriter writer, MavLink4Net.Messages.IMessage message)
 {
     MavLink4Net.Messages.Common.TerrainDataMessage tMessage = message as MavLink4Net.Messages.Common.TerrainDataMessage;
     writer.Write(tMessage.Lat);
     writer.Write(tMessage.Lon);
     writer.Write(tMessage.GridSpacing);
     writer.Write(tMessage.Data[0]);
     writer.Write(tMessage.Data[1]);
     writer.Write(tMessage.Data[2]);
     writer.Write(tMessage.Data[3]);
     writer.Write(tMessage.Data[4]);
     writer.Write(tMessage.Data[5]);
     writer.Write(tMessage.Data[6]);
     writer.Write(tMessage.Data[7]);
     writer.Write(tMessage.Data[8]);
     writer.Write(tMessage.Data[9]);
     writer.Write(tMessage.Data[10]);
     writer.Write(tMessage.Data[11]);
     writer.Write(tMessage.Data[12]);
     writer.Write(tMessage.Data[13]);
     writer.Write(tMessage.Data[14]);
     writer.Write(tMessage.Data[15]);
     writer.Write(tMessage.Gridbit);
 }