mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-10 10:15:01 +00:00
Compare commits
1 Commits
1.10.0-rc-
...
1.9.8-hotf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
747c68bd1e |
2
.github/workflows/docker.yml
vendored
2
.github/workflows/docker.yml
vendored
@@ -98,7 +98,7 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
Push_Nuget_Package:
|
||||
needs: Build_Project
|
||||
runs-on: windows-2019
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Download Build Version Info
|
||||
uses: actions/download-artifact@v1
|
||||
|
||||
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
@@ -82,7 +82,7 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
Push_Nuget_Package:
|
||||
needs: Build_Project
|
||||
runs-on: windows-2019
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Download Build Version Info
|
||||
uses: actions/download-artifact@v1
|
||||
|
||||
@@ -56,9 +56,6 @@ namespace PepperDash.Essentials.Room.Config
|
||||
[JsonProperty("mirroredTuners")]
|
||||
public Dictionary<uint, string> MirroredTuners { get; set; }
|
||||
|
||||
[JsonProperty("helpMessage")]
|
||||
public string HelpMessage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates the room
|
||||
/// </summary>
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace PepperDash.Essentials
|
||||
}
|
||||
}
|
||||
|
||||
public EssentialsHuddleVtc1PropertiesConfig PropertiesConfig { get; private set; }
|
||||
public EssentialsConferenceRoomPropertiesConfig PropertiesConfig { get; private set; }
|
||||
|
||||
private List<IRoutingSinkWithSwitching> Displays;
|
||||
|
||||
@@ -199,7 +199,7 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
try
|
||||
{
|
||||
PropertiesConfig = JsonConvert.DeserializeObject<EssentialsHuddleVtc1PropertiesConfig>
|
||||
PropertiesConfig = JsonConvert.DeserializeObject<EssentialsConferenceRoomPropertiesConfig>
|
||||
(config.Properties.ToString());
|
||||
|
||||
VideoCodec = DeviceManager.GetDeviceForKey(PropertiesConfig.VideoCodecKey) as
|
||||
@@ -361,7 +361,7 @@ namespace PepperDash.Essentials
|
||||
|
||||
protected override void CustomSetConfig(DeviceConfig config)
|
||||
{
|
||||
var newPropertiesConfig = JsonConvert.DeserializeObject<EssentialsHuddleVtc1PropertiesConfig>(config.Properties.ToString());
|
||||
var newPropertiesConfig = JsonConvert.DeserializeObject<EssentialsConferenceRoomPropertiesConfig>(config.Properties.ToString());
|
||||
|
||||
if (newPropertiesConfig != null)
|
||||
PropertiesConfig = newPropertiesConfig;
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace PepperDash.Essentials
|
||||
}
|
||||
}
|
||||
|
||||
public EssentialsHuddleVtc1PropertiesConfig PropertiesConfig { get; private set; }
|
||||
public EssentialsConferenceRoomPropertiesConfig PropertiesConfig { get; private set; }
|
||||
|
||||
public IRoutingSinkWithSwitching DefaultDisplay { get; private set; }
|
||||
public IBasicVolumeControls DefaultAudioDevice { get; private set; }
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
public class EssentialsTechRoom : EssentialsRoomBase, ITvPresetsProvider, IBridgeAdvanced, IRunDirectRouteAction
|
||||
{
|
||||
public EssentialsTechRoomConfig PropertiesConfig { get; private set; }
|
||||
private readonly EssentialsTechRoomConfig _config;
|
||||
private readonly Dictionary<string, TwoWayDisplayBase> _displays;
|
||||
|
||||
private readonly DevicePresetsModel _tunerPresets;
|
||||
@@ -57,16 +57,16 @@ namespace PepperDash.Essentials
|
||||
|
||||
public EssentialsTechRoom(DeviceConfig config) : base(config)
|
||||
{
|
||||
PropertiesConfig = config.Properties.ToObject<EssentialsTechRoomConfig>();
|
||||
_config = config.Properties.ToObject<EssentialsTechRoomConfig>();
|
||||
|
||||
_tunerPresets = new DevicePresetsModel(String.Format("{0}-presets", config.Key), PropertiesConfig.PresetsFileName);
|
||||
_tunerPresets = new DevicePresetsModel(String.Format("{0}-presets", config.Key), _config.PresetsFileName);
|
||||
|
||||
_tunerPresets.SetFileName(PropertiesConfig.PresetsFileName);
|
||||
_tunerPresets.SetFileName(_config.PresetsFileName);
|
||||
|
||||
_tunerPresets.PresetRecalled += TunerPresetsOnPresetRecalled;
|
||||
|
||||
_tuners = GetDevices<IRSetTopBoxBase>(PropertiesConfig.Tuners);
|
||||
_displays = GetDevices<TwoWayDisplayBase>(PropertiesConfig.Displays);
|
||||
_tuners = GetDevices<IRSetTopBoxBase>(_config.Tuners);
|
||||
_displays = GetDevices<TwoWayDisplayBase>(_config.Displays);
|
||||
|
||||
RoomPowerIsOnFeedback = new BoolFeedback(() => RoomPowerIsOn);
|
||||
|
||||
@@ -153,7 +153,7 @@ namespace PepperDash.Essentials
|
||||
|
||||
private void CreateOrUpdateScheduledEvents()
|
||||
{
|
||||
var eventsConfig = PropertiesConfig.ScheduledEvents;
|
||||
var eventsConfig = _config.ScheduledEvents;
|
||||
|
||||
GetOrCreateScheduleGroup();
|
||||
|
||||
@@ -207,21 +207,21 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
//update config based on key of scheduleEvent
|
||||
GetOrCreateScheduleGroup();
|
||||
var existingEventIndex = PropertiesConfig.ScheduledEvents.FindIndex((e) => e.Key == scheduledEvent.Key);
|
||||
var existingEventIndex = _config.ScheduledEvents.FindIndex((e) => e.Key == scheduledEvent.Key);
|
||||
|
||||
if (existingEventIndex < 0)
|
||||
{
|
||||
PropertiesConfig.ScheduledEvents.Add(scheduledEvent);
|
||||
_config.ScheduledEvents.Add(scheduledEvent);
|
||||
}
|
||||
else
|
||||
{
|
||||
PropertiesConfig.ScheduledEvents[existingEventIndex] = scheduledEvent;
|
||||
_config.ScheduledEvents[existingEventIndex] = scheduledEvent;
|
||||
}
|
||||
|
||||
//create or update event based on config
|
||||
CreateOrUpdateSingleEvent(scheduledEvent);
|
||||
//save config
|
||||
Config.Properties = JToken.FromObject(PropertiesConfig);
|
||||
Config.Properties = JToken.FromObject(_config);
|
||||
|
||||
CustomSetConfig(Config);
|
||||
//Fire Event
|
||||
@@ -230,7 +230,7 @@ namespace PepperDash.Essentials
|
||||
|
||||
public List<ScheduledEventConfig> GetScheduledEvents()
|
||||
{
|
||||
return PropertiesConfig.ScheduledEvents ?? new List<ScheduledEventConfig>();
|
||||
return _config.ScheduledEvents ?? new List<ScheduledEventConfig>();
|
||||
}
|
||||
|
||||
private void OnScheduledEventUpdate()
|
||||
@@ -242,14 +242,14 @@ namespace PepperDash.Essentials
|
||||
return;
|
||||
}
|
||||
|
||||
handler(this, new ScheduledEventEventArgs {ScheduledEvents = PropertiesConfig.ScheduledEvents});
|
||||
handler(this, new ScheduledEventEventArgs {ScheduledEvents = _config.ScheduledEvents});
|
||||
}
|
||||
|
||||
public event EventHandler<ScheduledEventEventArgs> ScheduledEventsChanged;
|
||||
|
||||
private void HandleScheduledEvent(ScheduledEvent schevent, ScheduledEventCommon.eCallbackReason type)
|
||||
{
|
||||
var eventConfig = PropertiesConfig.ScheduledEvents.FirstOrDefault(e => e.Key == schevent.Name);
|
||||
var eventConfig = _config.ScheduledEvents.FirstOrDefault(e => e.Key == schevent.Name);
|
||||
|
||||
if (eventConfig == null)
|
||||
{
|
||||
@@ -286,11 +286,11 @@ Params: {2}"
|
||||
{
|
||||
Debug.Console(2, this, "Room Powering On");
|
||||
|
||||
var dummySource = DeviceManager.GetDeviceForKey(PropertiesConfig.DummySourceKey) as IRoutingOutputs;
|
||||
var dummySource = DeviceManager.GetDeviceForKey(_config.DummySourceKey) as IRoutingOutputs;
|
||||
|
||||
if (dummySource == null)
|
||||
{
|
||||
Debug.Console(1, this, "Unable to get source with key: {0}", PropertiesConfig.DummySourceKey);
|
||||
Debug.Console(1, this, "Unable to get source with key: {0}", _config.DummySourceKey);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -376,12 +376,12 @@ Params: {2}"
|
||||
bridge.AddJoinMap(Key, joinMap);
|
||||
}
|
||||
|
||||
if (PropertiesConfig.IsPrimary)
|
||||
if (_config.IsPrimary)
|
||||
{
|
||||
Debug.Console(1, this, "Linking Primary system Tuner Preset Mirroring");
|
||||
if (PropertiesConfig.MirroredTuners != null && PropertiesConfig.MirroredTuners.Count > 0)
|
||||
if (_config.MirroredTuners != null && _config.MirroredTuners.Count > 0)
|
||||
{
|
||||
foreach (var tuner in PropertiesConfig.MirroredTuners)
|
||||
foreach (var tuner in _config.MirroredTuners)
|
||||
{
|
||||
var f = CurrentPresetsFeedbacks[tuner.Value];
|
||||
|
||||
@@ -423,9 +423,9 @@ Params: {2}"
|
||||
{
|
||||
Debug.Console(1, this, "Linking Secondary system Tuner Preset Mirroring");
|
||||
|
||||
if (PropertiesConfig.MirroredTuners != null && PropertiesConfig.MirroredTuners.Count > 0)
|
||||
if (_config.MirroredTuners != null && _config.MirroredTuners.Count > 0)
|
||||
{
|
||||
foreach (var tuner in PropertiesConfig.MirroredTuners)
|
||||
foreach (var tuner in _config.MirroredTuners)
|
||||
{
|
||||
var t = _tuners[tuner.Value];
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace PepperDash.Essentials
|
||||
public interface IEssentialsHuddleVtc1Room : IEssentialsRoom, IHasCurrentSourceInfoChange,
|
||||
IPrivacy, IHasCurrentVolumeControls, IRunRouteAction, IRunDefaultCallRoute, IHasVideoCodec, IHasAudioCodec, IHasDefaultDisplay, IHasInCallFeedback
|
||||
{
|
||||
EssentialsHuddleVtc1PropertiesConfig PropertiesConfig { get; }
|
||||
EssentialsConferenceRoomPropertiesConfig PropertiesConfig { get; }
|
||||
|
||||
bool ExcludeFromGlobalFunctions { get; }
|
||||
|
||||
|
||||
@@ -99,13 +99,18 @@ namespace PepperDash.Essentials.Core.Lighting
|
||||
var sceneIndex = 0;
|
||||
foreach (var scene in lightingDevice.LightingScenes)
|
||||
{
|
||||
trilist.SetSigTrueAction((uint)(joinMap.SelectSceneDirect.JoinNumber + sceneIndex), () => lightingDevice.SelectScene(lightingDevice.LightingScenes[sceneIndex]));
|
||||
var index1 = sceneIndex;
|
||||
trilist.SetSigTrueAction((uint)(joinMap.SelectSceneDirect.JoinNumber + sceneIndex), () =>
|
||||
{
|
||||
var index = index1;
|
||||
Debug.Console(2, this, "LightingDevice: sceneIndex: {0} index: {1} > inside action", index1, index);
|
||||
lightingDevice.SelectScene(lightingDevice.LightingScenes[index]);
|
||||
});
|
||||
scene.IsActiveFeedback.LinkInputSig(trilist.BooleanInput[(uint)(joinMap.SelectSceneDirect.JoinNumber + sceneIndex)]);
|
||||
trilist.StringInput[(uint)(joinMap.SelectSceneDirect.JoinNumber + sceneIndex)].StringValue = scene.Name;
|
||||
trilist.BooleanInput[(uint)(joinMap.ButtonVisibility.JoinNumber + sceneIndex)].BoolValue = true;
|
||||
sceneIndex++;
|
||||
}
|
||||
|
||||
return joinMap;
|
||||
}
|
||||
|
||||
|
||||
@@ -139,8 +139,7 @@ namespace PepperDash.Essentials.Core.Queues
|
||||
_queue = new CrestronQueue<IQueueMessage>(cap);
|
||||
_worker = new Thread(ProcessQueue, null, Thread.eThreadStartOptions.Running)
|
||||
{
|
||||
Priority = priority,
|
||||
Name = _key
|
||||
Priority = priority
|
||||
};
|
||||
|
||||
SetDelayValues(pacing);
|
||||
|
||||
@@ -411,7 +411,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
|
||||
if (codec is IHasCameraAutoMode)
|
||||
{
|
||||
trilist.SetBool(joinMap.CameraSupportsAutoMode.JoinNumber, SupportsCameraAutoMode);
|
||||
trilist.SetBool(joinMap.CameraSupportsAutoMode.JoinNumber, true);
|
||||
|
||||
(codec as IHasCameraAutoMode).CameraAutoModeIsOnFeedback.FireUpdate();
|
||||
}
|
||||
|
||||
@@ -32,20 +32,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
private const long MeetingRefreshTimer = 60000;
|
||||
public uint DefaultMeetingDurationMin { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// CR LF
|
||||
/// </summary>
|
||||
private const string EchoDelimiter = "\x0D\x0A\x0D\x0A";
|
||||
private const string Delimiter = "\x0D\x0A";
|
||||
|
||||
private const string SendDelimiter = "\x0D";
|
||||
|
||||
/// <summary>
|
||||
/// CR LF } CR LF
|
||||
/// </summary>
|
||||
private const string JsonDelimiter = "\x0D\x0A\x7D\x0D\x0A";
|
||||
|
||||
private string[] Delimiters = new string[] { EchoDelimiter, JsonDelimiter, "OK\x0D\x0A", "end\x0D\x0A" };
|
||||
//"echo off\x0D\x0A\x0A\x0D\x0A"
|
||||
private readonly GenericQueue _receiveQueue;
|
||||
//private readonly CrestronQueue<string> _receiveQueue;
|
||||
|
||||
@@ -71,7 +59,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
_props = JsonConvert.DeserializeObject<ZoomRoomPropertiesConfig>(config.Properties.ToString());
|
||||
|
||||
_receiveQueue = new GenericQueue(Key + "-rxQueue", Thread.eThreadPriority.MediumPriority, 2048);
|
||||
_receiveQueue = new GenericQueue(Key + "-rxQueue", Thread.eThreadPriority.MediumPriority, 512);
|
||||
|
||||
Communication = comm;
|
||||
|
||||
@@ -83,7 +71,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
else
|
||||
{
|
||||
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 30000, 120000, 300000,
|
||||
"zStatus SystemUnit" + SendDelimiter);
|
||||
"zStatus SystemUnit\r");
|
||||
}
|
||||
|
||||
DeviceManager.AddDevice(CommunicationMonitor);
|
||||
@@ -98,11 +86,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
_syncState.InitialSyncCompleted += SyncState_InitialSyncCompleted;
|
||||
|
||||
_syncState.FirstJsonResponseReceived += (o, a) => SetUpSyncQueries();
|
||||
|
||||
PhonebookSyncState = new CodecPhonebookSyncState(Key + "--PhonebookSync");
|
||||
|
||||
PortGather = new CommunicationGather(Communication, Delimiters) {IncludeDelimiter = true};
|
||||
PortGather = new CommunicationGather(Communication, "\x0A") {IncludeDelimiter = true};
|
||||
PortGather.LineReceived += Port_LineReceived;
|
||||
|
||||
CodecOsdIn = new RoutingInputPort(RoutingPortNames.CodecOsd,
|
||||
@@ -918,7 +904,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
Debug.Console(1, this, "Sending: '{0}'", command);
|
||||
}
|
||||
|
||||
Communication.SendText(command + SendDelimiter);
|
||||
Communication.SendText(command + Delimiter);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -928,28 +914,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
/// <param name="args"></param>
|
||||
private void Port_LineReceived(object dev, GenericCommMethodReceiveTextArgs args)
|
||||
{
|
||||
//Debug.Console(0, this, "Port_LineReceived");
|
||||
//if (CommDebuggingIsOn)
|
||||
// Debug.Console(1, this, "Gathered: '{0}'", args.Text);
|
||||
|
||||
if (args.Delimiter != JsonDelimiter)
|
||||
{
|
||||
// Debug.Console(0, this,
|
||||
//@"Non JSON response:
|
||||
//Delimiter: {0}
|
||||
//{1}", ComTextHelper.GetDebugText(args.Delimiter), args.Text);
|
||||
ProcessNonJsonResponse(args.Text);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Debug.Console(0, this,
|
||||
//@"JSON response:
|
||||
//Delimiter: {0}
|
||||
//{1}", ComTextHelper.GetDebugText(args.Delimiter), args.Text);
|
||||
_receiveQueue.Enqueue(new ProcessStringMessage(args.Text, DeserializeResponse));
|
||||
//_receiveQueue.Enqueue(new ProcessStringMessage(args.Text, ProcessMessage));
|
||||
}
|
||||
_receiveQueue.Enqueue(new ProcessStringMessage(args.Text, ProcessMessage));
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Queues the initial queries to be sent upon connection
|
||||
/// </summary>
|
||||
@@ -1008,84 +979,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
_syncState.StartSync();
|
||||
}
|
||||
|
||||
private void SetupSession()
|
||||
{
|
||||
// disable echo of commands
|
||||
SendText("echo off");
|
||||
// switch to json format
|
||||
// set feedback exclusions
|
||||
// Currently the feedback exclusions don't work when using the API in JSON response mode
|
||||
// But leave these here in case the API gets updated in the future
|
||||
// These may work as of 5.9.4
|
||||
if (_props.DisablePhonebookAutoDownload)
|
||||
{
|
||||
SendText("zFeedback Register Op: ex Path: /Event/Phonebook/AddedContact");
|
||||
}
|
||||
SendText("zFeedback Register Op: ex Path: /Event/InfoResult/Info/callin_country_list");
|
||||
SendText("zFeedback Register Op: ex Path: /Event/InfoResult/Info/callout_country_list");
|
||||
SendText("zFeedback Register Op: ex Path: /Event/InfoResult/Info/toll_free_callinLlist");
|
||||
|
||||
SendText("zStatus SystemUnit");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Processes non-JSON responses as their are received
|
||||
/// </summary>
|
||||
/// <param name="response"></param>
|
||||
private void ProcessNonJsonResponse(string response)
|
||||
{
|
||||
if (response.Contains("client_loop: send disconnect: Broken pipe"))
|
||||
{
|
||||
Debug.Console(1, this, Debug.ErrorLogLevel.Error,
|
||||
"Zoom Room Controller or App connected. Essentials will NOT control the Zoom Room until it is disconnected.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_syncState.InitialSyncComplete)
|
||||
{
|
||||
if(response.ToLower().Contains("*r login successful"))
|
||||
{
|
||||
_syncState.LoginResponseReceived();
|
||||
|
||||
SendText("format json");
|
||||
|
||||
SetupSession();
|
||||
}
|
||||
|
||||
//switch (response.Trim().ToLower()) // remove the whitespace
|
||||
//{
|
||||
// case "*r login successful":
|
||||
// {
|
||||
// _syncState.LoginMessageReceived();
|
||||
|
||||
// //// Fire up a thread to send the intial commands.
|
||||
// //CrestronInvoke.BeginInvoke(o =>
|
||||
// //{
|
||||
// // disable echo of commands
|
||||
// SendText("echo off");
|
||||
// // switch to json format
|
||||
// SendText("format json");
|
||||
// // set feedback exclusions
|
||||
// // Currently the feedback exclusions don't work when using the API in JSON response mode
|
||||
// // But leave these here in case the API gets updated in the future
|
||||
// // These may work as of 5.9.4
|
||||
// if (_props.DisablePhonebookAutoDownload)
|
||||
// {
|
||||
// SendText("zFeedback Register Op: ex Path: /Event/Phonebook/AddedContact");
|
||||
// }
|
||||
// SendText("zFeedback Register Op: ex Path: /Event/InfoResult/Info/callin_country_list");
|
||||
// SendText("zFeedback Register Op: ex Path: /Event/InfoResult/Info/callout_country_list");
|
||||
// SendText("zFeedback Register Op: ex Path: /Event/InfoResult/Info/toll_free_callinLlist");
|
||||
|
||||
// //});
|
||||
|
||||
// break;
|
||||
// }
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Processes messages as they are dequeued
|
||||
/// </summary>
|
||||
@@ -1113,7 +1006,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
//Debug.Console(2, this, "JSON Curly Brace Count: {0}", _jsonCurlyBraceCounter);
|
||||
|
||||
if (!_jsonFeedbackMessageIsIncoming && message.Trim('\x20') == "{" + EchoDelimiter)
|
||||
if (!_jsonFeedbackMessageIsIncoming && message.Trim('\x20') == "{" + Delimiter)
|
||||
// Check for the beginning of a new JSON message
|
||||
{
|
||||
_jsonFeedbackMessageIsIncoming = true;
|
||||
@@ -1130,7 +1023,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
return;
|
||||
}
|
||||
if (_jsonFeedbackMessageIsIncoming && message.Trim('\x20') == "}" + EchoDelimiter)
|
||||
if (_jsonFeedbackMessageIsIncoming && message.Trim('\x20') == "}" + Delimiter)
|
||||
// Check for the end of a JSON message
|
||||
{
|
||||
_jsonMessage.Append(message);
|
||||
@@ -1175,7 +1068,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
{
|
||||
case "*r login successful":
|
||||
{
|
||||
_syncState.LoginResponseReceived();
|
||||
_syncState.LoginMessageReceived();
|
||||
|
||||
|
||||
// Fire up a thread to send the intial commands.
|
||||
@@ -1228,11 +1121,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
var message = JObject.Parse(trimmedResponse);
|
||||
|
||||
if (!_syncState.FirstJsonResponseWasReceived)
|
||||
{
|
||||
_syncState.ReceivedFirstJsonResponse();
|
||||
}
|
||||
|
||||
var eType =
|
||||
(eZoomRoomResponseType)
|
||||
Enum.Parse(typeof (eZoomRoomResponseType), message["type"].Value<string>(), true);
|
||||
@@ -1241,7 +1129,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
var responseObj = message[topKey];
|
||||
|
||||
Debug.Console(1, this, "{0} Response Received. topKey: '{1}'\n{2}", eType, topKey, responseObj.ToString().Replace("\n", CrestronEnvironment.NewLine));
|
||||
Debug.Console(1, "{0} Response Received. topKey: '{1}'\n{2}", eType, topKey, responseObj.ToString());
|
||||
|
||||
switch (eType)
|
||||
{
|
||||
@@ -1754,17 +1642,19 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
{
|
||||
case "login":
|
||||
{
|
||||
_syncState.LoginResponseReceived();
|
||||
_syncState.LoginMessageReceived();
|
||||
|
||||
SetupSession();
|
||||
if (!_syncState.InitialQueryMessagesWereSent)
|
||||
{
|
||||
SetUpSyncQueries();
|
||||
}
|
||||
|
||||
JsonConvert.PopulateObject(responseObj.ToString(), Status.Login);
|
||||
|
||||
break;
|
||||
}
|
||||
case "systemunit":
|
||||
{
|
||||
|
||||
{
|
||||
JsonConvert.PopulateObject(responseObj.ToString(), Status.SystemUnit);
|
||||
|
||||
break;
|
||||
@@ -3170,7 +3060,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
handler(this, new LayoutInfoChangedEventArgs()
|
||||
{
|
||||
AvailableLayouts = AvailableLayouts,
|
||||
CurrentSelectedLayout = (zConfiguration.eLayoutStyle)Enum.Parse(typeof(zConfiguration.eLayoutStyle),string.IsNullOrEmpty(LocalLayoutFeedback.StringValue) ? "None" : LocalLayoutFeedback.StringValue , true),
|
||||
CurrentSelectedLayout = (zConfiguration.eLayoutStyle)Enum.Parse(typeof(zConfiguration.eLayoutStyle),LocalLayoutFeedback.StringValue, true),
|
||||
LayoutViewIsOnFirstPage = LayoutViewIsOnFirstPageFeedback.BoolValue,
|
||||
LayoutViewIsOnLastPage = LayoutViewIsOnLastPageFeedback.BoolValue,
|
||||
CanSwapContentWithThumbnail = CanSwapContentWithThumbnailFeedback.BoolValue,
|
||||
@@ -3547,9 +3437,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
}
|
||||
}
|
||||
|
||||
public bool LoginResponseWasReceived { get; private set; }
|
||||
|
||||
public bool FirstJsonResponseWasReceived { get; private set; }
|
||||
public bool LoginMessageWasReceived { get; private set; }
|
||||
|
||||
public bool InitialQueryMessagesWereSent { get; private set; }
|
||||
|
||||
@@ -3565,8 +3453,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
public event EventHandler<EventArgs> InitialSyncCompleted;
|
||||
|
||||
public event EventHandler FirstJsonResponseReceived;
|
||||
|
||||
public void StartSync()
|
||||
{
|
||||
DequeueQueries();
|
||||
@@ -3589,26 +3475,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
_syncQueries.Enqueue(query);
|
||||
}
|
||||
|
||||
public void LoginResponseReceived()
|
||||
public void LoginMessageReceived()
|
||||
{
|
||||
LoginResponseWasReceived = true;
|
||||
Debug.Console(1, this, "Login Rsponse Received.");
|
||||
LoginMessageWasReceived = true;
|
||||
Debug.Console(1, this, "Login Message Received.");
|
||||
CheckSyncStatus();
|
||||
}
|
||||
|
||||
public void ReceivedFirstJsonResponse()
|
||||
{
|
||||
FirstJsonResponseWasReceived = true;
|
||||
Debug.Console(1, this, "First JSON Response Received.");
|
||||
|
||||
var handler = FirstJsonResponseReceived;
|
||||
if (handler != null)
|
||||
{
|
||||
handler(this, null);
|
||||
}
|
||||
CheckSyncStatus();
|
||||
}
|
||||
|
||||
public void InitialQueryMessagesSent()
|
||||
{
|
||||
InitialQueryMessagesWereSent = true;
|
||||
@@ -3633,8 +3506,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
public void CodecDisconnected()
|
||||
{
|
||||
_syncQueries.Clear();
|
||||
LoginResponseWasReceived = false;
|
||||
FirstJsonResponseWasReceived = false;
|
||||
LoginMessageWasReceived = false;
|
||||
InitialQueryMessagesWereSent = false;
|
||||
LastQueryResponseWasReceived = false;
|
||||
CamerasHaveBeenSetUp = false;
|
||||
@@ -3643,7 +3515,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
private void CheckSyncStatus()
|
||||
{
|
||||
if (LoginResponseWasReceived && FirstJsonResponseWasReceived && InitialQueryMessagesWereSent && LastQueryResponseWasReceived &&
|
||||
if (LoginMessageWasReceived && InitialQueryMessagesWereSent && LastQueryResponseWasReceived &&
|
||||
CamerasHaveBeenSetUp)
|
||||
{
|
||||
InitialSyncComplete = true;
|
||||
|
||||
@@ -2,40 +2,30 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Newtonsoft.Json;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
{
|
||||
public class ZoomRoomPropertiesConfig
|
||||
{
|
||||
[JsonProperty("communicationMonitorProperties")]
|
||||
public CommunicationMonitorConfig CommunicationMonitorProperties { get; set; }
|
||||
|
||||
[JsonProperty("disablePhonebookAutoDownload")]
|
||||
public bool DisablePhonebookAutoDownload { get; set; }
|
||||
|
||||
[JsonProperty("supportsCameraAutoMode")]
|
||||
public bool SupportsCameraAutoMode { get; set; }
|
||||
|
||||
[JsonProperty("supportsCameraOff")]
|
||||
{
|
||||
public CommunicationMonitorConfig CommunicationMonitorProperties { get; set; }
|
||||
|
||||
public bool DisablePhonebookAutoDownload { get; set; }
|
||||
public bool SupportsCameraAutoMode { get; set; }
|
||||
public bool SupportsCameraOff { get; set; }
|
||||
|
||||
//if true, the layouts will be set automatically when sharing starts/ends or a call is joined
|
||||
[JsonProperty("autoDefaultLayouts")]
|
||||
//if true, the layouts will be set automatically when sharing starts/ends or a call is joined
|
||||
public bool AutoDefaultLayouts { get; set; }
|
||||
|
||||
/* This layout will be selected when Sharing starts (either from Far end or locally)*/
|
||||
[JsonProperty("defaultSharingLayout")]
|
||||
/* This layout will be selected when Sharing starts (either from Far end or locally)*/
|
||||
public string DefaultSharingLayout { get; set; }
|
||||
|
||||
//This layout will be selected when a call is connected and no content is being shared
|
||||
[JsonProperty("defaultCallLayout")]
|
||||
public string DefaultCallLayout { get; set; }
|
||||
|
||||
[JsonProperty("minutesBeforeMeetingStart")]
|
||||
//This layout will be selected when a call is connected and no content is being shared
|
||||
public string DefaultCallLayout { get; set; }
|
||||
|
||||
public int MinutesBeforeMeetingStart { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
<packages>
|
||||
<package id="PepperDashCore" version="1.1.1-rc-247" targetFramework="net35" allowedVersions="[1.0,2.0)"/>
|
||||
<package id="PepperDashCore" version="1.1.0" targetFramework="net35" allowedVersions="[1.0,2.0)"/>
|
||||
</packages>
|
||||
Reference in New Issue
Block a user