public static UdpUser ConnectTo(string hostname, int port) { var connection = new UdpUser(); connection.Client.Connect(hostname, port); return(connection); }
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); }
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); }
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); }
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); }
public Messages(UdpUser client) { _client = client; }