/// <summary> /// Raises the controller status changed event. /// </summary> /// <param name="args">Arguments.</param> protected virtual void OnControllerStatusChanged(ControllerStatusEventArgs args) { controllerStatus = args.Status; Utility.logger.Debug("{0}", controllerStatus); if (controllerStatus == ControllerStatus.Disconnected) { queuedMessages.Clear(); } if (ControllerStatusChanged != null) { ControllerStatusChanged(this, args); } }
static void Controller_ControllerStatusChanged(object sender, ControllerStatusEventArgs args) { Console.WriteLine("ControllerStatusChange {0}", args.Status); ToggleDebug(true); var controller = (sender as ZWaveController); controllerStatus = args.Status; switch (controllerStatus) { case ControllerStatus.Connected: // Initialize the controller and get the node list controller.Initialize(); break; case ControllerStatus.Disconnected: ShowMenu(); break; case ControllerStatus.Initializing: break; case ControllerStatus.Ready: // Query all nodes (Supported Classes, Routing Info, Node Information Frame, Manufacturer Specific) controller.Discovery(); ShowMenu(); break; case ControllerStatus.Error: Console.WriteLine("\nEnter [+] to try reconnect\n"); ShowMenu(); break; } ToggleDebug(false); }
/// <summary> /// Raises the controller status changed event. /// </summary> /// <param name="args">Arguments.</param> protected virtual void OnControllerStatusChanged(ControllerStatusEventArgs args) { controllerStatus = args.Status; Utility.logger.Debug("{0}", controllerStatus); if (controllerStatus == ControllerStatus.Disconnected) queuedMessages.Clear(); if (ControllerStatusChanged != null) ControllerStatusChanged(this, args); }
private void Controller_ControllerStatusChanged(object sender, ControllerStatusEventArgs args) { var controller = (sender as ZWaveController); switch (args.Status) { case ControllerStatus.Connected: // Initialize the controller and get the node list controller.Initialize(); break; case ControllerStatus.Disconnected: break; case ControllerStatus.Initializing: break; case ControllerStatus.Ready: // Query all nodes (Basic Classes, Node Information Frame, Manufacturer Specific[, Command Class version]) // Enabled by default if (this.GetOption("StartupDiscovery") == null || this.GetOption("StartupDiscovery").Value != "0") controller.Discovery(); break; case ControllerStatus.Error: controller.Connect(); break; } }
/* class USBDeviceInfo { public USBDeviceInfo(string deviceID, string pnpDeviceID, string description) { this.DeviceID = deviceID; this.PnpDeviceID = pnpDeviceID; this.Description = description; } public string DeviceID { get; private set; } public string PnpDeviceID { get; private set; } public string Description { get; private set; } } */ private void Controller_ControllerStatusChanged(object sender, ControllerStatusEventArgs args) { var controller = (sender as ZWaveController); switch (args.Status) { case ControllerStatus.Connected: // Initialize the controller and get the node list controller.Initialize(); break; case ControllerStatus.Disconnected: break; case ControllerStatus.Initializing: break; case ControllerStatus.Ready: // Query all nodes (Basic Classes, Node Information Frame, Manufacturer Specific, Command Class version) controller.Discovery(); break; case ControllerStatus.Error: controller.Connect(); break; } }