Compare commits

...

29 Commits

Author SHA1 Message Date
Trevor Payne
fbba6e089a Merge branch 'development' into feature/GenericHttpClientOptions 2023-07-04 23:56:27 -05:00
Trevor Payne
cef78c881e feature: Add Additional Options for Generic Http Client
Feature: Add constructor to set client options

feature: Add overloaded methods to set Request Types for Client Requests
2023-06-29 09:51:33 -05:00
Andrew Welker
e1ce35863f Merge pull request #1109 from PepperDash/release/1.14.0
Release/1.14.0
2023-06-07 10:11:49 -06:00
Andrew Welker
acd3bad1f2 Merge pull request #1108 from PepperDash/release/1.14.0
1.14.0
2023-06-07 09:54:34 -06:00
Andrew Welker
08514915b2 Merge branch 'main' into release/1.14.0 2023-05-09 10:22:08 -06:00
Andrew Welker
ea464038b9 Merge pull request #1106 from PepperDash/hotfix/remove-old-workflow
Hotfix/remove old workflow
2023-04-27 13:13:37 -06:00
Andrew Welker
c4c44d02f5 Merge branch 'development' into hotfix/remove-old-workflow 2023-04-27 12:54:18 -06:00
Andrew Welker
3fe5d89904 Merge pull request #1105 from PepperDash/hotfix/remove-old-workflow
Delete add-issues-to-project.yml
2023-04-27 12:54:08 -06:00
Jason T Alborough
c0d78e8978 Delete add-issues-to-project.yml 2023-04-27 13:59:36 -04:00
Neil Dorin
3716dd0824 Merge pull request #1104 from PepperDash/hotfix/dm-build-issues
Enable DM TX/RX builds for blade chassis DEV
2023-04-27 10:22:15 -06:00
Andrew Welker
ebe8ee5653 Merge branch 'development' into hotfix/dm-build-issues 2023-04-27 09:55:26 -06:00
Andrew Welker
432934ad00 Merge pull request #1103 from PepperDash/hotfix/dm-build-issues
Enable DM TX/RX builds for blade chassis
2023-04-27 09:55:08 -06:00
Andrew Welker
372cf86613 Merge pull request #1100 from PepperDash/feature/IHasBatteryStats
Add Interfaces for Battery Status Tracking
2023-04-27 09:51:15 -06:00
Andrew Welker
67c99a9ad4 Merge branch 'development' into feature/IHasBatteryStats 2023-04-27 09:26:56 -06:00
Andrew Welker
31085d42a9 Merge pull request #1099 from PepperDash/hotfix/DisplayPortHdcp
Resolve Issues with HDCP Displayport
2023-04-27 09:26:41 -06:00
Andrew Welker
0df315426b fix: use new interface for parentDev
The GetDmRmcController & GetDmTxController methods were
previously ignoring the `DmBladeChassisController` type.
This was causing transmitters connected to a DM blade chassis to
not be built,
2023-04-26 13:32:49 -06:00
Andrew Welker
6ddbdd90c7 feat: add new interface and update Chassis controllers 2023-04-26 13:32:18 -06:00
Andrew Welker
39e1e5167b Merge branch 'development' into hotfix/DisplayPortHdcp 2023-04-20 11:51:21 -06:00
Trevor Payne
7f916d1d2f refactor: change IHasPowerCycleWithBatteries to IHasPowerCycleWithBattery for clarity 2023-04-20 12:31:50 -05:00
Trevor Payne
7c7f087898 feature: added additional parameters to IHasPowerCycleWithBatteries 2023-04-20 12:29:34 -05:00
Trevor Payne
898dab1d9a feature: add several interfaces for battery status on devices
refactor: mark existing PDU interfaces in PepperDash_Essentials_Core.Devices as obsolete

refactor: replicate existing PDU interfaces in PepperDash.Essentials.Core
2023-04-20 12:21:45 -05:00
Andrew Welker
b221d2f0cb Merge pull request #1098 from PepperDash/hotfix/DisplayPortHdcp
Resolve Issues with HDCP Displayport
2023-04-19 08:20:02 -06:00
Trevor Payne
9656269826 fix: resolve issue where displayport hdcp event not registered properly
fix: resolve issue where feedback from Displayport HDCP capability was improperly named
2023-04-17 22:27:56 -05:00
Trevor Payne
ba182c1d98 Merge pull request #1094 from PepperDash/hotfix/ConsoleCommandFixes
Fix Console Response Line Errors
2023-04-14 14:08:02 -05:00
Andrew Welker
2460290dc1 Merge branch 'main' into hotfix/ConsoleCommandFixes 2023-04-14 12:39:29 -06:00
Andrew Welker
0b01661196 Merge pull request #1093 from PepperDash/hotfix/rmcEnhancements
Enhance Endpoint HDCP Functionality
2023-04-14 12:35:27 -06:00
Trevor Payne
dfa55ab9f8 fix: update console responses to properly use explicit NewLine characters
fix: Resolve #1084
2023-04-14 12:18:06 -05:00
Trevor Payne
55ad92e2f6 feature: enhance 4K DM Endpoint HDCP functionality
feature: add bridge join to report number of HDCP inputs

feature: Resolve #1088

feature: Resolve #1089
2023-04-14 11:41:32 -05:00
Andrew Welker
8965752025 Merge pull request #1085 from PepperDash/hotfix/pd-core-update-ssh-issues
Update PD Core to 1.2.1
2023-04-07 11:37:20 -06:00
25 changed files with 1604 additions and 1073 deletions

View File

@@ -1,37 +0,0 @@
name: Add bugs to bugs project
on:
issues:
types:
- opened
- labeled
jobs:
check-secret:
runs-on: ubuntu-latest
outputs:
my-key: ${{ steps.my-key.outputs.defined }}
steps:
- id: my-key
if: "${{ env.MY_KEY != '' }}"
run: echo "::set-output name=defined::true"
env:
MY_KEY: ${{ secrets.PROJECT_URL }}
throw-error:
name: Check
runs-on: ubuntu-latest
needs: [check-secret]
if: needs.check-secret.outputs.my-key != 'true'
steps:
- run: echo "The Project URL Repo Secret is empty"
add-to-project:
name: Add issue to project
runs-on: ubuntu-latest
needs: [check-secret]
if: needs.check-secret.outputs.my-key == 'true'
steps:
- uses: actions/add-to-project@main
with:
project-url: ${{ secrets.PROJECT_URL }}
github-token: ${{ secrets.GH_PROJECTS_PASSWORD }}

View File

