mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 21:24:54 +00:00
moves Port registration for controller ports to ConfigureComPort
...and renames method to RegisterAndConfigureComPort
This commit is contained in:
@@ -47,22 +47,24 @@ namespace PepperDash.Essentials.Core
|
|||||||
Spec = spec;
|
Spec = spec;
|
||||||
//IsConnected = new BoolFeedback(CommonBoolCue.IsConnected, () => true);
|
//IsConnected = new BoolFeedback(CommonBoolCue.IsConnected, () => true);
|
||||||
|
|
||||||
if (Port.Parent is CrestronControlSystem)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
var result = Port.Register();
|
|
||||||
if (result != eDeviceRegistrationUnRegistrationResponse.Success)
|
|
||||||
{
|
|
||||||
Debug.Console(0, this, "ERROR: Cannot register Com port: {0}", result);
|
|
||||||
return; // false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ConfigureComPort();
|
ConfigureComPort();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ConfigureComPort()
|
private void ConfigureComPort()
|
||||||
{
|
{
|
||||||
|
if (Port.Parent is CrestronControlSystem)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
var result = Port.Register();
|
||||||
|
if (result != eDeviceRegistrationUnRegistrationResponse.Success)
|
||||||
|
{
|
||||||
|
Debug.Console(0, this, "ERROR: Cannot register Com port: {0}", result);
|
||||||
|
return; // false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var specResult = Port.SetComPortSpec(Spec);
|
var specResult = Port.SetComPortSpec(Spec);
|
||||||
if (specResult != 0)
|
if (specResult != 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user