Example #1
0
        public static void OnConnectionStatusChanged(ApiConnectionStatus status, string type)
        {
            _apiConnectionStatus = status;

            ConnectionStatusHandler handler = ConnectionStatusChanged;

            if (handler != null)
            {
                handler(status, type);
            }
        }
        internal void ConnectAndStartListening()
        {
            StartListening();

            byte[] connectionPacket = Encoding.UTF8.GetBytes("conn_req:\x00\x00");
            connectionPacket[connectionPacket.Length - 2] = 0x96;
            connectionPacket[connectionPacket.Length - 1] = 0x17;

            ConnectionStatusHandler.Invoke(this, new ConnectionStatusEventArgs(ConnectionStatus.Connecting));
            TelloClient.Client.Send(connectionPacket);
        }
 public void SubscribeToConnectionStatus(ConnectionStatusHandler handler)
 {
     ConnectionStatusChanged += handler;
 }