@@ -93,25 +93,26 @@ namespace PepperDash.Essentials
CrestronConsole.AddNewConsoleCommand(s => CrestronConsole.AddNewConsoleCommand(s =>
{ {
foreach (var tl in TieLineCollection.Default) foreach (var tl in TieLineCollection.Default)
CrestronConsole.ConsoleCommandResponse(" {0}\r\n", tl); CrestronConsole.ConsoleCommandResponse(" {0}{1}", tl, CrestronEnvironment.NewLine);
}, },
"listtielines", "Prints out all tie lines", ConsoleAccessLevelEnum.AccessOperator); "listtielines", "Prints out all tie lines", ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(s => CrestronConsole.AddNewConsoleCommand(s =>
{ {
CrestronConsole.ConsoleCommandResponse CrestronConsole.ConsoleCommandResponse
("Current running configuration. This is the merged system and template configuration"); ("Current running configuration. This is the merged system and template configuration" + CrestronEnvironment.NewLine);
CrestronConsole.ConsoleCommandResponse(Newtonsoft.Json.JsonConvert.SerializeObject CrestronConsole.ConsoleCommandResponse(Newtonsoft.Json.JsonConvert.SerializeObject
(ConfigReader.ConfigObject, Newtonsoft.Json.Formatting.Indented)); (ConfigReader.ConfigObject, Newtonsoft.Json.Formatting.Indented));
}, "showconfig", "Shows the current running merged config", ConsoleAccessLevelEnum.AccessOperator); }, "showconfig", "Shows the current running merged config", ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(s => CrestronConsole.AddNewConsoleCommand(s =>
CrestronConsole.ConsoleCommandResponse( CrestronConsole.ConsoleCommandResponse(
"This system can be found at the following URLs:\r\n" + "This system can be found at the following URLs:{2}" +
"System URL: {0}\r\n" + "System URL: {0}{2}" +
"Template URL: {1}", "Template URL: {1}{2}",
ConfigReader.ConfigObject.SystemUrl, ConfigReader.ConfigObject.SystemUrl,
ConfigReader.ConfigObject.TemplateUrl), ConfigReader.ConfigObject.TemplateUrl,
CrestronEnvironment.NewLine),
"portalinfo", "portalinfo",
"Shows portal URLS from configuration", "Shows portal URLS from configuration",
ConsoleAccessLevelEnum.AccessOperator); ConsoleAccessLevelEnum.AccessOperator);

View File

@@ -165,7 +165,7 @@ namespace PepperDash.Essentials.Core.Bridges
Debug.Console(1, this, "Linking Device: '{0}'", device.Key); Debug.Console(1, this, "Linking Device: '{0}'", device.Key);
if (!typeof (IBridgeAdvanced).IsAssignableFrom(device.GetType().GetCType())) if (!typeof(IBridgeAdvanced).IsAssignableFrom(device.GetType().GetCType()))
{ {
Debug.Console(0, this, Debug.ErrorLogLevel.Notice, Debug.Console(0, this, Debug.ErrorLogLevel.Notice,
"{0} is not compatible with this bridge type. Please use 'eiscapi' instead, or updae the device.", "{0} is not compatible with this bridge type. Please use 'eiscapi' instead, or updae the device.",

View File

@@ -36,6 +36,28 @@ namespace PepperDash.Essentials.Core.Bridges
public JoinDataComplete AudioVideoSource = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 }, public JoinDataComplete AudioVideoSource = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata { Description = "DM RMC Audio Video Source Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog }); new JoinMetadata { Description = "DM RMC Audio Video Source Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
[JoinName("HdcpSupportCapability")]
public JoinDataComplete HdcpSupportCapability = new JoinDataComplete(new JoinData { JoinNumber = 2, JoinSpan = 1 },
new JoinMetadata { Description = "DM RMC HDCP Support Capability", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
[JoinName("Port1HdcpState")]
public JoinDataComplete Port1HdcpState = new JoinDataComplete(new JoinData { JoinNumber = 3, JoinSpan = 1 },
new JoinMetadata { Description = "DM RMC Port 1 (DM) HDCP State Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
[JoinName("Port2HdcpState")]
public JoinDataComplete Port2HdcpState = new JoinDataComplete(new JoinData { JoinNumber = 4, JoinSpan = 1 },
new JoinMetadata { Description = "DM TX Port 2 (HDMI) HDCP State Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
[JoinName("HdmiInputSync")]
public JoinDataComplete HdmiInputSync = new JoinDataComplete(new JoinData { JoinNumber = 2, JoinSpan = 1 },
new JoinMetadata { Description = "DM RMC HDMI Input Sync", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("HdcpInputPortCount")]
public JoinDataComplete HdcpInputPortCount = new JoinDataComplete(new JoinData { JoinNumber = 5, JoinSpan = 1 },
new JoinMetadata { Description = "Number of Input Ports that support HDCP", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
/// <summary> /// <summary>
/// Constructor to use when instantiating this Join Map without inheriting from it /// Constructor to use when instantiating this Join Map without inheriting from it
/// </summary> /// </summary>
@@ -50,7 +72,8 @@ namespace PepperDash.Essentials.Core.Bridges
/// </summary> /// </summary>
/// <param name="joinStart">Join this join map will start at</param> /// <param name="joinStart">Join this join map will start at</param>
/// <param name="type">Type of the child join map</param> /// <param name="type">Type of the child join map</param>
protected DmRmcControllerJoinMap(uint joinStart, Type type) : base(joinStart, type) protected DmRmcControllerJoinMap(uint joinStart, Type type)
: base(joinStart, type)
{ {
} }
} }

View File

@@ -68,6 +68,11 @@ namespace PepperDash.Essentials.Core.Bridges
public JoinDataComplete Port3HdcpState = new JoinDataComplete(new JoinData { JoinNumber = 8, JoinSpan = 1 }, public JoinDataComplete Port3HdcpState = new JoinDataComplete(new JoinData { JoinNumber = 8, JoinSpan = 1 },
new JoinMetadata { Description = "DM TX Port 3 HDCP State Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog }); new JoinMetadata { Description = "DM TX Port 3 HDCP State Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
[JoinName("HdcpInputPortCount")]
public JoinDataComplete HdcpInputPortCount = new JoinDataComplete(new JoinData { JoinNumber = 9, JoinSpan = 1 },
new JoinMetadata { Description = "Number of Input Ports that support HDCP", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
/// <summary> /// <summary>
/// Constructor to use when instantiating this Join Map without inheriting from it /// Constructor to use when instantiating this Join Map without inheriting from it
@@ -83,7 +88,8 @@ namespace PepperDash.Essentials.Core.Bridges
/// </summary> /// </summary>
/// <param name="joinStart">Join this join map will start at</param> /// <param name="joinStart">Join this join map will start at</param>
/// <param name="type">Type of the child join map</param> /// <param name="type">Type of the child join map</param>
protected DmTxControllerJoinMap(uint joinStart, Type type) : base(joinStart, type) protected DmTxControllerJoinMap(uint joinStart, Type type)
: base(joinStart, type)
{ {
} }
} }

View File

@@ -1,11 +1,10 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.ComponentModel;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharp.Net.Http; using Crestron.SimplSharp.Net.Http;
using Crestron.SimplSharp.Ssh;
using Crestron.SimplSharpPro.EthernetCommunication;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Core.DebugThings;
namespace PepperDash.Essentials.Core namespace PepperDash.Essentials.Core
{ {
@@ -17,52 +16,130 @@ namespace PepperDash.Essentials.Core
public GenericHttpClient(string key, string name, string hostname) public GenericHttpClient(string key, string name, string hostname)
: base(key, name) : base(key, name)
{ {
Client = new HttpClient(); Client = new HttpClient {HostName = hostname};
Client.HostName = hostname; }
public GenericHttpClient(string key, string name, string hostname, GenericHttpClientConnectionOptions options)
: base(key, name)
{
Client = new HttpClient
{
HostName = hostname,
Accept = options.Accept,
KeepAlive = options.KeepAlive,
Password = options.Password,
Timeout = options.Timeout,
TimeoutEnabled = options.TimeoutEnabled,
UserAgent = options.UserAgent,
UserName = options.UserName,
Version = options.Version
};
if (options.Port > 0) Client.Port = options.Port;
} }
/// <summary> /// <summary>
/// /// Send a HTTP Get Request to a client
/// </summary> /// </summary>
/// <param name="path"></param> /// <param name="path">Path to request node</param>
public void SendText(string path) public void SendText(string path)
{ {
HttpClientRequest request = new HttpClientRequest(); var url = string.Format("http://{0}/{1}", Client.HostName, path);
string url = string.Format("http://{0}/{1}", Client.HostName, path); var request = new HttpClientRequest()
request.Url = new UrlParser(url);
HttpClient.DISPATCHASYNC_ERROR error = Client.DispatchAsyncEx(request, Response, request);
}
public void SendText(string format, params object[] items)
{ {
HttpClientRequest request = new HttpClientRequest(); Url = new UrlParser(url)
string url = string.Format("http://{0}/{1}", Client.HostName, string.Format(format, items)); };
request.Url = new UrlParser(url); var error = Client.DispatchAsyncEx(request, Response, request);
HttpClient.DISPATCHASYNC_ERROR error = Client.DispatchAsyncEx(request, Response, request);
} }
/// <summary>
/// Send a HTTP Get Request to a client using a formatted string
/// </summary>
/// <param name="format">Path</param>
/// <param name="items">Parameters for Path String Formatting</param>
public void SendText(string format, params object[] items)
{
var url = string.Format("http://{0}/{1}", Client.HostName, string.Format(format, items));
var request = new HttpClientRequest()
{
Url = new UrlParser(url)
};
var error = Client.DispatchAsyncEx(request, Response, request);
}
/// <summary>
/// Send a unidirectional HTTP Get Request to a client using a formatted string
/// </summary>
/// <param name="format">Path</param>
/// <param name="items">Parameters for Path String Formatting</param>
public void SendTextNoResponse(string format, params object[] items) public void SendTextNoResponse(string format, params object[] items)
{ {
HttpClientRequest request = new HttpClientRequest(); var url = string.Format("http://{0}/{1}", Client.HostName, string.Format(format, items));
string url = string.Format("http://{0}/{1}", Client.HostName, string.Format(format, items)); var request = new HttpClientRequest()
request.Url = new UrlParser(url); {
Url = new UrlParser(url)
};
Client.Dispatch(request);
}
/// <summary>
/// Send an HTTP Request of a specific request type
/// </summary>
/// <param name="requestType">HTTP Request Type</param>
/// <param name="path">Path to request node</param>
public void SendText(RequestType requestType, string path)
{
var url = string.Format("http://{0}/{1}", Client.HostName, path);
var request = new HttpClientRequest()
{
Url = new UrlParser(url),
RequestType = requestType
};
var error = Client.DispatchAsyncEx(request, Response, request);
}
/// <summary>
/// Send an HTTP Request of a specific request type using a formatted string
/// </summary>
/// <param name="requestType">HTTP Request Type</param>
/// <param name="format">Path</param>
/// <param name="items">Parameters for Path String Formatting</param>
public void SendText(RequestType requestType, string format, params object[] items)
{
var url = string.Format("http://{0}/{1}", Client.HostName, string.Format(format, items));
var request = new HttpClientRequest()
{
Url = new UrlParser(url),
RequestType = requestType
};
var error = Client.DispatchAsyncEx(request, Response, request);
}
/// <summary>
/// Send a unidirectional HTTP Request of a specific request type using a formatted string
/// </summary>
/// <param name="requestType">HTTP Request Type</param>
/// <param name="format">Path</param>
/// <param name="items">Parameters for Path String Formatting</param>
public void SendTextNoResponse(RequestType requestType, string format, params object[] items)
{
var url = string.Format("http://{0}/{1}", Client.HostName, string.Format(format, items));
var request = new HttpClientRequest()
{
Url = new UrlParser(url)
};
Client.Dispatch(request); Client.Dispatch(request);
} }
private void Response(HttpClientResponse response, HTTP_CALLBACK_ERROR error, object request) private void Response(HttpClientResponse response, HTTP_CALLBACK_ERROR error, object request)
{ {
if (error == HTTP_CALLBACK_ERROR.COMPLETED) if (error != HTTP_CALLBACK_ERROR.COMPLETED) return;
{
var responseReceived = response; var responseReceived = response;
if (responseReceived.ContentString.Length > 0) if (responseReceived.ContentString.Length <= 0) return;
{ if (ResponseRecived == null) return;
if (ResponseRecived != null) var httpClientRequest = request as HttpClientRequest;
ResponseRecived(this, new GenericHttpClientEventArgs(responseReceived.ContentString, (request as HttpClientRequest).Url.ToString(), error)); if (httpClientRequest != null)
} ResponseRecived(this, new GenericHttpClientEventArgs(responseReceived.ContentString, httpClientRequest.Url.ToString(), error));
}
} }
@@ -100,6 +177,8 @@ namespace PepperDash.Essentials.Core
#endregion #endregion
} }
public class GenericHttpClientEventArgs : EventArgs public class GenericHttpClientEventArgs : EventArgs
{ {
public string ResponseText { get; private set; } public string ResponseText { get; private set; }
@@ -112,4 +191,84 @@ namespace PepperDash.Essentials.Core
Error = error; Error = error;
} }
} }
/// <summary>
/// Objedct to set parameters for HTTP Requests
/// </summary>
public class GenericHttpClientConnectionOptions
{
/// <summary>
/// Gets or sets content types that are acceptable for the response. The default
/// value is "text/html, image/gif, image/jpeg, image/png, */*".
/// </summary>
[DefaultValue("text/html, image/gif, image/jpeg, image/png")]
public string Accept { get; set; }
/// <summary>
/// Controls whether to use HTTP Keep-Alive to keep the connection alive between
/// requests. If enabled (true) , once a request is made and a connection is
/// established, this connection is kept open and used for future requests. If
/// disabled, the connection is closed, and a new connection is created for future
/// requests.
/// </summary>
[DefaultValue(true)]
public bool KeepAlive { get; set; }
/// <summary>
/// This property controls whether the request operation will do an automatic
/// timeout checking. If timeout handling is turned on (i.e. this property is
/// set to true) and a request takes longer than Timeout, it will be terminated.
/// </summary>
[DefaultValue(true)]
public bool TimeoutEnabled { get; set; }
/// <summary>
/// Gets or sets the maximum amount of time (in seconds) that a client will wait
/// for a server response within a single request. The default value is 60 seconds
/// (1 minute). The timeout handling can be activated via the TimeoutEnabled
/// property.
/// </summary>
[DefaultValue(60)]
public int Timeout { get; set; }
/// <summary>
/// Gets or sets the version identifier of the UserAgent. Can be used to mimic
/// particular browsers like Internet Explorer 6.0
/// </summary>
[DefaultValue("1.1")]
public string Version { get; set; }
/// <summary>
/// Gets or sets the identifier of the software being used to retrieve data via
/// the URL. Some custom HTTP servers check this HTTP header to provide content
/// optimized for particular HTTP browsers.
/// </summary>
[DefaultValue("Crestron SimplSharp HTTP Client")]
public string UserAgent { get; set; }
/// <summary>
/// Name that will be inserted into the Authorization HTTP header in the request
/// to the server.
/// </summary>
public string UserName { get; set; }
/// <summary>
/// Password that will be inserted into the Authorization HTTP header in the
/// request to the server.
/// </summary>
public string Password { get; set; }
/// <summary>
/// The server Port that you intend the client to connect to. If you do not
/// assign a port number on this property, the port number in the parsed URL
/// will be used. If a port number is assigned in the parsed URL, it will take
/// precedence over this property.
/// </summary>
/// <remarks>
/// If you do not assign a port number on this property, the port number in the
/// parsed URL will be used.
/// </remarks>
///
public int Port { get; set; }
}
} }

View File

@@ -388,17 +388,17 @@ namespace PepperDash.Essentials.Core
var outputPorts = ((device as IRoutingOutputs) != null) ? (device as IRoutingOutputs).OutputPorts : null; var outputPorts = ((device as IRoutingOutputs) != null) ? (device as IRoutingOutputs).OutputPorts : null;
if (inputPorts != null) if (inputPorts != null)
{ {
CrestronConsole.ConsoleCommandResponse("Device {0} has {1} Input Ports:", s, inputPorts.Count); CrestronConsole.ConsoleCommandResponse("Device {0} has {1} Input Ports:{2}", s, inputPorts.Count, CrestronEnvironment.NewLine);
foreach (var routingInputPort in inputPorts) foreach (var routingInputPort in inputPorts)
{ {
CrestronConsole.ConsoleCommandResponse("{0}", routingInputPort.Key); CrestronConsole.ConsoleCommandResponse("{0}{1}", routingInputPort.Key, CrestronEnvironment.NewLine);
} }
} }
if (outputPorts == null) return; if (outputPorts == null) return;
CrestronConsole.ConsoleCommandResponse("Device {0} has {1} Output Ports:", s, outputPorts.Count); CrestronConsole.ConsoleCommandResponse("Device {0} has {1} Output Ports:{2}", s, outputPorts.Count, CrestronEnvironment.NewLine);
foreach (var routingOutputPort in outputPorts) foreach (var routingOutputPort in outputPorts)
{ {
CrestronConsole.ConsoleCommandResponse("{0}", routingOutputPort.Key); CrestronConsole.ConsoleCommandResponse("{0}{1}", routingOutputPort.Key, CrestronEnvironment.NewLine);
} }
} }

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
@@ -8,6 +9,7 @@ namespace PepperDash_Essentials_Core.Devices
/// <summary> /// <summary>
/// Interface for any device that is able to control it'spower and has a configurable reboot time /// Interface for any device that is able to control it'spower and has a configurable reboot time
/// </summary> /// </summary>
[Obsolete("PepperDash_Essentials_Core.Devices is Deprecated - use PepperDash.Essentials.Core")]
public interface IHasPowerCycle : IKeyName, IHasPowerControlWithFeedback public interface IHasPowerCycle : IKeyName, IHasPowerControlWithFeedback
{ {
/// <summary> /// <summary>
@@ -24,6 +26,7 @@ namespace PepperDash_Essentials_Core.Devices
/// <summary> /// <summary>
/// Interface for any device that contains a collection of IHasPowerReboot Devices /// Interface for any device that contains a collection of IHasPowerReboot Devices
/// </summary> /// </summary>
[Obsolete("PepperDash_Essentials_Core.Devices is Deprecated - use PepperDash.Essentials.Core")]
public interface IHasControlledPowerOutlets : IKeyName public interface IHasControlledPowerOutlets : IKeyName
{ {
/// <summary> /// <summary>

View File

@@ -0,0 +1,87 @@
using Crestron.SimplSharp;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
{
/// <summary>
/// Interface for any device that has a battery that can be monitored
/// </summary>
public interface IHasBatteryStats : IKeyName
{
int BatteryPercentage { get; }
int BatteryCautionThresholdPercentage { get; }
int BatteryWarningThresholdPercentage { get; }
BoolFeedback BatteryIsWarningFeedback { get; }
BoolFeedback BatteryIsCautionFeedback { get; }
BoolFeedback BatteryIsOkFeedback { get; }
IntFeedback BatteryPercentageFeedback { get; }
}
/// <summary>
/// Interface for any device that has a battery that can be monitored and the ability to charge and discharge
/// </summary>
public interface IHasBatteryCharging : IHasBatteryStats
{
BoolFeedback BatteryIsCharging { get; }
}
/// <summary>
/// Interface for any device that has multiple batteries that can be monitored
/// </summary>
public interface IHasBatteries : IKeyName
{
ReadOnlyDictionary<string, IHasBatteryStats> Batteries { get; }
}
public interface IHasBatteryStatsExtended : IHasBatteryStats
{
int InputVoltage { get; }
int OutputVoltage { get; }
int InptuCurrent { get; }
int OutputCurrent { get; }
IntFeedback InputVoltageFeedback { get; }
IntFeedback OutputVoltageFeedback { get; }
IntFeedback InputCurrentFeedback { get; }
IntFeedback OutputCurrentFeedback { get; }
}
/// <summary>
/// Interface for any device that is able to control its power, has a configurable reboot time, and has batteries that can be monitored
/// </summary>
public interface IHasPowerCycleWithBattery : IHasPowerCycle, IHasBatteryStats
{
}
/// <summary>
/// Interface for any device that is able to control it's power and has a configurable reboot time
/// </summary>
public interface IHasPowerCycle : IKeyName, IHasPowerControlWithFeedback
{
/// <summary>
/// Delay between power off and power on for reboot
/// </summary>
int PowerCycleTimeMs { get; }
/// <summary>
/// Reboot outlet
/// </summary>
void PowerCycle();
}
/// <summary>
/// Interface for any device that contains a collection of IHasPowerReboot Devices
/// </summary>
public interface IHasControlledPowerOutlets : IKeyName
{
/// <summary>
/// Collection of IPduOutlets
/// </summary>
ReadOnlyDictionary<int, IHasPowerCycle> PduOutlets { get; }
}
}

View File

@@ -186,7 +186,7 @@ namespace PepperDash.Essentials.Core
var description = type.Value.Description; var description = type.Value.Description;
var cType = "Not Specified by Plugin"; var cType = "Not Specified by Plugin";
if(type.Value.CType != null) if (type.Value.CType != null)
{ {
cType = type.Value.CType.FullName; cType = type.Value.CType.FullName;
} }

View File

@@ -200,6 +200,7 @@
<Compile Include="Crestron IO\Relay\GenericRelayDevice.cs" /> <Compile Include="Crestron IO\Relay\GenericRelayDevice.cs" />
<Compile Include="Crestron IO\Relay\ISwitchedOutput.cs" /> <Compile Include="Crestron IO\Relay\ISwitchedOutput.cs" />
<Compile Include="Crestron IO\StatusSign\StatusSignController.cs" /> <Compile Include="Crestron IO\StatusSign\StatusSignController.cs" />
<Compile Include="Devices\PowerInterfaces.cs" />
<Compile Include="Web\RequestHandlers\AppDebugRequestHandler.cs" /> <Compile Include="Web\RequestHandlers\AppDebugRequestHandler.cs" />
<Compile Include="Web\RequestHandlers\GetFeedbacksForDeviceRequestHandler.cs" /> <Compile Include="Web\RequestHandlers\GetFeedbacksForDeviceRequestHandler.cs" />
<Compile Include="Web\EssentialsWebApiHelpers.cs" /> <Compile Include="Web\EssentialsWebApiHelpers.cs" />

View File

@@ -195,13 +195,12 @@ namespace PepperDash.Essentials
public static void ReportAssemblyVersions(string command) public static void ReportAssemblyVersions(string command)
{ {
CrestronConsole.ConsoleCommandResponse("Loaded Assemblies:"); CrestronConsole.ConsoleCommandResponse("Loaded Assemblies:" + CrestronEnvironment.NewLine);
foreach (var assembly in LoadedAssemblies) foreach (var assembly in LoadedAssemblies)
{ {
CrestronConsole.ConsoleCommandResponse("{0} Version: {1}", assembly.Name, assembly.Version); CrestronConsole.ConsoleCommandResponse("{0} Version: {1}" + CrestronEnvironment.NewLine, assembly.Name, assembly.Version);
} }
} }
/// <summary> /// <summary>
/// Moves any .dll assemblies not already loaded from the plugins folder to loadedPlugins folder /// Moves any .dll assemblies not already loaded from the plugins folder to loadedPlugins folder
/// </summary> /// </summary>

View File

@@ -22,7 +22,7 @@ namespace PepperDash.Essentials.DM
/// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions /// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions
/// ///
/// </summary> /// </summary>
public class DmBladeChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingNumericWithFeedback public class DmBladeChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitchWithEndpointOnlineFeedback, IRoutingNumericWithFeedback
{ {
private const string NonePortKey = "inputCard0--None"; private const string NonePortKey = "inputCard0--None";

View File

@@ -23,7 +23,7 @@ namespace PepperDash.Essentials.DM
/// ///
/// </summary> /// </summary>
[Description("Wrapper class for all DM-MD chassis variants from 8x8 to 32x32")] [Description("Wrapper class for all DM-MD chassis variants from 8x8 to 32x32")]
public class DmChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingNumericWithFeedback public class DmChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitchWithEndpointOnlineFeedback, IRoutingNumericWithFeedback
{ {
private const string NonePortKey = "inputCard0--None"; private const string NonePortKey = "inputCard0--None";
public DMChassisPropertiesConfig PropertiesConfig { get; set; } public DMChassisPropertiesConfig PropertiesConfig { get; set; }

View File

@@ -0,0 +1,91 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Endpoints;
using PepperDash.Essentials.Core;
namespace PepperDash_Essentials_DM
{
public interface IHasDmInHdcpSet
{
void SetDmInHdcpState(eHdcpCapabilityType hdcpState);
}
public interface IHasDmInHdcpGet
{
IntFeedback DmInHdcpStateFeedback { get; }
}
public interface IHasDmInHdcp : IHasDmInHdcpGet, IHasDmInHdcpSet
{
eHdcpCapabilityType DmInHdcpCapability { get; }
}
public interface IHasHdmiInHdcpSet
{
void SetHdmiInHdcpState(eHdcpCapabilityType hdcpState);
}
public interface IHasHdmiInHdcpGet
{
IntFeedback HdmiInHdcpStateFeedback { get; }
}
public interface IHasHdmiInHdcp : IHasHdmiInHdcpGet, IHasHdmiInHdcpSet
{
eHdcpCapabilityType HdmiInHdcpCapability { get; }
}
public interface IHasHdmiIn1HdcpSet
{
void SetHdmiIn1HdcpState(eHdcpCapabilityType hdcpState);
}
public interface IHasHdmiIn1HdcpGet
{
IntFeedback HdmiIn1HdcpStateFeedback { get; }
}
public interface IHasHdmiIn1Hdcp : IHasHdmiIn1HdcpGet, IHasHdmiIn1HdcpSet
{
eHdcpCapabilityType HdmiIn1HdcpCapability { get; }
}
public interface IHasHdmiIn2HdcpSet
{
void SetHdmiIn2HdcpState(eHdcpCapabilityType hdcpState);
}
public interface IHasHdmiIn2HdcpGet
{
IntFeedback HdmiInIn2HdcpStateFeedback { get; }
}
public interface IHasHdmi2InHdcp : IHasHdmiIn2HdcpGet, IHasHdmiIn2HdcpSet
{
eHdcpCapabilityType Hdmi2InHdcpCapability { get; }
}
public interface IHasDisplayPortInHdcpGet
{
IntFeedback DisplayPortInHdcpStateFeedback { get; }
}
public interface IHasDisplayPortInHdcpSet
{
void SetDisplayPortInHdcpState(eHdcpCapabilityType hdcpState);
}
public interface IHasDisplayPortInHdcp : IHasDisplayPortInHdcpGet, IHasDisplayPortInHdcpSet
{
eHdcpCapabilityType DisplayPortInHdcpCapability { get; }
}
}

View File

@@ -6,6 +6,7 @@ using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges; using PepperDash.Essentials.Core.Bridges;
using PepperDash_Essentials_DM;
namespace PepperDash.Essentials.DM namespace PepperDash.Essentials.DM
{ {
@@ -15,7 +16,7 @@ namespace PepperDash.Essentials.DM
/// </summary> /// </summary>
[Description("Wrapper Class for DM-RMC-4K-SCALER-C")] [Description("Wrapper Class for DM-RMC-4K-SCALER-C")]
public class DmRmc4kScalerCController : DmRmcControllerBase, IRoutingInputsOutputs, IBasicVolumeWithFeedback, public class DmRmc4kScalerCController : DmRmcControllerBase, IRoutingInputsOutputs, IBasicVolumeWithFeedback,
IIROutputPorts, IComPorts, ICec, IRelayPorts IIROutputPorts, IComPorts, ICec, IRelayPorts, IHasDmInHdcp
{ {
private readonly DmRmc4kScalerC _rmc; private readonly DmRmc4kScalerC _rmc;
@@ -27,6 +28,12 @@ namespace PepperDash.Essentials.DM
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; } public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
public EndpointDmInputStreamWithCec DmInput { get; private set; }
public IntFeedback DmInHdcpStateFeedback { get; private set; }
/// <summary> /// <summary>
/// Make a Crestron RMC and put it in here /// Make a Crestron RMC and put it in here
/// </summary> /// </summary>
@@ -52,10 +59,15 @@ namespace PepperDash.Essentials.DM
EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue); EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
EdidSerialNumberFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue); EdidSerialNumberFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn}; InputPorts = new RoutingPortCollection<RoutingInputPort> { DmIn };
OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HdmiOut, BalancedAudioOut}; OutputPorts = new RoutingPortCollection<RoutingOutputPort> { HdmiOut, BalancedAudioOut };
VideoOutputResolutionFeedback = new StringFeedback(() => _rmc.HdmiOutput.GetVideoResolutionString()); VideoOutputResolutionFeedback = new StringFeedback(() => _rmc.HdmiOutput.GetVideoResolutionString());
DmInHdcpStateFeedback = new IntFeedback("DmInHdcpCapability",
() => (int)_rmc.DmInput.HdcpCapabilityFeedback);
AddToFeedbackList(DmInHdcpStateFeedback);
_rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange; _rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
_rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange; _rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
@@ -192,5 +204,17 @@ namespace PepperDash.Essentials.DM
} }
#endregion #endregion
public eHdcpCapabilityType DmInHdcpCapability
{
get { return eHdcpCapabilityType.Hdcp2_2Support; }
}
public void SetDmInHdcpState(eHdcpCapabilityType hdcpState)
{
if (_rmc == null) return;
_rmc.DmInput.HdcpCapability = hdcpState;
}
} }
} }

View File

@@ -6,6 +6,7 @@ using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges; using PepperDash.Essentials.Core.Bridges;
using PepperDash_Essentials_DM;
namespace PepperDash.Essentials.DM namespace PepperDash.Essentials.DM
{ {
@@ -15,7 +16,7 @@ namespace PepperDash.Essentials.DM
/// </summary> /// </summary>
[Description("Wrapper Class for DM-RMC-4K-SCALER-C-DSP")] [Description("Wrapper Class for DM-RMC-4K-SCALER-C-DSP")]
public class DmRmc4kScalerCDspController : DmRmcControllerBase, IRoutingInputsOutputs, IBasicVolumeWithFeedback, public class DmRmc4kScalerCDspController : DmRmcControllerBase, IRoutingInputsOutputs, IBasicVolumeWithFeedback,
IIROutputPorts, IComPorts, ICec, IRelayPorts IIROutputPorts, IComPorts, ICec, IRelayPorts, IHasDmInHdcp
{ {
private readonly DmRmc4kScalerCDsp _rmc; private readonly DmRmc4kScalerCDsp _rmc;
@@ -27,6 +28,11 @@ namespace PepperDash.Essentials.DM
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; } public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
public EndpointDmInputStreamWithCec DmInput { get; private set; }
public IntFeedback DmInHdcpStateFeedback { get; private set; }
/// <summary> /// <summary>
/// Make a Crestron RMC and put it in here /// Make a Crestron RMC and put it in here
/// </summary> /// </summary>
@@ -53,6 +59,12 @@ namespace PepperDash.Essentials.DM
VideoOutputResolutionFeedback = new StringFeedback(() => _rmc.HdmiOutput.GetVideoResolutionString()); VideoOutputResolutionFeedback = new StringFeedback(() => _rmc.HdmiOutput.GetVideoResolutionString());
DmInHdcpStateFeedback = new IntFeedback("DmInHdcpCapability",
() => (int) _rmc.DmInput.HdcpCapabilityFeedback);
AddToFeedbackList(DmInHdcpStateFeedback);
InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn}; InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn};
OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HdmiOut, BalancedAudioOut}; OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HdmiOut, BalancedAudioOut};
@@ -191,5 +203,17 @@ namespace PepperDash.Essentials.DM
} }
#endregion #endregion
public eHdcpCapabilityType DmInHdcpCapability
{
get { return eHdcpCapabilityType.Hdcp2_2Support; }
}
public void SetDmInHdcpState(eHdcpCapabilityType hdcpState)
{
if (_rmc == null) return;
_rmc.DmInput.HdcpCapability = hdcpState;
}
} }
} }

View File

@@ -9,12 +9,13 @@ using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges; using PepperDash.Essentials.Core.Bridges;
using PepperDash.Core; using PepperDash.Core;
using PepperDash_Essentials_DM;
namespace PepperDash.Essentials.DM namespace PepperDash.Essentials.DM
{ {
[Description("Wrapper Class for DM-RMC-4K-Z-SCALER-C")] [Description("Wrapper Class for DM-RMC-4K-Z-SCALER-C")]
public class DmRmc4kZScalerCController : DmRmcControllerBase, IRmcRoutingWithFeedback, public class DmRmc4kZScalerCController : DmRmcControllerBase, IRmcRoutingWithFeedback,
IIROutputPorts, IComPorts, ICec, IRelayPorts IIROutputPorts, IComPorts, ICec, IRelayPorts, IHasDmInHdcp, IHasHdmiInHdcp
{ {
private readonly DmRmc4kzScalerC _rmc; private readonly DmRmc4kzScalerC _rmc;
@@ -22,6 +23,13 @@ namespace PepperDash.Essentials.DM
public RoutingInputPort HdmiIn { get; private set; } public RoutingInputPort HdmiIn { get; private set; }
public RoutingOutputPort HdmiOut { get; private set; } public RoutingOutputPort HdmiOut { get; private set; }
public IntFeedback DmInHdcpStateFeedback { get; private set; }
public IntFeedback HdmiInHdcpStateFeedback { get; private set; }
public BoolFeedback HdmiVideoSyncFeedback { get; private set; }
/// <summary> /// <summary>
/// The value of the current video source for the HDMI output on the receiver /// The value of the current video source for the HDMI output on the receiver
/// </summary> /// </summary>
@@ -44,11 +52,11 @@ namespace PepperDash.Essentials.DM
if (newEvent != null) newEvent(this, e); if (newEvent != null) newEvent(this, e);
} }
public DmRmc4kZScalerCController(string key, string name, DmRmc4kzScalerC rmc) public DmRmc4kZScalerCController(string key, string name, DmRmc4kzScalerC rmc)
: base(key, name, rmc) : base(key, name, rmc)
{ {
_rmc = rmc; _rmc = rmc;
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo, DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.DmCat, 0, this) eRoutingPortConnectionType.DmCat, 0, this)
{ {
@@ -62,6 +70,16 @@ namespace PepperDash.Essentials.DM
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo, HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.Hdmi, null, this); eRoutingPortConnectionType.Hdmi, null, this);
HdmiInHdcpStateFeedback = new IntFeedback("HdmiInHdcpCapability",
() => (int)_rmc.HdmiIn.HdcpCapabilityFeedback);
DmInHdcpStateFeedback = new IntFeedback("DmInHdcpCapability",
() => (int)_rmc.DmInput.HdcpCapabilityFeedback);
HdmiVideoSyncFeedback = new BoolFeedback("HdmiInVideoSync",
() => _rmc.HdmiIn.SyncDetectedFeedback.BoolValue);
AddToFeedbackList(HdmiInHdcpStateFeedback, DmInHdcpStateFeedback, HdmiVideoSyncFeedback);
EdidManufacturerFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue); EdidManufacturerFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
EdidNameFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Name.StringValue); EdidNameFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue); EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
@@ -69,11 +87,13 @@ namespace PepperDash.Essentials.DM
VideoOutputResolutionFeedback = new StringFeedback(() => _rmc.HdmiOutput.GetVideoResolutionString()); VideoOutputResolutionFeedback = new StringFeedback(() => _rmc.HdmiOutput.GetVideoResolutionString());
InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn, HdmiIn}; InputPorts = new RoutingPortCollection<RoutingInputPort> { DmIn, HdmiIn };
OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HdmiOut}; OutputPorts = new RoutingPortCollection<RoutingOutputPort> { HdmiOut };
_rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange; _rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
_rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange; _rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
_rmc.HdmiIn.InputStreamChange += InputStreamChangeEvent;
_rmc.DmInput.InputStreamChange += InputStreamChangeEvent;
_rmc.OnlineStatusChange += _rmc_OnlineStatusChange; _rmc.OnlineStatusChange += _rmc_OnlineStatusChange;
@@ -83,6 +103,20 @@ namespace PepperDash.Essentials.DM
AudioVideoSourceNumericFeedback = new IntFeedback(() => (ushort)(_rmc.SelectedSourceFeedback)); AudioVideoSourceNumericFeedback = new IntFeedback(() => (ushort)(_rmc.SelectedSourceFeedback));
} }
void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
{
switch (args.EventId)
{
case EndpointInputStreamEventIds.HdcpCapabilityFeedbackEventId:
if (inputStream == _rmc.HdmiIn) HdmiInHdcpStateFeedback.FireUpdate();
if (inputStream == _rmc.DmInput) DmInHdcpStateFeedback.FireUpdate();
break;
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
if (inputStream == _rmc.HdmiIn) HdmiVideoSyncFeedback.FireUpdate();
break;
}
}
private void _rmc_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args) private void _rmc_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
{ {
AudioVideoSourceNumericFeedback.FireUpdate(); AudioVideoSourceNumericFeedback.FireUpdate();
@@ -181,5 +215,31 @@ namespace PepperDash.Essentials.DM
} }
#endregion #endregion
public eHdcpCapabilityType DmInHdcpCapability
{
get { return eHdcpCapabilityType.Hdcp2_2Support; }
}
public void SetDmInHdcpState(eHdcpCapabilityType hdcpState)
{
if (_rmc == null) return;
_rmc.DmInput.HdcpCapability = hdcpState;
}
public eHdcpCapabilityType HdmiInHdcpCapability
{
get { return eHdcpCapabilityType.Hdcp2_2Support; }
}
public void SetHdmiInHdcpState(eHdcpCapabilityType hdcpState)
{
if (_rmc == null) return;
_rmc.HdmiIn.HdcpCapability = hdcpState;
}
} }
} }

