Exemple #1
0
        static void Main(string[] args)
        {
            SocketLink link = new SocketLink
            {
                server   = "localhost",
                account  = "*****@*****.**",
                pwd      = "fupbvxvuce",
                instance = "9ie673ff3bei"
            };


            var c = link.Connect();

            c.Wait();

            Controller ctrl = new Controller();

            var node = new Node("node01", link, ctrl);

            ctrl.node = node;

            node.Inputs  = "led";
            node.Outputs = "switch";
            var r = node.Run();

            r.Wait();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            SocketLink link = new SocketLink
            {
                server   = "cloud.nodewire.org",
                account  = "*****@*****.**",
                pwd      = "secret",
                instance = "lrsnr49yxurz"
            };


            var c = link.Connect();

            c.Wait();

            Controller ctrl = new Controller();

            var node = new Node("node01", link, ctrl);

            ctrl.node = node;

            node.Inputs  = "led";
            node.Outputs = "switch";
            node.Run().Wait();
            Console.ReadLine();
        }
Exemple #3
0
        async private void button2_Click(object sender, EventArgs e)
        {
            button2.Text      = "connecting...";
            button2.Enabled   = false;
            comboBox1.Enabled = false;
            link = new SocketLink
            {
                server   = "dashboard.nodewire.org",
                account  = "*****@*****.**",
                pwd      = "aB01@",
                instance = "1jex2k7cbedg"
            };
            try
            {
                await link.Connect();

                node = new Node("c#", link, this)
                {
                    Inputs = "led"
                };
                node.led = 1;
                await node.Run();
            }
            catch
            {
                button2.Text      = "connect";
                button1.Enabled   = false;
                button4.Enabled   = false;
                button2.Enabled   = true;
                button3.Enabled   = false;
                comboBox1.Enabled = true;
            }
        }
Exemple #4
0
        private async void Button1_Click(object sender, EventArgs e)
        {
            button1.Enabled = false;
            link            = new SocketLink
            {
                server   = "dashboard.nodewire.org",
                account  = "*****@*****.**",
                pwd      = "secret",
                instance = "lrsnr49yxurz"
            };
            await link.Connect();

            Controller ctrl = new Controller {
                radio = radioButton1
            };

            node = new Node("c#", link, ctrl)
            {
                Inputs = "led"
            };
            await node.Run();
        }