diff --git a/README.md b/README.md index b485eade..fac87250 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ Utilization of Essentials Framework falls into the following categories: ## Documentation -For detailed documentation, see the [Wiki](https://github.com/PepperDash/EssentialsFramework/wiki). +For detailed documentation, see the [DocFx Site](https://pepperdash.github.io/Essentials/). ## Support diff --git a/docs/docs/Home.md b/docs/docs/Home.md index 8e0c163e..bdda2185 100644 --- a/docs/docs/Home.md +++ b/docs/docs/Home.md @@ -19,12 +19,13 @@ Or use the links to the right to navigate our documentation. ## Benefits -- Runs on Crestron 3-Series, **4-Series** and VC-4 Control System platforms +- Runs on Crestron **4-Series** and VC-4 Control System platforms - Reduced hardware overhead compared to S+ and Simpl solutions - Quick development cycle - Shared resources made easily available - More flexibility with less code - Configurable using simple JSON files +- Built in websocket communication API for HTML5 frontend applications. - Is awesome --- diff --git a/src/PepperDash.Essentials.Core/Crestron/CrestronGenericBaseDevice.cs.orig b/src/PepperDash.Essentials.Core/Crestron/CrestronGenericBaseDevice.cs.orig deleted file mode 100644 index 8dc38428..00000000 --- a/src/PepperDash.Essentials.Core/Crestron/CrestronGenericBaseDevice.cs.orig +++ /dev/null @@ -1,128 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Crestron.SimplSharp; -using Crestron.SimplSharpPro; -using Crestron.SimplSharpPro.DeviceSupport; - -using PepperDash.Core; - -namespace PepperDash.Essentials.Core -{ - /// - /// A bridge class to cover the basic features of GenericBase hardware - /// - public class CrestronGenericBaseDevice : Device, IOnline, IHasFeedback, ICommunicationMonitor, IUsageTracking - { - public virtual GenericBase Hardware { get; protected set; } - - public BoolFeedback IsOnline { get; private set; } - public BoolFeedback IsRegistered { get; private set; } - public StringFeedback IpConnectionsText { get; private set; } - - public CrestronGenericBaseDevice(string key, string name, GenericBase hardware) - : base(key, name) - { - Hardware = hardware; - IsOnline = new BoolFeedback(CommonBoolCue.IsOnlineFeedback, () => Hardware.IsOnline); - IsRegistered = new BoolFeedback(new Cue("IsRegistered", 0, eCueType.Bool), () => Hardware.Registered); - IpConnectionsText = new StringFeedback(CommonStringCue.IpConnectionsText, () => - string.Join(",", Hardware.ConnectedIpList.Select(cip => cip.DeviceIpAddress).ToArray())); - CommunicationMonitor = new CrestronGenericBaseCommunicationMonitor(this, hardware, 120000, 300000); - } - - /// - /// Make sure that overriding classes call this! - /// Registers the Crestron device, connects up to the base events, starts communication monitor - /// - protected override bool CustomActivate() - { - Debug.LogMessage(LogEventLevel.Information, this, "Activating"); - var response = Hardware.RegisterWithLogging(Key); - if (response != eDeviceRegistrationUnRegistrationResponse.Success) - { -<<<<<<< HEAD - Debug.LogMessage(LogEventLevel.Information, this, "ERROR: Cannot register Crestron device: {0}", response); - return false; - } -======= - Debug.LogMessage(LogEventLevel.Information, this, "ERROR: Cannot register Crestron device: {0}", response); - return false; - } ->>>>>>> origin/feature/ecs-342-neil - Hardware.OnlineStatusChange += new OnlineStatusChangeEventHandler(Hardware_OnlineStatusChange); - CommunicationMonitor.Start(); - - return true; - } - - /// - /// This disconnects events and unregisters the base hardware device. - /// - /// - public override bool Deactivate() - { - CommunicationMonitor.Stop(); - Hardware.OnlineStatusChange -= Hardware_OnlineStatusChange; - - return Hardware.UnRegister() == eDeviceRegistrationUnRegistrationResponse.Success; - } - - /// - /// Returns a list containing the Outputs that we want to expose. - /// - public virtual List Feedbacks - { - get - { - return new List - { - IsOnline, - IsRegistered, - IpConnectionsText - }; - } - } - - void Hardware_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args) - { - IsOnline.FireUpdate(); - } - - #region IStatusMonitor Members - - public StatusMonitorBase CommunicationMonitor { get; private set; } - #endregion - - #region IUsageTracking Members - - public UsageTracking UsageTracker { get; set; } - - #endregion - } - - //*********************************************************************************** - public class CrestronGenericBaseDeviceEventIds - { - public const uint IsOnline = 1; - public const uint IpConnectionsText =2; - } - - /// - /// Adds logging to Register() failure - /// - public static class GenericBaseExtensions - { - public static eDeviceRegistrationUnRegistrationResponse RegisterWithLogging(this GenericBase device, string key) - { - var result = device.Register(); - if (result != eDeviceRegistrationUnRegistrationResponse.Success) - { - Debug.LogMessage(LogEventLevel.Information, "Cannot register device '{0}': {1}", key, result); - } - return result; - } - - } -} \ No newline at end of file diff --git a/src/PepperDash.Essentials.Core/PepperDash.Essentials.Core.csproj b/src/PepperDash.Essentials.Core/PepperDash.Essentials.Core.csproj index 3aa65e84..983155a5 100644 --- a/src/PepperDash.Essentials.Core/PepperDash.Essentials.Core.csproj +++ b/src/PepperDash.Essentials.Core/PepperDash.Essentials.Core.csproj @@ -28,12 +28,6 @@ - - - - - - diff --git a/src/PepperDash.Essentials.Core/PepperDash_Essentials_Core.csproj.DotSettings b/src/PepperDash.Essentials.Core/PepperDash_Essentials_Core.csproj.DotSettings deleted file mode 100644 index cb991a69..00000000 --- a/src/PepperDash.Essentials.Core/PepperDash_Essentials_Core.csproj.DotSettings +++ /dev/null @@ -1,3 +0,0 @@ - - True - False \ No newline at end of file diff --git a/src/PepperDash.Essentials.Core/SomeWebSocketClass.cs b/src/PepperDash.Essentials.Core/SomeWebSocketClass.cs deleted file mode 100644 index b87e87ae..00000000 --- a/src/PepperDash.Essentials.Core/SomeWebSocketClass.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Net.WebSockets; -using System.Threading; -using System.Threading.Tasks; - -public class SomeWebSocketClass -{ - private ClientWebSocket _webSocket; - - public SomeWebSocketClass() - { - _webSocket = new ClientWebSocket(); - } - - public async Task ConnectAsync(Uri uri) - { - await _webSocket.ConnectAsync(uri, CancellationToken.None); - } - - public async Task SendAsync(string message) - { - var buffer = System.Text.Encoding.UTF8.GetBytes(message); - await _webSocket.SendAsync(new ArraySegment(buffer), WebSocketMessageType.Text, true, CancellationToken.None); - } - - public async Task ReceiveAsync() - { - var buffer = new byte[1024]; - var result = await _webSocket.ReceiveAsync(new ArraySegment(buffer), CancellationToken.None); - return System.Text.Encoding.UTF8.GetString(buffer, 0, result.Count); - } - - public async Task CloseAsync() - { - await _webSocket.CloseAsync(WebSocketCloseStatus.NormalClosure, string.Empty, CancellationToken.None); - } -}