diff --git a/PepperDashEssentials/AppServer/DeviceTypeInterfaces/IChannelExtensions.cs b/PepperDashEssentials/AppServer/DeviceTypeInterfaces/IChannelExtensions.cs
deleted file mode 100644
index 287a9ba1..00000000
--- a/PepperDashEssentials/AppServer/DeviceTypeInterfaces/IChannelExtensions.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using PepperDash.Essentials.Core;
-using PepperDash.Core;
-
-namespace PepperDash.Essentials.Room.MobileControl
-{
- public static class IChannelExtensions
- {
- public static void LinkActions(this IChannel dev, MobileControlSystemController controller)
- {
- var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
-
- controller.AddAction(prefix + "chanUp", new PressAndHoldAction(dev.ChannelUp));
- controller.AddAction(prefix + "chanDown", new PressAndHoldAction(dev.ChannelDown));
- controller.AddAction(prefix + "lastChan", new PressAndHoldAction(dev.LastChannel));
- controller.AddAction(prefix + "guide", new PressAndHoldAction(dev.Guide));
- controller.AddAction(prefix + "info", new PressAndHoldAction(dev.Info));
- controller.AddAction(prefix + "exit", new PressAndHoldAction(dev.Exit));
- }
-
- public static void UnlinkActions(this IChannel dev, MobileControlSystemController controller)
- {
- var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
-
- controller.RemoveAction(prefix + "chanUp");
- controller.RemoveAction(prefix + "chanDown");
- controller.RemoveAction(prefix + "lastChan");
- controller.RemoveAction(prefix + "guide");
- controller.RemoveAction(prefix + "info");
- controller.RemoveAction(prefix + "exit");
- }
- }
-}
\ No newline at end of file
diff --git a/PepperDashEssentials/AppServer/DeviceTypeInterfaces/IColorExtensions.cs b/PepperDashEssentials/AppServer/DeviceTypeInterfaces/IColorExtensions.cs
deleted file mode 100644
index 9912433d..00000000
--- a/PepperDashEssentials/AppServer/DeviceTypeInterfaces/IColorExtensions.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using PepperDash.Essentials.Core;
-using PepperDash.Core;
-
-namespace PepperDash.Essentials.Room.MobileControl
-{
- public static class IColorExtensions
- {
- public static void LinkActions(this IColor dev, MobileControlSystemController controller)
- {
- var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
-
- controller.AddAction(prefix + "red", new PressAndHoldAction(dev.Red));
- controller.AddAction(prefix + "green", new PressAndHoldAction(dev.Green));
- controller.AddAction(prefix + "yellow", new PressAndHoldAction(dev.Yellow));
- controller.AddAction(prefix + "blue", new PressAndHoldAction(dev.Blue));
- }
-
- public static void UnlinkActions(this IColor dev, MobileControlSystemController controller)
- {
- var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
-
- controller.RemoveAction(prefix + "red");
- controller.RemoveAction(prefix + "green");
- controller.RemoveAction(prefix + "yellow");
- controller.RemoveAction(prefix + "blue");
- }
- }
-}
\ No newline at end of file
diff --git a/PepperDashEssentials/AppServer/DeviceTypeInterfaces/IDPadExtensions.cs b/PepperDashEssentials/AppServer/DeviceTypeInterfaces/IDPadExtensions.cs
deleted file mode 100644
index b094dfe8..00000000
--- a/PepperDashEssentials/AppServer/DeviceTypeInterfaces/IDPadExtensions.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using PepperDash.Essentials.Core;
-using PepperDash.Core;
-
-namespace PepperDash.Essentials.Room.MobileControl
-{
- public static class IDPadExtensions
- {
- public static void LinkActions(this IDPad dev, MobileControlSystemController controller)
- {
- var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
-
- controller.AddAction(prefix + "up", new PressAndHoldAction(dev.Up));
- controller.AddAction(prefix + "down", new PressAndHoldAction(dev.Down));
- controller.AddAction(prefix + "left", new PressAndHoldAction(dev.Left));
- controller.AddAction(prefix + "right", new PressAndHoldAction(dev.Right));
- controller.AddAction(prefix + "select", new PressAndHoldAction(dev.Select));
- controller.AddAction(prefix + "menu", new PressAndHoldAction(dev.Menu));
- controller.AddAction(prefix + "exit", new PressAndHoldAction(dev.Exit));
- }
-
- public static void UnlinkActions(this IDPad dev, MobileControlSystemController controller)
- {
- var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
-
- controller.RemoveAction(prefix + "up");
- controller.RemoveAction(prefix + "down");
- controller.RemoveAction(prefix + "left");
- controller.RemoveAction(prefix + "right");
- controller.RemoveAction(prefix + "select");
- controller.RemoveAction(prefix + "menu");
- controller.RemoveAction(prefix + "exit");
- }
- }
-}
\ No newline at end of file
diff --git a/PepperDashEssentials/AppServer/DeviceTypeInterfaces/IDvrExtensions.cs b/PepperDashEssentials/AppServer/DeviceTypeInterfaces/IDvrExtensions.cs
deleted file mode 100644
index d4a9570b..00000000
--- a/PepperDashEssentials/AppServer/DeviceTypeInterfaces/IDvrExtensions.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using PepperDash.Essentials.Core;
-using PepperDash.Core;
-
-namespace PepperDash.Essentials.Room.MobileControl
-{
- public static class IDvrExtensions
- {
- public static void LinkActions(this IDvr dev, MobileControlSystemController controller)
- {
- var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
-
- controller.AddAction(prefix + "dvrlist", new PressAndHoldAction(dev.DvrList));
- controller.AddAction(prefix + "record", new PressAndHoldAction(dev.Record));
- }
-
- public static void UnlinkActions(this IDvr dev, MobileControlSystemController controller)
- {
- var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
-
- controller.RemoveAction(prefix + "dvrlist");
- controller.RemoveAction(prefix + "record");
- }
- }
-}
\ No newline at end of file
diff --git a/PepperDashEssentials/AppServer/DeviceTypeInterfaces/INumericExtensions.cs b/PepperDashEssentials/AppServer/DeviceTypeInterfaces/INumericExtensions.cs
deleted file mode 100644
index 2b61d775..00000000
--- a/PepperDashEssentials/AppServer/DeviceTypeInterfaces/INumericExtensions.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using PepperDash.Essentials.Core;
-using PepperDash.Core;
-
-namespace PepperDash.Essentials.Room.MobileControl
-{
- public static class INumericExtensions
- {
- public static void LinkActions(this INumericKeypad dev, MobileControlSystemController controller)
- {
- var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
-
- controller.AddAction(prefix + "num0", new PressAndHoldAction(dev.Digit0));
- controller.AddAction(prefix + "num1", new PressAndHoldAction(dev.Digit1));
- controller.AddAction(prefix + "num2", new PressAndHoldAction(dev.Digit2));
- controller.AddAction(prefix + "num3", new PressAndHoldAction(dev.Digit3));
- controller.AddAction(prefix + "num4", new PressAndHoldAction(dev.Digit4));
- controller.AddAction(prefix + "num5", new PressAndHoldAction(dev.Digit5));
- controller.AddAction(prefix + "num6", new PressAndHoldAction(dev.Digit6));
- controller.AddAction(prefix + "num7", new PressAndHoldAction(dev.Digit0));
- controller.AddAction(prefix + "num8", new PressAndHoldAction(dev.Digit0));
- controller.AddAction(prefix + "num9", new PressAndHoldAction(dev.Digit0));
- controller.AddAction(prefix + "numDash", new PressAndHoldAction(dev.KeypadAccessoryButton1));
- controller.AddAction(prefix + "numEnter", new PressAndHoldAction(dev.KeypadAccessoryButton2));
- // Deal with the Accessory functions on the numpad later
- }
-
- public static void UnlinkActions(this INumericKeypad dev, MobileControlSystemController controller)
- {
- var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
-
- controller.RemoveAction(prefix + "num0");
- controller.RemoveAction(prefix + "num1");
- controller.RemoveAction(prefix + "num2");
- controller.RemoveAction(prefix + "num3");
- controller.RemoveAction(prefix + "num4");
- controller.RemoveAction(prefix + "num5");
- controller.RemoveAction(prefix + "num6");
- controller.RemoveAction(prefix + "num7");
- controller.RemoveAction(prefix + "num8");
- controller.RemoveAction(prefix + "num9");
- controller.RemoveAction(prefix + "numDash");
- controller.RemoveAction(prefix + "numEnter");
- }
- }
-}
\ No newline at end of file
diff --git a/PepperDashEssentials/AppServer/DeviceTypeInterfaces/IPowerExtensions.cs b/PepperDashEssentials/AppServer/DeviceTypeInterfaces/IPowerExtensions.cs
deleted file mode 100644
index 515c2c7f..00000000
--- a/PepperDashEssentials/AppServer/DeviceTypeInterfaces/IPowerExtensions.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using PepperDash.Essentials.Core;
-using PepperDash.Core;
-
-namespace PepperDash.Essentials.Room.MobileControl
-{
- public static class IPowerExtensions
- {
- public static void LinkActions(this IPower dev, MobileControlSystemController controller)
- {
- var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
-
- controller.AddAction(prefix + "powerOn", new Action(dev.PowerOn));
- controller.AddAction(prefix + "powerOff", new Action(dev.PowerOff));
- controller.AddAction(prefix + "powerToggle", new Action(dev.PowerToggle));
- }
-
- public static void UnlinkActions(this IPower dev, MobileControlSystemController controller)
- {
- var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
-
- controller.RemoveAction(prefix + "powerOn");
- controller.RemoveAction(prefix + "powerOff");
- controller.RemoveAction(prefix + "powerToggle");
-
- }
- }
-}
\ No newline at end of file
diff --git a/PepperDashEssentials/AppServer/DeviceTypeInterfaces/ISetTopBoxControlsExtensions.cs b/PepperDashEssentials/AppServer/DeviceTypeInterfaces/ISetTopBoxControlsExtensions.cs
deleted file mode 100644
index 2ea60545..00000000
--- a/PepperDashEssentials/AppServer/DeviceTypeInterfaces/ISetTopBoxControlsExtensions.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using PepperDash.Essentials.Core;
-using PepperDash.Core;
-
-namespace PepperDash.Essentials.Room.MobileControl
-{
- public static class ISetTopBoxControlsExtensions
- {
- public static void LinkActions(this ISetTopBoxControls dev, MobileControlSystemController controller)
- {
- var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
-
- controller.AddAction(prefix + "dvrList", new PressAndHoldAction(dev.DvrList));
- controller.AddAction(prefix + "replay", new PressAndHoldAction(dev.Replay));
- }
-
- public static void UnlinkActions(this ISetTopBoxControls dev, MobileControlSystemController controller)
- {
- var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
-
- controller.RemoveAction(prefix + "dvrList");
- controller.RemoveAction(prefix + "replay");
- }
- }
-}
\ No newline at end of file
diff --git a/PepperDashEssentials/AppServer/DeviceTypeInterfaces/ITransportExtensions.cs b/PepperDashEssentials/AppServer/DeviceTypeInterfaces/ITransportExtensions.cs
deleted file mode 100644
index f34fb9e3..00000000
--- a/PepperDashEssentials/AppServer/DeviceTypeInterfaces/ITransportExtensions.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using PepperDash.Essentials.Core;
-using PepperDash.Core;
-
-namespace PepperDash.Essentials.Room.MobileControl
-{
- public static class ITransportExtensions
- {
- public static void LinkActions(this ITransport dev, MobileControlSystemController controller)
- {
- var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
-
- controller.AddAction(prefix + "play", new PressAndHoldAction(dev.Play));
- controller.AddAction(prefix + "pause", new PressAndHoldAction(dev.Pause));
- controller.AddAction(prefix + "stop", new PressAndHoldAction(dev.Stop));
- controller.AddAction(prefix + "prevTrack", new PressAndHoldAction(dev.ChapPlus));
- controller.AddAction(prefix + "nextTrack", new PressAndHoldAction(dev.ChapMinus));
- controller.AddAction(prefix + "rewind", new PressAndHoldAction(dev.Rewind));
- controller.AddAction(prefix + "ffwd", new PressAndHoldAction(dev.FFwd));
- controller.AddAction(prefix + "record", new PressAndHoldAction(dev.Record));
- }
-
- public static void UnlinkActions(this ITransport dev, MobileControlSystemController controller)
- {
- var prefix = string.Format(@"/device/{0}/", (dev as IKeyed).Key);
-
- controller.RemoveAction(prefix + "play");
- controller.RemoveAction(prefix + "pause");
- controller.RemoveAction(prefix + "stop");
- controller.RemoveAction(prefix + "prevTrack");
- controller.RemoveAction(prefix + "nextTrack");
- controller.RemoveAction(prefix + "rewind");
- controller.RemoveAction(prefix + "ffwd");
- controller.RemoveAction(prefix + "record");
- }
- }
-}
\ No newline at end of file
diff --git a/PepperDashEssentials/AppServer/Interfaces.cs b/PepperDashEssentials/AppServer/Interfaces.cs
deleted file mode 100644
index 8a1c20c8..00000000
--- a/PepperDashEssentials/AppServer/Interfaces.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-
-using PepperDash.Essentials.Core;
-
-namespace PepperDash.Essentials.Room.MobileControl
-{
- ///
- /// Represents a room whose configuration is derived from runtime data,
- /// perhaps from another program, and that the data may not be fully
- /// available at startup.
- ///
- public interface IDelayedConfiguration
- {
- event EventHandler ConfigurationIsReady;
- }
-}
-
diff --git a/PepperDashEssentials/AppServer/Messengers/AudioCodecBaseMessenger.cs b/PepperDashEssentials/AppServer/Messengers/AudioCodecBaseMessenger.cs
deleted file mode 100644
index 65cc5b47..00000000
--- a/PepperDashEssentials/AppServer/Messengers/AudioCodecBaseMessenger.cs
+++ /dev/null
@@ -1,102 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-using PepperDash.Essentials.Core.Devices.AudioCodec;
-using PepperDash.Essentials.Core.Devices.Codec;
-using PepperDash.Essentials.Devices.Common.AudioCodec;
-
-namespace PepperDash.Essentials.AppServer.Messengers
-{
- ///
- /// Provides a messaging bridge for an AudioCodecBase device
- ///
- public class AudioCodecBaseMessenger : MessengerBase
- {
- ///
- /// Device being bridged
- ///
- public AudioCodecBase Codec { get; set; }
-
- ///
- /// Constuctor
- ///
- ///
- ///
- ///
- public AudioCodecBaseMessenger(string key, AudioCodecBase codec, string messagePath)
- : base(key, messagePath)
- {
- if (codec == null)
- throw new ArgumentNullException("codec");
-
- Codec = codec;
- codec.CallStatusChange += new EventHandler(codec_CallStatusChange);
-
- }
-
- protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
- {
- appServerController.AddAction(MessagePath + "/fullStatus", new Action(SendAtcFullMessageObject));
- appServerController.AddAction(MessagePath + "/dial", new Action(s => Codec.Dial(s)));
- appServerController.AddAction(MessagePath + "/endCallById", new Action(s =>
- {
- var call = GetCallWithId(s);
- if (call != null)
- Codec.EndCall(call);
- }));
- appServerController.AddAction(MessagePath + "/endAllCalls", new Action(Codec.EndAllCalls));
- appServerController.AddAction(MessagePath + "/dtmf", new Action(s => Codec.SendDtmf(s)));
- appServerController.AddAction(MessagePath + "/rejectById", new Action(s =>
- {
- var call = GetCallWithId(s);
- if (call != null)
- Codec.RejectCall(call);
- }));
- appServerController.AddAction(MessagePath + "/acceptById", new Action(s =>
- {
- var call = GetCallWithId(s);
- if (call != null)
- Codec.AcceptCall(call);
- }));
- }
-
- ///
- /// Helper to grab a call with string ID
- ///
- ///
- ///
- CodecActiveCallItem GetCallWithId(string id)
- {
- return Codec.ActiveCalls.FirstOrDefault(c => c.Id == id);
- }
-
- void codec_CallStatusChange(object sender, CodecCallStatusItemChangeEventArgs e)
- {
- SendAtcFullMessageObject();
- }
-
- ///
- /// Helper method to build call status for vtc
- ///
- ///
- void SendAtcFullMessageObject()
- {
-
- var info = Codec.CodecInfo;
- PostStatusMessage(new
- {
- isInCall = Codec.IsInCall,
- calls = Codec.ActiveCalls,
- info = new
- {
- phoneNumber = info.PhoneNumber
- }
- });
- }
- }
-}
\ No newline at end of file
diff --git a/PepperDashEssentials/AppServer/Messengers/CameraBaseMessenger.cs b/PepperDashEssentials/AppServer/Messengers/CameraBaseMessenger.cs
deleted file mode 100644
index 043341a9..00000000
--- a/PepperDashEssentials/AppServer/Messengers/CameraBaseMessenger.cs
+++ /dev/null
@@ -1,174 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Devices.Common.Cameras;
-
-namespace PepperDash.Essentials.AppServer.Messengers
-{
- public class CameraBaseMessenger : MessengerBase
- {
- ///
- /// Device being bridged
- ///
- public CameraBase Camera { get; set; }
-
- ///
- /// Constructor
- ///
- ///
- ///
- ///
- public CameraBaseMessenger(string key, CameraBase camera, string messagePath)
- : base(key, messagePath)
- {
- if (camera == null)
- throw new ArgumentNullException("camera");
-
- Camera = camera;
-
- var presetsCamera = Camera as IHasCameraPresets;
-
- if (presetsCamera != null)
- {
- presetsCamera.PresetsListHasChanged += new EventHandler(presetsCamera_PresetsListHasChanged);
- }
-
- }
-
- void presetsCamera_PresetsListHasChanged(object sender, EventArgs e)
- {
- var presetsCamera = Camera as IHasCameraPresets;
-
- var presetList = new List();
-
- if (presetsCamera != null)
- presetList = presetsCamera.Presets;
-
- PostStatusMessage(new
- {
- presets = presetList
- });
- }
-
- protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
- {
- appServerController.AddAction(MessagePath + "/fullStatus", new Action(SendCameraFullMessageObject));
-
- var ptzCamera = Camera as IHasCameraPtzControl;
-
- if (ptzCamera != null)
- {
-
- // Need to evaluate how to pass through these P&H actions. Need a method that takes a bool maybe?
- AppServerController.AddAction(MessagePath + "/cameraUp", new PressAndHoldAction((b) =>
- {
- if (b)
- ptzCamera.TiltUp();
- else
- ptzCamera.TiltStop();
- }));
- AppServerController.AddAction(MessagePath + "/cameraDown", new PressAndHoldAction((b) =>
- {
- if (b)
- ptzCamera.TiltDown();
- else
- ptzCamera.TiltStop();
- }));
- AppServerController.AddAction(MessagePath + "/cameraLeft", new PressAndHoldAction((b) =>
- {
- if (b)
- ptzCamera.PanLeft();
- else
- ptzCamera.PanStop();
- }));
- AppServerController.AddAction(MessagePath + "/cameraRight", new PressAndHoldAction((b) =>
- {
- if (b)
- ptzCamera.PanRight();
- else
- ptzCamera.PanStop();
- }));
- AppServerController.AddAction(MessagePath + "/cameraZoomIn", new PressAndHoldAction((b) =>
- {
- if (b)
- ptzCamera.ZoomIn();
- else
- ptzCamera.ZoomStop();
- }));
- AppServerController.AddAction(MessagePath + "/cameraZoomOut", new PressAndHoldAction((b) =>
- {
- if (b)
- ptzCamera.ZoomOut();
- else
- ptzCamera.ZoomStop();
- }));
- }
-
- if (Camera is IHasCameraAutoMode)
- {
- appServerController.AddAction(MessagePath + "/cameraModeAuto", new Action((Camera as IHasCameraAutoMode).CameraAutoModeOn));
- appServerController.AddAction(MessagePath + "/cameraModeManual", new Action((Camera as IHasCameraAutoMode).CameraAutoModeOff));
- }
-
- if (Camera is IPower)
- {
- appServerController.AddAction(MessagePath + "/cameraModeOff", new Action((Camera as IPower).PowerOff));
- }
-
- var presetsCamera = Camera as IHasCameraPresets;
-
- if (presetsCamera != null)
- {
- for(int i = 1; i <= 6; i++)
- {
- var preset = i;
- appServerController.AddAction(MessagePath + "/cameraPreset" + i, new Action((p) => presetsCamera.PresetSelect(preset)));
- }
- }
- }
-
- ///
- /// Helper method to update the full status of the camera
- ///
- void SendCameraFullMessageObject()
- {
- var presetsCamera = Camera as IHasCameraPresets;
-
- var presetList = new List();
-
- if (presetsCamera != null)
- presetList = presetsCamera.Presets;
-
- PostStatusMessage(new
- {
- cameraMode = GetCameraMode(),
- hasPresets = Camera is IHasCameraPresets,
- presets = presetList
- });
- }
-
- ///
- /// Computes the current camera mode
- ///
- ///
- string GetCameraMode()
- {
- string m;
- if (Camera is IHasCameraAutoMode && (Camera as IHasCameraAutoMode).CameraAutoModeIsOnFeedback.BoolValue)
- m = eCameraControlMode.Auto.ToString().ToLower();
- else if (Camera is IPower && !(Camera as IPower).PowerIsOnFeedback.BoolValue)
- m = eCameraControlMode.Off.ToString().ToLower();
- else
- m = eCameraControlMode.Manual.ToString().ToLower();
- return m;
- }
- }
-}
\ No newline at end of file
diff --git a/PepperDashEssentials/AppServer/Messengers/ConfigMessenger.cs b/PepperDashEssentials/AppServer/Messengers/ConfigMessenger.cs
deleted file mode 100644
index ae05c118..00000000
--- a/PepperDashEssentials/AppServer/Messengers/ConfigMessenger.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-
-using PepperDash.Core;
-using PepperDash.Essentials.Core.Config;
-
-namespace PepperDash.Essentials.AppServer.Messengers
-{
-
- ///
- /// Handles interactions with the app server to update the config
- ///
- public class ConfigMessenger : MessengerBase
- {
- public ConfigMessenger(string key, string messagePath)
- : base(key, messagePath)
- {
- ConfigUpdater.ConfigStatusChanged -= ConfigUpdater_ConfigStatusChanged;
- ConfigUpdater.ConfigStatusChanged += new EventHandler(ConfigUpdater_ConfigStatusChanged);
- }
-
- void ConfigUpdater_ConfigStatusChanged(object sender, ConfigStatusEventArgs e)
- {
- PostUpdateStatus(e.UpdateStatus.ToString());
- }
-
- protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
- {
- appServerController.AddAction(MessagePath + "/updateConfig", new Action(s => GetConfigFile(s)));
- }
-
- ///
- /// Generates or passes the URL to make the request to GET the config from a server
- ///
- ///
- void GetConfigFile(string url)
- {
- try
- {
- // Attempt to parse the URL
- var parser = new Crestron.SimplSharp.Net.Http.UrlParser(url);
-
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "Successfully parsed URL from AppServer message: {0}", parser.Url);
- }
- catch (Exception e)
- {
- // If unable to parse the URL, generate it from config data
- Debug.Console(2, "Error parsing URL: {0}", e);
-
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "Unable to parse URL from AppServer message. Generating URL from config data");
- url = string.Format("http://{0}/api/system/{1}/config", AppServerController.Config.ServerUrl, AppServerController.SystemUuid);
- }
-
- ConfigUpdater.GetConfigFromServer(url);
- }
-
- ///
- /// Posts a message with the current status of the config update
- ///
- ///
- void PostUpdateStatus(string status)
- {
- PostStatusMessage(new
- {
- updateStatus = status
- });
- }
-
- }
-
-
-}
\ No newline at end of file
diff --git a/PepperDashEssentials/AppServer/Messengers/IRunRouteActionMessenger.cs b/PepperDashEssentials/AppServer/Messengers/IRunRouteActionMessenger.cs
deleted file mode 100644
index 05f25048..00000000
--- a/PepperDashEssentials/AppServer/Messengers/IRunRouteActionMessenger.cs
+++ /dev/null
@@ -1,82 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Core.Rooms;
-
-
-namespace PepperDash.Essentials.AppServer.Messengers
-{
- public class IRunRouteActionMessenger : MessengerBase
- {
- ///
- /// Device being bridged
- ///
- public IRunRouteAction RoutingDevice {get; private set;}
-
- public IRunRouteActionMessenger(string key, IRunRouteAction routingDevice, string messagePath)
- : base(key, messagePath)
- {
- if (routingDevice == null)
- throw new ArgumentNullException("routingDevice");
-
- RoutingDevice = routingDevice;
-
- var routingSink = RoutingDevice as IRoutingSinkNoSwitching;
-
- if (routingSink != null)
- {
- routingSink.CurrentSourceChange += new SourceInfoChangeHandler(routingSink_CurrentSourceChange);
- }
- }
-
- void routingSink_CurrentSourceChange(SourceListItem info, ChangeType type)
- {
- SendRoutingFullMessageObject();
- }
-
- protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
- {
- appServerController.AddAction(MessagePath + "/fullStatus", new Action(SendRoutingFullMessageObject));
-
- appServerController.AddAction(MessagePath + "/source", new Action(c =>
- {
- RoutingDevice.RunRouteAction(c.SourceListItem, c.SourceListKey);
- }));
-
- var sinkDevice = RoutingDevice as IRoutingSinkNoSwitching;
- if(sinkDevice != null)
- {
- sinkDevice.CurrentSourceChange += new SourceInfoChangeHandler((o, a) =>
- {
- SendRoutingFullMessageObject();
- });
- }
- }
-
- ///
- /// Helper method to update full status of the routing device
- ///
- void SendRoutingFullMessageObject()
- {
- var sinkDevice = RoutingDevice as IRoutingSinkNoSwitching;
-
- if(sinkDevice != null)
- {
- var sourceKey = sinkDevice.CurrentSourceInfoKey;
-
- if (string.IsNullOrEmpty(sourceKey))
- sourceKey = "none";
-
- PostStatusMessage(new
- {
- selectedSourceKey = sourceKey
- });
- }
- }
- }
-}
\ No newline at end of file
diff --git a/PepperDashEssentials/AppServer/Messengers/MessengerBase.cs b/PepperDashEssentials/AppServer/Messengers/MessengerBase.cs
deleted file mode 100644
index 981ef4b7..00000000
--- a/PepperDashEssentials/AppServer/Messengers/MessengerBase.cs
+++ /dev/null
@@ -1,81 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-
-using PepperDash.Core;
-
-using PepperDash.Essentials.Core.Devices.Codec;
-using PepperDash.Essentials.Devices.Common.VideoCodec;
-
-namespace PepperDash.Essentials.AppServer.Messengers
-{
- ///
- /// Provides a messaging bridge for a VideoCodecBase
- ///
- public abstract class MessengerBase : IKeyed
- {
- public string Key { get; private set; }
-
- ///
- ///
- ///
- public MobileControlSystemController AppServerController { get; private set; }
-
- public string MessagePath { get; private set; }
-
- ///
- ///
- ///
- ///
- public MessengerBase(string key, string messagePath)
- {
- Key = key;
-
- if (string.IsNullOrEmpty(messagePath))
- throw new ArgumentException("messagePath must not be empty or null");
-
- MessagePath = messagePath;
- }
-
-
- ///
- /// Registers this messenger with appserver controller
- ///
- ///
- public void RegisterWithAppServer(MobileControlSystemController appServerController)
- {
- if (appServerController == null)
- throw new ArgumentNullException("appServerController");
-
- AppServerController = appServerController;
- CustomRegisterWithAppServer(AppServerController);
- }
-
- ///
- /// Implemented in extending classes. Wire up API calls and feedback here
- ///
- ///
- abstract protected void CustomRegisterWithAppServer(MobileControlSystemController appServerController);
-
- ///
- /// Helper for posting status message
- ///
- /// The contents of the content object
- protected void PostStatusMessage(object contentObject)
- {
- if (AppServerController != null)
- {
- AppServerController.SendMessageToServer(JObject.FromObject(new
- {
- type = MessagePath,
- content = contentObject
- }));
- }
- }
- }
-}
\ No newline at end of file
diff --git a/PepperDashEssentials/AppServer/Messengers/SIMPLAtcMessenger.cs b/PepperDashEssentials/AppServer/Messengers/SIMPLAtcMessenger.cs
deleted file mode 100644
index e7fb05ef..00000000
--- a/PepperDashEssentials/AppServer/Messengers/SIMPLAtcMessenger.cs
+++ /dev/null
@@ -1,230 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro.DeviceSupport;
-using Crestron.SimplSharpPro.EthernetCommunication;
-
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Core.Devices.Codec;
-
-namespace PepperDash.Essentials.AppServer.Messengers
-{
- public class SIMPLAtcMessenger : MessengerBase
- {
- BasicTriList EISC;
-
- public SIMPLAtcJoinMap JoinMap {get; private set;}
-
- /////
- ///// 221
- /////
- //const uint BDialHangupOnHook = 221;
-
- /////
- ///// 251
- /////
- //const uint BIncomingAnswer = 251;
- /////
- ///// 252
- /////
- //const uint BIncomingReject = 252;
- /////
- ///// 241
- /////
- //const uint BSpeedDial1 = 241;
- /////
- ///// 242
- /////
- //const uint BSpeedDial2 = 242;
- /////
- ///// 243
- /////
- //const uint BSpeedDial3 = 243;
- /////
- ///// 244
- /////
- //const uint BSpeedDial4 = 244;
-
- /////
- ///// 201
- /////
- //const uint SCurrentDialString = 201;
- /////
- ///// 211
- /////
- //const uint SCurrentCallNumber = 211;
- /////
- ///// 212
- /////
- //const uint SCurrentCallName = 212;
- /////
- ///// 221
- /////
- //const uint SHookState = 221;
- /////
- ///// 222
- /////
- //const uint SCallDirection = 222;
-
- /////
- ///// 201-212 0-9*#
- /////
- //Dictionary DTMFMap = new Dictionary
- //{
- // { "1", 201 },
- // { "2", 202 },
- // { "3", 203 },
- // { "4", 204 },
- // { "5", 205 },
- // { "6", 206 },
- // { "7", 207 },
- // { "8", 208 },
- // { "9", 209 },
- // { "0", 210 },
- // { "*", 211 },
- // { "#", 212 },
- //};
-
- ///
- ///
- ///
- CodecActiveCallItem CurrentCallItem;
-
-
- ///
- ///
- ///
- ///
- ///
- public SIMPLAtcMessenger(string key, BasicTriList eisc, string messagePath)
- : base(key, messagePath)
- {
- EISC = eisc;
-
- JoinMap = new SIMPLAtcJoinMap(201);
-
- CurrentCallItem = new CodecActiveCallItem();
- CurrentCallItem.Type = eCodecCallType.Audio;
- CurrentCallItem.Id = "-audio-";
- }
-
- ///
- ///
- ///
- void SendFullStatus()
- {
-
-
- this.PostStatusMessage(new
- {
- calls = GetCurrentCallList(),
- currentCallString = EISC.GetString(JoinMap.CurrentCallName.JoinNumber),
- currentDialString = EISC.GetString(JoinMap.CurrentDialString.JoinNumber),
- isInCall = EISC.GetString(JoinMap.HookState.JoinNumber) == "Connected"
- });
- }
-
- ///
- ///
- ///
- ///
- protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
- {
- //EISC.SetStringSigAction(SCurrentDialString, s => PostStatusMessage(new { currentDialString = s }));
-
- EISC.SetStringSigAction(JoinMap.HookState.JoinNumber, s =>
- {
- CurrentCallItem.Status = (eCodecCallStatus)Enum.Parse(typeof(eCodecCallStatus), s, true);
- //GetCurrentCallList();
- SendFullStatus();
- });
-
- EISC.SetStringSigAction(JoinMap.CurrentCallNumber.JoinNumber, s =>
- {
- CurrentCallItem.Number = s;
- SendCallsList();
- });
-
- EISC.SetStringSigAction(JoinMap.CurrentCallName.JoinNumber, s =>
- {
- CurrentCallItem.Name = s;
- SendCallsList();
- });
-
- EISC.SetStringSigAction(JoinMap.CallDirection.JoinNumber, s =>
- {
- CurrentCallItem.Direction = (eCodecCallDirection)Enum.Parse(typeof(eCodecCallDirection), s, true);
- SendCallsList();
- });
-
- // Add press and holds using helper
- Action addPHAction = (s, u) =>
- AppServerController.AddAction(MessagePath + s, new PressAndHoldAction(b => EISC.SetBool(u, b)));
-
- // Add straight pulse calls
- Action addAction = (s, u) =>
- AppServerController.AddAction(MessagePath + s, new Action(() => EISC.PulseBool(u, 100)));
- addAction("/endCallById", JoinMap.EndCall.JoinNumber);
- addAction("/endAllCalls", JoinMap.EndCall.JoinNumber);
- addAction("/acceptById", JoinMap.IncomingAnswer.JoinNumber);
- addAction("/rejectById", JoinMap.IncomingReject.JoinNumber);
-
- var speeddialStart = JoinMap.SpeedDialStart.JoinNumber;
- var speeddialEnd = JoinMap.SpeedDialStart.JoinNumber + JoinMap.SpeedDialStart.JoinSpan;
-
- var speedDialIndex = 1;
- for (uint i = speeddialStart; i < speeddialEnd; i++)
- {
- addAction(string.Format("/speedDial{0}", speedDialIndex), i);
- speedDialIndex++;
- }
-
- // Get status
- AppServerController.AddAction(MessagePath + "/fullStatus", new Action(SendFullStatus));
- // Dial on string
- AppServerController.AddAction(MessagePath + "/dial", new Action(s => EISC.SetString(JoinMap.CurrentDialString.JoinNumber, s)));
- // Pulse DTMF
- AppServerController.AddAction(MessagePath + "/dtmf", new Action(s =>
- {
- var join = JoinMap.Joins[s];
- if (join != null)
- {
- if (join.JoinNumber > 0)
- {
- EISC.PulseBool(join.JoinNumber, 100);
- }
- }
- }));
- }
-
- ///
- ///
- ///
- void SendCallsList()
- {
- PostStatusMessage(new
- {
- calls = GetCurrentCallList(),
- });
- }
-
- ///
- /// Turns the
- ///
- ///
- List GetCurrentCallList()
- {
- if (CurrentCallItem.Status == eCodecCallStatus.Disconnected)
- {
- return new List();
- }
- else
- {
- return new List() { CurrentCallItem };
- }
- }
- }
-}
\ No newline at end of file
diff --git a/PepperDashEssentials/AppServer/Messengers/SIMPLCameraMessenger.cs b/PepperDashEssentials/AppServer/Messengers/SIMPLCameraMessenger.cs
deleted file mode 100644
index 9cf6456f..00000000
--- a/PepperDashEssentials/AppServer/Messengers/SIMPLCameraMessenger.cs
+++ /dev/null
@@ -1,149 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro.DeviceSupport;
-using Crestron.SimplSharpPro.EthernetCommunication;
-
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Bridges;
-using PepperDash.Essentials.Devices.Common.Cameras;
-
-namespace PepperDash.Essentials.AppServer.Messengers
-{
- public class SIMPLCameraMessenger : MessengerBase
- {
- BasicTriList EISC;
-
- CameraControllerJoinMap JoinMap;
-
-
- public SIMPLCameraMessenger(string key, BasicTriList eisc, string messagePath, uint joinStart)
- : base(key, messagePath)
- {
- EISC = eisc;
-
- JoinMap = new CameraControllerJoinMap(joinStart);
-
- EISC.SetUShortSigAction(JoinMap.NumberOfPresets.JoinNumber, (u) => SendCameraFullMessageObject());
-
- EISC.SetBoolSigAction(JoinMap.CameraModeAuto.JoinNumber, (b) => PostCameraMode());
- EISC.SetBoolSigAction(JoinMap.CameraModeManual.JoinNumber, (b) => PostCameraMode());
- EISC.SetBoolSigAction(JoinMap.CameraModeOff.JoinNumber, (b) => PostCameraMode());
- }
-
-
- protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
- {
- var asc = appServerController;
-
- asc.AddAction(MessagePath + "/fullStatus", new Action(SendCameraFullMessageObject));
-
- // Add press and holds using helper action
- Action addPHAction = (s, u) =>
- asc.AddAction(MessagePath + s, new PressAndHoldAction(b => EISC.SetBool(u, b)));
- addPHAction("/cameraUp", JoinMap.TiltUp.JoinNumber);
- addPHAction("/cameraDown", JoinMap.TiltDown.JoinNumber);
- addPHAction("/cameraLeft", JoinMap.PanLeft.JoinNumber);
- addPHAction("/cameraRight", JoinMap.PanRight.JoinNumber);
- addPHAction("/cameraZoomIn", JoinMap.ZoomIn.JoinNumber);
- addPHAction("/cameraZoomOut", JoinMap.ZoomOut.JoinNumber);
-
- Action addAction = (s, u) =>
- asc.AddAction(MessagePath + s, new Action(() => EISC.PulseBool(u, 100)));
-
- addAction("/cameraModeAuto", JoinMap.CameraModeAuto.JoinNumber);
- addAction("/cameraModeManual", JoinMap.CameraModeManual.JoinNumber);
- addAction("/cameraModeOff", JoinMap.CameraModeOff.JoinNumber);
-
- var presetStart = JoinMap.PresetRecallStart.JoinNumber;
- var presetEnd = JoinMap.PresetRecallStart.JoinNumber + JoinMap.PresetRecallStart.JoinSpan;
-
- int presetId = 1;
- // camera presets
- for (uint i = presetStart; i <= presetEnd; i++)
- {
- addAction("/cameraPreset" + (presetId), i);
- presetId++;
- }
- }
-
- public void CustomUnregsiterWithAppServer(MobileControlSystemController appServerController)
- {
- appServerController.RemoveAction(MessagePath + "/fullStatus");
-
- appServerController.RemoveAction(MessagePath + "/cameraUp");
- appServerController.RemoveAction(MessagePath + "/cameraDown");
- appServerController.RemoveAction(MessagePath + "/cameraLeft");
- appServerController.RemoveAction(MessagePath + "/cameraRight");
- appServerController.RemoveAction(MessagePath + "/cameraZoomIn");
- appServerController.RemoveAction(MessagePath + "/cameraZoomOut");
- appServerController.RemoveAction(MessagePath + "/cameraModeAuto");
- appServerController.RemoveAction(MessagePath + "/cameraModeManual");
- appServerController.RemoveAction(MessagePath + "/cameraModeOff");
-
- EISC.SetUShortSigAction(JoinMap.NumberOfPresets.JoinNumber, null);
-
- EISC.SetBoolSigAction(JoinMap.CameraModeAuto.JoinNumber, null);
- EISC.SetBoolSigAction(JoinMap.CameraModeManual.JoinNumber, null);
- EISC.SetBoolSigAction(JoinMap.CameraModeOff.JoinNumber, null);
- }
-
- ///
- /// Helper method to update the full status of the camera
- ///
- void SendCameraFullMessageObject()
- {
- var presetList = new List();
-
- // Build a list of camera presets based on the names and count
- if (EISC.GetBool(JoinMap.SupportsPresets.JoinNumber))
- {
- var presetStart = JoinMap.PresetLabelStart.JoinNumber;
- var presetEnd = JoinMap.PresetLabelStart.JoinNumber + JoinMap.NumberOfPresets.JoinNumber;
-
- var presetId = 1;
- for (uint i = presetStart; i < presetEnd; i++)
- {
- var presetName = EISC.GetString(i);
- var preset = new CameraPreset(presetId, presetName, string.IsNullOrEmpty(presetName), true);
- presetList.Add(preset);
- presetId++;
- }
- }
-
- PostStatusMessage(new
- {
- cameraMode = GetCameraMode(),
- hasPresets = EISC.GetBool(JoinMap.SupportsPresets.JoinNumber),
- presets = presetList
- });
- }
-
- ///
- ///
- ///
- void PostCameraMode()
- {
- PostStatusMessage(new
- {
- cameraMode = GetCameraMode()
- });
- }
-
- ///
- /// Computes the current camera mode
- ///
- ///
- string GetCameraMode()
- {
- string m;
- if (EISC.GetBool(JoinMap.CameraModeAuto.JoinNumber)) m = eCameraControlMode.Auto.ToString().ToLower();
- else if (EISC.GetBool(JoinMap.CameraModeManual.JoinNumber)) m = eCameraControlMode.Manual.ToString().ToLower();
- else m = eCameraControlMode.Off.ToString().ToLower();
- return m;
- }
- }
-}
\ No newline at end of file
diff --git a/PepperDashEssentials/AppServer/Messengers/SIMPLRouteMessenger.cs b/PepperDashEssentials/AppServer/Messengers/SIMPLRouteMessenger.cs
deleted file mode 100644
index 7b8c26d4..00000000
--- a/PepperDashEssentials/AppServer/Messengers/SIMPLRouteMessenger.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro.DeviceSupport;
-
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-
-
-namespace PepperDash.Essentials.AppServer.Messengers
-{
- public class SIMPLRouteMessenger : MessengerBase
- {
- BasicTriList EISC;
-
- uint JoinStart;
-
- public class StringJoin
- {
- ///
- /// 1
- ///
- public const uint CurrentSource = 1;
- }
-
- public SIMPLRouteMessenger(string key, BasicTriList eisc, string messagePath, uint joinStart)
- : base(key, messagePath)
- {
- EISC = eisc;
- JoinStart = joinStart - 1;
-
- EISC.SetStringSigAction(JoinStart + StringJoin.CurrentSource, (s) => SendRoutingFullMessageObject(s));
- }
-
- protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
- {
- appServerController.AddAction(MessagePath + "/fullStatus", new Action(() =>
- {
- SendRoutingFullMessageObject(EISC.GetString(JoinStart + StringJoin.CurrentSource));
- }));
-
- appServerController.AddAction(MessagePath +"/source", new Action(c =>
- {
- EISC.SetString(JoinStart + StringJoin.CurrentSource, c.SourceListItem);
- }));
-
- }
-
- public void CustomUnregsiterWithAppServer(MobileControlSystemController appServerController)
- {
- appServerController.RemoveAction(MessagePath + "/fullStatus");
- appServerController.RemoveAction(MessagePath + "/source");
-
- EISC.SetStringSigAction(JoinStart + StringJoin.CurrentSource, null);
- }
-
- ///
- /// Helper method to update full status of the routing device
- ///
- void SendRoutingFullMessageObject(string sourceKey)
- {
- if (string.IsNullOrEmpty(sourceKey))
- sourceKey = "none";
-
- PostStatusMessage(new
- {
- selectedSourceKey = sourceKey
- });
- }
- }
-}
\ No newline at end of file
diff --git a/PepperDashEssentials/AppServer/Messengers/SIMPLVtcMessenger.cs b/PepperDashEssentials/AppServer/Messengers/SIMPLVtcMessenger.cs
deleted file mode 100644
index 391360fb..00000000
--- a/PepperDashEssentials/AppServer/Messengers/SIMPLVtcMessenger.cs
+++ /dev/null
@@ -1,665 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro.DeviceSupport;
-using Crestron.SimplSharpPro.EthernetCommunication;
-
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Core.Devices.Codec;
-using PepperDash.Essentials.Devices.Common.Cameras;
-
-namespace PepperDash.Essentials.AppServer.Messengers
-{
- public class SIMPLVtcMessenger : MessengerBase
- {
- BasicTriList EISC;
-
- public SIMPLVtcJoinMap JoinMap { get; private set; }
-
- ///********* Bools *********/
- /////
- ///// 724
- /////
- //const uint BDialHangup = 724;
- /////
- ///// 750
- /////
- //const uint BCallIncoming = 750;
- /////
- ///// 751
- /////
- //const uint BIncomingAnswer = 751;
- /////
- ///// 752
- /////
- //const uint BIncomingReject = 752;
- /////
- ///// 741
- /////
- //const uint BSpeedDial1 = 741;
- /////
- ///// 742
- /////
- //const uint BSpeedDial2 = 742;
- /////
- ///// 743
- /////
- //const uint BSpeedDial3 = 743;
- /////
- ///// 744
- /////
- //const uint BSpeedDial4 = 744;
- /////
- ///// 800
- /////
- //const uint BDirectorySearchBusy = 800;
- /////
- ///// 801
- /////
- //const uint BDirectoryLineSelected = 801;
- /////
- ///// 801 when selected entry is a contact
- /////
- //const uint BDirectoryEntryIsContact = 801;
- /////
- ///// 802 To show/hide back button
- /////
- //const uint BDirectoryIsRoot = 802;
- /////
- ///// 803 Pulse from system to inform us when directory is ready
- /////
- //const uint BDirectoryHasChanged = 803;
- /////
- ///// 804
- /////
- //const uint BDirectoryRoot = 804;
- /////
- ///// 805
- /////
- //const uint BDirectoryFolderBack = 805;
- /////
- ///// 806
- /////
- //const uint BDirectoryDialSelectedLine = 806;
- /////
- ///// 811
- /////
- //const uint BCameraControlUp = 811;
- /////
- ///// 812
- /////
- //const uint BCameraControlDown = 812;
- /////
- ///// 813
- /////
- //const uint BCameraControlLeft = 813;
- /////
- ///// 814
- /////
- //const uint BCameraControlRight = 814;
- /////
- ///// 815
- /////
- //const uint BCameraControlZoomIn = 815;
- /////
- ///// 816
- /////
- //const uint BCameraControlZoomOut = 816;
- /////
- ///// 821 - 826
- /////
- //const uint BCameraPresetStart = 821;
-
- /////
- ///// 831
- /////
- //const uint BCameraModeAuto = 831;
- /////
- ///// 832
- /////
- //const uint BCameraModeManual = 832;
- /////
- ///// 833
- /////
- //const uint BCameraModeOff = 833;
-
- /////
- ///// 841
- /////
- //const uint BCameraSelfView = 841;
-
- /////
- ///// 842
- /////
- //const uint BCameraLayout = 842;
- /////
- ///// 843
- /////
- //const uint BCameraSupportsAutoMode = 843;
- /////
- ///// 844
- /////
- //const uint BCameraSupportsOffMode = 844;
-
-
- ///********* Ushorts *********/
- /////
- ///// 760
- /////
- //const uint UCameraNumberSelect = 760;
- /////
- ///// 801
- /////
- //const uint UDirectorySelectRow = 801;
- /////
- ///// 801
- /////
- //const uint UDirectoryRowCount = 801;
-
-
-
- ///********* Strings *********/
- /////
- ///// 701
- /////
- //const uint SCurrentDialString = 701;
- /////
- ///// 702
- /////
- //const uint SCurrentCallName = 702;
- /////
- ///// 703
- /////
- //const uint SCurrentCallNumber = 703;
- /////
- ///// 731
- /////
- //const uint SHookState = 731;
- /////
- ///// 722
- /////
- //const uint SCallDirection = 722;
- /////
- ///// 751
- /////
- //const uint SIncomingCallName = 751;
- /////
- ///// 752
- /////
- //const uint SIncomingCallNumber = 752;
-
- /////
- ///// 800
- /////
- //const uint SDirectorySearchString = 800;
- /////
- ///// 801-1055
- /////
- //const uint SDirectoryEntriesStart = 801;
- /////
- ///// 1056
- /////
- //const uint SDirectoryEntrySelectedName = 1056;
- /////
- ///// 1057
- /////
- //const uint SDirectoryEntrySelectedNumber = 1057;
- /////
- ///// 1058
- /////
- //const uint SDirectorySelectedFolderName = 1058;
-
-
- /////
- ///// 701-712 0-9*#
- /////
- //Dictionary DTMFMap = new Dictionary
- //{
- // { "1", 701 },
- // { "2", 702 },
- // { "3", 703 },
- // { "4", 704 },
- // { "5", 705 },
- // { "6", 706 },
- // { "7", 707 },
- // { "8", 708 },
- // { "9", 709 },
- // { "0", 710 },
- // { "*", 711 },
- // { "#", 712 },
- //};
-
- CodecActiveCallItem CurrentCallItem;
- CodecActiveCallItem IncomingCallItem;
-
- ushort PreviousDirectoryLength = 701;
-
- ///
- ///
- ///
- ///
- ///
- public SIMPLVtcMessenger(string key, BasicTriList eisc, string messagePath)
- : base(key, messagePath)
- {
- EISC = eisc;
-
- JoinMap = new SIMPLVtcJoinMap(701);
-
- CurrentCallItem = new CodecActiveCallItem();
- CurrentCallItem.Type = eCodecCallType.Video;
- CurrentCallItem.Id = "-video-";
- }
-
- ///
- ///
- ///
- ///
- protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
- {
- var asc = appServerController;
- EISC.SetStringSigAction(JoinMap.HookState.JoinNumber, s =>
- {
- CurrentCallItem.Status = (eCodecCallStatus)Enum.Parse(typeof(eCodecCallStatus), s, true);
- PostFullStatus(); // SendCallsList();
- });
-
- EISC.SetStringSigAction(JoinMap.CurrentCallNumber.JoinNumber, s =>
- {
- CurrentCallItem.Number = s;
- PostCallsList();
- });
-
- EISC.SetStringSigAction(JoinMap.CurrentCallName.JoinNumber, s =>
- {
- CurrentCallItem.Name = s;
- PostCallsList();
- });
-
- EISC.SetStringSigAction(JoinMap.CallDirection.JoinNumber, s =>
- {
- CurrentCallItem.Direction = (eCodecCallDirection)Enum.Parse(typeof(eCodecCallDirection), s, true);
- PostCallsList();
- });
-
- EISC.SetBoolSigAction(JoinMap.IncomingCall.JoinNumber, b =>
- {
- if (b)
- {
- var ica = new CodecActiveCallItem()
- {
- Direction = eCodecCallDirection.Incoming,
- Id = "-video-incoming",
- Name = EISC.GetString(JoinMap.IncomingCallName.JoinNumber),
- Number = EISC.GetString(JoinMap.IncomingCallNumber.JoinNumber),
- Status = eCodecCallStatus.Ringing,
- Type = eCodecCallType.Video
- };
- IncomingCallItem = ica;
- }
- else
- {
- IncomingCallItem = null;
- }
- PostCallsList();
- });
-
- EISC.SetBoolSigAction(JoinMap.CameraSupportsAutoMode.JoinNumber, b =>
- {
- PostStatusMessage(new
- {
- cameraSupportsAutoMode = b
- });
- });
- EISC.SetBoolSigAction(JoinMap.CameraSupportsOffMode.JoinNumber, b =>
- {
- PostStatusMessage(new
- {
- cameraSupportsOffMode = b
- });
- });
-
- // Directory insanity
- EISC.SetUShortSigAction(JoinMap.DirectoryRowCount.JoinNumber, u =>
- {
- // The length of the list comes in before the list does.
- // Splice the sig change operation onto the last string sig that will be changing
- // when the directory entries make it through.
- if (PreviousDirectoryLength > 0)
- {
- EISC.ClearStringSigAction(JoinMap.DirectoryEntriesStart.JoinNumber + PreviousDirectoryLength - 1);
- }
- EISC.SetStringSigAction(JoinMap.DirectoryEntriesStart.JoinNumber + u - 1, s => PostDirectory());
- PreviousDirectoryLength = u;
- });
-
- EISC.SetStringSigAction(JoinMap.DirectoryEntrySelectedName.JoinNumber, s =>
- {
- PostStatusMessage(new
- {
- directoryContactSelected = new
- {
- name = EISC.GetString(JoinMap.DirectoryEntrySelectedName.JoinNumber),
- }
- });
- });
-
- EISC.SetStringSigAction(JoinMap.DirectoryEntrySelectedNumber.JoinNumber, s =>
- {
- PostStatusMessage(new
- {
- directoryContactSelected = new
- {
- number = EISC.GetString(JoinMap.DirectoryEntrySelectedNumber.JoinNumber),
- }
- });
- });
-
- EISC.SetStringSigAction(JoinMap.DirectorySelectedFolderName.JoinNumber, s => PostStatusMessage(new
- {
- directorySelectedFolderName = EISC.GetString(JoinMap.DirectorySelectedFolderName.JoinNumber)
- }));
-
- EISC.SetSigTrueAction(JoinMap.CameraModeAuto.JoinNumber, () => PostCameraMode());
- EISC.SetSigTrueAction(JoinMap.CameraModeManual.JoinNumber, () => PostCameraMode());
- EISC.SetSigTrueAction(JoinMap.CameraModeOff.JoinNumber, () => PostCameraMode());
-
- EISC.SetBoolSigAction(JoinMap.CameraSelfView.JoinNumber, b => PostStatusMessage(new
- {
- cameraSelfView = b
- }));
-
- EISC.SetUShortSigAction(JoinMap.CameraNumberSelect.JoinNumber, (u) => PostSelectedCamera());
-
-
- // Add press and holds using helper action
- Action addPHAction = (s, u) =>
- AppServerController.AddAction(MessagePath + s, new PressAndHoldAction(b => EISC.SetBool(u, b)));
- addPHAction("/cameraUp", JoinMap.CameraTiltUp.JoinNumber);
- addPHAction("/cameraDown", JoinMap.CameraTiltDown.JoinNumber);
- addPHAction("/cameraLeft", JoinMap.CameraPanLeft.JoinNumber);
- addPHAction("/cameraRight", JoinMap.CameraPanRight.JoinNumber);
- addPHAction("/cameraZoomIn", JoinMap.CameraZoomIn.JoinNumber);
- addPHAction("/cameraZoomOut", JoinMap.CameraZoomOut.JoinNumber);
-
- // Add straight pulse calls using helper action
- Action addAction = (s, u) =>
- AppServerController.AddAction(MessagePath + s, new Action(() => EISC.PulseBool(u, 100)));
- addAction("/endCallById", JoinMap.EndCall.JoinNumber);
- addAction("/endAllCalls", JoinMap.EndCall.JoinNumber);
- addAction("/acceptById", JoinMap.IncomingAnswer.JoinNumber);
- addAction("/rejectById", JoinMap.IncomingReject.JoinNumber);
-
- var speeddialStart = JoinMap.SpeedDialStart.JoinNumber;
- var speeddialEnd = JoinMap.SpeedDialStart.JoinNumber + JoinMap.SpeedDialStart.JoinSpan;
-
- var speedDialIndex = 1;
- for (uint i = speeddialStart; i < speeddialEnd; i++)
- {
- addAction(string.Format("/speedDial{0}", speedDialIndex), i);
- speedDialIndex++;
- }
-
- addAction("/cameraModeAuto", JoinMap.CameraModeAuto.JoinNumber);
- addAction("/cameraModeManual", JoinMap.CameraModeManual.JoinNumber);
- addAction("/cameraModeOff", JoinMap.CameraModeOff.JoinNumber);
- addAction("/cameraSelfView", JoinMap.CameraSelfView.JoinNumber);
- addAction("/cameraLayout", JoinMap.CameraLayout.JoinNumber);
-
- asc.AddAction("/cameraSelect", new Action(SelectCamera));
-
- // camera presets
- for(uint i = 0; i < 6; i++)
- {
- addAction("/cameraPreset" + (i + 1), JoinMap.CameraPresetStart.JoinNumber + i);
- }
-
- asc.AddAction(MessagePath + "/isReady", new Action(PostIsReady));
- // Get status
- asc.AddAction(MessagePath + "/fullStatus", new Action(PostFullStatus));
- // Dial on string
- asc.AddAction(MessagePath + "/dial", new Action(s =>
- EISC.SetString(JoinMap.CurrentDialString.JoinNumber, s)));
- // Pulse DTMF
- AppServerController.AddAction(MessagePath + "/dtmf", new Action(s =>
- {
- var join = JoinMap.Joins[s];
- if (join != null)
- {
- if (join.JoinNumber > 0)
- {
- EISC.PulseBool(join.JoinNumber, 100);
- }
- }
- }));
-
- // Directory madness
- asc.AddAction(MessagePath + "/directoryRoot", new Action(() => EISC.PulseBool(JoinMap.DirectoryRoot.JoinNumber)));
- asc.AddAction(MessagePath + "/directoryBack", new Action(() => EISC.PulseBool(JoinMap.DirectoryFolderBack.JoinNumber)));
- asc.AddAction(MessagePath + "/directoryById", new Action(s =>
- {
- // the id should contain the line number to forward to simpl
- try
- {
- var u = ushort.Parse(s);
- EISC.SetUshort(JoinMap.DirectorySelectRow.JoinNumber, u);
- EISC.PulseBool(JoinMap.DirectoryLineSelected.JoinNumber);
- }
- catch (Exception)
- {
- Debug.Console(1, this, Debug.ErrorLogLevel.Warning,
- "/directoryById request contains non-numeric ID incompatible with DDVC bridge");
- }
-
- }));
- asc.AddAction(MessagePath + "/directorySelectContact", new Action(s =>
- {
- try
- {
- var u = ushort.Parse(s);
- EISC.SetUshort(JoinMap.DirectorySelectRow.JoinNumber, u);
- EISC.PulseBool(JoinMap.DirectoryLineSelected.JoinNumber);
- }
- catch
- {
-
- }
- }));
- asc.AddAction(MessagePath + "/directoryDialContact", new Action(() => {
- EISC.PulseBool(JoinMap.DirectoryDialSelectedLine.JoinNumber);
- }));
- asc.AddAction(MessagePath + "/getDirectory", new Action(() =>
- {
- if (EISC.GetUshort(JoinMap.DirectoryRowCount.JoinNumber) > 0)
- {
- PostDirectory();
- }
- else
- {
- EISC.PulseBool(JoinMap.DirectoryRoot.JoinNumber);
- }
- }));
- }
-
- ///
- ///
- ///
- void PostFullStatus()
- {
- this.PostStatusMessage(new
- {
- calls = GetCurrentCallList(),
- cameraMode = GetCameraMode(),
- cameraSelfView = EISC.GetBool(JoinMap.CameraSelfView.JoinNumber),
- cameraSupportsAutoMode = EISC.GetBool(JoinMap.CameraSupportsAutoMode.JoinNumber),
- cameraSupportsOffMode = EISC.GetBool(JoinMap.CameraSupportsOffMode.JoinNumber),
- currentCallString = EISC.GetString(JoinMap.CurrentCallNumber.JoinNumber),
- currentDialString = EISC.GetString(JoinMap.CurrentDialString.JoinNumber),
- directoryContactSelected = new
- {
- name = EISC.GetString(JoinMap.DirectoryEntrySelectedName.JoinNumber),
- number = EISC.GetString(JoinMap.DirectoryEntrySelectedNumber.JoinNumber)
- },
- directorySelectedFolderName = EISC.GetString(JoinMap.DirectorySelectedFolderName.JoinNumber),
- isInCall = EISC.GetString(JoinMap.HookState.JoinNumber) == "Connected",
- hasDirectory = true,
- hasDirectorySearch = false,
- hasRecents = !EISC.BooleanOutput[502].BoolValue,
- hasCameras = true,
- showCamerasWhenNotInCall = EISC.BooleanOutput[503].BoolValue,
- selectedCamera = GetSelectedCamera(),
- });
- }
-
- ///
- ///
- ///
- void PostDirectory()
- {
- var u = EISC.GetUshort(JoinMap.DirectoryRowCount.JoinNumber);
- var items = new List