mirror of
https://github.com/PepperDash/PepperDashCore.git
synced 2026-02-15 04:34:46 +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)
|
if (DebugExpiryPeriod != null)
|
||||||
{
|
{
|
||||||
DisableDebugging();
|
DebugExpiryPeriod.Stop();
|
||||||
|
DebugExpiryPeriod.Dispose();
|
||||||
|
DebugExpiryPeriod = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RxStreamDebuggingIsEnabled = false;
|
||||||
|
TxStreamDebuggingIsEnabled = false;
|
||||||
|
|
||||||
DebugExpiryPeriod = new CTimer((o) => DisableDebugging(), _DebugTimeoutInMs);
|
DebugExpiryPeriod = new CTimer((o) => DisableDebugging(), _DebugTimeoutInMs);
|
||||||
|
|
||||||
if ((setting & eStreamDebuggingSetting.Rx) == eStreamDebuggingSetting.Rx)
|
if ((setting & eStreamDebuggingSetting.Rx) == eStreamDebuggingSetting.Rx)
|
||||||
@@ -92,7 +97,7 @@ namespace PepperDash.Core
|
|||||||
if ((setting & eStreamDebuggingSetting.Tx) == eStreamDebuggingSetting.Tx)
|
if ((setting & eStreamDebuggingSetting.Tx) == eStreamDebuggingSetting.Tx)
|
||||||
TxStreamDebuggingIsEnabled = true;
|
TxStreamDebuggingIsEnabled = true;
|
||||||
|
|
||||||
Debug.SetDeviceDebugSettings(ParentDeviceKey, setting);
|
Debug.SetDeviceDebugSettings(ParentDeviceKey, setting.ToString());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,14 +106,17 @@ namespace PepperDash.Core
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void DisableDebugging()
|
private void DisableDebugging()
|
||||||
{
|
{
|
||||||
DebugExpiryPeriod.Stop();
|
if (DebugExpiryPeriod != null)
|
||||||
DebugExpiryPeriod.Dispose();
|
{
|
||||||
DebugExpiryPeriod = null;
|
DebugExpiryPeriod.Stop();
|
||||||
|
DebugExpiryPeriod.Dispose();
|
||||||
|
DebugExpiryPeriod = null;
|
||||||
|
}
|
||||||
|
|
||||||
RxStreamDebuggingIsEnabled = false;
|
RxStreamDebuggingIsEnabled = false;
|
||||||
TxStreamDebuggingIsEnabled = false;
|
TxStreamDebuggingIsEnabled = false;
|
||||||
|
|
||||||
Debug.SetDeviceDebugSettings(ParentDeviceKey, eStreamDebuggingSetting.Off);
|
Debug.SetDeviceDebugSettings(ParentDeviceKey, eStreamDebuggingSetting.Off.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,11 +68,9 @@ namespace PepperDash.Core.DebugThings
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public void SetDebugSettingsForKey(string deviceKey, object settings)
|
public void SetDebugSettingsForKey(string deviceKey, object settings)
|
||||||
{
|
{
|
||||||
var existingSettings = DeviceDebugSettings[deviceKey];
|
if(DeviceDebugSettings.ContainsKey(deviceKey))
|
||||||
|
|
||||||
if (existingSettings != null)
|
|
||||||
{
|
{
|
||||||
existingSettings = settings;
|
DeviceDebugSettings[deviceKey] = settings;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
DeviceDebugSettings.Add(deviceKey, settings);
|
DeviceDebugSettings.Add(deviceKey, settings);
|
||||||
|
|||||||
Reference in New Issue
Block a user