I’m Used this " https://github.com/dsuarezv/mavlink.net "
and I use “Silicon Labs CP210x USB to UART Bridge (COM6)”.
step1. connect Serialport - success
In pixhawk2.1, the default information is displayed. (GPS, etc.)
public MavLinkSerialPortTransport mavLinkSerialPortTransport = null;
public Ardupilot()
{
mavLinkSerialPortTransport = new MavLinkSerialPortTransport();
mavLinkSerialPortTransport.SerialPortName = SerialPortName;
mavLinkSerialPortTransport.BaudRate = BaudRate;
mavLinkSerialPortTransport.OnPacketReceived += new PacketReceivedDelegate(recvPacket);
mavLinkSerialPortTransport.Initialize();
}
private void recvPacket(object sender, MavLinkNet.MavLinkPacket packet)
{
Console.WriteLine(packet.Message.MessageId);
}
step2. Test Sending Message - sucess
But the delegate does not respond.
public void MissionCount()
{
UasMissionCount uasMissionCount = new UasMissionCount()
{
MissionType = MavMissionType.Mission,
TargetComponent = 1,
TargetSystem = 1,
};
mavLinkSerialPortTransport.SendMessage(uasMissionCount);
}
I sent a lot of other messages, but not all of them answered.