View File

@@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using Crestron.SimplSharpPro.DeviceSupport; using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM; using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Cards; using Crestron.SimplSharpPro.DM.Cards;
@@ -11,6 +12,7 @@ using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.DeviceInfo; using PepperDash.Essentials.Core.DeviceInfo;
using PepperDash.Essentials.DM.Config; using PepperDash.Essentials.DM.Config;
using PepperDash.Essentials.Core.Config; using PepperDash.Essentials.Core.Config;
using PepperDash_Essentials_DM;
namespace PepperDash.Essentials.DM namespace PepperDash.Essentials.DM
{ {
@@ -74,18 +76,79 @@ namespace PepperDash.Essentials.DM
if (rmc.EdidSerialNumberFeedback != null) if (rmc.EdidSerialNumberFeedback != null)
rmc.EdidSerialNumberFeedback.LinkInputSig(trilist.StringInput[joinMap.EdidSerialNumber.JoinNumber]); rmc.EdidSerialNumberFeedback.LinkInputSig(trilist.StringInput[joinMap.EdidSerialNumber.JoinNumber]);
//If the device is an DM-RMC-4K-Z-SCALER-C //If the device is an DM-RMC-4K-Z-SCALER-C
var routing = rmc as IRmcRouting; var routing = rmc as IRoutingInputsOutputs;
trilist.UShortInput[joinMap.HdcpInputPortCount.JoinNumber].UShortValue = (ushort)(routing == null
? 1
: routing.InputPorts.Count);
if (routing == null) if (routing == null)
{ {
return; return;
} }
var hdcpCapability = eHdcpCapabilityType.HdcpSupportOff;
if (routing.InputPorts[DmPortName.HdmiIn] != null)
{
var hdmiInHdcp = routing as IHasHdmiInHdcp;
if (hdmiInHdcp != null)
{
if (rmc.Feedbacks["HdmiInHdcpCapability"] != null)
{
var intFeedback = rmc.Feedbacks["HdmiInHdcpCapability"] as IntFeedback;
if (intFeedback != null)
intFeedback.LinkInputSig(trilist.UShortInput[joinMap.Port1HdcpState.JoinNumber]);
}
if (rmc.Feedbacks["HdmiInVideoSync"] != null)
{
var boolFeedback = rmc.Feedbacks["HdmiInVideoSync"] as BoolFeedback;
if (boolFeedback != null)
boolFeedback.LinkInputSig(trilist.BooleanInput[joinMap.HdmiInputSync.JoinNumber]);
}
hdcpCapability = hdmiInHdcp.HdmiInHdcpCapability > hdcpCapability
? hdmiInHdcp.HdmiInHdcpCapability
: hdcpCapability;
if (routing.AudioVideoSourceNumericFeedback != null) trilist.SetUShortSigAction(joinMap.Port1HdcpState.JoinNumber, a => hdmiInHdcp.SetHdmiInHdcpState((eHdcpCapabilityType)a));
routing.AudioVideoSourceNumericFeedback.LinkInputSig(trilist.UShortInput[joinMap.AudioVideoSource.JoinNumber]); }
}
if (routing.InputPorts[DmPortName.DmIn] != null)
{
var dmInHdcp = rmc as IHasDmInHdcp;
trilist.SetUShortSigAction(joinMap.AudioVideoSource.JoinNumber, a => routing.ExecuteNumericSwitch(a, 1, eRoutingSignalType.AudioVideo)); if (dmInHdcp != null)
{
if (rmc.Feedbacks["DmInHdcpCapability"] != null)
{
var intFeedback = rmc.Feedbacks["DmInHdcpCapability"] as IntFeedback;
if (intFeedback != null)
intFeedback.LinkInputSig(trilist.UShortInput[joinMap.Port2HdcpState.JoinNumber]);
}
hdcpCapability = dmInHdcp.DmInHdcpCapability > hdcpCapability
? dmInHdcp.DmInHdcpCapability
: hdcpCapability;
trilist.SetUShortSigAction(joinMap.Port2HdcpState.JoinNumber, a => dmInHdcp.SetDmInHdcpState((eHdcpCapabilityType)a));
}
}
trilist.UShortInput[joinMap.HdcpSupportCapability.JoinNumber].UShortValue = (ushort)hdcpCapability;
trilist.UShortInput[joinMap.HdcpInputPortCount.JoinNumber].UShortValue = (ushort)routing.InputPorts.Count;
var routingWithFeedback = routing as IRmcRouting;
if (routingWithFeedback == null) return;
if (routingWithFeedback.AudioVideoSourceNumericFeedback != null)
routingWithFeedback.AudioVideoSourceNumericFeedback.LinkInputSig(
trilist.UShortInput[joinMap.AudioVideoSource.JoinNumber]);
trilist.SetUShortSigAction(joinMap.AudioVideoSource.JoinNumber,
a => routingWithFeedback.ExecuteNumericSwitch(a, 1, eRoutingSignalType.AudioVideo));
} }
#region Implementation of IDeviceInfoProvider #region Implementation of IDeviceInfoProvider
@@ -373,9 +436,9 @@ namespace PepperDash.Essentials.DM
} }
return rx; return rx;
} }
else if (parentDev is DmChassisController) else if (parentDev is IDmSwitchWithEndpointOnlineFeedback)
{ {
var controller = parentDev as DmChassisController; var controller = parentDev as IDmSwitchWithEndpointOnlineFeedback;
var chassis = controller.Chassis; var chassis = controller.Chassis;
var num = props.ParentOutputNumber; var num = props.ParentOutputNumber;
Debug.Console(1, "Creating DM Chassis device '{0}'. Output number '{1}'.", key, num); Debug.Console(1, "Creating DM Chassis device '{0}'. Output number '{1}'.", key, num);

View File

@@ -127,28 +127,23 @@ namespace PepperDash.Essentials.DM
Tx.OnlineStatusChange += Tx_OnlineStatusChange; Tx.OnlineStatusChange += Tx_OnlineStatusChange;
VideoSourceNumericFeedback = new IntFeedback(() => (int) Tx.VideoSourceFeedback); VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);
AudioSourceNumericFeedback = new IntFeedback(() => (int) Tx.AudioSourceFeedback); AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);
HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability", HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability",
() => (int) tx.HdmiInputs[1].HdcpCapabilityFeedback); () => (int)tx.HdmiInputs[1].HdcpCapabilityFeedback);
HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability",
() => (int) tx.HdmiInputs[2].HdcpCapabilityFeedback); () => (int)tx.HdmiInputs[2].HdcpCapabilityFeedback);
HdcpStateFeedback =
new IntFeedback(
() =>
tx.HdmiInputs[1].HdcpCapabilityFeedback > tx.HdmiInputs[2].HdcpCapabilityFeedback
? (int) tx.HdmiInputs[1].HdcpCapabilityFeedback
: (int) tx.HdmiInputs[2].HdcpCapabilityFeedback);
HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support; HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;
Hdmi1VideoSyncFeedback = new BoolFeedback(() => (bool) tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue); HdcpStateFeedback = new IntFeedback(() => (int)HdcpSupportCapability);
Hdmi2VideoSyncFeedback = new BoolFeedback(() => (bool) tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue); Hdmi1VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue);
Hdmi2VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue);
var combinedFuncs = new VideoStatusFuncsWrapper var combinedFuncs = new VideoStatusFuncsWrapper
{ {

View File

@@ -145,15 +145,10 @@ namespace PepperDash.Essentials.DM
HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", () => (int)tx.HdmiInputs[2].HdcpCapabilityFeedback); HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", () => (int)tx.HdmiInputs[2].HdcpCapabilityFeedback);
HdcpStateFeedback =
new IntFeedback(
() =>
tx.HdmiInputs[1].HdcpCapabilityFeedback > tx.HdmiInputs[2].HdcpCapabilityFeedback
? (int)tx.HdmiInputs[1].HdcpCapabilityFeedback
: (int)tx.HdmiInputs[2].HdcpCapabilityFeedback);
HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support; HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;
HdcpStateFeedback = new IntFeedback(() => (int)HdcpSupportCapability);
Hdmi1VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue); Hdmi1VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue);
Hdmi2VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue); Hdmi2VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue);

