Example #1
0
        public MAVLinkSerialPort(MAVLinkInterface mavint, MAVLink.SERIAL_CONTROL_DEV port)
        {
            this.mavint = mavint;
            this.port   = port;

            if (!mavint.BaseStream.IsOpen)
            {
                throw new Exception(Strings.PleaseConnect);
            }

            if (mavint.getHeartBeat().Length == 0)
            {
                throw new Exception("No valid heartbeats read from port");
            }

            if (subscription.Value != null)
            {
                mavint.UnSubscribeToPacketType(subscription);
            }

            subscription = mavint.SubscribeToPacketType(MAVLink.MAVLINK_MSG_ID.SERIAL_CONTROL, ReceviedPacket, true);

            bgdata              = new Thread(mainloop);
            bgdata.Name         = "MAVLinkSerialPort";
            bgdata.IsBackground = true;
            bgdata.Start();
        }
        public MAVLinkSerialPort(MAVLinkInterface mavint, MAVLink.SERIAL_CONTROL_DEV port)
        {
            this.mavint = mavint;
            this.port = port;

            if (!mavint.BaseStream.IsOpen)
            {
                mavint.BaseStream.Open();
            }

            if (mavint.getHeartBeat().Length == 0)
            {
                throw new Exception("No valid heartbeats read from port");
            }

            if (subscription.Value != null)
                mavint.UnSubscribeToPacketType(subscription);

            subscription = mavint.SubscribeToPacketType(MAVLink.MAVLINK_MSG_ID.SERIAL_CONTROL, ReceviedPacket, true);

            bgdata = new Thread(mainloop);
            bgdata.Name = "MAVLinkSerialPort";
            bgdata.IsBackground = true;
            bgdata.Start();
        }
Example #3
0
        public MAVLinkSerialPort(MAVLinkInterface mavint, MAVLink.SERIAL_CONTROL_DEV port)
        {
            this.mavint = mavint;
            this.port   = port;

            if (!mavint.BaseStream.IsOpen)
            {
                mavint.BaseStream.Open();
            }

            if (mavint.getHeartBeat().Length == 0)
            {
                throw new Exception("No valid heartbeats read from port");
            }

            if (subscription.Value != null)
            {
                mavint.UnSubscribeToPacketType(subscription);
            }

            subscription = mavint.SubscribeToPacketType(MAVLink.MAVLINK_MSG_ID.SERIAL_CONTROL, ReceviedPacket, true);
        }