set up program to load Cisco Codec from config, not just manually

This commit is contained in:
Neil Dorin
2017-09-22 15:40:08 -06:00
parent 1d46f8520d
commit a71e991383
7 changed files with 52 additions and 33 deletions

View File

@@ -17,10 +17,10 @@ namespace PepperDash.Essentials.Devices.Common.DSP
// Verbose on subscriptions? // Verbose on subscriptions?
// Example subscription feedback responses
// ! "publishToken":"name" "value":-77.0 // ! "publishToken":"name" "value":-77.0
// ! "myLevelName" -77 // ! "myLevelName" -77
public class BiampTesiraForteDsp : DspBase public class BiampTesiraForteDsp : DspBase
{ {
public IBasicCommunication Communication { get; private set; } public IBasicCommunication Communication { get; private set; }

View File

@@ -10,7 +10,8 @@ using PepperDash.Core;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config; using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Devices.Common.DSP; using PepperDash.Essentials.Devices.Common.DSP;
using PepperDash.Essentials.Devices.Common.VideoCodec;
using PepperDash.Essentials.Devices.Common; using PepperDash.Essentials.Devices.Common;
@@ -104,25 +105,32 @@ namespace PepperDash.Essentials.Devices.Common
{ {
return new PepperDash.Essentials.Devices.Common.VideoCodec return new PepperDash.Essentials.Devices.Common.VideoCodec
.MockVC(key, name); .MockVC(key, name);
} }
else if (groupName == "settopbox") //(typeName == "irstbbase") else if (typeName == "ciscocodec")
{ {
var irCont = IRPortHelper.GetIrOutputPortController(dc); var comm = CommFactory.CreateCommForDevice(dc);
var config = dc.Properties.ToObject<SetTopBoxPropertiesConfig>(); var props = JsonConvert.DeserializeObject<Codec.CiscoCodecPropertiesConfig>(properties.ToString());
var stb = new IRSetTopBoxBase(key, name, irCont, config); return new PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.CiscoCodec(key, name, comm, props);
}
//stb.HasDvr = properties.Value<bool>("hasDvr");
var listName = properties.Value<string>("presetsList"); else if (groupName == "settopbox") //(typeName == "irstbbase")
if (listName != null) {
stb.LoadPresets(listName); var irCont = IRPortHelper.GetIrOutputPortController(dc);
return stb; var config = dc.Properties.ToObject<SetTopBoxPropertiesConfig>();
} var stb = new IRSetTopBoxBase(key, name, irCont, config);
else if (typeName == "roku") //stb.HasDvr = properties.Value<bool>("hasDvr");
{ var listName = properties.Value<string>("presetsList");
var irCont = IRPortHelper.GetIrOutputPortController(dc); if (listName != null)
return new Roku2(key, name, irCont); stb.LoadPresets(listName);
return stb;
}
else if (typeName == "roku")
{
var irCont = IRPortHelper.GetIrOutputPortController(dc);
return new Roku2(key, name, irCont);
} }
return null; return null;

View File

@@ -149,7 +149,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
int PresentationSource; int PresentationSource;
string PhoneBookMode; string PhonebookMode = "Local"; // Default to Local
int PhonebookResultsLimit = 255; // Could be set later by config.
// Constructor for IBasicCommunication // Constructor for IBasicCommunication
public CiscoCodec(string key, string name, IBasicCommunication comm, CiscoCodecPropertiesConfig props ) public CiscoCodec(string key, string name, IBasicCommunication comm, CiscoCodecPropertiesConfig props )
@@ -173,7 +175,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
DeviceManager.AddDevice(CommunicationMonitor); DeviceManager.AddDevice(CommunicationMonitor);
PhoneBookMode = props.PhonebookMode; PhonebookMode = props.PhonebookMode;
SyncState = new CodecSyncState(key + "--sync"); SyncState = new CodecSyncState(key + "--sync");
@@ -218,7 +220,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
//SendText("xCommand Bookings List Days: 1 DayOffset: 0"); //SendText("xCommand Bookings List Days: 1 DayOffset: 0");
// Get Phonebook (determine local/corporate from config, and set results limit) // Get Phonebook (determine local/corporate from config, and set results limit)
//SendText("xCommand Phonebook Search PhonebookType: {0} ContactType: Folder Limit: {0}", PhonebookType, PhonebookResultsLimit); SendText(string.Format("xCommand Phonebook Search PhonebookType: {0} ContactType: Folder Limit: {1}", PhonebookMode, PhonebookResultsLimit));
} }
/// <summary> /// <summary>
@@ -237,6 +239,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
socket.ConnectionChange += new EventHandler<GenericSocketStatusChageEventArgs>(socket_ConnectionChange); socket.ConnectionChange += new EventHandler<GenericSocketStatusChageEventArgs>(socket_ConnectionChange);
} }
CommunicationMonitor.Start();
InputPorts.Add(new RoutingInputPort(RoutingPortNames.HdmiIn1, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, new Action(SelectPresentationSource1), this)); InputPorts.Add(new RoutingInputPort(RoutingPortNames.HdmiIn1, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, new Action(SelectPresentationSource1), this));
InputPorts.Add(new RoutingInputPort(RoutingPortNames.HdmiIn2, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, new Action(SelectPresentationSource2), this)); InputPorts.Add(new RoutingInputPort(RoutingPortNames.HdmiIn2, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, new Action(SelectPresentationSource2), this));
@@ -503,7 +507,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
} }
} }
/// <summary> /// <summary>
/// Evaluates an event received from the codec /// Evaluates an event received from the codec
/// </summary> /// </summary>
@@ -534,8 +537,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
(selector as Action)(); (selector as Action)();
} }
//protected Func<bool> InCallFeedbackFunc { get { return () => false; } }
protected override Func<bool> IncomingCallFeedbackFunc { get { return () => false; } } protected override Func<bool> IncomingCallFeedbackFunc { get { return () => false; } }
/// <summary> /// <summary>

