mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-14 04:04:58 +00:00
Compare commits
31 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d8c7e3cfc7 | ||
|
|
eeb106c489 | ||
|
|
c1d62ea5d4 | ||
|
|
9148cfd819 | ||
|
|
60550caf99 | ||
|
|
59baa74dd7 | ||
|
|
bf31bf9e93 | ||
|
|
ee8776cfb1 | ||
|
|
0b59990532 | ||
|
|
8d3fd343f1 | ||
|
|
372274d9fa | ||
|
|
403c03491c | ||
|
|
3770c2a47d | ||
|
|
5f4a1f768e | ||
|
|
7eed7866f1 | ||
|
|
c5403f33c5 | ||
|
|
c9f10ecb90 | ||
|
|
ef2da21c2a | ||
|
|
b0920746d1 | ||
|
|
b531d724ff | ||
|
|
1b17d92ee0 | ||
|
|
2c0739df4b | ||
|
|
b77fc3647a | ||
|
|
1fe8993db3 | ||
|
|
f735f7377d | ||
|
|
4e43565c1a | ||
|
|
97e157b5b6 | ||
|
|
157ef3397f | ||
|
|
16c39b5201 | ||
|
|
8f278f4ec2 | ||
|
|
a81f92481c |
@@ -1,6 +1,6 @@
|
|||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Version>2.0.0-local</Version>
|
<Version>2.4.0-local</Version>
|
||||||
<InformationalVersion>$(Version)</InformationalVersion>
|
<InformationalVersion>$(Version)</InformationalVersion>
|
||||||
<Authors>PepperDash Technology</Authors>
|
<Authors>PepperDash Technology</Authors>
|
||||||
<Company>PepperDash Technology</Company>
|
<Company>PepperDash Technology</Company>
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
<Project>
|
<Project>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<None Include="$(TargetDir)$(TargetName).$(Version).$(TargetFramework).clz" Condition="$(ProjectType) == 'Library'">
|
||||||
|
<Pack>true</Pack>
|
||||||
|
<PackagePath>build;</PackagePath>
|
||||||
|
</None>
|
||||||
<None Include="$(TargetDir)$(TargetName).$(Version).$(TargetFramework).cpz" Condition="$(ProjectType) == 'Program'">
|
<None Include="$(TargetDir)$(TargetName).$(Version).$(TargetFramework).cpz" Condition="$(ProjectType) == 'Program'">
|
||||||
<Pack>true</Pack>
|
<Pack>true</Pack>
|
||||||
<PackagePath>build;</PackagePath>
|
<PackagePath>build;</PackagePath>
|
||||||
@@ -9,30 +13,41 @@
|
|||||||
<PackagePath>build;</PackagePath>
|
<PackagePath>build;</PackagePath>
|
||||||
</None>
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<PropertyGroup Condition="$(ProjectType) == 'Library'">
|
||||||
|
<FileName>$(TargetDir)$(TargetName).$(Version).$(TargetFramework).clz</FileName>
|
||||||
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="$(ProjectType) == 'ProgramLibrary'">
|
<PropertyGroup Condition="$(ProjectType) == 'ProgramLibrary'">
|
||||||
<FileName>$(TargetDir)$(TargetName).$(Version).$(TargetFramework).cplz</FileName>
|
<FileName>$(TargetDir)$(TargetName).$(Version).$(TargetFramework).cplz</FileName>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="$(ProjectType) == 'Program'">
|
<PropertyGroup Condition="$(ProjectType) == 'Program'">
|
||||||
<FileName>$(TargetDir)$(TargetName).$(Version).$(TargetFramework).cpz</FileName>
|
<FileName>$(TargetDir)$(TargetName).$(Version).$(TargetFramework).cpz</FileName>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Target Name="DeleteCPLZ" BeforeTargets="PreBuildEvent" Condition="$(ProjectType) == 'ProgramLibrary' And $(TargetDir) != '' And Exists($(FileName))">
|
|
||||||
<Delete Files="$(TargetDir)$(TargetName).$(Version).$(TargetFramework).cplz">
|
<Target Name="DeleteCLZ" BeforeTargets="PreBuildEvent" Condition="$(ProjectType) == 'Library' And $(TargetDir) != '' And Exists($(FileName))">
|
||||||
|
<Delete Files="$(TargetDir)$(TargetName).$(Version).$(TargetFramework).clz">
|
||||||
<Output TaskParameter="DeletedFiles" ItemName="DeletedList"/>
|
<Output TaskParameter="DeletedFiles" ItemName="DeletedList"/>
|
||||||
</Delete>
|
</Delete>
|
||||||
<Message Text="Deleted files: '@(DeletedList)'" />
|
<Message Text="Deleted files: '@(DeletedList)'" />
|
||||||
</Target>
|
</Target>
|
||||||
<Target Name="CreateCPLZ" AfterTargets="Build" Condition="$(ProjectType) == 'ProgramLibrary' And $(TargetDir) != ''" DependsOnTargets="DeleteCPLZ">
|
|
||||||
<Message Text="Creating CPLZ $(TargetDir)"></Message>
|
|
||||||
<MakeDir Directories="$(PackageOutputPath)" Condition="!Exists($(PackageOutputPath))" />
|
|
||||||
<ZipDirectory SourceDirectory="$(TargetDir)" DestinationFile="$(PackageOutputPath)\$(TargetName).$(Version).$(TargetFramework).cplz" Overwrite="true"/>
|
|
||||||
<Copy SourceFiles="$(PackageOutputPath)\$(TargetName).$(Version).$(TargetFramework).cplz" DestinationFiles="$(TargetDir)$(TargetName).$(Version).$(TargetFramework).cplz" />
|
|
||||||
</Target>
|
|
||||||
<Target Name="DeleteCPZ" BeforeTargets="PreBuildEvent" Condition="$(ProjectType) == 'Program' And $(TargetDir) != '' And Exists($(FileName))">
|
<Target Name="DeleteCPZ" BeforeTargets="PreBuildEvent" Condition="$(ProjectType) == 'Program' And $(TargetDir) != '' And Exists($(FileName))">
|
||||||
<Delete Files="$(TargetDir)$(TargetName).$(Version).$(TargetFramework).cpz">
|
<Delete Files="$(TargetDir)$(TargetName).$(Version).$(TargetFramework).cpz">
|
||||||
<Output TaskParameter="DeletedFiles" ItemName="DeletedList"/>
|
<Output TaskParameter="DeletedFiles" ItemName="DeletedList"/>
|
||||||
</Delete>
|
</Delete>
|
||||||
<Message Text="Deleted files: '@(DeletedList)'" />
|
<Message Text="Deleted files: '@(DeletedList)'" />
|
||||||
</Target>
|
</Target>
|
||||||
|
<Target Name="DeleteCPLZ" BeforeTargets="PreBuildEvent" Condition="$(ProjectType) == 'ProgramLibrary' And $(TargetDir) != '' And Exists($(FileName))">
|
||||||
|
<Delete Files="$(TargetDir)$(TargetName).$(Version).$(TargetFramework).cplz">
|
||||||
|
<Output TaskParameter="DeletedFiles" ItemName="DeletedList"/>
|
||||||
|
</Delete>
|
||||||
|
<Message Text="Deleted files: '@(DeletedList)'" />
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="CreateCPLZ" AfterTargets="Build" Condition="$(ProjectType) == 'ProgramLibrary' And $(TargetDir) != ''" DependsOnTargets="DeleteCPLZ">
|
||||||
|
<Message Text="Creating CPLZ $(TargetDir)"></Message>
|
||||||
|
<MakeDir Directories="$(PackageOutputPath)" Condition="!Exists($(PackageOutputPath))" />
|
||||||
|
<ZipDirectory SourceDirectory="$(TargetDir)" DestinationFile="$(PackageOutputPath)\$(TargetName).$(Version).$(TargetFramework).cplz" Overwrite="true"/>
|
||||||
|
<Copy SourceFiles="$(PackageOutputPath)\$(TargetName).$(Version).$(TargetFramework).cplz" DestinationFiles="$(TargetDir)$(TargetName).$(Version).$(TargetFramework).cplz" />
|
||||||
|
</Target>
|
||||||
<Target Name="Copy CLZ" AfterTargets="SimplSharpPostProcess" Condition="($(ProjectType) == 'Library')">
|
<Target Name="Copy CLZ" AfterTargets="SimplSharpPostProcess" Condition="($(ProjectType) == 'Library')">
|
||||||
<Message Text="Copying CLZ"></Message>
|
<Message Text="Copying CLZ"></Message>
|
||||||
<Move SourceFiles="$(TargetDir)\$(TargetName).clz" DestinationFiles="$(TargetDir)\$(TargetName).$(Version).$(TargetFramework).clz"/>
|
<Move SourceFiles="$(TargetDir)\$(TargetName).clz" DestinationFiles="$(TargetDir)\$(TargetName).$(Version).$(TargetFramework).clz"/>
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
Hardware.OnlineStatusChange += Hardware_OnlineStatusChange;
|
Hardware.OnlineStatusChange += Hardware_OnlineStatusChange;
|
||||||
CommunicationMonitor.Start();
|
CommunicationMonitor.Start();
|
||||||
|
|
||||||
return true;
|
return base.CustomActivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -11,5 +11,16 @@ namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
|||||||
bool WebviewIsVisible { get; }
|
bool WebviewIsVisible { get; }
|
||||||
void ShowWebView(string url, string mode, string title, string target);
|
void ShowWebView(string url, string mode, string title, string target);
|
||||||
void HideWebView();
|
void HideWebView();
|
||||||
|
event EventHandler<WebViewStatusChangedEventArgs> WebViewStatusChanged;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class WebViewStatusChangedEventArgs : EventArgs
|
||||||
|
{
|
||||||
|
public string Status { get; }
|
||||||
|
|
||||||
|
public WebViewStatusChangedEventArgs(string status)
|
||||||
|
{
|
||||||
|
Status = status;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ using PepperDash.Essentials.Core.Config;
|
|||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using Serilog.Events;
|
using Serilog.Events;
|
||||||
|
using System.IO;
|
||||||
|
using PepperDash.Core.Logging;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core
|
namespace PepperDash.Essentials.Core
|
||||||
{
|
{
|
||||||
@@ -69,7 +71,26 @@ namespace PepperDash.Essentials.Core
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var filePath = Global.FilePathPrefix + "ir" + Global.DirectorySeparator + config.Properties["control"]["irFile"].Value<string>();
|
// var filePath = Global.FilePathPrefix + "ir" + Global.DirectorySeparator + config.Properties["control"]["irFile"].Value<string>();
|
||||||
|
|
||||||
|
var fileName = config.Properties["control"]["irFile"].Value<string>();
|
||||||
|
|
||||||
|
var files = Directory.GetFiles(Global.FilePathPrefix, fileName, SearchOption.AllDirectories);
|
||||||
|
|
||||||
|
if(files.Length == 0)
|
||||||
|
{
|
||||||
|
this.LogError("IR file {fileName} not found in {path}", fileName, Global.FilePathPrefix);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(files.Length > 1)
|
||||||
|
{
|
||||||
|
this.LogError("IR file {fileName} found in multiple locations: {files}", fileName, files);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var filePath = files[0];
|
||||||
|
|
||||||
Debug.LogMessage(LogEventLevel.Debug, "*************Attempting to load IR file: {0}***************", filePath);
|
Debug.LogMessage(LogEventLevel.Debug, "*************Attempting to load IR file: {0}***************", filePath);
|
||||||
|
|
||||||
LoadDriver(filePath);
|
LoadDriver(filePath);
|
||||||
|
|||||||
@@ -1,81 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using Crestron.SimplSharpPro;
|
|
||||||
|
|
||||||
using PepperDash.Essentials.Core;
|
|
||||||
using PepperDash.Essentials.Core.Config;
|
|
||||||
using PepperDash.Core;
|
|
||||||
using Serilog.Events;
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core.Devices
|
|
||||||
{
|
|
||||||
[Obsolete("Please use PepperDash.Essentials.Devices.Common, this will be removed in 2.1")]
|
|
||||||
public class InRoomPc : EssentialsDevice, IHasFeedback, IRoutingOutputs, IAttachVideoStatus, IUiDisplayInfo, IUsageTracking
|
|
||||||
{
|
|
||||||
public uint DisplayUiType { get { return DisplayUiConstants.TypeLaptop; } }
|
|
||||||
public string IconName { get; set; }
|
|
||||||
public BoolFeedback HasPowerOnFeedback { get; private set; }
|
|
||||||
|
|
||||||
public RoutingOutputPort AnyVideoOut { get; private set; }
|
|
||||||
|
|
||||||
#region IRoutingOutputs Members
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Options: hdmi
|
|
||||||
/// </summary>
|
|
||||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
public InRoomPc(string key, string name)
|
|
||||||
: base(key, name)
|
|
||||||
{
|
|
||||||
IconName = "PC";
|
|
||||||
HasPowerOnFeedback = new BoolFeedback("HasPowerFeedback",
|
|
||||||
() => this.GetVideoStatuses() != VideoStatusOutputs.NoStatus);
|
|
||||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
|
|
||||||
OutputPorts.Add(AnyVideoOut = new RoutingOutputPort(RoutingPortNames.AnyVideoOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
|
||||||
eRoutingPortConnectionType.None, 0, this));
|
|
||||||
}
|
|
||||||
|
|
||||||
#region IHasFeedback Members
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Passes through the VideoStatuses list
|
|
||||||
/// </summary>
|
|
||||||
public FeedbackCollection<Feedback> Feedbacks
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
var newList = new FeedbackCollection<Feedback>();
|
|
||||||
newList.AddRange(this.GetVideoStatuses().ToList());
|
|
||||||
return newList;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region IUsageTracking Members
|
|
||||||
|
|
||||||
public UsageTracking UsageTracker { get; set; }
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
|
|
||||||
[Obsolete("Please use PepperDash.Essentials.Devices.Common, this will be removed in 2.1")]
|
|
||||||
public class InRoomPcFactory : EssentialsDeviceFactory<InRoomPc>
|
|
||||||
{
|
|
||||||
public InRoomPcFactory()
|
|
||||||
{
|
|
||||||
TypeNames = new List<string>() { "inroompc" };
|
|
||||||
}
|
|
||||||
|
|
||||||
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
|
||||||
{
|
|
||||||
Debug.LogMessage(LogEventLevel.Debug, "Factory Attempting to create new InRoomPc Device");
|
|
||||||
return new InRoomPc(dc.Key, dc.Name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,16 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using Crestron.SimplSharp;
|
|
||||||
using Crestron.SimplSharpPro;
|
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
|
||||||
|
|
||||||
using System.ComponentModel;
|
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using Serilog.Events;
|
using System.Threading;
|
||||||
|
using PepperDash.Core.Logging;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core
|
namespace PepperDash.Essentials.Core
|
||||||
{
|
{
|
||||||
@@ -31,35 +22,34 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Return true if the Client is ISocketStatus
|
/// Return true if the Client is ISocketStatus
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsSocket
|
public bool IsSocket => Client is ISocketStatus;
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return Client is ISocketStatus;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
long PollTime;
|
private readonly string PollString;
|
||||||
CTimer PollTimer;
|
private readonly Action PollAction;
|
||||||
string PollString;
|
private readonly long PollTime;
|
||||||
Action PollAction;
|
|
||||||
|
|
||||||
/// <summary>
|
private Timer PollTimer;
|
||||||
///
|
|
||||||
/// </summary>
|
private SemaphoreSlim semaphore = new SemaphoreSlim(1, 1);
|
||||||
/// <param name="client"></param>
|
|
||||||
/// <param name="pollTime">in MS, >= 5000</param>
|
/// <summary>
|
||||||
/// <param name="warningTime">in MS, >= 5000</param>
|
/// GenericCommunicationMonitor constructor
|
||||||
/// <param name="errorTime">in MS, >= 5000</param>
|
///
|
||||||
/// <param name="pollString">String to send to comm</param>
|
/// Note: If the client is a socket, the connection status will be monitored and the PollTimer will be started automatically when the client is connected
|
||||||
public GenericCommunicationMonitor(IKeyed parent, IBasicCommunication client, long pollTime,
|
/// </summary>
|
||||||
|
/// <param name="parent">Parent device</param>
|
||||||
|
/// <param name="client">Communications Client</param>
|
||||||
|
/// <param name="pollTime">Time in MS for polling</param>
|
||||||
|
/// <param name="warningTime">Warning time in MS. If a message is not received before this elapsed time the status will be Warning</param>
|
||||||
|
/// <param name="errorTime">Error time in MS. If a message is not received before this elapsed time the status will be Error</param>
|
||||||
|
/// <param name="pollString">string to send for polling</param>
|
||||||
|
/// <exception cref="ArgumentException">Poll time must be less than warning and error time</exception>
|
||||||
|
public GenericCommunicationMonitor(IKeyed parent, IBasicCommunication client, long pollTime,
|
||||||
long warningTime, long errorTime, string pollString) :
|
long warningTime, long errorTime, string pollString) :
|
||||||
base(parent, warningTime, errorTime)
|
base(parent, warningTime, errorTime)
|
||||||
{
|
{
|
||||||
if (pollTime > warningTime || pollTime > errorTime)
|
if (pollTime > warningTime || pollTime > errorTime)
|
||||||
throw new ArgumentException("pollTime must be less than warning or errorTime");
|
throw new ArgumentException("pollTime must be less than warning or errorTime");
|
||||||
//if (pollTime < 5000)
|
|
||||||
// throw new ArgumentException("pollTime cannot be less than 5000 ms");
|
|
||||||
|
|
||||||
Client = client;
|
Client = client;
|
||||||
PollTime = pollTime;
|
PollTime = pollTime;
|
||||||
@@ -67,26 +57,41 @@ namespace PepperDash.Essentials.Core
|
|||||||
|
|
||||||
if (IsSocket)
|
if (IsSocket)
|
||||||
{
|
{
|
||||||
(Client as ISocketStatus).ConnectionChange += new EventHandler<GenericSocketStatusChageEventArgs>(socket_ConnectionChange);
|
(Client as ISocketStatus).ConnectionChange += Socket_ConnectionChange;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// GenericCommunicationMonitor constructor with a bool to specify whether to monitor BytesReceived
|
||||||
|
///
|
||||||
|
/// Note: If the client is a socket, the connection status will be monitored and the PollTimer will be started automatically when the client is connected
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="parent">Parent device</param>
|
||||||
|
/// <param name="client">Communications Client</param>
|
||||||
|
/// <param name="pollTime">Time in MS for polling</param>
|
||||||
|
/// <param name="warningTime">Warning time in MS. If a message is not received before this elapsed time the status will be Warning</param>
|
||||||
|
/// <param name="errorTime">Error time in MS. If a message is not received before this elapsed time the status will be Error</param>
|
||||||
|
/// <param name="pollString">string to send for polling</param>
|
||||||
|
/// <param name="monitorBytesReceived">Use bytesReceived event instead of textReceived when true</param>
|
||||||
public GenericCommunicationMonitor(IKeyed parent, IBasicCommunication client, long pollTime,
|
public GenericCommunicationMonitor(IKeyed parent, IBasicCommunication client, long pollTime,
|
||||||
long warningTime, long errorTime, string pollString, bool monitorBytesReceived) :
|
long warningTime, long errorTime, string pollString, bool monitorBytesReceived) :
|
||||||
this(parent, client, pollTime, warningTime, errorTime, pollString)
|
this(parent, client, pollTime, warningTime, errorTime, pollString)
|
||||||
{
|
{
|
||||||
SetMonitorBytesReceived(monitorBytesReceived);
|
MonitorBytesReceived = monitorBytesReceived;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Poll is a provided action instead of string
|
/// GenericCommunicationMonitor constructor with a poll action instead of a poll string
|
||||||
|
///
|
||||||
|
/// Note: If the client is a socket, the connection status will be monitored and the PollTimer will be started automatically when the client is connected
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="parent"></param>
|
/// <param name="parent">Parent device</param>
|
||||||
/// <param name="client"></param>
|
/// <param name="client">Communications Client</param>
|
||||||
/// <param name="pollTime"></param>
|
/// <param name="pollTime">Time in MS for polling</param>
|
||||||
/// <param name="warningTime"></param>
|
/// <param name="warningTime">Warning time in MS. If a message is not received before this elapsed time the status will be Warning</param>
|
||||||
/// <param name="errorTime"></param>
|
/// <param name="errorTime">Error time in MS. If a message is not received before this elapsed time the status will be Error</param>
|
||||||
/// <param name="pollBytes"></param>
|
/// <param name="pollAction">Action to execute for polling</param>
|
||||||
|
/// <exception cref="ArgumentException">Poll time must be less than warning and error time</exception>
|
||||||
public GenericCommunicationMonitor(IKeyed parent, IBasicCommunication client, long pollTime,
|
public GenericCommunicationMonitor(IKeyed parent, IBasicCommunication client, long pollTime,
|
||||||
long warningTime, long errorTime, Action pollAction) :
|
long warningTime, long errorTime, Action pollAction) :
|
||||||
base(parent, warningTime, errorTime)
|
base(parent, warningTime, errorTime)
|
||||||
@@ -102,51 +107,67 @@ namespace PepperDash.Essentials.Core
|
|||||||
|
|
||||||
if (IsSocket)
|
if (IsSocket)
|
||||||
{
|
{
|
||||||
(Client as ISocketStatus).ConnectionChange += new EventHandler<GenericSocketStatusChageEventArgs>(socket_ConnectionChange);
|
(Client as ISocketStatus).ConnectionChange += Socket_ConnectionChange;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// GenericCommunicationMonitor constructor with a poll action instead of a poll string and a bool to specify whether to monitor BytesReceived
|
||||||
|
///
|
||||||
|
/// Note: If the client is a socket, the connection status will be monitored and the PollTimer will be started automatically when the client is connected
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="parent">Parent device</param>
|
||||||
|
/// <param name="client">Communications Client</param>
|
||||||
|
/// <param name="pollTime">Time in MS for polling</param>
|
||||||
|
/// <param name="warningTime">Warning time in MS. If a message is not received before this elapsed time the status will be Warning</param>
|
||||||
|
/// <param name="errorTime">Error time in MS. If a message is not received before this elapsed time the status will be Error</param>
|
||||||
|
/// <param name="pollAction">Action to execute for polling</param>
|
||||||
|
/// <param name="monitorBytesReceived">Use bytesReceived event instead of textReceived when true</param>
|
||||||
public GenericCommunicationMonitor(IKeyed parent, IBasicCommunication client, long pollTime,
|
public GenericCommunicationMonitor(IKeyed parent, IBasicCommunication client, long pollTime,
|
||||||
long warningTime, long errorTime, Action pollAction, bool monitorBytesReceived) :
|
long warningTime, long errorTime, Action pollAction, bool monitorBytesReceived) :
|
||||||
this(parent, client, pollTime, warningTime, errorTime, pollAction)
|
this(parent, client, pollTime, warningTime, errorTime, pollAction)
|
||||||
{
|
{
|
||||||
SetMonitorBytesReceived(monitorBytesReceived);
|
MonitorBytesReceived = monitorBytesReceived;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Build the monitor from a config object
|
/// GenericCommunicationMonitor constructor with a config object
|
||||||
/// </summary>
|
///
|
||||||
public GenericCommunicationMonitor(IKeyed parent, IBasicCommunication client,
|
/// Note: If the client is a socket, the connection status will be monitored and the PollTimer will be started automatically when the client is connected
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="parent">Parent Device</param>
|
||||||
|
/// <param name="client">Communications Client</param>
|
||||||
|
/// <param name="props"><see cref="CommunicationMonitorConfig">Communication Monitor Config</see> object</param>
|
||||||
|
public GenericCommunicationMonitor(IKeyed parent, IBasicCommunication client,
|
||||||
CommunicationMonitorConfig props) :
|
CommunicationMonitorConfig props) :
|
||||||
this(parent, client, props.PollInterval, props.TimeToWarning, props.TimeToError, props.PollString)
|
this(parent, client, props.PollInterval, props.TimeToWarning, props.TimeToError, props.PollString)
|
||||||
{
|
{
|
||||||
if (IsSocket)
|
if (IsSocket)
|
||||||
{
|
{
|
||||||
(Client as ISocketStatus).ConnectionChange += new EventHandler<GenericSocketStatusChageEventArgs>(socket_ConnectionChange);
|
(Client as ISocketStatus).ConnectionChange += Socket_ConnectionChange;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Builds the monitor from a config object and takes a bool to specify whether to monitor BytesReceived
|
/// GenericCommunicationMonitor constructor with a config object and a bool to specify whether to monitor BytesReceived
|
||||||
/// Default is to monitor TextReceived
|
///
|
||||||
|
/// Note: If the client is a socket, the connection status will be monitored and the PollTimer will be started automatically when the client is connected
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="parent"></param>
|
/// <param name="parent">Parent Device</param>
|
||||||
/// <param name="client"></param>
|
/// <param name="client">Communications Client</param>
|
||||||
/// <param name="props"></param>
|
/// <param name="props"><see cref="CommunicationMonitorConfig">Communication Monitor Config</see> object</param>
|
||||||
/// <param name="monitorBytesReceived"></param>
|
/// <param name="monitorBytesReceived">Use bytesReceived event instead of textReceived when true</param>
|
||||||
public GenericCommunicationMonitor(IKeyed parent, IBasicCommunication client, CommunicationMonitorConfig props, bool monitorBytesReceived) :
|
public GenericCommunicationMonitor(IKeyed parent, IBasicCommunication client, CommunicationMonitorConfig props, bool monitorBytesReceived) :
|
||||||
this(parent, client, props.PollInterval, props.TimeToWarning, props.TimeToError, props.PollString)
|
this(parent, client, props.PollInterval, props.TimeToWarning, props.TimeToError, props.PollString)
|
||||||
{
|
|
||||||
SetMonitorBytesReceived(monitorBytesReceived);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SetMonitorBytesReceived(bool monitorBytesReceived)
|
|
||||||
{
|
{
|
||||||
MonitorBytesReceived = monitorBytesReceived;
|
MonitorBytesReceived = monitorBytesReceived;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Start the poll cycle
|
||||||
|
/// </summary>
|
||||||
public override void Start()
|
public override void Start()
|
||||||
{
|
{
|
||||||
if (MonitorBytesReceived)
|
if (MonitorBytesReceived)
|
||||||
@@ -163,7 +184,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
BeginPolling();
|
BeginPolling();
|
||||||
}
|
}
|
||||||
|
|
||||||
void socket_ConnectionChange(object sender, GenericSocketStatusChageEventArgs e)
|
private void Socket_ConnectionChange(object sender, GenericSocketStatusChageEventArgs e)
|
||||||
{
|
{
|
||||||
if (!e.Client.IsConnected)
|
if (!e.Client.IsConnected)
|
||||||
{
|
{
|
||||||
@@ -177,57 +198,71 @@ namespace PepperDash.Essentials.Core
|
|||||||
// Start polling and set status to unknow and let poll result update the status to IsOk when a response is received
|
// Start polling and set status to unknow and let poll result update the status to IsOk when a response is received
|
||||||
Status = MonitorStatus.StatusUnknown;
|
Status = MonitorStatus.StatusUnknown;
|
||||||
Start();
|
Start();
|
||||||
BeginPolling();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BeginPolling()
|
private void BeginPolling()
|
||||||
{
|
{
|
||||||
Poll();
|
try
|
||||||
PollTimer = new CTimer(o => Poll(), null, PollTime, PollTime);
|
{
|
||||||
|
semaphore.Wait();
|
||||||
|
{
|
||||||
|
if (PollTimer != null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
PollTimer = new Timer(o => Poll(), null, 0, PollTime);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
semaphore.Release();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stop the poll cycle
|
||||||
|
/// </summary>
|
||||||
public override void Stop()
|
public override void Stop()
|
||||||
{
|
{
|
||||||
if(MonitorBytesReceived)
|
if(MonitorBytesReceived)
|
||||||
{
|
{
|
||||||
Client.BytesReceived -= this.Client_BytesReceived;
|
Client.BytesReceived -= Client_BytesReceived;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Client.TextReceived -= Client_TextReceived;
|
Client.TextReceived -= Client_TextReceived;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PollTimer != null)
|
StopErrorTimers();
|
||||||
|
|
||||||
|
if (PollTimer == null)
|
||||||
{
|
{
|
||||||
PollTimer.Stop();
|
return;
|
||||||
PollTimer = null;
|
|
||||||
StopErrorTimers();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PollTimer.Dispose();
|
||||||
|
PollTimer = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client_TextReceived(object sender, GenericCommMethodReceiveTextArgs e)
|
private void Client_TextReceived(object sender, GenericCommMethodReceiveTextArgs e)
|
||||||
{
|
{
|
||||||
DataReceived();
|
DataReceived();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
private void Client_BytesReceived(object sender, GenericCommMethodReceiveBytesArgs e)
|
||||||
/// Upon any receipt of data, set everything to ok!
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
void Client_BytesReceived(object sender, GenericCommMethodReceiveBytesArgs e)
|
|
||||||
{
|
{
|
||||||
DataReceived();
|
DataReceived();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DataReceived()
|
private void DataReceived()
|
||||||
{
|
{
|
||||||
Status = MonitorStatus.IsOk;
|
Status = MonitorStatus.IsOk;
|
||||||
ResetErrorTimers();
|
ResetErrorTimers();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Poll()
|
private void Poll()
|
||||||
{
|
{
|
||||||
StartErrorTimers();
|
StartErrorTimers();
|
||||||
if (Client.IsConnected)
|
if (Client.IsConnected)
|
||||||
@@ -240,12 +275,14 @@ namespace PepperDash.Essentials.Core
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug.LogMessage(LogEventLevel.Verbose, this, "Comm not connected");
|
this.LogVerbose("Comm not connected");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Communication Monitor Configuration from Essentials Configuration
|
||||||
|
/// </summary>
|
||||||
public class CommunicationMonitorConfig
|
public class CommunicationMonitorConfig
|
||||||
{
|
{
|
||||||
public int PollInterval { get; set; }
|
public int PollInterval { get; set; }
|
||||||
@@ -253,6 +290,9 @@ namespace PepperDash.Essentials.Core
|
|||||||
public int TimeToError { get; set; }
|
public int TimeToError { get; set; }
|
||||||
public string PollString { get; set; }
|
public string PollString { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default constructor. Sets pollInterval to 30s, TimeToWarning to 120s, and TimeToError to 300s
|
||||||
|
/// </summary>
|
||||||
public CommunicationMonitorConfig()
|
public CommunicationMonitorConfig()
|
||||||
{
|
{
|
||||||
PollInterval = 30000;
|
PollInterval = 30000;
|
||||||
|
|||||||
@@ -2,13 +2,14 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharp.CrestronIO;
|
// using Crestron.SimplSharp.CrestronIO;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using Serilog.Events;
|
using Serilog.Events;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
namespace PepperDash.Essentials
|
namespace PepperDash.Essentials
|
||||||
{
|
{
|
||||||
@@ -283,11 +284,21 @@ namespace PepperDash.Essentials
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
static void UnzipAndMoveCplzArchives()
|
static void UnzipAndMoveCplzArchives()
|
||||||
{
|
{
|
||||||
Debug.LogMessage(LogEventLevel.Information, "Looking for .cplz archives from plugins folder...");
|
Debug.LogMessage(LogEventLevel.Information, "Looking for .cplz archives from user folder...");
|
||||||
var di = new DirectoryInfo(_pluginDirectory);
|
//var di = new DirectoryInfo(_pluginDirectory);
|
||||||
var zFiles = di.GetFiles("*.cplz");
|
//var zFiles = di.GetFiles("*.cplz");
|
||||||
|
|
||||||
if (zFiles.Length > 0)
|
//// Find cplz files at the root of the user folder. Makes development/testing easier for VC-4, and helps with mistakes by end users
|
||||||
|
|
||||||
|
//var userDi = new DirectoryInfo(Global.FilePathPrefix);
|
||||||
|
//var userZFiles = userDi.GetFiles("*.cplz");
|
||||||
|
|
||||||
|
Debug.LogInformation("Checking {folder} for .cplz files", Global.FilePathPrefix);
|
||||||
|
var cplzFiles = Directory.GetFiles(Global.FilePathPrefix, "*.cplz", SearchOption.AllDirectories)
|
||||||
|
.Select(f => new FileInfo(f))
|
||||||
|
.ToArray();
|
||||||
|
|
||||||
|
if (cplzFiles.Length > 0)
|
||||||
{
|
{
|
||||||
if (!Directory.Exists(_loadedPluginsDirectoryPath))
|
if (!Directory.Exists(_loadedPluginsDirectoryPath))
|
||||||
{
|
{
|
||||||
@@ -295,12 +306,12 @@ namespace PepperDash.Essentials
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var zfi in zFiles)
|
foreach (var zfi in cplzFiles)
|
||||||
{
|
{
|
||||||
Directory.CreateDirectory(_tempDirectory);
|
Directory.CreateDirectory(_tempDirectory);
|
||||||
var tempDi = new DirectoryInfo(_tempDirectory);
|
var tempDi = new DirectoryInfo(_tempDirectory);
|
||||||
|
|
||||||
Debug.LogMessage(LogEventLevel.Information, "Found cplz: {0}. Unzipping into temp plugins directory", zfi.Name);
|
Debug.LogMessage(LogEventLevel.Information, "Found cplz: {0}. Unzipping into temp plugins directory", zfi.FullName);
|
||||||
var result = CrestronZIP.Unzip(zfi.FullName, tempDi.FullName);
|
var result = CrestronZIP.Unzip(zfi.FullName, tempDi.FullName);
|
||||||
Debug.LogMessage(LogEventLevel.Information, "UnZip Result: {0}", result.ToString());
|
Debug.LogMessage(LogEventLevel.Information, "UnZip Result: {0}", result.ToString());
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using PepperDash.Essentials.Core.Queues;
|
using Crestron.SimplSharpPro.Keypads;
|
||||||
|
using PepperDash.Essentials.Core.Queues;
|
||||||
using PepperDash.Essentials.Core.Routing;
|
using PepperDash.Essentials.Core.Routing;
|
||||||
using Serilog.Events;
|
using Serilog.Events;
|
||||||
using System;
|
using System;
|
||||||
@@ -88,9 +89,17 @@ namespace PepperDash.Essentials.Core
|
|||||||
|
|
||||||
Debug.LogMessage(LogEventLevel.Debug, "Attempting to build source route from {sourceKey} of type {type}", destination, source.Key);
|
Debug.LogMessage(LogEventLevel.Debug, "Attempting to build source route from {sourceKey} of type {type}", destination, source.Key);
|
||||||
|
|
||||||
var audioRouteDescriptor = new RouteDescriptor(source, destination, destinationPort, eRoutingSignalType.Audio);
|
RouteDescriptor audioRouteDescriptor;
|
||||||
|
|
||||||
var audioSuccess = destination.GetRouteToSource(source, null, null, eRoutingSignalType.Audio, 0, audioRouteDescriptor, destinationPort, sourcePort);
|
if (signalType.HasFlag(eRoutingSignalType.SecondaryAudio))
|
||||||
|
{
|
||||||
|
audioRouteDescriptor = new RouteDescriptor(source, destination, destinationPort, eRoutingSignalType.SecondaryAudio);
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
audioRouteDescriptor = new RouteDescriptor(source, destination, destinationPort, eRoutingSignalType.Audio);
|
||||||
|
}
|
||||||
|
|
||||||
|
var audioSuccess = destination.GetRouteToSource(source, null, null, signalType.HasFlag(eRoutingSignalType.SecondaryAudio) ? eRoutingSignalType.SecondaryAudio : eRoutingSignalType.Audio, 0, audioRouteDescriptor, destinationPort, sourcePort);
|
||||||
|
|
||||||
if (!audioSuccess)
|
if (!audioSuccess)
|
||||||
Debug.LogMessage(LogEventLevel.Debug, "Cannot find audio route to {0}", destination, source.Key);
|
Debug.LogMessage(LogEventLevel.Debug, "Cannot find audio route to {0}", destination, source.Key);
|
||||||
@@ -268,13 +277,12 @@ namespace PepperDash.Essentials.Core
|
|||||||
|
|
||||||
if (destinationPort == null)
|
if (destinationPort == null)
|
||||||
{
|
{
|
||||||
|
|
||||||
destinationTieLines = TieLineCollection.Default.Where(t =>
|
destinationTieLines = TieLineCollection.Default.Where(t =>
|
||||||
t.DestinationPort.ParentDevice.Key == destination.Key && (t.Type == signalType || t.Type.HasFlag(eRoutingSignalType.AudioVideo)));
|
t.DestinationPort.ParentDevice.Key == destination.Key && (t.Type.HasFlag(signalType) || signalType == eRoutingSignalType.AudioVideo));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
destinationTieLines = TieLineCollection.Default.Where(t => t.DestinationPort.ParentDevice.Key == destination.Key && t.DestinationPort.Key == destinationPort.Key && (t.Type == signalType || t.Type.HasFlag(eRoutingSignalType.AudioVideo)));
|
destinationTieLines = TieLineCollection.Default.Where(t => t.DestinationPort.ParentDevice.Key == destination.Key && t.DestinationPort.Key == destinationPort.Key && (t.Type.HasFlag(signalType)));
|
||||||
}
|
}
|
||||||
|
|
||||||
// find the TieLine without a port
|
// find the TieLine without a port
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core
|
namespace PepperDash.Essentials.Core
|
||||||
@@ -8,10 +9,11 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class RoutingInputPort : RoutingPort
|
public class RoutingInputPort : RoutingPort
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The IRoutingInputs object this lives on
|
/// The IRoutingInputs object this lives on
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IRoutingInputs ParentDevice { get; private set; }
|
[JsonIgnore]
|
||||||
|
public IRoutingInputs ParentDevice { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Constructor for a basic RoutingInputPort
|
/// Constructor for a basic RoutingInputPort
|
||||||
|
|||||||
@@ -1,14 +1,17 @@
|
|||||||
using System;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core
|
namespace PepperDash.Essentials.Core
|
||||||
{
|
{
|
||||||
public class RoutingOutputPort : RoutingPort
|
public class RoutingOutputPort : RoutingPort
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The IRoutingOutputs object this port lives on
|
/// The IRoutingOutputs object this port lives on
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IRoutingOutputs ParentDevice { get; private set; }
|
///
|
||||||
|
[JsonIgnore]
|
||||||
|
public IRoutingOutputs ParentDevice { get; private set; }
|
||||||
|
|
||||||
public InUseTracking InUseTracker { get; private set; }
|
public InUseTracking InUseTracker { get; private set; }
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
using PepperDash.Core;
|
|
||||||
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core
|
namespace PepperDash.Essentials.Core
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -57,6 +57,16 @@ namespace PepperDash.Essentials.Core
|
|||||||
DestinationPort = destinationPort;
|
DestinationPort = destinationPort;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a tie line with an overriding Type. See help for OverrideType property for info
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="overrideType">The signal type to limit the link to. Overrides DestinationPort.Type</param>
|
||||||
|
public TieLine(RoutingOutputPort sourcePort, RoutingInputPort destinationPort, eRoutingSignalType? overrideType) :
|
||||||
|
this(sourcePort, destinationPort)
|
||||||
|
{
|
||||||
|
OverrideType = overrideType;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a tie line with an overriding Type. See help for OverrideType property for info
|
/// Creates a tie line with an overriding Type. See help for OverrideType property for info
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ using Crestron.SimplSharp.CrestronIO;
|
|||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
@@ -23,6 +24,10 @@ namespace PepperDash.Essentials.Core.Config
|
|||||||
public string DestinationCard { get; set; }
|
public string DestinationCard { get; set; }
|
||||||
public string DestinationPort { get; set; }
|
public string DestinationPort { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("type", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
|
public eRoutingSignalType? OverrideType { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the appropriate tie line for either a card-based device or
|
/// Returns the appropriate tie line for either a card-based device or
|
||||||
/// regular device with ports on-device.
|
/// regular device with ports on-device.
|
||||||
@@ -65,7 +70,7 @@ namespace PepperDash.Essentials.Core.Config
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new TieLine(sourceOutputPort, destinationInputPort);
|
return new TieLine(sourceOutputPort, destinationInputPort, OverrideType);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LogError(string msg)
|
void LogError(string msg)
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
|||||||
|
|
||||||
#region IRoutingOutputs Members
|
#region IRoutingOutputs Members
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; protected set; }
|
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; protected set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
protected override void RegisterActions()
|
protected override void RegisterActions()
|
||||||
|
|
||||||
{
|
{
|
||||||
AddAction("/presets/fullStatus", (id, content) =>
|
AddAction("/fullStatus", (id, content) =>
|
||||||
{
|
{
|
||||||
this.LogInformation("getting full status for client {id}", id);
|
this.LogInformation("getting full status for client {id}", id);
|
||||||
try
|
try
|
||||||
@@ -56,7 +56,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
AddAction("/presets/recall", (id, content) =>
|
AddAction("/recall", (id, content) =>
|
||||||
{
|
{
|
||||||
var p = content.ToObject<PresetChannelMessage>();
|
var p = content.ToObject<PresetChannelMessage>();
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
RecallPreset(dev, p.Preset.Channel);
|
RecallPreset(dev, p.Preset.Channel);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddAction("/presets/save", (id, content) =>
|
AddAction("/save", (id, content) =>
|
||||||
{
|
{
|
||||||
var presets = content.ToObject<List<PresetChannel>>();
|
var presets = content.ToObject<List<PresetChannel>>();
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,101 @@
|
|||||||
|
using Newtonsoft.Json;
|
||||||
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Core.Logging;
|
||||||
|
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
|
{
|
||||||
|
public class IHasInputsMessenger<TKey> : MessengerBase
|
||||||
|
{
|
||||||
|
private readonly IHasInputs<TKey> itemDevice;
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constructs a messenger for a device that implements IHasInputs<typeparamref name="TKey"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key"></param>
|
||||||
|
/// <param name="messagePath"></param>
|
||||||
|
/// <param name="device"></param>
|
||||||
|
public IHasInputsMessenger(string key, string messagePath, IHasInputs<TKey> device) : base(key, messagePath, device)
|
||||||
|
{
|
||||||
|
itemDevice = device;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void RegisterActions()
|
||||||
|
{
|
||||||
|
base.RegisterActions();
|
||||||
|
|
||||||
|
AddAction("/fullStatus", (id, context) =>
|
||||||
|
{
|
||||||
|
SendFullStatus();
|
||||||
|
});
|
||||||
|
|
||||||
|
itemDevice.Inputs.ItemsUpdated += (sender, args) =>
|
||||||
|
{
|
||||||
|
SendFullStatus();
|
||||||
|
};
|
||||||
|
|
||||||
|
itemDevice.Inputs.CurrentItemChanged += (sender, args) =>
|
||||||
|
{
|
||||||
|
SendFullStatus();
|
||||||
|
};
|
||||||
|
|
||||||
|
foreach (var input in itemDevice.Inputs.Items)
|
||||||
|
{
|
||||||
|
var key = input.Key;
|
||||||
|
var localItem = input.Value;
|
||||||
|
|
||||||
|
AddAction($"/{key}", (id, content) =>
|
||||||
|
{
|
||||||
|
localItem.Select();
|
||||||
|
});
|
||||||
|
|
||||||
|
localItem.ItemUpdated += (sender, args) =>
|
||||||
|
{
|
||||||
|
SendFullStatus();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SendFullStatus()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
this.LogInformation("Sending full status");
|
||||||
|
|
||||||
|
var stateObject = new IHasInputsStateMessage<TKey>
|
||||||
|
{
|
||||||
|
Inputs = new Inputs<TKey>
|
||||||
|
{
|
||||||
|
Items = itemDevice.Inputs.Items,
|
||||||
|
CurrentItem = itemDevice.Inputs.CurrentItem
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
PostStatusMessage(stateObject);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
this.LogError("Error sending full status: {0}", e.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class IHasInputsStateMessage<TKey> : DeviceStateMessageBase
|
||||||
|
{
|
||||||
|
[JsonProperty("inputs")]
|
||||||
|
public Inputs<TKey> Inputs { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Inputs<TKey>
|
||||||
|
{
|
||||||
|
[JsonProperty("items")]
|
||||||
|
public Dictionary<TKey, ISelectableItem> Items { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("currentItem")]
|
||||||
|
public TKey CurrentItem { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,17 +1,25 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Converters;
|
|
||||||
using Newtonsoft.Json.Linq;
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Core.Logging;
|
||||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.AppServer.Messengers
|
namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
{
|
{
|
||||||
public class ISelectableItemsMessenger<TKey> : MessengerBase
|
public class ISelectableItemsMessenger<TKey> : MessengerBase
|
||||||
{
|
{
|
||||||
private static readonly JsonSerializer serializer = new JsonSerializer { Converters = { new StringEnumConverter() } };
|
|
||||||
private readonly ISelectableItems<TKey> itemDevice;
|
private readonly ISelectableItems<TKey> itemDevice;
|
||||||
|
|
||||||
private readonly string _propName;
|
private readonly string _propName;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constructs a messenger for a device that implements ISelectableItems<typeparamref name="TKey"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key"></param>
|
||||||
|
/// <param name="messagePath"></param>
|
||||||
|
/// <param name="device"></param>
|
||||||
|
/// <param name="propName"></param>
|
||||||
public ISelectableItemsMessenger(string key, string messagePath, ISelectableItems<TKey> device, string propName) : base(key, messagePath, device as IKeyName)
|
public ISelectableItemsMessenger(string key, string messagePath, ISelectableItems<TKey> device, string propName) : base(key, messagePath, device as IKeyName)
|
||||||
{
|
{
|
||||||
itemDevice = device;
|
itemDevice = device;
|
||||||
@@ -56,10 +64,32 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
|
|
||||||
private void SendFullStatus()
|
private void SendFullStatus()
|
||||||
{
|
{
|
||||||
var stateObject = new JObject();
|
try
|
||||||
stateObject[_propName] = JToken.FromObject(itemDevice, serializer);
|
{
|
||||||
PostStatusMessage(stateObject);
|
this.LogInformation("Sending full status");
|
||||||
|
|
||||||
|
var stateObject = new ISelectableItemsStateMessage<TKey>
|
||||||
|
{
|
||||||
|
Items = itemDevice.Items,
|
||||||
|
CurrentItem = itemDevice.CurrentItem
|
||||||
|
};
|
||||||
|
|
||||||
|
PostStatusMessage(stateObject);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
this.LogError("Error sending full status: {0}", e.Message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class ISelectableItemsStateMessage<TKey> : DeviceStateMessageBase
|
||||||
|
{
|
||||||
|
[JsonProperty("items")]
|
||||||
|
public Dictionary<TKey, ISelectableItem> Items { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("currentItem")]
|
||||||
|
public TKey CurrentItem { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Core.Logging;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||||
using System;
|
using System;
|
||||||
@@ -152,11 +153,13 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
|
|
||||||
message.Name = _device.Name;
|
message.Name = _device.Name;
|
||||||
|
|
||||||
PostStatusMessage(JToken.FromObject(message), MessagePath, clientId);
|
var token = JToken.FromObject(message);
|
||||||
|
|
||||||
|
PostStatusMessage(token, MessagePath, clientId);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Debug.LogMessage(ex, "Exception posting status message", this);
|
this.LogError(ex, "Exception posting status message for {messagePath} to {clientId}", MessagePath, clientId ?? "all clients");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,11 +176,13 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
|
|
||||||
deviceState.MessageBasePath = MessagePath;
|
deviceState.MessageBasePath = MessagePath;
|
||||||
|
|
||||||
PostStatusMessage(JToken.FromObject(deviceState), type, clientId);
|
var token = JToken.FromObject(deviceState);
|
||||||
|
|
||||||
|
PostStatusMessage(token, type, clientId);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Debug.LogMessage(ex, "Exception posting status message", this);
|
this.LogError(ex, "Exception posting status message for {type} to {clientId}", type, clientId ?? "all clients");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ using PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using static PepperDash.Essentials.AppServer.Messengers.VideoCodecBaseStateMessage.CameraStatus;
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.AppServer.Messengers
|
namespace PepperDash.Essentials.AppServer.Messengers
|
||||||
{
|
{
|
||||||
@@ -78,16 +77,23 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void CallHistory_RecentCallsListHasChanged(object sender, EventArgs e)
|
private void CallHistory_RecentCallsListHasChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var state = new VideoCodecBaseStateMessage();
|
try
|
||||||
|
|
||||||
if (!(sender is CodecCallHistory codecCallHistory)) return;
|
|
||||||
var recents = codecCallHistory.RecentCalls;
|
|
||||||
|
|
||||||
if (recents != null)
|
|
||||||
{
|
{
|
||||||
state.RecentCalls = recents;
|
var state = new VideoCodecBaseStateMessage();
|
||||||
|
|
||||||
PostStatusMessage(state);
|
if (!(sender is CodecCallHistory codecCallHistory)) return;
|
||||||
|
var recents = codecCallHistory.RecentCalls;
|
||||||
|
|
||||||
|
if (recents != null)
|
||||||
|
{
|
||||||
|
state.RecentCalls = recents;
|
||||||
|
|
||||||
|
PostStatusMessage(state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
this.LogError(ex, "Error posting call history");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,28 +113,24 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
protected void SendDirectory(CodecDirectory directory)
|
protected void SendDirectory(CodecDirectory directory)
|
||||||
{
|
{
|
||||||
var state = new VideoCodecBaseStateMessage();
|
try
|
||||||
|
|
||||||
|
|
||||||
if (Codec is IHasDirectory dirCodec)
|
|
||||||
{
|
{
|
||||||
this.LogVerbose("Sending Directory. Directory Item Count: {directoryItemCount}", directory.CurrentDirectoryResults.Count);
|
var state = new VideoCodecBaseStateMessage();
|
||||||
|
|
||||||
//state.CurrentDirectory = PrefixDirectoryFolderItems(directory);
|
|
||||||
state.CurrentDirectory = directory;
|
|
||||||
CrestronInvoke.BeginInvoke((o) => PostStatusMessage(state));
|
|
||||||
|
|
||||||
/* var directoryMessage = new
|
if (Codec is IHasDirectory dirCodec)
|
||||||
{
|
{
|
||||||
currentDirectory = new
|
this.LogVerbose("Sending Directory. Directory Item Count: {directoryItemCount}", directory.CurrentDirectoryResults.Count);
|
||||||
{
|
|
||||||
directoryResults = prefixedDirectoryResults,
|
|
||||||
isRootDirectory = isRoot
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
//Spool up a thread in case this is a large quantity of data
|
//state.CurrentDirectory = PrefixDirectoryFolderItems(directory);
|
||||||
CrestronInvoke.BeginInvoke((o) => PostStatusMessage(directoryMessage)); */
|
state.CurrentDirectory = directory;
|
||||||
|
|
||||||
|
CrestronInvoke.BeginInvoke((o) => PostStatusMessage(state));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
this.LogError(ex, "Error sending directory");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,14 +141,20 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void Codec_IsReadyChange(object sender, EventArgs e)
|
private void Codec_IsReadyChange(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var state = new VideoCodecBaseStateMessage
|
try
|
||||||
{
|
{
|
||||||
IsReady = true
|
var state = new VideoCodecBaseStateMessage
|
||||||
};
|
{
|
||||||
|
IsReady = true
|
||||||
|
};
|
||||||
|
|
||||||
PostStatusMessage(state);
|
PostStatusMessage(state);
|
||||||
|
|
||||||
SendFullStatus();
|
SendFullStatus();
|
||||||
|
} catch (Exception ex)
|
||||||
|
{
|
||||||
|
this.LogError(ex, "Error sending codec ready status");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -353,32 +361,51 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
|
|
||||||
private void SharingSourceFeedback_OutputChange(object sender, FeedbackEventArgs e)
|
private void SharingSourceFeedback_OutputChange(object sender, FeedbackEventArgs e)
|
||||||
{
|
{
|
||||||
var state = new VideoCodecBaseStateMessage
|
try
|
||||||
{
|
{
|
||||||
SharingSource = e.StringValue
|
var state = new VideoCodecBaseStateMessage
|
||||||
};
|
{
|
||||||
|
SharingSource = e.StringValue
|
||||||
|
};
|
||||||
|
|
||||||
PostStatusMessage(state);
|
PostStatusMessage(state);
|
||||||
|
} catch (Exception ex)
|
||||||
|
{
|
||||||
|
this.LogError(ex, "Error posting sharing source");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SharingContentIsOnFeedback_OutputChange(object sender, FeedbackEventArgs e)
|
private void SharingContentIsOnFeedback_OutputChange(object sender, FeedbackEventArgs e)
|
||||||
{
|
{
|
||||||
var state = new VideoCodecBaseStateMessage
|
try
|
||||||
{
|
{
|
||||||
SharingContentIsOn = e.BoolValue
|
var state = new VideoCodecBaseStateMessage
|
||||||
};
|
{
|
||||||
|
SharingContentIsOn = e.BoolValue
|
||||||
|
};
|
||||||
|
|
||||||
PostStatusMessage(state);
|
PostStatusMessage(state);
|
||||||
|
} catch (Exception ex)
|
||||||
|
{
|
||||||
|
this.LogError(ex, "Error posting sharing content");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PhonebookSyncState_InitialSyncCompleted(object sender, EventArgs e)
|
private void PhonebookSyncState_InitialSyncCompleted(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var state = new VideoCodecBaseStateMessage
|
try
|
||||||
{
|
{
|
||||||
InitialPhonebookSyncComplete = true
|
var state = new VideoCodecBaseStateMessage
|
||||||
};
|
{
|
||||||
|
InitialPhonebookSyncComplete = true
|
||||||
|
};
|
||||||
|
|
||||||
PostStatusMessage(state);
|
PostStatusMessage(state);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
this.LogError(ex, "Error posting phonebook sync state");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CameraIsOffFeedback_OutputChange(object sender, FeedbackEventArgs e)
|
private void CameraIsOffFeedback_OutputChange(object sender, FeedbackEventArgs e)
|
||||||
@@ -404,8 +431,14 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
|
|
||||||
private void CameraCodec_CameraSelected(object sender, CameraSelectedEventArgs e)
|
private void CameraCodec_CameraSelected(object sender, CameraSelectedEventArgs e)
|
||||||
{
|
{
|
||||||
MapCameraActions();
|
try
|
||||||
PostSelectedCamera();
|
{
|
||||||
|
MapCameraActions();
|
||||||
|
PostSelectedCamera();
|
||||||
|
} catch(Exception ex)
|
||||||
|
{
|
||||||
|
this.LogError(ex, "Exception handling camera selected event");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -564,21 +597,28 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
|
|
||||||
private void PostCallHistory()
|
private void PostCallHistory()
|
||||||
{
|
{
|
||||||
var codec = (Codec as IHasCallHistory);
|
try
|
||||||
|
|
||||||
if (codec != null)
|
|
||||||
{
|
{
|
||||||
var status = new VideoCodecBaseStateMessage();
|
var codec = (Codec as IHasCallHistory);
|
||||||
|
|
||||||
var recents = codec.CallHistory.RecentCalls;
|
if (codec != null)
|
||||||
|
|
||||||
if (recents != null)
|
|
||||||
{
|
{
|
||||||
status.RecentCalls = codec.CallHistory.RecentCalls;
|
var status = new VideoCodecBaseStateMessage();
|
||||||
|
|
||||||
PostStatusMessage(status);
|
var recents = codec.CallHistory.RecentCalls;
|
||||||
|
|
||||||
|
if (recents != null)
|
||||||
|
{
|
||||||
|
status.RecentCalls = codec.CallHistory.RecentCalls;
|
||||||
|
|
||||||
|
PostStatusMessage(status);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
this.LogError(ex, "Error posting call history");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -609,23 +649,30 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void GetDirectoryRoot()
|
private void GetDirectoryRoot()
|
||||||
{
|
{
|
||||||
if (!(Codec is IHasDirectory dirCodec))
|
try
|
||||||
{
|
{
|
||||||
// do something else?
|
if (!(Codec is IHasDirectory dirCodec))
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!dirCodec.PhonebookSyncState.InitialSyncComplete)
|
|
||||||
{
|
|
||||||
var state = new VideoCodecBaseStateMessage
|
|
||||||
{
|
{
|
||||||
InitialPhonebookSyncComplete = false
|
// do something else?
|
||||||
};
|
return;
|
||||||
|
}
|
||||||
|
if (!dirCodec.PhonebookSyncState.InitialSyncComplete)
|
||||||
|
{
|
||||||
|
var state = new VideoCodecBaseStateMessage
|
||||||
|
{
|
||||||
|
InitialPhonebookSyncComplete = false
|
||||||
|
};
|
||||||
|
|
||||||
PostStatusMessage(state);
|
PostStatusMessage(state);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
dirCodec.SetCurrentDirectoryToRoot();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
this.LogError(ex, "Error getting directory root");
|
||||||
}
|
}
|
||||||
|
|
||||||
dirCodec.SetCurrentDirectoryToRoot();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -654,14 +701,21 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void SendIsReady()
|
private void SendIsReady()
|
||||||
{
|
{
|
||||||
var status = new VideoCodecBaseStateMessage();
|
try
|
||||||
|
{
|
||||||
|
var status = new VideoCodecBaseStateMessage();
|
||||||
|
|
||||||
var codecType = Codec.GetType();
|
var codecType = Codec.GetType();
|
||||||
|
|
||||||
status.IsReady = Codec.IsReady;
|
status.IsReady = Codec.IsReady;
|
||||||
status.IsZoomRoom = codecType.GetInterface("IHasZoomRoomLayouts") != null;
|
status.IsZoomRoom = codecType.GetInterface("IHasZoomRoomLayouts") != null;
|
||||||
|
|
||||||
PostStatusMessage(status);
|
PostStatusMessage(status);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
this.LogError(ex, "Error sending codec ready status");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -670,55 +724,60 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
protected VideoCodecBaseStateMessage GetStatus()
|
protected VideoCodecBaseStateMessage GetStatus()
|
||||||
{
|
{
|
||||||
var status = new VideoCodecBaseStateMessage();
|
try
|
||||||
|
|
||||||
|
|
||||||
if (Codec is IHasCodecCameras camerasCodec)
|
|
||||||
{
|
{
|
||||||
status.Cameras = new VideoCodecBaseStateMessage.CameraStatus
|
var status = new VideoCodecBaseStateMessage();
|
||||||
|
|
||||||
|
if (Codec is IHasCodecCameras camerasCodec)
|
||||||
{
|
{
|
||||||
CameraManualIsSupported = true,
|
status.Cameras = new CameraStatus
|
||||||
CameraAutoIsSupported = Codec.SupportsCameraAutoMode,
|
{
|
||||||
CameraOffIsSupported = Codec.SupportsCameraOff,
|
CameraManualIsSupported = true,
|
||||||
CameraMode = GetCameraMode(),
|
CameraAutoIsSupported = Codec.SupportsCameraAutoMode,
|
||||||
Cameras = camerasCodec.Cameras,
|
CameraOffIsSupported = Codec.SupportsCameraOff,
|
||||||
SelectedCamera = GetSelectedCamera(camerasCodec)
|
CameraMode = GetCameraMode(),
|
||||||
};
|
Cameras = camerasCodec.Cameras,
|
||||||
}
|
SelectedCamera = GetSelectedCamera(camerasCodec)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
if (Codec is IHasDirectory directoryCodec)
|
if (Codec is IHasDirectory directoryCodec)
|
||||||
|
{
|
||||||
|
status.HasDirectory = true;
|
||||||
|
status.HasDirectorySearch = true;
|
||||||
|
status.CurrentDirectory = directoryCodec.CurrentDirectoryResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
var codecType = Codec.GetType();
|
||||||
|
|
||||||
|
status.CameraSelfViewIsOn = Codec is IHasCodecSelfView && (Codec as IHasCodecSelfView).SelfviewIsOnFeedback.BoolValue;
|
||||||
|
status.IsInCall = Codec.IsInCall;
|
||||||
|
status.PrivacyModeIsOn = Codec.PrivacyModeIsOnFeedback.BoolValue;
|
||||||
|
status.SharingContentIsOn = Codec.SharingContentIsOnFeedback.BoolValue;
|
||||||
|
status.SharingSource = Codec.SharingSourceFeedback.StringValue;
|
||||||
|
status.StandbyIsOn = Codec.StandbyIsOnFeedback.BoolValue;
|
||||||
|
status.Calls = Codec.ActiveCalls;
|
||||||
|
status.Info = Codec.CodecInfo;
|
||||||
|
status.ShowSelfViewByDefault = Codec.ShowSelfViewByDefault;
|
||||||
|
status.SupportsAdHocMeeting = Codec is IHasStartMeeting;
|
||||||
|
status.HasRecents = Codec is IHasCallHistory;
|
||||||
|
status.HasCameras = Codec is IHasCameras;
|
||||||
|
status.Presets = GetCurrentPresets();
|
||||||
|
status.IsZoomRoom = codecType.GetInterface("IHasZoomRoomLayouts") != null;
|
||||||
|
status.ReceivingContent = Codec is IHasFarEndContentStatus && (Codec as IHasFarEndContentStatus).ReceivingContent.BoolValue;
|
||||||
|
|
||||||
|
if (Codec is IHasMeetingInfo meetingInfoCodec)
|
||||||
|
{
|
||||||
|
status.MeetingInfo = meetingInfoCodec.MeetingInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
status.HasDirectory = true;
|
this.LogError(ex, "Error getting codec status");
|
||||||
status.HasDirectorySearch = true;
|
return null;
|
||||||
status.CurrentDirectory = directoryCodec.CurrentDirectoryResult;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var codecType = Codec.GetType();
|
|
||||||
|
|
||||||
status.CameraSelfViewIsOn = Codec is IHasCodecSelfView && (Codec as IHasCodecSelfView).SelfviewIsOnFeedback.BoolValue;
|
|
||||||
status.IsInCall = Codec.IsInCall;
|
|
||||||
status.PrivacyModeIsOn = Codec.PrivacyModeIsOnFeedback.BoolValue;
|
|
||||||
status.SharingContentIsOn = Codec.SharingContentIsOnFeedback.BoolValue;
|
|
||||||
status.SharingSource = Codec.SharingSourceFeedback.StringValue;
|
|
||||||
status.StandbyIsOn = Codec.StandbyIsOnFeedback.BoolValue;
|
|
||||||
status.Calls = Codec.ActiveCalls;
|
|
||||||
status.Info = Codec.CodecInfo;
|
|
||||||
status.ShowSelfViewByDefault = Codec.ShowSelfViewByDefault;
|
|
||||||
status.SupportsAdHocMeeting = Codec is IHasStartMeeting;
|
|
||||||
status.HasRecents = Codec is IHasCallHistory;
|
|
||||||
status.HasCameras = Codec is IHasCameras;
|
|
||||||
status.Presets = GetCurrentPresets();
|
|
||||||
status.IsZoomRoom = codecType.GetInterface("IHasZoomRoomLayouts") != null;
|
|
||||||
status.ReceivingContent = Codec is IHasFarEndContentStatus && (Codec as IHasFarEndContentStatus).ReceivingContent.BoolValue;
|
|
||||||
|
|
||||||
if (Codec is IHasMeetingInfo meetingInfoCodec)
|
|
||||||
{
|
|
||||||
status.MeetingInfo = meetingInfoCodec.MeetingInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Debug.Console(2, this, "VideoCodecBaseStatus:\n{0}", JsonConvert.SerializeObject(status));
|
|
||||||
|
|
||||||
return status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void SendFullStatus()
|
protected virtual void SendFullStatus()
|
||||||
@@ -733,22 +792,36 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
|
|
||||||
private void PostReceivingContent(bool receivingContent)
|
private void PostReceivingContent(bool receivingContent)
|
||||||
{
|
{
|
||||||
var state = new VideoCodecBaseStateMessage
|
try
|
||||||
{
|
{
|
||||||
ReceivingContent = receivingContent
|
var state = new VideoCodecBaseStateMessage
|
||||||
};
|
{
|
||||||
PostStatusMessage(state);
|
ReceivingContent = receivingContent
|
||||||
|
};
|
||||||
|
|
||||||
|
PostStatusMessage(state);
|
||||||
|
} catch(Exception ex)
|
||||||
|
{
|
||||||
|
this.LogError(ex, "Error posting receiving content");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PostCameraSelfView()
|
private void PostCameraSelfView()
|
||||||
{
|
{
|
||||||
var status = new VideoCodecBaseStateMessage
|
try
|
||||||
{
|
{
|
||||||
CameraSelfViewIsOn = Codec is IHasCodecSelfView
|
var status = new VideoCodecBaseStateMessage
|
||||||
&& (Codec as IHasCodecSelfView).SelfviewIsOnFeedback.BoolValue
|
{
|
||||||
};
|
CameraSelfViewIsOn = Codec is IHasCodecSelfView
|
||||||
|
&& (Codec as IHasCodecSelfView).SelfviewIsOnFeedback.BoolValue
|
||||||
|
};
|
||||||
|
|
||||||
PostStatusMessage(status);
|
PostStatusMessage(status);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
this.LogError(ex, "Error posting camera self view");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -756,34 +829,56 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void PostCameraMode()
|
private void PostCameraMode()
|
||||||
{
|
{
|
||||||
var status = new VideoCodecBaseStateMessage
|
try
|
||||||
{
|
{
|
||||||
CameraMode = GetCameraMode()
|
var status = new VideoCodecBaseStateMessage
|
||||||
};
|
{
|
||||||
|
CameraMode = GetCameraMode()
|
||||||
|
};
|
||||||
|
|
||||||
PostStatusMessage(status);
|
PostStatusMessage(status);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
this.LogError(ex, "Error posting camera mode");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PostSelectedCamera()
|
private void PostSelectedCamera()
|
||||||
{
|
{
|
||||||
var camerasCodec = Codec as IHasCodecCameras;
|
try
|
||||||
|
|
||||||
var status = new VideoCodecBaseStateMessage
|
|
||||||
{
|
{
|
||||||
Cameras = new VideoCodecBaseStateMessage.CameraStatus() { SelectedCamera = GetSelectedCamera(camerasCodec) },
|
var camerasCodec = Codec as IHasCodecCameras;
|
||||||
Presets = GetCurrentPresets()
|
|
||||||
};
|
var status = new VideoCodecBaseStateMessage
|
||||||
PostStatusMessage(status);
|
{
|
||||||
|
Cameras = new CameraStatus() { SelectedCamera = GetSelectedCamera(camerasCodec) },
|
||||||
|
Presets = GetCurrentPresets()
|
||||||
|
};
|
||||||
|
|
||||||
|
PostStatusMessage(status);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
this.LogError(e, "Error posting selected camera");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PostCameraPresets()
|
private void PostCameraPresets()
|
||||||
{
|
{
|
||||||
var status = new VideoCodecBaseStateMessage
|
try
|
||||||
{
|
{
|
||||||
Presets = GetCurrentPresets()
|
var status = new VideoCodecBaseStateMessage
|
||||||
};
|
{
|
||||||
|
Presets = GetCurrentPresets()
|
||||||
|
};
|
||||||
|
|
||||||
PostStatusMessage(status);
|
PostStatusMessage(status);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
this.LogError(e, "Error posting camera presets");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Camera GetSelectedCamera(IHasCodecCameras camerasCodec)
|
private Camera GetSelectedCamera(IHasCodecCameras camerasCodec)
|
||||||
@@ -796,7 +891,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
{
|
{
|
||||||
camera.Name = camerasCodec.SelectedCamera.Name;
|
camera.Name = camerasCodec.SelectedCamera.Name;
|
||||||
|
|
||||||
camera.Capabilities = new Camera.CameraCapabilities()
|
camera.Capabilities = new CameraCapabilities()
|
||||||
{
|
{
|
||||||
CanPan = camerasCodec.SelectedCamera.CanPan,
|
CanPan = camerasCodec.SelectedCamera.CanPan,
|
||||||
CanTilt = camerasCodec.SelectedCamera.CanTilt,
|
CanTilt = camerasCodec.SelectedCamera.CanTilt,
|
||||||
@@ -922,59 +1017,57 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
|||||||
|
|
||||||
[JsonProperty("supportsAdHocMeeting", NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty("supportsAdHocMeeting", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public bool? SupportsAdHocMeeting { get; set; }
|
public bool? SupportsAdHocMeeting { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
public class CameraStatus
|
public class CameraStatus
|
||||||
{
|
{
|
||||||
[JsonProperty("cameraManualSupported", NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty("cameraManualSupported", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public bool? CameraManualIsSupported { get; set; }
|
public bool? CameraManualIsSupported { get; set; }
|
||||||
|
|
||||||
[JsonProperty("cameraAutoSupported", NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty("cameraAutoSupported", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public bool? CameraAutoIsSupported { get; set; }
|
public bool? CameraAutoIsSupported { get; set; }
|
||||||
|
|
||||||
[JsonProperty("cameraOffSupported", NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty("cameraOffSupported", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public bool? CameraOffIsSupported { get; set; }
|
public bool? CameraOffIsSupported { get; set; }
|
||||||
|
|
||||||
[JsonProperty("cameraMode", NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty("cameraMode", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public string CameraMode { get; set; }
|
public string CameraMode { get; set; }
|
||||||
|
|
||||||
[JsonProperty("cameraList", NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty("cameraList", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public List<CameraBase> Cameras { get; set; }
|
public List<CameraBase> Cameras { get; set; }
|
||||||
|
|
||||||
[JsonProperty("selectedCamera", NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty("selectedCamera", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public Camera SelectedCamera { get; set; }
|
public Camera SelectedCamera { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
public class Camera
|
public class Camera
|
||||||
{
|
{
|
||||||
[JsonProperty("key", NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty("key", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public string Key { get; set; }
|
public string Key { get; set; }
|
||||||
|
|
||||||
[JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
[JsonProperty("isFarEnd", NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty("isFarEnd", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public bool? IsFarEnd { get; set; }
|
public bool? IsFarEnd { get; set; }
|
||||||
|
|
||||||
[JsonProperty("capabilities", NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty("capabilities", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public CameraCapabilities Capabilities { get; set; }
|
public CameraCapabilities Capabilities { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
public class CameraCapabilities
|
public class CameraCapabilities
|
||||||
{
|
{
|
||||||
[JsonProperty("canPan", NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty("canPan", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public bool? CanPan { get; set; }
|
public bool? CanPan { get; set; }
|
||||||
|
|
||||||
[JsonProperty("canTilt", NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty("canTilt", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public bool? CanTilt { get; set; }
|
public bool? CanTilt { get; set; }
|
||||||
|
|
||||||
[JsonProperty("canZoom", NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty("canZoom", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public bool? CanZoom { get; set; }
|
public bool? CanZoom { get; set; }
|
||||||
|
|
||||||
[JsonProperty("canFocus", NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty("canFocus", NullValueHandling = NullValueHandling.Ignore)]
|
||||||
public bool? CanFocus { get; set; }
|
public bool? CanFocus { get; set; }
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -763,11 +763,10 @@ namespace PepperDash.Essentials
|
|||||||
{
|
{
|
||||||
this.LogVerbose("Adding InputsMessenger<string> for {deviceKey}", device.Key);
|
this.LogVerbose("Adding InputsMessenger<string> for {deviceKey}", device.Key);
|
||||||
|
|
||||||
var messenger = new ISelectableItemsMessenger<string>(
|
var messenger = new IHasInputsMessenger<string>(
|
||||||
$"{device.Key}-inputs-{Key}",
|
$"{device.Key}-inputs-{Key}",
|
||||||
$"/device/{device.Key}",
|
$"/device/{device.Key}",
|
||||||
stringInputs.Inputs,
|
stringInputs
|
||||||
"inputs"
|
|
||||||
);
|
);
|
||||||
|
|
||||||
AddDefaultDeviceMessenger(messenger);
|
AddDefaultDeviceMessenger(messenger);
|
||||||
@@ -779,11 +778,10 @@ namespace PepperDash.Essentials
|
|||||||
{
|
{
|
||||||
this.LogVerbose("Adding InputsMessenger for {deviceKey}", device.Key);
|
this.LogVerbose("Adding InputsMessenger for {deviceKey}", device.Key);
|
||||||
|
|
||||||
var messenger = new ISelectableItemsMessenger<byte>(
|
var messenger = new IHasInputsMessenger<byte>(
|
||||||
$"{device.Key}-inputs-{Key}",
|
$"{device.Key}-inputs-{Key}",
|
||||||
$"/device/{device.Key}",
|
$"/device/{device.Key}",
|
||||||
byteInputs.Inputs,
|
byteInputs
|
||||||
"inputs"
|
|
||||||
);
|
);
|
||||||
|
|
||||||
AddDefaultDeviceMessenger(messenger);
|
AddDefaultDeviceMessenger(messenger);
|
||||||
@@ -795,11 +793,10 @@ namespace PepperDash.Essentials
|
|||||||
{
|
{
|
||||||
this.LogVerbose("Adding InputsMessenger for {deviceKey}", device.Key);
|
this.LogVerbose("Adding InputsMessenger for {deviceKey}", device.Key);
|
||||||
|
|
||||||
var messenger = new ISelectableItemsMessenger<int>(
|
var messenger = new IHasInputsMessenger<int>(
|
||||||
$"{device.Key}-inputs-{Key}",
|
$"{device.Key}-inputs-{Key}",
|
||||||
$"/device/{device.Key}",
|
$"/device/{device.Key}",
|
||||||
intInputs.Inputs,
|
intInputs
|
||||||
"inputs"
|
|
||||||
);
|
);
|
||||||
|
|
||||||
AddDefaultDeviceMessenger(messenger);
|
AddDefaultDeviceMessenger(messenger);
|
||||||
@@ -1133,7 +1130,11 @@ namespace PepperDash.Essentials
|
|||||||
|
|
||||||
_messengers.Add(messenger.Key, messenger);
|
_messengers.Add(messenger.Key, messenger);
|
||||||
|
|
||||||
messenger.RegisterWithAppServer(this);
|
if (_initialized)
|
||||||
|
{
|
||||||
|
this.LogDebug("Registering messenger {messengerKey} AFTER initialization", messenger.Key);
|
||||||
|
messenger.RegisterWithAppServer(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddDefaultDeviceMessenger(IMobileControlMessenger messenger)
|
private void AddDefaultDeviceMessenger(IMobileControlMessenger messenger)
|
||||||
@@ -2230,17 +2231,15 @@ Mobile Control Direct Server Infromation:
|
|||||||
// /room/roomAB
|
// /room/roomAB
|
||||||
|
|
||||||
// Can't do direct comparison because it will match /room/roomA with /room/roomA/xxx instead of /room/roomAB/xxx
|
// Can't do direct comparison because it will match /room/roomA with /room/roomA/xxx instead of /room/roomAB/xxx
|
||||||
var handlersKv = _actionDictionary.FirstOrDefault(kv => message.Type.StartsWith(kv.Key + "/")); // adds trailing slash to ensure above case is handled
|
var handlers = _actionDictionary.Where(kv => message.Type.StartsWith(kv.Key + "/")).SelectMany(kv => kv.Value).ToList(); // adds trailing slash to ensure above case is handled
|
||||||
|
|
||||||
|
|
||||||
if (handlersKv.Key == null)
|
if (handlers.Count == 0)
|
||||||
{
|
{
|
||||||
this.LogInformation("-- Warning: Incoming message has no registered handler {type}", message.Type);
|
this.LogInformation("-- Warning: Incoming message has no registered handler {type}", message.Type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
var handlers = handlersKv.Value;
|
|
||||||
|
|
||||||
foreach (var handler in handlers)
|
foreach (var handler in handlers)
|
||||||
{
|
{
|
||||||
Task.Run(
|
Task.Run(
|
||||||
|
|||||||
@@ -113,10 +113,7 @@ namespace PepperDash.Essentials
|
|||||||
|
|
||||||
_server.SendMessageToAllClients(message);
|
_server.SendMessageToAllClients(message);
|
||||||
|
|
||||||
_server.LogVerbose("Message TX To all clients: {message}", null, message);
|
_server.LogVerbose("Message TX To all clients: {message}", message);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (ThreadAbortException)
|
catch (ThreadAbortException)
|
||||||
{
|
{
|
||||||
@@ -126,8 +123,6 @@ namespace PepperDash.Essentials
|
|||||||
{
|
{
|
||||||
Debug.LogMessage(ex, "Caught an exception in the Transmit Processor");
|
Debug.LogMessage(ex, "Caught an exception in the Transmit Processor");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -679,6 +679,14 @@ namespace PepperDash.Essentials.WebSocketServer
|
|||||||
}
|
}
|
||||||
|
|
||||||
var values = s.Split(' ');
|
var values = s.Split(' ');
|
||||||
|
|
||||||
|
if(values.Length < 2)
|
||||||
|
{
|
||||||
|
CrestronConsole.ConsoleCommandResponse("Invalid number of arguments. Please provide a room key and a grant code");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
var roomKey = values[0];
|
var roomKey = values[0];
|
||||||
var grantCode = values[1];
|
var grantCode = values[1];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user