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?
// Example subscription feedback responses
// ! "publishToken":"name" "value":-77.0
// ! "myLevelName" -77
public class BiampTesiraForteDsp : DspBase
{
public IBasicCommunication Communication { get; private set; }

View File

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

View File

@@ -149,7 +149,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
int PresentationSource;
string PhoneBookMode;
string PhonebookMode = "Local"; // Default to Local
int PhonebookResultsLimit = 255; // Could be set later by config.
// Constructor for IBasicCommunication
public CiscoCodec(string key, string name, IBasicCommunication comm, CiscoCodecPropertiesConfig props )
@@ -173,7 +175,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
DeviceManager.AddDevice(CommunicationMonitor);
PhoneBookMode = props.PhonebookMode;
PhonebookMode = props.PhonebookMode;
SyncState = new CodecSyncState(key + "--sync");
@@ -218,7 +220,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
//SendText("xCommand Bookings List Days: 1 DayOffset: 0");
// 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>
@@ -237,6 +239,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
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.HdmiIn2, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, new Action(SelectPresentationSource2), this));
@@ -503,7 +507,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
}
}
/// <summary>
/// Evaluates an event received from the codec
/// </summary>
@@ -534,8 +537,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
(selector as Action)();
}
//protected Func<bool> InCallFeedbackFunc { get { return () => false; } }
protected override Func<bool> IncomingCallFeedbackFunc { get { return () => false; } }
/// <summary>

View File

@@ -5,7 +5,10 @@ using System.Text;
using Crestron.SimplSharp;
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 DefaultVolume

View File

@@ -5,7 +5,10 @@ using System.Text;
using Crestron.SimplSharp;
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 CauseValue

View File

@@ -7,6 +7,9 @@ using Crestron.SimplSharp.CrestronXml.Serialization;
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
{
// Helper Classes for Proerties
@@ -1634,7 +1637,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public string Value { get; set; }
}
public class FacilityServiceId
{
public string Value { get; set; }