mirror of
https://github.com/PepperDash/PepperDashCore.git
synced 2026-04-12 03:57:08 +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:
parent
0453546d13
commit
3d7bc32b8a
2 changed files with 16 additions and 10 deletions
|
|
@ -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());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -100,15 +105,18 @@ namespace PepperDash.Core
|
||||||
/// Disabled debugging
|
/// Disabled debugging
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void DisableDebugging()
|
private void DisableDebugging()
|
||||||
|
{
|
||||||
|
if (DebugExpiryPeriod != null)
|
||||||
{
|
{
|
||||||
DebugExpiryPeriod.Stop();
|
DebugExpiryPeriod.Stop();
|
||||||
DebugExpiryPeriod.Dispose();
|
DebugExpiryPeriod.Dispose();
|
||||||
DebugExpiryPeriod = null;
|
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);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue