本文整理匯總了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();
}
}
}