From dd0f7a586e8f04806643db079637b2bdbdb0d143 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Fri, 2 Apr 2021 09:03:39 -0600 Subject: [PATCH 1/3] fix Console statement and add help --- .../PepperDashEssentialsBase/Devices/DeviceManager.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DeviceManager.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DeviceManager.cs index 55bc523a..cb8c89db 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DeviceManager.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DeviceManager.cs @@ -387,6 +387,15 @@ namespace PepperDash.Essentials.Core /// public static void SetDeviceStreamDebugging(string s) { + if (String.IsNullOrEmpty(s) || s.Contains("?")) + { + Debug.Console(0, + @"SETDEVICESTREAMDEBUG [{deviceKey}] [OFF |TX | RX | BOTH] [timeOutInMinutes] + {deviceKey} [OFF | TX | RX | BOTH] - Device to set stream debugging on, and which setting to use + timeOutInMinutes - Set timeout for stream debugging. Default is 30 minutes"); + return; + } + var args = s.Split(' '); var deviceKey = args[0]; @@ -437,7 +446,7 @@ namespace PepperDash.Essentials.Core else { device.StreamDebugging.SetDebuggingWithDefaultTimeout(debugSetting); - Debug.Console(0, "Device: '{0}' debug level set to {1) for default time (30 minutes)", deviceKey, debugSetting); + Debug.Console(0, "Device: '{0}' debug level set to {1} for default time (30 minutes)", deviceKey, debugSetting); } } From 252d0373802814c663c9ae1125d5bac53a6571f5 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Fri, 2 Apr 2021 09:09:13 -0600 Subject: [PATCH 2/3] change to method signature instead of lambda --- .../PepperDashEssentialsBase/Devices/DeviceManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DeviceManager.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DeviceManager.cs index cb8c89db..b8e20e9b 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DeviceManager.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DeviceManager.cs @@ -46,7 +46,7 @@ namespace PepperDash.Essentials.Core CrestronConsole.AddNewConsoleCommand(SimulateComReceiveOnDevice, "devsimreceive", "Simulates incoming data on a com device", ConsoleAccessLevelEnum.AccessOperator); - CrestronConsole.AddNewConsoleCommand(s => SetDeviceStreamDebugging(s), "setdevicestreamdebug", "set comm debug [deviceKey] [off/rx/tx/both] ([minutes])", ConsoleAccessLevelEnum.AccessOperator); + CrestronConsole.AddNewConsoleCommand(SetDeviceStreamDebugging, "setdevicestreamdebug", "set comm debug [deviceKey] [off/rx/tx/both] ([minutes])", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(s => DisableAllDeviceStreamDebugging(), "disableallstreamdebug", "disables stream debugging on all devices", ConsoleAccessLevelEnum.AccessOperator); } From e832566168aa59a7bfcf5051b42c4319cef5638b Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Fri, 2 Apr 2021 09:44:02 -0600 Subject: [PATCH 3/3] change to CrestronConsole.ConsoleCommandResponse for help text --- .../PepperDashEssentialsBase/Devices/DeviceManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DeviceManager.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DeviceManager.cs index b8e20e9b..cca16ec7 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DeviceManager.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Devices/DeviceManager.cs @@ -389,7 +389,7 @@ namespace PepperDash.Essentials.Core { if (String.IsNullOrEmpty(s) || s.Contains("?")) { - Debug.Console(0, + CrestronConsole.ConsoleCommandResponse( @"SETDEVICESTREAMDEBUG [{deviceKey}] [OFF |TX | RX | BOTH] [timeOutInMinutes] {deviceKey} [OFF | TX | RX | BOTH] - Device to set stream debugging on, and which setting to use timeOutInMinutes - Set timeout for stream debugging. Default is 30 minutes");