View File

@@ -121,7 +121,7 @@ namespace PepperDash.Essentials.DM
Tx.HdmiInputs[1].InputStreamChange += InputStreamChangeEvent; Tx.HdmiInputs[1].InputStreamChange += InputStreamChangeEvent;
Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent; Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent;
Tx.DisplayPortInput.InputStreamChange += DisplayPortInputStreamChange; Tx.DisplayPortInput.InputStreamChange += InputStreamChangeEvent;
Tx.BaseEvent += Tx_BaseEvent; Tx.BaseEvent += Tx_BaseEvent;
Tx.OnlineStatusChange += Tx_OnlineStatusChange; Tx.OnlineStatusChange += Tx_OnlineStatusChange;
@@ -131,9 +131,8 @@ namespace PepperDash.Essentials.DM
HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability", () => (int)tx.HdmiInputs[1].HdcpCapabilityFeedback); HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability", () => (int)tx.HdmiInputs[1].HdcpCapabilityFeedback);
HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", () => (int)tx.HdmiInputs[2].HdcpCapabilityFeedback); HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", () => (int)tx.HdmiInputs[2].HdcpCapabilityFeedback);
DisplayPortInHdcpCapabilityFeedback = new IntFeedback("DisplayPortInHdcpCapability",
DisplayPortInHdcpCapabilityFeedback = new IntFeedback("DisplayPortHdcpCapability", () => (int)tx.DisplayPortInput.HdcpCapabilityFeedback);
() => (int) tx.DisplayPortInput.HdcpCapabilityFeedback);
/* /*
@@ -146,13 +145,18 @@ namespace PepperDash.Essentials.DM
*/ */
//yeah this is gross - but it's the quickest way to do this... //yeah this is gross - but it's the quickest way to do this...
/*
HdcpStateFeedback = new IntFeedback(() => { HdcpStateFeedback = new IntFeedback(() => {
var states = new[] {(int) tx.DisplayPortInput.HdcpCapabilityFeedback, (int) tx.HdmiInputs[1].HdcpCapabilityFeedback, (int) tx.HdmiInputs[2].HdcpCapabilityFeedback}; var states = new[] {(int) tx.DisplayPortInput.HdcpCapabilityFeedback, (int) tx.HdmiInputs[1].HdcpCapabilityFeedback, (int) tx.HdmiInputs[2].HdcpCapabilityFeedback};
return states.Max(); return states.Max();
}); });
*/
HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support; HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;
// I feel like we have had this as a misnomer for so long, that it really needed to be fixed
// All we were doing was reporting the best of the current statuses - not the actual capability of the device.
HdcpStateFeedback = new IntFeedback(() => (int)HdcpSupportCapability);
Hdmi1VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue); Hdmi1VideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue);
@@ -166,13 +170,19 @@ namespace PepperDash.Essentials.DM
(ActualActiveVideoInput == eVst.Hdmi1 (ActualActiveVideoInput == eVst.Hdmi1
&& tx.HdmiInputs[1].VideoAttributes.HdcpActiveFeedback.BoolValue) && tx.HdmiInputs[1].VideoAttributes.HdcpActiveFeedback.BoolValue)
|| (ActualActiveVideoInput == eVst.Hdmi2 || (ActualActiveVideoInput == eVst.Hdmi2
&& tx.HdmiInputs[2].VideoAttributes.HdcpActiveFeedback.BoolValue), && tx.HdmiInputs[2].VideoAttributes.HdcpActiveFeedback.BoolValue)
|| (ActualActiveVideoInput == eVst.DisplayPort
&& tx.DisplayPortInput.VideoAttributes.HdcpActiveFeedback.BoolValue),
HdcpStateFeedbackFunc = () => HdcpStateFeedbackFunc = () =>
{ {
if (ActualActiveVideoInput == eVst.Hdmi1) if (ActualActiveVideoInput == eVst.Hdmi1)
return tx.HdmiInputs[1].VideoAttributes.HdcpStateFeedback.ToString(); return tx.HdmiInputs[1].VideoAttributes.HdcpStateFeedback.ToString();
return ActualActiveVideoInput == eVst.Hdmi2 ? tx.HdmiInputs[2].VideoAttributes.HdcpStateFeedback.ToString() : ""; if (ActualActiveVideoInput == eVst.Hdmi2)
return tx.HdmiInputs[2].VideoAttributes.HdcpStateFeedback.ToString();
return ActualActiveVideoInput == eVst.DisplayPort
? tx.DisplayPortInput.VideoAttributes.HdcpStateFeedback.ToString()
: "";
}, },
VideoResolutionFeedbackFunc = () => VideoResolutionFeedbackFunc = () =>
@@ -181,6 +191,8 @@ namespace PepperDash.Essentials.DM
return tx.HdmiInputs[1].VideoAttributes.GetVideoResolutionString(); return tx.HdmiInputs[1].VideoAttributes.GetVideoResolutionString();
if (ActualActiveVideoInput == eVst.Hdmi2) if (ActualActiveVideoInput == eVst.Hdmi2)
return tx.HdmiInputs[2].VideoAttributes.GetVideoResolutionString(); return tx.HdmiInputs[2].VideoAttributes.GetVideoResolutionString();
if (ActualActiveVideoInput == eVst.DisplayPort)
return tx.DisplayPortInput.VideoAttributes.GetVideoResolutionString();
return ActualActiveVideoInput == eVst.Vga ? tx.DisplayPortInput.VideoAttributes.GetVideoResolutionString() : ""; return ActualActiveVideoInput == eVst.Vga ? tx.DisplayPortInput.VideoAttributes.GetVideoResolutionString() : "";
}, },
VideoSyncFeedbackFunc = () => VideoSyncFeedbackFunc = () =>
@@ -188,6 +200,8 @@ namespace PepperDash.Essentials.DM
&& tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue) && tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue)
|| (ActualActiveVideoInput == eVst.Hdmi2 || (ActualActiveVideoInput == eVst.Hdmi2
&& tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue) && tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue)
|| (ActualActiveVideoInput == eVst.DisplayPort
&& tx.DisplayPortInput.SyncDetectedFeedback.BoolValue)
|| (ActualActiveVideoInput == eVst.Vga || (ActualActiveVideoInput == eVst.Vga
&& tx.DisplayPortInput.SyncDetectedFeedback.BoolValue) && tx.DisplayPortInput.SyncDetectedFeedback.BoolValue)
@@ -206,28 +220,15 @@ namespace PepperDash.Essentials.DM
AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback, AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback, AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiIn1HdcpCapabilityFeedback, HdmiIn2HdcpCapabilityFeedback, AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiIn1HdcpCapabilityFeedback, HdmiIn2HdcpCapabilityFeedback,
Hdmi1VideoSyncFeedback, Hdmi2VideoSyncFeedback, DisplayPortVideoSyncFeedback); Hdmi1VideoSyncFeedback, Hdmi2VideoSyncFeedback, DisplayPortVideoSyncFeedback, DisplayPortInHdcpCapabilityFeedback);
// Set Ports for CEC
HdmiIn1.Port = Tx.HdmiInputs[1]; HdmiIn1.Port = Tx.HdmiInputs[1];
HdmiIn2.Port = Tx.HdmiInputs[2]; HdmiIn2.Port = Tx.HdmiInputs[2];
DisplayPortIn.Port = Tx.DisplayPortInput;
HdmiLoopOut.Port = Tx.HdmiOutput; HdmiLoopOut.Port = Tx.HdmiOutput;
DmOut.Port = Tx.DmOutput; DmOut.Port = Tx.DmOutput;
} }
void DisplayPortInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
{
Debug.Console(2, "{0} event {1} stream {2}", Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
switch (args.EventId)
{
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
DisplayPortVideoSyncFeedback.FireUpdate();
break;
}
}
public override bool CustomActivate() public override bool CustomActivate()
{ {
@@ -339,11 +340,17 @@ namespace PepperDash.Essentials.DM
case EndpointInputStreamEventIds.HdcpCapabilityFeedbackEventId: case EndpointInputStreamEventIds.HdcpCapabilityFeedbackEventId:
if (inputStream == Tx.HdmiInputs[1]) HdmiIn1HdcpCapabilityFeedback.FireUpdate(); if (inputStream == Tx.HdmiInputs[1]) HdmiIn1HdcpCapabilityFeedback.FireUpdate();
if (inputStream == Tx.HdmiInputs[2]) HdmiIn2HdcpCapabilityFeedback.FireUpdate(); if (inputStream == Tx.HdmiInputs[2]) HdmiIn2HdcpCapabilityFeedback.FireUpdate();
if (inputStream == Tx.DisplayPortInput) DisplayPortInHdcpCapabilityFeedback.FireUpdate();
Debug.Console(2, this, "DisplayPortHDCP Mode Trigger = {0}",
DisplayPortInHdcpCapabilityFeedback.IntValue);
HdcpStateFeedback.FireUpdate(); HdcpStateFeedback.FireUpdate();
break; break;
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId: case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
if (inputStream == Tx.HdmiInputs[1]) Hdmi1VideoSyncFeedback.FireUpdate(); if (inputStream == Tx.HdmiInputs[1]) Hdmi1VideoSyncFeedback.FireUpdate();
if (inputStream == Tx.HdmiInputs[2]) Hdmi2VideoSyncFeedback.FireUpdate(); if (inputStream == Tx.HdmiInputs[2]) Hdmi2VideoSyncFeedback.FireUpdate();
if (inputStream == Tx.DisplayPortInput) DisplayPortVideoSyncFeedback.FireUpdate();
break; break;
} }
} }

View File

@@ -1,8 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro; using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport; using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM; using Crestron.SimplSharpPro.DM;
@@ -44,7 +42,7 @@ namespace PepperDash.Essentials.DM
if (typeName.StartsWith("dmtx401")) if (typeName.StartsWith("dmtx401"))
return new DmTx401CController(key, name, new DmTx401C(dmInput), true); return new DmTx401CController(key, name, new DmTx401C(dmInput), true);
if (typeName.StartsWith("hdbasettx")) if (typeName.StartsWith("hdbasettx"))
new HDBaseTTxController(key, name, new HDTx3CB(dmInput)); return new HDBaseTTxController(key, name, new HDTx3CB(dmInput));
return null; return null;
} }
@@ -83,6 +81,7 @@ namespace PepperDash.Essentials.DM
/// <param name="key"></param> /// <param name="key"></param>
/// <param name="name"></param> /// <param name="name"></param>
/// <param name="props"></param> /// <param name="props"></param>
/// <param name="typeName"></param>
/// <returns></returns> /// <returns></returns>
public static BasicDmTxControllerBase GetDmTxController(string key, string name, string typeName, DmTxPropertiesConfig props) public static BasicDmTxControllerBase GetDmTxController(string key, string name, string typeName, DmTxPropertiesConfig props)
{ {
@@ -98,7 +97,7 @@ namespace PepperDash.Essentials.DM
// Catch constructor failures, mainly dues to IPID // Catch constructor failures, mainly dues to IPID
try try
{ {
if(typeName.StartsWith("dmtx200")) if (typeName.StartsWith("dmtx200"))
return new DmTx200Controller(key, name, new DmTx200C2G(ipid, Global.ControlSystem), false); return new DmTx200Controller(key, name, new DmTx200C2G(ipid, Global.ControlSystem), false);
if (typeName.StartsWith("dmtx201c")) if (typeName.StartsWith("dmtx201c"))
return new DmTx201CController(key, name, new DmTx201C(ipid, Global.ControlSystem), false); return new DmTx201CController(key, name, new DmTx201C(ipid, Global.ControlSystem), false);
@@ -128,10 +127,10 @@ namespace PepperDash.Essentials.DM
BasicDmTxControllerBase tx; BasicDmTxControllerBase tx;
bool useChassisForOfflineFeedback = false; bool useChassisForOfflineFeedback = false;
if (parentDev is DmChassisController) if (parentDev is IDmSwitchWithEndpointOnlineFeedback)
{ {
// Get the Crestron chassis and link stuff up // Get the Crestron chassis and link stuff up
var switchDev = (parentDev as DmChassisController); var switchDev = (parentDev as IDmSwitchWithEndpointOnlineFeedback);
var chassis = switchDev.Chassis; var chassis = switchDev.Chassis;
//Check that the input is within range of this chassis' possible inputs //Check that the input is within range of this chassis' possible inputs
@@ -180,7 +179,8 @@ namespace PepperDash.Essentials.DM
return null; return null;
} }
} }
else if(parentDev is DmpsRoutingController)
if (parentDev is DmpsRoutingController)
{ {
// Get the DMPS chassis and link stuff up // Get the DMPS chassis and link stuff up
var dmpsDev = (parentDev as DmpsRoutingController); var dmpsDev = (parentDev as DmpsRoutingController);
@@ -209,7 +209,7 @@ namespace PepperDash.Essentials.DM
try try
{ {
if(Global.ControlSystemIsDmps4kType) if (Global.ControlSystemIsDmps4kType)
{ {
tx = GetDmTxForChassisWithoutIpId(key, name, typeName, dmInput); tx = GetDmTxForChassisWithoutIpId(key, name, typeName, dmInput);
useChassisForOfflineFeedback = true; useChassisForOfflineFeedback = true;
@@ -237,13 +237,10 @@ namespace PepperDash.Essentials.DM
} }
} }
else
{
Debug.Console(0, "Cannot create DM device '{0}'. '{1}' is not a processor, DM Chassis or DMPS.", key, pKey); Debug.Console(0, "Cannot create DM device '{0}'. '{1}' is not a processor, DM Chassis or DMPS.", key, pKey);
return null; return null;
} }
} }
}
public abstract class BasicDmTxControllerBase : CrestronGenericBridgeableBaseDevice public abstract class BasicDmTxControllerBase : CrestronGenericBridgeableBaseDevice
{ {
@@ -281,7 +278,8 @@ namespace PepperDash.Essentials.DM
}; };
} }
protected DmTxControllerBase(string key, string name, DmHDBasedTEndPoint hardware) : base(key, name, hardware) protected DmTxControllerBase(string key, string name, DmHDBasedTEndPoint hardware)
: base(key, name, hardware)
{ {
} }
@@ -335,8 +333,6 @@ namespace PepperDash.Essentials.DM
txR.VideoSourceNumericFeedback.LinkInputSig(trilist.UShortInput[joinMap.VideoInput.JoinNumber]); txR.VideoSourceNumericFeedback.LinkInputSig(trilist.UShortInput[joinMap.VideoInput.JoinNumber]);
txR.AudioSourceNumericFeedback.LinkInputSig(trilist.UShortInput[joinMap.AudioInput.JoinNumber]); txR.AudioSourceNumericFeedback.LinkInputSig(trilist.UShortInput[joinMap.AudioInput.JoinNumber]);
trilist.UShortInput[joinMap.HdcpSupportCapability.JoinNumber].UShortValue = (ushort)tx.HdcpSupportCapability;
if (txR.InputPorts[DmPortName.HdmiIn] != null) if (txR.InputPorts[DmPortName.HdmiIn] != null)
{ {
var inputPort = txR.InputPorts[DmPortName.HdmiIn]; var inputPort = txR.InputPorts[DmPortName.HdmiIn];
@@ -383,7 +379,7 @@ namespace PepperDash.Essentials.DM
{ {
var intFeedback = tx.Feedbacks["HdmiIn2HdcpCapability"] as IntFeedback; var intFeedback = tx.Feedbacks["HdmiIn2HdcpCapability"] as IntFeedback;
if (intFeedback != null) if (intFeedback != null)
intFeedback.LinkInputSig(trilist.UShortInput[joinMap.Port1HdcpState.JoinNumber]); intFeedback.LinkInputSig(trilist.UShortInput[joinMap.Port2HdcpState.JoinNumber]);
} }
if (inputPort.ConnectionType == eRoutingPortConnectionType.Hdmi && inputPort.Port != null) if (inputPort.ConnectionType == eRoutingPortConnectionType.Hdmi && inputPort.Port != null)
@@ -400,19 +396,33 @@ namespace PepperDash.Essentials.DM
if (tx.Feedbacks["DisplayPortInHdcpCapability"] != null) if (tx.Feedbacks["DisplayPortInHdcpCapability"] != null)
{ {
var intFeedback = tx.Feedbacks["DisplayPortInHdcpCapability"] as IntFeedback; var intFeedback = tx.Feedbacks["DisplayPortInHdcpCapability"] as IntFeedback;
if (intFeedback != null) if (intFeedback != null)
intFeedback.LinkInputSig(trilist.UShortInput[joinMap.Port3HdcpState.JoinNumber]);
}
if (inputPort.ConnectionType == eRoutingPortConnectionType.Hdmi && inputPort.Port != null) intFeedback.LinkInputSig(trilist.UShortInput[joinMap.Port3HdcpState.JoinNumber]);
if (inputPort.ConnectionType == eRoutingPortConnectionType.DisplayPort && inputPort.Port != null)
{ {
var port = inputPort.Port as EndpointDisplayPortInput; var port = inputPort.Port as EndpointDisplayPortInput;
SetHdcpCapabilityAction(port, joinMap.Port3HdcpState.JoinNumber, trilist);
SetHdcpCapabilityAction(hdcpTypeSimple, port, joinMap.Port3HdcpState.JoinNumber, trilist); }
}
} }
}
var hdcpInputPortCount =
(ushort)
txR.InputPorts.Where(
x => (x.Type == eRoutingSignalType.Video) || (x.Type == eRoutingSignalType.AudioVideo))
.Where(
x =>
(x.ConnectionType == eRoutingPortConnectionType.DmCat) ||
(x.ConnectionType == eRoutingPortConnectionType.Hdmi) ||
(x.ConnectionType == eRoutingPortConnectionType.DisplayPort))
.ToList().Count();
trilist.SetUshort(joinMap.HdcpInputPortCount.JoinNumber, hdcpInputPortCount);
} }
@@ -462,17 +472,15 @@ namespace PepperDash.Essentials.DM
} }
} }
private void SetHdcpCapabilityAction(bool hdcpTypeSimple, EndpointDisplayPortInput port, uint join, private void SetHdcpCapabilityAction(EndpointDisplayPortInput port, uint join,
BasicTriList trilist) BasicTriList trilist)
{ {
trilist.SetUShortSigAction(join, trilist.SetUShortSigAction(join,
s => s =>
{ {
Debug.Console(0, this, "Trying to set HDCP to {0} on port {1}", s, port.ToString());
port.HdcpCapability = (eHdcpCapabilityType) s; port.HdcpCapability = (eHdcpCapabilityType) s;
}); });
} }
} }
@@ -481,8 +489,22 @@ namespace PepperDash.Essentials.DM
{ {
public DmTxControllerFactory() public DmTxControllerFactory()
{ {
TypeNames = new List<string>() { "dmtx200c", "dmtx201c", "dmtx201s", "dmtx4k100c", "dmtx4k202c", "dmtx4kz202c", "dmtx4k302c", "dmtx4kz302c", TypeNames = new List<string>
"dmtx401c", "dmtx401s", "dmtx4k100c1g", "dmtx4kz100c1g", "hdbasettx" }; {
"dmtx200c",
"dmtx201c",
"dmtx201s",
"dmtx4k100c",
"dmtx4k202c",
"dmtx4kz202c",
"dmtx4k302c",
"dmtx4kz302c",
"dmtx401c",
"dmtx401s",
"dmtx4k100c1g",
"dmtx4kz100c1g",
"hdbasettx"
};
} }
public override EssentialsDevice BuildDevice(DeviceConfig dc) public override EssentialsDevice BuildDevice(DeviceConfig dc)
@@ -492,8 +514,8 @@ namespace PepperDash.Essentials.DM
Debug.Console(1, "Factory Attempting to create new DM-TX Device"); Debug.Console(1, "Factory Attempting to create new DM-TX Device");
var props = JsonConvert.DeserializeObject var props = JsonConvert.DeserializeObject
<PepperDash.Essentials.DM.Config.DmTxPropertiesConfig>(dc.Properties.ToString()); <DmTxPropertiesConfig>(dc.Properties.ToString());
return PepperDash.Essentials.DM.DmTxHelper.GetDmTxController(dc.Key, dc.Name, type, props); return DmTxHelper.GetDmTxController(dc.Key, dc.Name, type, props);
} }
} }

View File

@@ -16,10 +16,17 @@ using PepperDash.Essentials.Core;
using PepperDash.Essentials.DM.Config; using PepperDash.Essentials.DM.Config;
namespace PepperDash.Essentials.DM { namespace PepperDash.Essentials.DM {
public interface IDmSwitch { public interface IDmSwitch
{
Switch Chassis { get; } Switch Chassis { get; }
Dictionary<uint, string> TxDictionary { get; } Dictionary<uint, string> TxDictionary { get; }
Dictionary<uint, string> RxDictionary { get; } Dictionary<uint, string> RxDictionary { get; }
} }
public interface IDmSwitchWithEndpointOnlineFeedback : IDmSwitch
{
Dictionary<uint, BoolFeedback> InputEndpointOnlineFeedbacks { get; }
Dictionary<uint, BoolFeedback> OutputEndpointOnlineFeedbacks { get; }
}
} }

View File

@@ -105,6 +105,7 @@
<Compile Include="Chassis\HdMdNxM4kEBridgeableController.cs" /> <Compile Include="Chassis\HdMdNxM4kEBridgeableController.cs" />
<Compile Include="Chassis\HdMdNxM4kEController.cs" /> <Compile Include="Chassis\HdMdNxM4kEController.cs" />
<Compile Include="Config\InputPropertiesConfig.cs" /> <Compile Include="Config\InputPropertiesConfig.cs" />
<Compile Include="Endpoints\EndpointInterfaces.cs" />
<Compile Include="Endpoints\DGEs\DgeJoinMap.cs" /> <Compile Include="Endpoints\DGEs\DgeJoinMap.cs" />
<Compile Include="Endpoints\DGEs\DmDge200CController.cs" /> <Compile Include="Endpoints\DGEs\DmDge200CController.cs" />
<Compile Include="Endpoints\Receivers\DmRmc4kZ100CController.cs" /> <Compile Include="Endpoints\Receivers\DmRmc4kZ100CController.cs" />