本文整理汇总了C#中MissionPlanner.MAVLinkInterface.getHeartBeat方法的典型用法代码示例。如果您正苦于以下问题:C# MAVLinkInterface.getHeartBeat方法的具体用法?C# MAVLinkInterface.getHeartBeat怎么用?C# MAVLinkInterface.getHeartBeat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MissionPlanner.MAVLinkInterface
的用法示例。
在下文中一共展示了MAVLinkInterface.getHeartBeat方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: but_droneapi_Click
private void but_droneapi_Click(object sender, EventArgs e)
{
string droneshareusername = MainV2.getConfig("droneshareusername");
InputBox.Show("Username", "Username", ref droneshareusername);
MainV2.config["droneshareusername"] = droneshareusername;
string dronesharepassword = MainV2.getConfig("dronesharepassword");
if (dronesharepassword != "")
{
try
{
// fail on bad entry
var crypto = new Crypto();
dronesharepassword = crypto.DecryptString(dronesharepassword);
}
catch
{
}
}
InputBox.Show("Password", "Password", ref dronesharepassword, true);
var crypto2 = new Crypto();
string encryptedpw = crypto2.EncryptString(dronesharepassword);
MainV2.config["dronesharepassword"] = encryptedpw;
DroneProto dp = new DroneProto();
if (dp.connect())
{
if (dp.loginUser(droneshareusername, dronesharepassword))
{
MAVLinkInterface mine = new MAVLinkInterface();
var comfile = new CommsFile();
mine.BaseStream = comfile;
mine.BaseStream.PortName = @"C:\Users\hog\Documents\apm logs\iris 6-4-14\2014-04-06 09-07-32.tlog";
mine.BaseStream.Open();
comfile.bps = 4000;
mine.getHeartBeat();
dp.setVechileId(mine.MAV.Guid, 0, mine.MAV.sysid);
dp.startMission();
while (true)
{
byte[] packet = mine.readPacket();
dp.SendMavlink(packet, 0);
}
// dp.close();
// mine.Close();
}
}
}