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(); }
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(); }
public ZWaveNode(byte nodeId, ZWavePort zport) { this.Id = nodeId; this.zwavePort = zport; }
public ZWaveNode(byte nodeId, ZWavePort zp, byte genericType) { this.Id = nodeId; this.zwavePort = zp; this.GenericClass = genericType; }
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; }
// 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; }
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; }
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; }