示例#1
0
 public Controller(ZWavePort zwavePort) : base(1, zwavePort)
 {
     zwavePort.ZWaveMessageReceived += new ZWavePort.ZWaveMessageReceivedEvent((object sender, ZWaveMessageReceivedEventArgs args) =>
     {
         try
         {
             ZwaveMessageReceived(sender, args);
         }
         catch (Exception ex)
         {
             Console.WriteLine("ZWaveLib: ERROR in _zwavemessagereceived(...) " + ex.Message + "\n" + ex.StackTrace);
         }
     });
     LoadNodesConfig();
 }
示例#2
0
 public Controller(ZWavePort zwavePort) : base(1, zwavePort)
 {
     zwavePort.ZWaveMessageReceived += new ZWavePort.ZWaveMessageReceivedEvent((object sender, ZWaveMessageReceivedEventArgs args) =>
     {
         try
         {
             ZwaveMessageReceived(sender, args);
         }
         catch (Exception ex)
         {
             Utility.DebugLog(DebugMessageType.Error, "Exception occurred in _zwavemessagereceived(...) " + ex.Message + "\n" + ex.StackTrace);
         }
     });
     LoadNodesConfig();
 }
示例#3
0
 public Controller(ZWavePort zwavePort)
     : base(1, zwavePort)
 {
     zwavePort.ZWaveMessageReceived += new ZWavePort.ZWaveMessageReceivedEvent((object sender, ZWaveMessageReceivedEventArgs args) =>
     {
         try
         {
             ZwaveMessageReceived(sender, args);
         }
         catch (Exception ex)
         {
             Utility.DebugLog(DebugMessageType.Error, "Exception occurred in _zwavemessagereceived(...) " + ex.Message + "\n" + ex.StackTrace);
         }
     });
     LoadNodesConfig();
 }
示例#4
0
 public Controller(ZWavePort zwavePort)
     : base(1, zwavePort)
 {
     zwavePort.ZWaveMessageReceived += new ZWavePort.ZWaveMessageReceivedEvent((object sender, ZWaveMessageReceivedEventArgs args) =>
     {
         try
         {
             ZwaveMessageReceived(sender, args);
         }
         catch (Exception ex)
         {
             Console.WriteLine("ZWaveLib: ERROR in _zwavemessagereceived(...) " + ex.Message + "\n" + ex.StackTrace);
         }
     });
     LoadNodesConfig();
 }
示例#5
0
 public ZWaveNode(byte nodeId, ZWavePort zport)
 {
     this.Id        = nodeId;
     this.zwavePort = zport;
 }
示例#6
0
 public ZWaveNode(byte nodeId, ZWavePort zp, byte genericType)
 {
     this.Id           = nodeId;
     this.zwavePort    = zp;
     this.GenericClass = genericType;
 }
示例#7
0
文件: ZWave.cs 项目: Qu3uk/HomeGenie
 private void LoadZwavePort()
 {
     if (zwavePort == null)
     {
         zwavePort = new ZWavePort();
         //
         controller = new Controller(zwavePort);
         //
         controller.ControllerEvent += DiscoveryEvent;
         controller.ParameterChanged += controller_ParameterChanged;
         controller.ManufacturerSpecificResponse += controller_ManufacturerSpecificResponse;
     }
     zwavePort.PortName = this.GetOption("Port").Value;
 }
示例#8
0
文件: ZWave.cs 项目: Qu3uk/HomeGenie
 // TODO: check if this is to be deprecated or relocated
 public void Dispose()
 {
     //_unloadZWavePort();
     try
     {
         controller.ControllerEvent -= DiscoveryEvent;
         controller.ParameterChanged -= controller_ParameterChanged;
         controller.ManufacturerSpecificResponse -= controller_ManufacturerSpecificResponse;
     }
     catch
     {
     }
     //
     try
     {
         zwavePort.Disconnect();
     }
     catch
     {
     }
     zwavePort = null;
     controller = null;
 }
示例#9
0
 public ZWaveNode(byte nodeId, ZWavePort zp, byte genericType)
 {
     this.Id = nodeId;
     this.zwavePort = zp;
     this.GenericClass = genericType;
 }
示例#10
0
 public ZWaveNode(byte nodeId, ZWavePort zport)
 {
     this.Id = nodeId;
     this.zwavePort = zport;
 }
示例#11
0
 private void LoadZwavePort()
 {
     if (zwavePort == null)
     {
         zwavePort = new ZWavePort();
         //
         controller = new Controller(zwavePort);
         //
         controller.DiscoveryEvent += DiscoveryEvent;
         controller.UpdateNodeParameter += controller_UpdateNodeParameter;
         controller.ManufacturerSpecificResponse += controller_ManufacturerSpecificResponse;
     }
     zwavePort.PortName = portName;
 }
示例#12
0
 public void Dispose()
 {
     //_unloadZWavePort();
     try
     {
         controller.DiscoveryEvent -= DiscoveryEvent;
         controller.UpdateNodeParameter -= controller_UpdateNodeParameter;
         controller.ManufacturerSpecificResponse -= controller_ManufacturerSpecificResponse;
     }
     catch
     {
     }
     //
     try
     {
         zwavePort.Disconnect();
     }
     catch
     {
     }
     zwavePort = null;
     controller = null;
 }