View File

@@ -5,7 +5,10 @@ using System.Text;
using Crestron.SimplSharp; using Crestron.SimplSharp;
namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
{ {
/// <summary>
/// This class exists to capture serialized data sent back by a Cisco codec in JSON output mode
/// </summary>
public class CiscoCodecConfiguration public class CiscoCodecConfiguration
{ {
public class DefaultVolume public class DefaultVolume

View File

@@ -5,7 +5,10 @@ using System.Text;
using Crestron.SimplSharp; using Crestron.SimplSharp;
namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
{ {
/// <summary>
/// This class exists to capture serialized data sent back by a Cisco codec in JSON output mode
/// </summary>
public class CiscoCodecEvents public class CiscoCodecEvents
{ {
public class CauseValue public class CauseValue

View File

@@ -7,6 +7,9 @@ using Crestron.SimplSharp.CrestronXml.Serialization;
namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
{ {
/// <summary>
/// This class exists to capture serialized data sent back by a Cisco codec in JSON output mode
/// </summary>
public class CiscoCodecStatus public class CiscoCodecStatus
{ {
// Helper Classes for Proerties // Helper Classes for Proerties
@@ -1634,7 +1637,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public string Value { get; set; } public string Value { get; set; }
} }
public class FacilityServiceId public class FacilityServiceId
{ {
public string Value { get; set; } public string Value { get; set; }

View File

@@ -29,8 +29,8 @@ namespace PepperDash.Essentials
/// </summary> /// </summary>
public override void InitializeSystem() public override void InitializeSystem()
{ {
//CrestronConsole.AddNewConsoleCommand(s => GoWithLoad(), "go", "Reloads configuration file", CrestronConsole.AddNewConsoleCommand(s => GoWithLoad(), "go", "Reloads configuration file",
// ConsoleAccessLevelEnum.AccessOperator); ConsoleAccessLevelEnum.AccessOperator);
//CrestronConsole.AddNewConsoleCommand(s => TearDown(), "ungo", "Unloads configuration file", //CrestronConsole.AddNewConsoleCommand(s => TearDown(), "ungo", "Unloads configuration file",
// ConsoleAccessLevelEnum.AccessOperator); // ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(s => CrestronConsole.AddNewConsoleCommand(s =>
@@ -40,7 +40,7 @@ namespace PepperDash.Essentials
}, },
"listtielines", "Prints out all tie lines", ConsoleAccessLevelEnum.AccessOperator); "listtielines", "Prints out all tie lines", ConsoleAccessLevelEnum.AccessOperator);
GoWithLoad(); //GoWithLoad();
} }
/// <summary> /// <summary>
@@ -128,6 +128,7 @@ namespace PepperDash.Essentials
} }
// CODEC TESTING // CODEC TESTING
/*
try try
{ {
GenericSshClient TestCodecClient = new GenericSshClient("TestCodec-1--SshClient", "10.11.50.135", 22, "crestron", "2H3Zu&OvgXp6"); GenericSshClient TestCodecClient = new GenericSshClient("TestCodec-1--SshClient", "10.11.50.135", 22, "crestron", "2H3Zu&OvgXp6");
@@ -149,6 +150,7 @@ namespace PepperDash.Essentials
{ {
Debug.Console(0, "Error in something Neil is working on ;) \r{0}", e); Debug.Console(0, "Error in something Neil is working on ;) \r{0}", e);
} }
*/
// CODEC TESTING // CODEC TESTING
} }