Ejemplo n.º 1
0
 public void Serialize(System.IO.BinaryWriter writer, MavLink4Net.Messages.IMessage message)
 {
     MavLink4Net.Messages.Common.CommandIntMessage tMessage = message as MavLink4Net.Messages.Common.CommandIntMessage;
     writer.Write(tMessage.Param1);
     writer.Write(tMessage.Param2);
     writer.Write(tMessage.Param3);
     writer.Write(tMessage.Param4);
     writer.Write(tMessage.X);
     writer.Write(tMessage.Y);
     writer.Write(tMessage.Z);
     writer.Write(((ushort)(tMessage.Command)));
     writer.Write(tMessage.TargetSystem);
     writer.Write(tMessage.TargetComponent);
     writer.Write(((byte)(tMessage.Frame)));
     writer.Write(tMessage.Current);
     writer.Write(tMessage.Autocontinue);
 }
Ejemplo n.º 2
0
 public MavLink4Net.Messages.IMessage Deserialize(System.IO.BinaryReader reader)
 {
     MavLink4Net.Messages.Common.CommandIntMessage message = new MavLink4Net.Messages.Common.CommandIntMessage();
     message.Param1          = reader.ReadSingle();
     message.Param2          = reader.ReadSingle();
     message.Param3          = reader.ReadSingle();
     message.Param4          = reader.ReadSingle();
     message.X               = reader.ReadInt32();
     message.Y               = reader.ReadInt32();
     message.Z               = reader.ReadSingle();
     message.Command         = ((MavLink4Net.Messages.Common.Cmd)(reader.ReadUInt16()));
     message.TargetSystem    = reader.ReadByte();
     message.TargetComponent = reader.ReadByte();
     message.Frame           = ((MavLink4Net.Messages.Common.Frame)(reader.ReadByte()));
     message.Current         = reader.ReadByte();
     message.Autocontinue    = reader.ReadByte();
     return(message);
 }