예제 #1
0
        public static UdpUser ConnectTo(string hostname, int port)
        {
            var connection = new UdpUser();

            connection.Client.Connect(hostname, port);
            return(connection);
        }
예제 #2
0
        private static void Connect()
        {
            //Console.WriteLine("Connecting to tello.");
            client = UdpUser.ConnectTo("192.168.10.1", 8889);

            ConnectionState = ConnectionState.Connecting;

            byte[] connectPacket = Encoding.UTF8.GetBytes("conn_req:\x00\x00");
            connectPacket[connectPacket.Length - 2] = 0x96;
            connectPacket[connectPacket.Length - 1] = 0x17;
            client.Send(connectPacket);
        }
예제 #3
0
        private static void connect(string IP)
        {
            //Console.WriteLine("Connecting to tello.");
            client = UdpUser.ConnectTo(IP, 8889);

            connectionState = ConnectionState.Connecting;
            //send event
            onConnection(connectionState);

            byte[] connectPacket = Encoding.UTF8.GetBytes("conn_req:\x00\x00");
            connectPacket[connectPacket.Length - 2] = 0x96;
            connectPacket[connectPacket.Length - 1] = 0x17;
            client.Send(connectPacket);
        }
예제 #4
0
        private void Connect()
        {
            //Console.WriteLine("Connecting to tello.");
            _client = UdpUser.ConnectTo("192.168.10.1", 8889);

            Messages  = new Messages(_client);
            _handlers = new CommandHandlers(State, Messages, OnUpdate);

            SetConnectionState(ConnectionState.Connecting);

            var connectPacket = Encoding.UTF8.GetBytes("conn_req:\x00\x00");

            connectPacket[connectPacket.Length - 2] = 0x96;
            connectPacket[connectPacket.Length - 1] = 0x17;
            _client.Send(connectPacket);
        }
예제 #5
0
        private static void connect()
        {
            tick = 0;

            //Debug.Log("Connecting to tello.");
            client = UdpUser.ConnectTo("192.168.10.1", 8889);

            connectionState = ConnectionState.Connecting;
            //send event
            onConnection(connectionState);

            byte[] connectPacket = Encoding.UTF8.GetBytes("conn_req:\x00\x00");
            //byte[] connectPacket = Encoding.UTF8.GetBytes("conn_req:\x96\x17"); // connect with video stream
            connectPacket[connectPacket.Length - 2] = 0x96;
            connectPacket[connectPacket.Length - 1] = 0x17;
            client.Send(connectPacket);
        }
예제 #6
0
 public Messages(UdpUser client)
 {
     _client = client;
 }