Exemple #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();
 }
Exemple #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();
 }
Exemple #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();
 }
Exemple #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();
 }
Exemple #5
0
 public ZWaveNode(byte nodeId, ZWavePort zport)
 {
     this.Id        = nodeId;
     this.zwavePort = zport;
 }
Exemple #6
0
 public ZWaveNode(byte nodeId, ZWavePort zp, byte genericType)
 {
     this.Id           = nodeId;
     this.zwavePort    = zp;
     this.GenericClass = genericType;
 }
Exemple #7
0
 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;
 }
Exemple #8
0
 // 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;
 }
Exemple #9
0
 public ZWaveNode(byte nodeId, ZWavePort zp, byte genericType)
 {
     this.Id = nodeId;
     this.zwavePort = zp;
     this.GenericClass = genericType;
 }
Exemple #10
0
 public ZWaveNode(byte nodeId, ZWavePort zport)
 {
     this.Id = nodeId;
     this.zwavePort = zport;
 }
Exemple #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;
 }
Exemple #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;
 }