mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-07-02 10:38:16 +00:00
fix: register ComPort shutdown hook after initialization
This commit is contained in:
parent
cd8bfcfbdc
commit
d4f1fecc64
1 changed files with 3 additions and 3 deletions
|
|
@ -52,7 +52,6 @@ namespace PepperDash.Essentials.Core
|
||||||
ComPort.ComPortSpec spec, EssentialsControlPropertiesConfig config) : base(key)
|
ComPort.ComPortSpec spec, EssentialsControlPropertiesConfig config) : base(key)
|
||||||
{
|
{
|
||||||
StreamDebugging = new CommunicationStreamDebugging(key);
|
StreamDebugging = new CommunicationStreamDebugging(key);
|
||||||
CrestronEnvironment.ProgramStatusEventHandler += CrestronEnvironment_ProgramStatusEventHandler;
|
|
||||||
|
|
||||||
Spec = spec;
|
Spec = spec;
|
||||||
|
|
||||||
|
|
@ -62,6 +61,8 @@ namespace PepperDash.Essentials.Core
|
||||||
|
|
||||||
RegisterAndConfigureComPort();
|
RegisterAndConfigureComPort();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
CrestronEnvironment.ProgramStatusEventHandler += CrestronEnvironment_ProgramStatusEventHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -73,8 +74,6 @@ namespace PepperDash.Essentials.Core
|
||||||
public ComPortController(string key, ComPort port, ComPort.ComPortSpec spec)
|
public ComPortController(string key, ComPort port, ComPort.ComPortSpec spec)
|
||||||
: base(key)
|
: base(key)
|
||||||
{
|
{
|
||||||
CrestronEnvironment.ProgramStatusEventHandler += CrestronEnvironment_ProgramStatusEventHandler;
|
|
||||||
|
|
||||||
if (port == null)
|
if (port == null)
|
||||||
{
|
{
|
||||||
Debug.LogMessage(LogEventLevel.Information, this, "ERROR: Invalid com port, continuing but comms will not function");
|
Debug.LogMessage(LogEventLevel.Information, this, "ERROR: Invalid com port, continuing but comms will not function");
|
||||||
|
|
@ -86,6 +85,7 @@ namespace PepperDash.Essentials.Core
|
||||||
//IsConnected = new BoolFeedback(CommonBoolCue.IsConnected, () => true);
|
//IsConnected = new BoolFeedback(CommonBoolCue.IsConnected, () => true);
|
||||||
|
|
||||||
RegisterAndConfigureComPort();
|
RegisterAndConfigureComPort();
|
||||||
|
CrestronEnvironment.ProgramStatusEventHandler += CrestronEnvironment_ProgramStatusEventHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RegisterAndConfigureComPort()
|
private void RegisterAndConfigureComPort()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue