Exemple #1
0
        public HAInterface(BasicInterface iface)
        {
            _interface    = iface;
            _receivedData = new ConcurrentQueue <string>();
            _outgoingCommandQueueDetail = new Dictionary <Guid, CommandQueueDetail>();
            _OnCommandList  = new List <Tuple <string, OnCommandCallBack> >();
            _OnCommandListA = new List <Tuple <string, Action <Command> > >();

            if (_interface != null)
            {
                _interface.DataReceived += _DataReceived;
            }
            Log("Initialized");
            _taskDispatch = Task.Factory.StartNew(() => {
                try
                {
                    Dispatch();
                }
                catch (Exception ex)
                {
                    Log(ex);
                }
            }
                                                  );
        }
Exemple #2
0
 public void SetUp()
 {
     _data   = null;
     _action = null;
     _t      = new Netomity.Interfaces.Basic.Fakes.StubBasicInterface()
     {
         SendString        = (data) => { _data = data; },
         DataReceivedEvent = (ev) => { _t._DataReceived(ev); },
     };
     _ha = new Netomity.Interfaces.HA.Fakes.StubHAInterface(iface: _t)
     {
         CommandCommand = (command) => { _command = command; return(new Task <bool>(() => { return true; })); },
         OnCommandStringActionOfCommand = (address, action) => {
             _action = action;
         }
     };
     _sd = new StateDevice(iface: _ha, address: _address);
 }
Exemple #3
0
        public void SetUp()
        {
            _data = null;
            _t    = new Netomity.Interfaces.Basic.Fakes.StubBasicInterface()
            {
                SendString        = (data) => { _data = data; },
                DataReceivedEvent = (ev) => { _t._DataReceived(ev); },
            };

            _ha = new HAInterface(iface: _t);
            _sp = new SendParams()
            {
                SendData        = "asdf",
                SuccessResponse = "asdfgood",
                FailureResponse = "asdfbad",
                Timeout         = 1,
            };
        }
Exemple #4
0
        public void SetUp()
        {
            var logger = new Netomity.Core.Fakes.StubLogger();

            _intA = new Netomity.Interfaces.Basic.Fakes.StubBasicInterface()
            {
                Open01 = () =>
                {
                    _intAOpen = true;
                    return(Task.Factory.StartNew(() => {}));
                },
                IsOpenGet = () => { return(_intAOpen); },
            };
            _intB = new Netomity.Interfaces.Basic.Fakes.StubBasicInterface()
            {
                Open01 = () =>
                {
                    _intBOpen = true;
                    return(Task.Factory.StartNew(() => {}));
                },
                IsOpenGet = () => { return(_intBOpen); },
            };
            _bc = new BasicConnector(_intA, _intB);
        }
Exemple #5
0
 public Insteon(BasicInterface iface)
     : base(iface: iface)
 {
 }
Exemple #6
0
 public W800(BasicInterface iface)
     : base(iface: iface)
 {
 }