mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-11 19:44:52 +00:00
fix: enhance COM port registration logging and update GenericSink class for input switching
This commit is contained in:
@@ -91,6 +91,9 @@ namespace PepperDash.Essentials.Core
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (Port.Parent is CrestronControlSystem || Port.Parent is CenIoCom102)
|
||||||
|
{
|
||||||
var result = Port.Register();
|
var result = Port.Register();
|
||||||
if (result != eDeviceRegistrationUnRegistrationResponse.Success)
|
if (result != eDeviceRegistrationUnRegistrationResponse.Success)
|
||||||
{
|
{
|
||||||
@@ -98,6 +101,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.LogInformation($"Successfully registered {Key} using {Port.Parent.GetType().Name}-comport-{Port.ID} (result == {result})");
|
this.LogInformation($"Successfully registered {Key} using {Port.Parent.GetType().Name}-comport-{Port.ID} (result == {result})");
|
||||||
|
}
|
||||||
|
|
||||||
var specResult = Port.SetComPortSpec(Spec);
|
var specResult = Port.SetComPortSpec(Spec);
|
||||||
if (specResult != 0)
|
if (specResult != 0)
|
||||||
@@ -107,38 +111,6 @@ namespace PepperDash.Essentials.Core
|
|||||||
}
|
}
|
||||||
this.LogInformation($"Successfully set comspec for {Key} using {Port.Parent.GetType().Name}-comport-{Port.ID} (result == {specResult})");
|
this.LogInformation($"Successfully set comspec for {Key} using {Port.Parent.GetType().Name}-comport-{Port.ID} (result == {specResult})");
|
||||||
|
|
||||||
|
|
||||||
// TODO [ ] - Remove debug logging once verified working
|
|
||||||
// if (Port.Parent is CenIoCom102)
|
|
||||||
// {
|
|
||||||
// Port.PropertyChanged += (s, e) =>
|
|
||||||
// {
|
|
||||||
// this.LogInformation($@"RegisterAndConfigureComPort: PropertyChanged Fired >>
|
|
||||||
// comPort-'{Port.ID}',
|
|
||||||
// Property Changed-'{e.Property}',
|
|
||||||
// Value Changed-'{e.Value}',
|
|
||||||
// deviceName-'{Port.DeviceName}',
|
|
||||||
// parentDevice-'{Port.ParentDevice}',
|
|
||||||
// parent-`{Port.Parent}`,
|
|
||||||
// online-`{Port.IsOnline}`,
|
|
||||||
// present-`{Port.Present}`,
|
|
||||||
// supportedBaudRates-'{Port.SupportedBaudRates}'");
|
|
||||||
// };
|
|
||||||
// Port.ExtendedInformationChanged += (s, e) =>
|
|
||||||
// {
|
|
||||||
|
|
||||||
// this.LogInformation($@"RegisterAndConfigureComPort: ExtendedInformationChanged Fired >>
|
|
||||||
// comPort-'{Port.ID}',
|
|
||||||
// {e.Protocol},
|
|
||||||
// {e.BaudRate},
|
|
||||||
// {e.Parity},
|
|
||||||
// {e.DataBits},
|
|
||||||
// {e.StopBits},
|
|
||||||
// HW Handshake-'{e.HardwareHandshakeSetting}',
|
|
||||||
// SW Handshake-'{e.SoftwareHandshakeSetting}'");
|
|
||||||
// };
|
|
||||||
// }
|
|
||||||
|
|
||||||
Port.SerialDataReceived += Port_SerialDataReceived;
|
Port.SerialDataReceived += Port_SerialDataReceived;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ namespace PepperDash.Essentials.Core.Routing
|
|||||||
/// <param name="inputPort">The currently selected input port on the destination device.</param>
|
/// <param name="inputPort">The currently selected input port on the destination device.</param>
|
||||||
private void UpdateDestination(IRoutingSinkWithSwitching destination, RoutingInputPort inputPort)
|
private void UpdateDestination(IRoutingSinkWithSwitching destination, RoutingInputPort inputPort)
|
||||||
{
|
{
|
||||||
// Debug.LogMessage(Serilog.Events.LogEventLevel.Verbose, "Updating destination {destination} with inputPort {inputPort}", this,destination?.Key, inputPort?.Key);
|
Debug.LogMessage(Serilog.Events.LogEventLevel.Verbose, "Updating destination {destination} with inputPort {inputPort}", this, destination?.Key, inputPort?.Key);
|
||||||
|
|
||||||
if(inputPort == null)
|
if(inputPort == null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace PepperDash.Essentials.Devices.Common.Generic
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a GenericSink
|
/// Represents a GenericSink
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class GenericSink : EssentialsDevice, IRoutingSinkWithInputPort
|
public class GenericSink : EssentialsDevice, IRoutingSinkWithSwitchingWithInputPort
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the GenericSink class
|
/// Initializes a new instance of the GenericSink class
|
||||||
@@ -20,7 +20,7 @@ namespace PepperDash.Essentials.Devices.Common.Generic
|
|||||||
{
|
{
|
||||||
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
||||||
|
|
||||||
var inputPort = new RoutingInputPort(RoutingPortNames.AnyVideoIn, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, null, this);
|
var inputPort = new RoutingInputPort(RoutingPortNames.AnyVideoIn, eRoutingSignalType.AudioVideo | eRoutingSignalType.SecondaryAudio, eRoutingPortConnectionType.Hdmi, null, this);
|
||||||
|
|
||||||
InputPorts.Add(inputPort);
|
InputPorts.Add(inputPort);
|
||||||
}
|
}
|
||||||
@@ -66,6 +66,15 @@ namespace PepperDash.Essentials.Devices.Common.Generic
|
|||||||
/// Event fired when the current source changes
|
/// Event fired when the current source changes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public event SourceInfoChangeHandler CurrentSourceChange;
|
public event SourceInfoChangeHandler CurrentSourceChange;
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public event InputChangedEventHandler InputChanged;
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public void ExecuteSwitch(object inputSelector)
|
||||||
|
{
|
||||||
|
throw new System.NotImplementedException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user