示例#1
0
        private void Listen(object obj)
        {
            ThreadHelper th = (ThreadHelper)obj;

            while (true)
            {
                callback_p cback = GPIOManager.start_polling((int)th.Pin);
                th.Callback((uint)cback.pin, (uint)0, DateTime.Now);
            }
        }
示例#2
0
        private void Listen(object obj)
        {
            ThreadHelper th = (ThreadHelper)obj;

            while (true)
            {
                callback_p cback = GPIOManager.start_polling((int)th.Pin);

                DateTime dt = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc).AddMilliseconds(cback.poll_time * 1000);
                th.Callback((uint)cback.pin, (uint)0, dt);
            }
        }
示例#3
0
        private void Listen(object obj)
        {
            ThreadHelper th = (ThreadHelper)obj;

            while (true)
            {
                //Console.WriteLine("Pin: {0}", (int)th.Pin);
                int pin = (int)th.Pin;
                //callback_p cback = GPIOManager.start_polling(pin);
                ulong cback = GPIOManager.start_polling(pin);
                //DateTime dt = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc).AddMilliseconds(cback.poll_time * 1000);
                th.Callback(4, (uint)0, DateTime.Now);
            }
        }
示例#4
0
        private void ListenInterruptions(object obj)
        {
            ThreadHelper th = (ThreadHelper)obj;

            //Console.WriteLine ("Start Listen Interruptions");
            while (true)
            {
                int   pin   = (int)th.Pin;
                ulong cback = GPIOManager.start_polling(pin);
                //Console.WriteLine("INTERRUPT!");
                if (isEnabled)
                {
                    th.Callback(4, (uint)0, DateTime.Now);
                }
            }
        }