Exemplo n.º 1
0
        private void clientdata(IAsyncResult ar)
        {
            var client = ((UdpClient)ar.AsyncState);

            if (client == null || client.Client == null)
            {
                return;
            }
            try
            {
                var port = ((IPEndPoint)client.Client.LocalEndPoint).Port;

                var udpclient = new UdpSerial(client);

                var mav = new MAVLinkInterface();
                mav.BaseStream = udpclient;

                MainV2.comPort = mav;
                MainV2.Comports.Add(mav);

                mav.Open(false, true);

                mav.getParamListAsync(mav.MAV.sysid, mav.MAV.compid).ConfigureAwait(false);

                Forms.Device.BeginInvokeOnMainThread(() =>
                {
                });
            }
            catch (Exception ex)
            {
                Log.Warning("", ex.ToString());
            }
        }