mirror of
https://github.com/PepperDash/PepperDashCore.git
synced 2026-02-16 05:04:48 +00:00
Merge pull request #66 from PepperDash/bugfix/stream-debugging-fixes
Fixes some exceptions when setting stream debugging mode
This commit is contained in:
@@ -79,10 +79,7 @@ namespace PepperDash.Core
|
|||||||
|
|
||||||
_DebugTimeoutInMs = minutes * 60000;
|
_DebugTimeoutInMs = minutes * 60000;
|
||||||
|
|
||||||
if (DebugExpiryPeriod != null)
|
StopDebugTimer();
|
||||||
{
|
|
||||||
DisableDebugging();
|
|
||||||
}
|
|
||||||
|
|
||||||
DebugExpiryPeriod = new CTimer((o) => DisableDebugging(), _DebugTimeoutInMs);
|
DebugExpiryPeriod = new CTimer((o) => DisableDebugging(), _DebugTimeoutInMs);
|
||||||
|
|
||||||
@@ -101,14 +98,24 @@ namespace PepperDash.Core
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void DisableDebugging()
|
private void DisableDebugging()
|
||||||
{
|
{
|
||||||
DebugExpiryPeriod.Stop();
|
StopDebugTimer();
|
||||||
DebugExpiryPeriod.Dispose();
|
|
||||||
DebugExpiryPeriod = null;
|
|
||||||
|
|
||||||
|
Debug.SetDeviceDebugSettings(ParentDeviceKey, eStreamDebuggingSetting.Off);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void StopDebugTimer()
|
||||||
|
{
|
||||||
RxStreamDebuggingIsEnabled = false;
|
RxStreamDebuggingIsEnabled = false;
|
||||||
TxStreamDebuggingIsEnabled = false;
|
TxStreamDebuggingIsEnabled = false;
|
||||||
|
|
||||||
Debug.SetDeviceDebugSettings(ParentDeviceKey, eStreamDebuggingSetting.Off);
|
if (DebugExpiryPeriod == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
DebugExpiryPeriod.Stop();
|
||||||
|
DebugExpiryPeriod.Dispose();
|
||||||
|
DebugExpiryPeriod = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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