mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-13 11:44:54 +00:00
chore: remove 4SERIES compiler directive
This commit is contained in:
@@ -12,7 +12,7 @@ using Serilog.Events;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common.Displays
|
||||
{
|
||||
public class MockDisplay : TwoWayDisplayBase, IBasicVolumeWithFeedback, IBridgeAdvanced, IHasInputs<string, string>, IRoutingSinkWithSwitchingWithInputPort, IHasPowerControlWithFeedback
|
||||
public class MockDisplay : TwoWayDisplayBase, IBasicVolumeWithFeedback, IBridgeAdvanced, IHasInputs<string>, IRoutingSinkWithSwitchingWithInputPort, IHasPowerControlWithFeedback
|
||||
{
|
||||
public ISelectableItems<string> Inputs { get; private set; }
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.AppServer.Messengers;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||
#if SERIES4
|
||||
#endif
|
||||
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public class IChannelMessenger:MessengerBase
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.AppServer.Messengers;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||
#if SERIES4
|
||||
#endif
|
||||
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public class IDPadMessenger:MessengerBase
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.AppServer.Messengers;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||
#if SERIES4
|
||||
#endif
|
||||
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public class IDvrMessenger: MessengerBase
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.AppServer.Messengers;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||
#if SERIES4
|
||||
#endif
|
||||
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public class INumericKeypadMessenger:MessengerBase
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.AppServer.Messengers;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||
#if SERIES4
|
||||
#endif
|
||||
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public class ISetTopBoxControlsMessenger:MessengerBase
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.AppServer.Messengers;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||
#if SERIES4
|
||||
#endif
|
||||
|
||||
namespace PepperDash.Essentials.Room.MobileControl
|
||||
{
|
||||
public class ITransportMessenger:MessengerBase
|
||||
|
||||
@@ -30,11 +30,8 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
codec.CallStatusChange += Codec_CallStatusChange;
|
||||
}
|
||||
|
||||
#if SERIES4
|
||||
protected override void RegisterActions()
|
||||
#else
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
#endif
|
||||
|
||||
{
|
||||
base.RegisterActions();
|
||||
|
||||
|
||||
@@ -46,11 +46,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
);
|
||||
}
|
||||
|
||||
#if SERIES4
|
||||
protected override void RegisterActions()
|
||||
#else
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
#endif
|
||||
{
|
||||
base.RegisterActions();
|
||||
|
||||
|
||||
@@ -40,11 +40,8 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
|
||||
#region Overrides of MessengerBase
|
||||
|
||||
#if SERIES4
|
||||
protected override void RegisterActions()
|
||||
#else
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
#endif
|
||||
|
||||
{
|
||||
AddAction("/presets/fullStatus", (id, content) => {
|
||||
this.LogInformation("getting full status for client {id}", id);
|
||||
|
||||
@@ -47,11 +47,8 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
|
||||
#region Overrides of MessengerBase
|
||||
|
||||
#if SERIES4
|
||||
|
||||
protected override void RegisterActions()
|
||||
#else
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
#endif
|
||||
{
|
||||
AddAction("/fullStatus", (id, content) => SendStatus());
|
||||
|
||||
|
||||
@@ -10,11 +10,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
}
|
||||
|
||||
#if SERIES4
|
||||
protected override void RegisterActions()
|
||||
#else
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
#endif
|
||||
{
|
||||
base.RegisterActions();
|
||||
|
||||
|
||||
@@ -20,11 +20,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
ScheduleSource.CodecSchedule.MeetingEventChange += new EventHandler<MeetingEventArgs>(CodecSchedule_MeetingEventChange);
|
||||
}
|
||||
|
||||
#if SERIES4
|
||||
protected override void RegisterActions()
|
||||
#else
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
#endif
|
||||
{
|
||||
AddAction("/schedule/fullStatus", (id, content) => SendFullScheduleObject());
|
||||
}
|
||||
|
||||
@@ -31,11 +31,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
SendRoutingFullMessageObject();
|
||||
}
|
||||
|
||||
#if SERIES4
|
||||
protected override void RegisterActions()
|
||||
#else
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
#endif
|
||||
{
|
||||
AddAction("/fullStatus", (id, content) => SendRoutingFullMessageObject());
|
||||
|
||||
|
||||
@@ -21,11 +21,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
this.device = device;
|
||||
}
|
||||
|
||||
#if SERIES4
|
||||
protected override void RegisterActions()
|
||||
#else
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
#endif
|
||||
{
|
||||
base.RegisterActions();
|
||||
|
||||
|
||||
@@ -30,11 +30,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
PostStatusMessage(state);
|
||||
}
|
||||
|
||||
#if SERIES4
|
||||
protected override void RegisterActions()
|
||||
#else
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
#endif
|
||||
{
|
||||
base.RegisterActions();
|
||||
|
||||
|
||||
@@ -13,11 +13,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
/// <summary>
|
||||
/// Provides a messaging bridge
|
||||
/// </summary>
|
||||
#if SERIES4
|
||||
public abstract class MessengerBase : EssentialsDevice, IMobileControlMessenger
|
||||
#else
|
||||
public abstract class MessengerBase: EssentialsDevice
|
||||
#endif
|
||||
{
|
||||
protected IKeyName _device;
|
||||
|
||||
@@ -30,11 +26,8 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
#if SERIES4
|
||||
|
||||
public IMobileControl AppServerController { get; private set; }
|
||||
#else
|
||||
public MobileControlSystemController AppServerController { get; private set; }
|
||||
#endif
|
||||
|
||||
public string MessagePath { get; private set; }
|
||||
|
||||
@@ -76,11 +69,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
/// Registers this messenger with appserver controller
|
||||
/// </summary>
|
||||
/// <param name="appServerController"></param>
|
||||
#if SERIES4
|
||||
public void RegisterWithAppServer(IMobileControl appServerController)
|
||||
#else
|
||||
public void RegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
#endif
|
||||
{
|
||||
AppServerController = appServerController ?? throw new ArgumentNullException("appServerController");
|
||||
|
||||
@@ -133,11 +122,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
/// Implemented in extending classes. Wire up API calls and feedback here
|
||||
/// </summary>
|
||||
/// <param name="appServerController"></param>
|
||||
#if SERIES4
|
||||
protected virtual void RegisterActions()
|
||||
#else
|
||||
protected virtual void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
#endif
|
||||
{
|
||||
|
||||
}
|
||||
@@ -174,7 +159,6 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
}
|
||||
}
|
||||
|
||||
#if SERIES4
|
||||
protected void PostStatusMessage(string type, DeviceStateMessageBase deviceState, string clientId = null)
|
||||
{
|
||||
try
|
||||
@@ -195,7 +179,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
Debug.LogMessage(ex, "Exception posting status message", this);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
protected void PostStatusMessage(JToken content, string type = "", string clientId = null)
|
||||
{
|
||||
try
|
||||
|
||||
@@ -21,11 +21,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
|
||||
#region Overrides of MessengerBase
|
||||
|
||||
#if SERIES4
|
||||
protected override void RegisterActions()
|
||||
#else
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
#endif
|
||||
{
|
||||
AddAction("/saveScheduledEvents", (id, content) => SaveScheduledEvents(content.ToObject<List<ScheduledEventConfig>>()));
|
||||
AddAction("/status", (id, content) =>
|
||||
|
||||
@@ -57,11 +57,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="appServerController"></param>
|
||||
#if SERIES4
|
||||
protected override void RegisterActions()
|
||||
#else
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
#endif
|
||||
{
|
||||
//EISC.SetStringSigAction(SCurrentDialString, s => PostStatusMessage(new { currentDialString = s }));
|
||||
|
||||
|
||||
@@ -32,11 +32,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
}
|
||||
|
||||
|
||||
#if SERIES4
|
||||
protected override void RegisterActions()
|
||||
#else
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
#endif
|
||||
{
|
||||
AddAction("/fullStatus", (id, content) => SendCameraFullMessageObject());
|
||||
|
||||
@@ -84,11 +80,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
cameraAction(state.Value.Equals("true", StringComparison.InvariantCultureIgnoreCase));
|
||||
}
|
||||
|
||||
#if SERIES4
|
||||
public void CustomUnregsiterWithAppServer(IMobileControl appServerController)
|
||||
#else
|
||||
public void CustomUnregsiterWithAppServer(MobileControlSystemController appServerController)
|
||||
#endif
|
||||
public void CustomUnregisterWithAppServer(IMobileControl appServerController)
|
||||
{
|
||||
appServerController.RemoveAction(MessagePath + "/fullStatus");
|
||||
|
||||
|
||||
@@ -26,11 +26,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
|
||||
#region Overrides of MessengerBase
|
||||
|
||||
#if SERIES4
|
||||
protected override void RegisterActions()
|
||||
#else
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController controller)
|
||||
#endif
|
||||
{
|
||||
Debug.Console(2, "********** Direct Route Messenger CustomRegisterWithAppServer **********");
|
||||
|
||||
|
||||
@@ -30,11 +30,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
_eisc.SetStringSigAction(_joinStart + StringJoin.CurrentSource, SendRoutingFullMessageObject);
|
||||
}
|
||||
|
||||
#if SERIES4
|
||||
protected override void RegisterActions()
|
||||
#else
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
#endif
|
||||
{
|
||||
AddAction("/fullStatus",
|
||||
(id, content) => SendRoutingFullMessageObject(_eisc.GetString(_joinStart + StringJoin.CurrentSource)));
|
||||
@@ -47,11 +43,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
});
|
||||
}
|
||||
|
||||
#if SERIES4
|
||||
public void CustomUnregsiterWithAppServer(IMobileControl appServerController)
|
||||
#else
|
||||
public void CustomUnregsiterWithAppServer(MobileControlSystemController appServerController)
|
||||
#endif
|
||||
public void CustomUnregisterWithAppServer(IMobileControl appServerController)
|
||||
{
|
||||
appServerController.RemoveAction(MessagePath + "/fullStatus");
|
||||
appServerController.RemoveAction(MessagePath + "/source");
|
||||
|
||||
@@ -43,11 +43,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="appServerController"></param>
|
||||
#if SERIES4
|
||||
protected override void RegisterActions()
|
||||
#else
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
#endif
|
||||
{
|
||||
_eisc.SetStringSigAction(JoinMap.HookState.JoinNumber, s =>
|
||||
{
|
||||
|
||||
@@ -16,11 +16,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
device = shades;
|
||||
}
|
||||
|
||||
#if SERIES4
|
||||
protected override void RegisterActions()
|
||||
#else
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
#endif
|
||||
{
|
||||
base.RegisterActions();
|
||||
|
||||
|
||||
@@ -83,11 +83,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
));
|
||||
}
|
||||
|
||||
#if SERIES4
|
||||
protected override void RegisterActions()
|
||||
#else
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
#endif
|
||||
{
|
||||
AddAction("/fullStatus", (id, content) => SendFullStatusMessage());
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||
using TwoWayDisplayBase = PepperDash.Essentials.Devices.Common.Displays.TwoWayDisplayBase;
|
||||
using PepperDash.Essentials.Devices.Common.Displays;
|
||||
|
||||
namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
@@ -33,11 +32,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
PostStatusMessage(messageObj);
|
||||
}
|
||||
|
||||
#if SERIES4
|
||||
protected override void RegisterActions()
|
||||
#else
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
#endif
|
||||
{
|
||||
base.RegisterActions();
|
||||
|
||||
|
||||
@@ -152,11 +152,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
/// Called from base's RegisterWithAppServer method
|
||||
/// </summary>
|
||||
/// <param name="appServerController"></param>
|
||||
#if SERIES4
|
||||
protected override void RegisterActions()
|
||||
#else
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
#endif
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -4,12 +4,7 @@ using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||
|
||||
namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
|
||||
#if SERIES4
|
||||
public class MobileControlMessage : IMobileControlMessage
|
||||
#else
|
||||
public class MobileControlMessage
|
||||
#endif
|
||||
{
|
||||
[JsonProperty("type")]
|
||||
public string Type { get; set; }
|
||||
|
||||
@@ -16,30 +16,14 @@ namespace PepperDash.Essentials
|
||||
[JsonProperty("clientAppUrl")]
|
||||
public string ClientAppUrl { get; set; }
|
||||
|
||||
#if SERIES4
|
||||
[JsonProperty("directServer")]
|
||||
public MobileControlDirectServerPropertiesConfig DirectServer { get; set; }
|
||||
|
||||
[JsonProperty("applicationConfig")]
|
||||
public MobileControlApplicationConfig ApplicationConfig { get; set; }
|
||||
public MobileControlApplicationConfig ApplicationConfig { get; set; } = null;
|
||||
|
||||
[JsonProperty("enableApiServer")]
|
||||
public bool EnableApiServer { get; set; }
|
||||
#endif
|
||||
|
||||
[JsonProperty("roomBridges")]
|
||||
[Obsolete("No longer necessary")]
|
||||
public List<MobileControlRoomBridgePropertiesConfig> RoomBridges { get; set; }
|
||||
|
||||
public MobileControlConfig()
|
||||
{
|
||||
RoomBridges = new List<MobileControlRoomBridgePropertiesConfig>();
|
||||
|
||||
#if SERIES4
|
||||
EnableApiServer = true; // default to true
|
||||
ApplicationConfig = null;
|
||||
#endif
|
||||
}
|
||||
public bool EnableApiServer { get; set; } = true;
|
||||
}
|
||||
|
||||
public class MobileControlDirectServerPropertiesConfig
|
||||
|
||||
@@ -28,6 +28,7 @@ using PepperDash.Essentials.Core.Shades;
|
||||
using PepperDash.Essentials.Core.Web;
|
||||
using PepperDash.Essentials.Devices.Common.AudioCodec;
|
||||
using PepperDash.Essentials.Devices.Common.Cameras;
|
||||
using PepperDash.Essentials.Devices.Common.Displays;
|
||||
using PepperDash.Essentials.Devices.Common.SoftCodec;
|
||||
using PepperDash.Essentials.Devices.Common.VideoCodec;
|
||||
using PepperDash.Essentials.Room.MobileControl;
|
||||
@@ -35,10 +36,6 @@ using PepperDash.Essentials.Services;
|
||||
using PepperDash.Essentials.WebApiHandlers;
|
||||
using Serilog.Events;
|
||||
using WebSocketSharp;
|
||||
using DisplayBase = PepperDash.Essentials.Devices.Common.Displays.DisplayBase;
|
||||
using TwoWayDisplayBase = PepperDash.Essentials.Devices.Common.Displays.TwoWayDisplayBase;
|
||||
#if SERIES4
|
||||
#endif
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
@@ -59,16 +56,11 @@ namespace PepperDash.Essentials
|
||||
private readonly List<MobileControlBridgeBase> _roomBridges =
|
||||
new List<MobileControlBridgeBase>();
|
||||
|
||||
#if SERIES4
|
||||
private readonly Dictionary<string, IMobileControlMessenger> _messengers =
|
||||
new Dictionary<string, IMobileControlMessenger>();
|
||||
|
||||
private readonly Dictionary<string, IMobileControlMessenger> _defaultMessengers =
|
||||
new Dictionary<string, IMobileControlMessenger>();
|
||||
#else
|
||||
private readonly Dictionary<string, MessengerBase> _deviceMessengers =
|
||||
new Dictionary<string, MessengerBase>();
|
||||
#endif
|
||||
|
||||
private readonly GenericQueue _transmitToServerQueue;
|
||||
|
||||
@@ -81,11 +73,10 @@ namespace PepperDash.Essentials
|
||||
|
||||
public List<MobileControlBridgeBase> RoomBridges => _roomBridges;
|
||||
|
||||
#if SERIES4
|
||||
private readonly MobileControlWebsocketServer _directServer;
|
||||
|
||||
public MobileControlWebsocketServer DirectServer => _directServer;
|
||||
#endif
|
||||
|
||||
private readonly CCriticalSection _wsCriticalSection = new CCriticalSection();
|
||||
|
||||
public string SystemUrl; //set only from SIMPL Bridge!
|
||||
@@ -191,7 +182,6 @@ namespace PepperDash.Essentials
|
||||
25
|
||||
);
|
||||
|
||||
#if SERIES4
|
||||
if (Config.DirectServer != null && Config.DirectServer.EnableDirectServer)
|
||||
{
|
||||
_directServer = new MobileControlWebsocketServer(
|
||||
@@ -207,7 +197,6 @@ namespace PepperDash.Essentials
|
||||
25
|
||||
);
|
||||
}
|
||||
#endif
|
||||
|
||||
Host = config.ServerUrl;
|
||||
if (!Host.StartsWith("http"))
|
||||
@@ -514,9 +503,8 @@ namespace PepperDash.Essentials
|
||||
// messengerAdded = true;
|
||||
//}
|
||||
|
||||
if (device is TwoWayDisplayBase)
|
||||
{
|
||||
var display = device as TwoWayDisplayBase;
|
||||
if (device is TwoWayDisplayBase twoWayDisplay)
|
||||
{
|
||||
Debug.Console(
|
||||
2,
|
||||
this,
|
||||
@@ -526,7 +514,7 @@ namespace PepperDash.Essentials
|
||||
var twoWayDisplayMessenger = new TwoWayDisplayBaseMessenger(
|
||||
$"{device.Key}-twoWayDisplay-{Key}",
|
||||
string.Format("/device/{0}", device.Key),
|
||||
display
|
||||
twoWayDisplay
|
||||
);
|
||||
AddDefaultDeviceMessenger(twoWayDisplayMessenger);
|
||||
|
||||
@@ -1281,11 +1269,7 @@ namespace PepperDash.Essentials
|
||||
return _messengers.ContainsKey(key);
|
||||
}
|
||||
|
||||
#if SERIES4
|
||||
public void AddDeviceMessenger(IMobileControlMessenger messenger)
|
||||
#else
|
||||
public void AddDeviceMessenger(MessengerBase messenger)
|
||||
#endif
|
||||
{
|
||||
if (_messengers.ContainsKey(messenger.Key))
|
||||
{
|
||||
@@ -1815,10 +1799,9 @@ namespace PepperDash.Essentials
|
||||
var conn = _wsClient2 == null ? "No client" : (_wsClient2.IsAlive ? "Yes" : "No");
|
||||
|
||||
var secSinceLastAck = DateTime.Now - _lastAckMessage;
|
||||
#if SERIES4
|
||||
|
||||
if (Config.EnableApiServer)
|
||||
{
|
||||
#endif
|
||||
CrestronConsole.ConsoleCommandResponse(
|
||||
@"Mobile Control Edge Server API Information:
|
||||
|
||||
@@ -1837,7 +1820,6 @@ namespace PepperDash.Essentials
|
||||
conn,
|
||||
secSinceLastAck.Seconds
|
||||
);
|
||||
#if SERIES4
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1916,7 +1898,6 @@ Mobile Control Direct Server Infromation:
|
||||
Not Enabled in Config."
|
||||
);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1924,7 +1905,7 @@ Mobile Control Direct Server Infromation:
|
||||
/// </summary>
|
||||
public void RegisterSystemToServer()
|
||||
{
|
||||
#if SERIES4
|
||||
|
||||
if (!Config.EnableApiServer)
|
||||
{
|
||||
Debug.Console(
|
||||
@@ -1934,7 +1915,7 @@ Mobile Control Direct Server Infromation:
|
||||
);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
var result = CreateWebsocket();
|
||||
|
||||
if (!result)
|
||||
@@ -2177,10 +2158,10 @@ Mobile Control Direct Server Infromation:
|
||||
var essentialsVersion = Global.AssemblyVersion;
|
||||
confObject.Info.RuntimeInfo.AssemblyVersion = essentialsVersion;
|
||||
|
||||
//#if DEBUG
|
||||
|
||||
// // Set for local testing
|
||||
// confObject.RuntimeInfo.PluginVersion = "4.0.0-localBuild";
|
||||
//#else
|
||||
|
||||
// Populate the plugin version
|
||||
var pluginVersion = Assembly
|
||||
.GetExecutingAssembly()
|
||||
@@ -2197,7 +2178,6 @@ Mobile Control Direct Server Infromation:
|
||||
confObject.RuntimeInfo.PepperDashCoreVersion = PluginLoader.PepperDashCoreAssembly.Version;
|
||||
confObject.RuntimeInfo.EssentialsPlugins = PluginLoader.EssentialsPluginAssemblies;
|
||||
}
|
||||
//#endif
|
||||
return confObject;
|
||||
}
|
||||
|
||||
@@ -2218,12 +2198,12 @@ Mobile Control Direct Server Infromation:
|
||||
/// <param name="o"></param>
|
||||
public void SendMessageObject(IMobileControlMessage o)
|
||||
{
|
||||
#if SERIES4
|
||||
|
||||
if (Config.EnableApiServer)
|
||||
{
|
||||
#endif
|
||||
|
||||
_transmitToServerQueue.Enqueue(new TransmitMessage(o, _wsClient2));
|
||||
#if SERIES4
|
||||
|
||||
}
|
||||
|
||||
if (
|
||||
@@ -2234,10 +2214,10 @@ Mobile Control Direct Server Infromation:
|
||||
{
|
||||
_transmitToClientsQueue.Enqueue(new MessageToClients(o, _directServer));
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#if SERIES4
|
||||
|
||||
public void SendMessageObjectToDirectClient(object o)
|
||||
{
|
||||
if (
|
||||
@@ -2249,7 +2229,7 @@ Mobile Control Direct Server Infromation:
|
||||
_transmitToClientsQueue.Enqueue(new MessageToClients(o, _directServer));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Disconnects the Websocket Client and stops the heartbeat timer
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<ProjectType>ProgramLibrary</ProjectType>
|
||||
</PropertyGroup>
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<RootNamespace>PepperDash.Essentials</RootNamespace>
|
||||
<TargetFramework>net472</TargetFramework>
|
||||
|
||||
@@ -1,36 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Core.Logging;
|
||||
using PepperDash.Essentials.AppServer;
|
||||
using PepperDash.Essentials.AppServer.Messengers;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||
using PepperDash.Essentials.Room.MobileControl;
|
||||
using PepperDash.Essentials.Room.Config;
|
||||
using PepperDash.Essentials.Devices.Common.VideoCodec;
|
||||
using PepperDash.Essentials.Devices.Common.AudioCodec;
|
||||
using PepperDash.Essentials.Devices.Common.Cameras;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using PepperDash.Essentials.Devices.Common.Room;
|
||||
using IShades = PepperDash.Essentials.Core.Shades.IShades;
|
||||
using ShadeBase = PepperDash.Essentials.Devices.Common.Shades.ShadeBase;
|
||||
using PepperDash.Essentials.Devices.Common.TouchPanel;
|
||||
using Crestron.SimplSharp;
|
||||
using Volume = PepperDash.Essentials.Room.MobileControl.Volume;
|
||||
using PepperDash.Essentials.Core.CrestronIO;
|
||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||
using PepperDash.Essentials.Core.Lighting;
|
||||
using PepperDash.Essentials.Core.Shades;
|
||||
using PepperDash.Core.Logging;
|
||||
|
||||
|
||||
|
||||
#if SERIES4
|
||||
using PepperDash.Essentials.AppServer;
|
||||
#endif
|
||||
using PepperDash.Essentials.Devices.Common.AudioCodec;
|
||||
using PepperDash.Essentials.Devices.Common.Cameras;
|
||||
using PepperDash.Essentials.Devices.Common.Room;
|
||||
using PepperDash.Essentials.Devices.Common.VideoCodec;
|
||||
using PepperDash.Essentials.Room.Config;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using IShades = PepperDash.Essentials.Core.Shades.IShades;
|
||||
using ShadeBase = PepperDash.Essentials.Devices.Common.Shades.ShadeBase;
|
||||
using Volume = PepperDash.Essentials.Room.MobileControl.Volume;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
@@ -66,11 +57,8 @@ namespace PepperDash.Essentials
|
||||
AddPreActivationAction(GetRoom);
|
||||
}
|
||||
|
||||
#if SERIES4
|
||||
|
||||
protected override void RegisterActions()
|
||||
#else
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
#endif
|
||||
{
|
||||
// we add actions to the messaging system with a path, and a related action. Custom action
|
||||
// content objects can be handled in the controller's LineReceived method - and perhaps other
|
||||
|
||||
@@ -175,11 +175,8 @@ namespace PepperDash.Essentials.Room.MobileControl
|
||||
ConfigIsLoaded = true;
|
||||
}
|
||||
|
||||
#if SERIES4
|
||||
protected override void RegisterActions()
|
||||
#else
|
||||
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
|
||||
#endif
|
||||
|
||||
{
|
||||
SetupFunctions();
|
||||
SetupFeedbacks();
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace PepperDash.Essentials
|
||||
}
|
||||
|
||||
|
||||
#if SERIES4
|
||||
|
||||
public class MessageToClients : IQueueMessage
|
||||
{
|
||||
private readonly MobileControlWebsocketServer _server;
|
||||
@@ -146,5 +146,4 @@ namespace PepperDash.Essentials
|
||||
#endregion
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
Reference in New Issue
Block a user