mirror of
https://github.com/PepperDash/PepperDashCore.git
synced 2026-02-04 23:34:51 +00:00
Fixes some exceptions when setting stream debugging mode. Changes stream debugging to clear both rx and tx flags before setting mode again.
This commit is contained in:
@@ -81,9 +81,14 @@ namespace PepperDash.Core
|
||||
|
||||
if (DebugExpiryPeriod != null)
|
||||
{
|
||||
DisableDebugging();
|
||||
DebugExpiryPeriod.Stop();
|
||||
DebugExpiryPeriod.Dispose();
|
||||
DebugExpiryPeriod = null;
|
||||
}
|
||||
|
||||
RxStreamDebuggingIsEnabled = false;
|
||||
TxStreamDebuggingIsEnabled = false;
|
||||
|
||||
DebugExpiryPeriod = new CTimer((o) => DisableDebugging(), _DebugTimeoutInMs);
|
||||
|
||||
if ((setting & eStreamDebuggingSetting.Rx) == eStreamDebuggingSetting.Rx)
|
||||
@@ -92,7 +97,7 @@ namespace PepperDash.Core
|
||||
if ((setting & eStreamDebuggingSetting.Tx) == eStreamDebuggingSetting.Tx)
|
||||
TxStreamDebuggingIsEnabled = true;
|
||||
|
||||
Debug.SetDeviceDebugSettings(ParentDeviceKey, setting);
|
||||
Debug.SetDeviceDebugSettings(ParentDeviceKey, setting.ToString());
|
||||
|
||||
}
|
||||
|
||||
@@ -101,14 +106,17 @@ namespace PepperDash.Core
|
||||
/// </summary>
|
||||
private void DisableDebugging()
|
||||
{
|
||||
DebugExpiryPeriod.Stop();
|
||||
DebugExpiryPeriod.Dispose();
|
||||
DebugExpiryPeriod = null;
|
||||
if (DebugExpiryPeriod != null)
|
||||
{
|
||||
DebugExpiryPeriod.Stop();
|
||||
DebugExpiryPeriod.Dispose();
|
||||
DebugExpiryPeriod = null;
|
||||
}
|
||||
|
||||
RxStreamDebuggingIsEnabled = false;
|
||||
TxStreamDebuggingIsEnabled = false;
|
||||
|
||||
Debug.SetDeviceDebugSettings(ParentDeviceKey, eStreamDebuggingSetting.Off);
|
||||
Debug.SetDeviceDebugSettings(ParentDeviceKey, eStreamDebuggingSetting.Off.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -68,11 +68,9 @@ namespace PepperDash.Core.DebugThings
|
||||
/// <returns></returns>
|
||||
public void SetDebugSettingsForKey(string deviceKey, object settings)
|
||||
{
|
||||
var existingSettings = DeviceDebugSettings[deviceKey];
|
||||
|
||||
if (existingSettings != null)
|
||||
if(DeviceDebugSettings.ContainsKey(deviceKey))
|
||||
{
|
||||
existingSettings = settings;
|
||||
DeviceDebugSettings[deviceKey] = settings;
|
||||
}
|
||||
else
|
||||
DeviceDebugSettings.Add(deviceKey, settings);
|
||||
|
||||
Reference in New Issue
Block a user