public static IotApi UsePhilpsQueueRest(this IotApi api, string gatewayUrl, string userName)
        {
            PhilipsHueRestClient hue = new PhilipsHueRestClient(userName, gatewayUrl);

            api.RegisterModule(hue);
            return(api);
        }
Exemplo n.º 2
0
        public static IotApi RegisterRetry(this IotApi api, int numOfRetries, TimeSpan delayTime)
        {
            RetryModule module = new Services.RetryModule(numOfRetries, delayTime);

            api.RegisterModule(module);
            return(api);
        }
Exemplo n.º 3
0
        public static IotApi RegisterPersist(this IotApi api, Dictionary <string, object> args = null)
        {
            PersistModule module = new Services.PersistModule();

            api.RegisterModule(module);

            return(api);
        }
Exemplo n.º 4
0
        public void OpenTest()
        {
            Dictionary <string, object> arg = new Dictionary <string, object>();

            arg.Add("endpoint", "opc.tcp://aqib:51210/UA/SampleServer");

            IotApi api = new IotApi();

            api.RegisterModule(new OPCConnector());
            api.Open(arg);
            api.SendAsync("ffff").Wait();
        }
Exemplo n.º 5
0
        public MainPage()
        {
            this.InitializeComponent();
            Settings sett = new Settings(); //default setting

            m_Ccu.RegisterModule(new XmlRpc());

            Dictionary <string, object> agr = new Dictionary <string, object>()
            {
                { "Uri", "http://192.168.0.222:2001" }
            };

            m_Ccu.Open(agr);
        }
Exemplo n.º 6
0
        public void NodeWriteTest()
        {
            Dictionary <string, object> arg = new Dictionary <string, object>();

            arg.Add("endpoint", "opc.tcp://aqib:51210/UA/SampleServer");

            IotApi api = new IotApi();

            api.RegisterModule(new OPCConnector());
            api.Open(arg);


            var list = new List <MonitoredItem> {
                new MonitoredItem(new Subscription().DefaultItem)
                {
                    DisplayName = "ServerStatusCurrentTime", StartNodeId = "i=2267"
                }
            };

            api.SendAsync(list).Wait();
            //
        }
Exemplo n.º 7
0
        public static void RegisterTest()
        {
            IotApi api = new IotApi();

            api.RegisterModule(new MQTTSnConnector());

            Dictionary <string, object> agr = new Dictionary <string, object>();

            agr.Add("ip", "127.0.0.1");

            agr.Add("port", 100);

            api.Open(agr);

            MessageInterface.RegisterWrk register = new MessageInterface.RegisterWrk();
            register.register.topicId   = new byte[] { };
            register.register.topicName = ASCIIEncoding.ASCII.GetBytes("");
            register.register.messageId = ASCIIEncoding.ASCII.GetBytes(Convert.ToString(2).PadLeft(2, '0'));
            register.register.length    = Convert.ToByte(6 + "ff".Length);

            api.SendAsync(register);
        }