Пример #1
0
 public void Serialize(System.IO.BinaryWriter writer, MavLink4Net.Messages.IMessage message)
 {
     MavLink4Net.Messages.Common.AttitudeTargetMessage tMessage = message as MavLink4Net.Messages.Common.AttitudeTargetMessage;
     writer.Write(tMessage.TimeBootMs);
     writer.Write(tMessage.Q[0]);
     writer.Write(tMessage.Q[1]);
     writer.Write(tMessage.Q[2]);
     writer.Write(tMessage.Q[3]);
     writer.Write(tMessage.BodyRollRate);
     writer.Write(tMessage.BodyPitchRate);
     writer.Write(tMessage.BodyYawRate);
     writer.Write(tMessage.Thrust);
     writer.Write(tMessage.TypeMask);
 }
Пример #2
0
 public MavLink4Net.Messages.IMessage Deserialize(System.IO.BinaryReader reader)
 {
     MavLink4Net.Messages.Common.AttitudeTargetMessage message = new MavLink4Net.Messages.Common.AttitudeTargetMessage();
     message.TimeBootMs    = reader.ReadUInt32();
     message.Q[0]          = reader.ReadSingle();
     message.Q[1]          = reader.ReadSingle();
     message.Q[2]          = reader.ReadSingle();
     message.Q[3]          = reader.ReadSingle();
     message.BodyRollRate  = reader.ReadSingle();
     message.BodyPitchRate = reader.ReadSingle();
     message.BodyYawRate   = reader.ReadSingle();
     message.Thrust        = reader.ReadSingle();
     message.TypeMask      = reader.ReadByte();
     return(message);
 }