Example #1
0
        private void btnExtenderConnect_Click(object sender, EventArgs e)
        {
            IPAddress localhost = null;
            var       host      = Dns.GetHostEntry(Dns.GetHostName());

            // Get IPv4 Address
            var IPv4Address = host.AddressList.FirstOrDefault(xx => xx.AddressFamily == AddressFamily.InterNetwork);

            // Check if there is an IPv4 Address
            if (IPv4Address != null)
            {
                localhost = IPv4Address;
            }
            else
            {
                throw new Exception("No network adapters with an IPv4 address in the system!");
            }

            if (m_device != null)
            {
                m_device.Stop();
            }

            SoftSledConfig currConfig = SoftSledConfigManager.ReadConfig();

            if (!currConfig.IsPaired)
            {
                MessageBox.Show("SoftSled is currently not paired with Windows Media Center. Enter the 'Extender Setup' mode to pair.");
                return;
            }

            txtLog.Text = "";

            m_device = new ExtenderDevice(m_logger);
            m_device.Start();

            // If RDP not Initialised
            if (!rdpInitialised)
            {
                // Initialise RDP
                InitialiseRdpClient();
            }

            // Set RDP Server Address
            rdpClient.Server = currConfig.RdpLoginHost;
            // Set RDP Username
            rdpClient.UserName = currConfig.RdpLoginUserName;
            // Set RDP Password
            rdpClient.AdvancedSettings2.ClearTextPassword = currConfig.RdpLoginPassword;
            // Set RDP Color Depth
            rdpClient.ColorDepth = 32;
            // Connect RDP
            rdpClient.Connect();

            SetStatus("Remote Desktop Connecting...");
            isConnecting = true;
        }
Example #2
0
        private void btnExtenderConnect_Click(object sender, EventArgs e)
        {
            if (m_device != null)
            {
                m_device.Stop();
            }

            SoftSledConfig currConfig = SoftSledConfigManager.ReadConfig();

            if (!currConfig.IsPaired)
            {
                MessageBox.Show("SoftSled is currently not paired with Windows Media Center. Enter the 'Extender Setup' mode to pair.");
                return;
            }

            txtLog.Text = "";
            devCapsIter = 1;

            m_device = new ExtenderDevice(m_logger);
            m_device.Start();

            m_channelHandler                 = new McxVirtualChannelHandler();
            rdpClient.OnConnected           += new EventHandler(rdpClient_OnConnected);
            rdpClient.OnDisconnected        += new AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEventHandler(rdpClient_OnDisconnected);
            rdpClient.OnChannelReceivedData += new AxMSTSCLib.IMsTscAxEvents_OnChannelReceivedDataEventHandler(rdpClient_OnChannelReceivedData);

            rdpClient.AdvancedSettings3.RDPPort    = 3390;
            rdpClient.SecuredSettings.StartProgram = "%windir%\\ehome\\ehshell.exe";
            rdpClient.Server   = currConfig.RdpLoginHost;
            rdpClient.UserName = currConfig.RdpLoginUserName;
            rdpClient.AdvancedSettings2.ClearTextPassword = currConfig.RdpLoginPassword;

            // McxSess - used by mcrmgr
            // MCECaps - not known where used
            // devcaps - used by ehshell to determine extender capabilities
            // avctrl - used for av signalling
            // VCHD - something to do with av signalling

            // NOTICE, if you want ehshell.exe to start up in normal Remote Desktop mode, remove the devcaps channel definition bellow.
            rdpClient.CreateVirtualChannels("McxSess,MCECaps,devcaps,avctrl,VCHD");
            rdpClient.Connect();

            SetStatus("Remote Desktop Connecting...");
            isConnecting = true;

            TcpListener tcp1 = new TcpListener(3776);
            TcpListener tcp2 = new TcpListener(3777);
            TcpListener tcp3 = new TcpListener(3778);
            TcpListener tcp4 = new TcpListener(2177);

            //new Thread(new ParameterizedThreadStart(Listen)).Start(tcp1);
            //new Thread(new ParameterizedThreadStart(Listen)).Start(tcp2);
            // new Thread(new ParameterizedThreadStart(Listen)).Start(tcp3);
            //new Thread(new ParameterizedThreadStart(Listen)).Start(tcp4);
        }
Example #3
0
        private void BtnExtenderSetup_Click(object sender, EventArgs e) {
            if (m_device != null) {
                MessageBox.Show("Device is already broadcasting!");
                return;
            }

            m_device = new ExtenderDevice(m_logger);
            m_device.Start();

            MessageBox.Show("SoftSled is broadcasting! Use the key 1234-3706 to pair the device");
        }
Example #4
0
 private void StartButton_Click(object sender, EventArgs e)
 {
     /*
      * SSDP request = new SSDP(new IPEndPoint(new IPAddress(0x6900A8C0),3391),1801);
      * HTTPMessage theMessage = new HTTPMessage();
      *
      * theMessage.Directive = "M-SEARCH";
      * theMessage.AddTag("Host", textBox2.Text + ":1900");
      * theMessage.AddTag("MX", "2");
      * theMessage.AddTag("Man", "ssdp:discover");
      * theMessage.AddTag("ST", "uuid:4e455447-4541-524e-4153-000da20110c6");
      * textBox1.Text = theMessage.StringPacket;
      *
      * request.BroadcastData(theMessage);
      */
     //textBox1.Text = getServicesFromDevice(textBox2.Text);
     m_device.Start();
 }