diff --git a/PepperDashEssentials/PepperDashEssentials.csproj b/PepperDashEssentials/PepperDashEssentials.csproj index 7fbda5ee..08716a1a 100644 --- a/PepperDashEssentials/PepperDashEssentials.csproj +++ b/PepperDashEssentials/PepperDashEssentials.csproj @@ -73,7 +73,7 @@ False - ..\essentials-framework\pepperdashcore-builds\PepperDash_Core.dll + ..\packages\PepperDashCore\lib\net35\PepperDash_Core.dll False diff --git a/PepperDashEssentials/UIDrivers/Essentials/EssentialsPanelMainInterfaceDriver.cs b/PepperDashEssentials/UIDrivers/Essentials/EssentialsPanelMainInterfaceDriver.cs index 5793c3bd..ab4ff3aa 100644 --- a/PepperDashEssentials/UIDrivers/Essentials/EssentialsPanelMainInterfaceDriver.cs +++ b/PepperDashEssentials/UIDrivers/Essentials/EssentialsPanelMainInterfaceDriver.cs @@ -26,7 +26,9 @@ namespace PepperDash.Essentials public PanelDriverBase CurrentChildDriver { get; private set; } - public ScreenSaverController ScreenSaverController { get; set; } + public ScreenSaverController ScreenSaverController { get; set; } + + private readonly long _timeoutMs; CrestronTouchpanelPropertiesConfig Config; @@ -41,38 +43,51 @@ namespace PepperDash.Essentials { Config = config; + _timeoutMs = Config.ScreenSaverTimeoutMin * 60 * 1000; + var tsx52or60 = trilist as Tswx52ButtonVoiceControl; - if (tsx52or60 != null) - { - tsx52or60.ExtenderTouchDetectionReservedSigs.DeviceExtenderSigChange += ExtenderTouchDetectionReservedSigs_DeviceExtenderSigChange; + if (tsx52or60 != null) + { + tsx52or60.ExtenderTouchDetectionReservedSigs.Use(); + tsx52or60.ExtenderTouchDetectionReservedSigs.DeviceExtenderSigChange += ExtenderTouchDetectionReservedSigs_DeviceExtenderSigChange; + tsx52or60.ExtenderTouchDetectionReservedSigs.Time.UShortValue = 1; + ManageInactivityTimer(); + } else { var tswx70 = trilist as TswX70Base; if (tswx70 != null) - { - tswx70.ExtenderTouchDetectionReservedSigs.DeviceExtenderSigChange += ExtenderTouchDetectionReservedSigs_DeviceExtenderSigChange; + { + tswx70.ExtenderTouchDetectionReservedSigs.Use(); + tswx70.ExtenderTouchDetectionReservedSigs.DeviceExtenderSigChange += ExtenderTouchDetectionReservedSigs_DeviceExtenderSigChange; + tswx70.ExtenderTouchDetectionReservedSigs.Time.UShortValue = 1; + ManageInactivityTimer(); } } } void ExtenderTouchDetectionReservedSigs_DeviceExtenderSigChange(Crestron.SimplSharpPro.DeviceExtender currentDeviceExtender, Crestron.SimplSharpPro.SigEventArgs args) { - var timeoutMs = Config.ScreenSaverTimeoutMin * 60 * 1000; - if (args.Sig.BoolValue) - { - if (InactivityTimer != null) - { - InactivityTimer.Reset(timeoutMs); - } - else - { - InactivityTimer = new CTimer((o) => InactivityTimerExpired(), timeoutMs); - } + if (args.Sig.BoolValue) + { + ManageInactivityTimer(); } - } + } + + private void ManageInactivityTimer() + { + if (InactivityTimer != null) + { + InactivityTimer.Reset(_timeoutMs); + } + else + { + InactivityTimer = new CTimer((o) => InactivityTimerExpired(), _timeoutMs); + } + } void InactivityTimerExpired() { diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj index e57b6a62..df250d84 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj @@ -85,7 +85,7 @@ False - ..\..\pepperdashcore-builds\PepperDash_Core.dll + ..\..\..\packages\PepperDashCore\lib\net35\PepperDash_Core.dll False diff --git a/essentials-framework/Essentials DM/Essentials_DM/PepperDash_Essentials_DM.csproj b/essentials-framework/Essentials DM/Essentials_DM/PepperDash_Essentials_DM.csproj index 76aae649..a737def4 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/PepperDash_Essentials_DM.csproj +++ b/essentials-framework/Essentials DM/Essentials_DM/PepperDash_Essentials_DM.csproj @@ -61,7 +61,7 @@ False - ..\..\pepperdashcore-builds\PepperDash_Core.dll + ..\..\..\packages\PepperDashCore\lib\net35\PepperDash_Core.dll False diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj index 6055f9ab..e639d6cb 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj @@ -65,7 +65,7 @@ False - ..\..\pepperdashcore-builds\PepperDash_Core.dll + ..\..\..\packages\PepperDashCore\lib\net35\PepperDash_Core.dll False diff --git a/packages.config b/packages.config new file mode 100644 index 00000000..996a91db --- /dev/null +++ b/packages.config @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/packages/PepperDashCore/.signature.p7s b/packages/PepperDashCore/.signature.p7s new file mode 100644 index 00000000..6a659d6e Binary files /dev/null and b/packages/PepperDashCore/.signature.p7s differ diff --git a/packages/PepperDashCore/PepperDashCore.nupkg b/packages/PepperDashCore/PepperDashCore.nupkg new file mode 100644 index 00000000..9185a83d Binary files /dev/null and b/packages/PepperDashCore/PepperDashCore.nupkg differ diff --git a/packages/PepperDashCore/lib/net35/PepperDash_Core.clz b/packages/PepperDashCore/lib/net35/PepperDash_Core.clz new file mode 100644 index 00000000..8c63e5b9 Binary files /dev/null and b/packages/PepperDashCore/lib/net35/PepperDash_Core.clz differ diff --git a/packages/PepperDashCore/lib/net35/PepperDash_Core.dll b/packages/PepperDashCore/lib/net35/PepperDash_Core.dll new file mode 100644 index 00000000..75c88121 Binary files /dev/null and b/packages/PepperDashCore/lib/net35/PepperDash_Core.dll differ diff --git a/packages/PepperDashCore/lib/net35/PepperDash_Core.xml b/packages/PepperDashCore/lib/net35/PepperDash_Core.xml new file mode 100644 index 00000000..01661142 --- /dev/null +++ b/packages/PepperDashCore/lib/net35/PepperDash_Core.xml @@ -0,0 +1,3754 @@ + + + + PepperDash_Core + + + + + Constants + + + + + Generic boolean value change constant + + + + + Evaluated boolean change constant + + + + + Update busy change const + + + + + Password is valid change constant + + + + + Password LED change constant + + + + + Generic ushort value change constant + + + + + Password count + + + + + Password selecte index change constant + + + + + Password length + + + + + Generic string value change constant + + + + + Device class + + + + + Constructor + + + + + Initialize method + + + + + + + BoolChange event handler helper + + + + + + + + UshrtChange event handler helper + + + + + + + + StringChange event handler helper + + + + + + + + ObjectChange event handler helper + + + + + + + + JSON config key property + + + + + JSON config name property + + + + + JSON config type property + + + + + JSON config properties + + + + + Bool change event handler + + + + + Ushort change event handler + + + + + String change event handler + + + + + Object change event handler + + + + + An incoming communication stream + + + + + Unique key interface to require a unique key for the class + + + + + Unique Key + + + + + + + + + + + + + + + + + + + Stores the state of the request + + + + + Waithandle for main thread. + + + + + Constants + + + + + Processor Change Event Args Class + + + + + Constructor + + + + + Constructor overload + + + + + Constructor + + + + + Ethernet Change Event Args Class + + + + + Constructor + + + + + Constructor overload + + + + + + + Constructor overload + + + + + + + Control Subnet Chage Event Args Class + + + + + Constructor + + + + + Constructor overload + + + + + Constructor overload + + + + + Program Change Event Args Class + + + + + Constructor + + + + + Constructor overload + + + + + + + Constructor overload + + + + + + + The core event and status-bearing class that most if not all device and connectors can derive from. + + + + + Named Keyed device interface. Forces the devie to have a Unique Key and a name. + + + + + Isn't it obvious :) + + + + + Base constructor for all Devices. + + + + + + Gets this device ready to be used in the system. Runs any added pre-activation items, and + all post-activation at end. Classes needing additional logic to + run should override CustomActivate() + + + + + Called in between Pre and PostActivationActions when Activate() is called. + Override to provide addtitional setup when calling activation. Overriding classes + do not need to call base.CustomActivate() + + true if device activated successfully. + + + + Call to deactivate device - unlink events, etc. Overriding classes do not + need to call base.Deactivate() + + + + + + Helper method to check object for bool value false and fire an Action method + + Should be of type bool, others will be ignored + Action to be run when o is false + + + + Unique Key + + + + + Name of the devie + + + + + + + + + + + + + + + A bandaid client that monitors whether the server is reachable + + + + + Timer to operate the bandaid monitor client in a loop. + + + + + + + + + + + + + + + constructor S+ Does not accept a key. Use initialze with key to set the debug key on this device. If using with + make sure to set all properties manually. + + + + + constructor with debug key set at instantiation. Make sure to set all properties before listening. + + + + + + Contstructor that sets all properties by calling the initialize method with a config object. + + + + + + Disconnects all clients and stops the server + + + + + Initialize Key for device using client name from SIMPL+. Called on Listen from SIMPL+ + + + + + + Start listening on the specified port + + + + + Stop Listeneing + + + + + Disconnects Client + + + + + + Disconnect All Clients + + + + + Broadcast text from server to all connected clients + + + + + + Not sure this is useful in library, maybe Pro?? + + + + + + + Secure Server Socket Status Changed Callback + + + + + + + + Secure TCP Client Connected to Secure Server Callback + + + + + + + Secure Received Data Async Callback + + + + + + + + Private Event Handler method to handle the closing of connections when the program stops + + + + + + Starts the monitor client cycle. Timed wait, then call RunMonitorClient + + + + + + + + + + + + + + + On monitor connect, restart the operation + + + + + If the client hangs, add to counter and maybe fire the choke event + + + + + Event for Receiving text + + + + + Event for client connection socket status change + + + + + Event for Server State Change + + + + + For a server with a pre shared key, this will fire after the communication is established and the key exchange is complete. If no shared key, this will fire + after connection is successful. Use this event to know when the client is ready for communication to avoid stepping on shared key. + + + + + A band aid event to notify user that the server has choked. + + + + + 3 by default + + + + + Text representation of the Socket Status enum values for the server + + + + + Bool showing if socket is connected + + + + + S+ helper for IsConnected + + + + + Bool showing if socket is connected + + + + + S+ helper for IsConnected + + + + + Number of clients currently connected. + + + + + Port Server should listen on + + + + + S+ helper for Port + + + + + Bool to show whether the server requires a preshared key. Must be set the same in the client, and if true shared keys must be identical on server/client + + + + + S+ helper for requires shared key bool + + + + + SharedKey is sent for varification to the server. Shared key can be any text (255 char limit in SIMPL+ Module), but must match the Shared Key on the Server module. + If SharedKey changes while server is listening or clients are connected, disconnect and stop listening will be called + + + + + Heartbeat Required bool sets whether server disconnects client if heartbeat is not received + + + + + S+ Helper for Heartbeat Required + + + + + Milliseconds before server expects another heartbeat. Set by property HeartbeatRequiredIntervalInSeconds which is driven from S+ + + + + + Simpl+ Heartbeat Analog value in seconds + + + + + String to Match for heartbeat. If null or empty any string will reset heartbeat timer + + + + + Defaults to 2000 + + + + + Private flag to note that the server has stopped intentionally + + + + + Creates or gets a debug context + + + + + + + Do not use. For S+ access. + + + + + Used to save memory when shutting down + + + + + + Callback for console command + + + + + + Sets the debug level + + Valid values 0 (no debug), 1 (critical), 2 (all messages) + + + + Prints message to console if current debug level is equal to or higher than the level of this message. + Uses CrestronConsole.PrintLine. + + + Console format string + Object parameters + + + + Appends a device Key to the beginning of a message + + + + + Writes the memory object after timeout + + + + + Writes the memory - use SaveMemoryOnTimeout + + + + + + + + + + Helper to get the file path for this app's debug memory + + + + + Describes the folder location where a given program stores it's debug level memory. By default, the + file written will be named appNdebug where N is 1-10. + + + + + Device communication parameter class + + + + + Constructor + + + + + Device TCP/SSH properties class + + + + + Constructor + + + + + Device control class + + + + + Constructor + + + + + Device properties class + + + + + Constructor + + + + + Root device class + + + + + Constants for simpl modules + + + + + Json object evaluated constant + + + + + Json object changed constant + + + + + + + + + + Default constructor + + + + + Constructor overload + + + + + + + Constructor overload + + + + + + + + Device change event args object + + + + + Device change event args type + + + + + Device change event args index + + + + + Bool change event args + + + + + Constructor + + + + + Constructor overload + + + + + + + Constructor overload + + + + + + + + Boolean state property + + + + + Boolean ushort value property + + + + + Boolean change event args type + + + + + Boolean change event args index + + + + + Ushort change event args + + + + + Constructor + + + + + Constructor overload + + + + + + + Constructor overload + + + + + + + + Ushort change event args integer value + + + + + Ushort change event args type + + + + + Ushort change event args index + + + + + String change event args + + + + + Constructor + + + + + Constructor overload + + + + + + + Constructor overload + + + + + + + + String change event args value + + + + + String change event args type + + + + + string change event args index + + + + + Represents a device that implements ISocketStatus and IStreamDebugging + + + + + For IBasicCommunication classes that have SocketStatus. GenericSshClient, + GenericTcpIpClient + + + + + Represents a device that uses basic connection + + + + + Represents a device with stream debugging capablities + + + + + Queue to temporarily store received messages with the source IP and Port info + + + + + Constructor for S+. Make sure to set key, address, port, and buffersize using init method + + + + + + + + + + + + + + Call from S+ to initialize values + + + + + + + + + + + + + + + + + + + + Enables the UDP Server + + + + + Disabled the UDP Server + + + + + Recursive method to receive data + + + + + + + This method gets spooled up in its own thread an protected by a CCriticalSection to prevent multiple threads from running concurrently. + It will dequeue items as they are enqueued automatically. + + + + + General send method + + + + + + + + + + + + + + + + + + + + + + This event will fire when a message is dequeued that includes the source IP and Port info if needed to determine the source of the received data. + + + + + + + + + + + + + + + + + + + + + + + + + Address of server + + + + + Port on server + + + + + Another damn S+ helper because S+ seems to treat large port nums as signed ints + which screws up things + + + + + Indicates that the UDP Server is enabled + + + + + Defaults to 2000 + + + + + + + + + + + + + + + + + + + Stupid S+ Constructor + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Defaults to 32768 + + + + + Adds a file master. If the master's key or filename is equivalent to any existing + master, this will fail + + New master to add + + + + + Gets a master by its key. Case-insensitive + + + + + + + + + + Typical constructor. + + + + + S+ Constructor - Must set all properties before calling Connect + + + + + Just to help S+ set the key + + + + + Handles closing this up when the program shuts down + + + + + Connect to the server, using the provided properties. + + + + + Disconnect the clients and put away it's resources. + + + + + Kills the stream, cleans up the client and sets it to null + + + + + Anything to do with reestablishing connection on failures + + + + + Kills the stream + + + + + Handles the keyboard interactive authentication, should it be required. + + + + + Handler for data receive on ShellStream. Passes data across to queue for line parsing. + + + + + Error event handler for client events - disconnect, etc. Will forward those events via ConnectionChange + event + + + + + Helper for ConnectionChange event + + + + + Sends text to the server + + + + + + Sends Bytes to the server + + + + + + Event that fires when data is received. Delivers args with byte array + + + + + Event that fires when data is received. Delivered as text. + + + + + Event when the connection status changes. + + + + + Address of server + + + + + Port on server + + + + + Username for server + + + + + And... Password for server. That was worth documenting! + + + + + True when the server is connected - when status == 2. + + + + + S+ helper for IsConnected + + + + + + + + + + Contains the familiar Simpl analog status values. This drives the ConnectionChange event + and IsConnected with be true when this == 2. + + + + + Determines whether client will attempt reconnection on failure. Default is true + + + + + Will be set and unset by connect and disconnect only + + + + + S+ helper for AutoReconnect + + + + + Millisecond value, determines the timeout period in between reconnect attempts. + Set to 5000 by default + + + + + Fired when connection changes + + + + + S+ Constructor + + + + + EventArgs class + + Connection State + The Client + + + + Connection State + + + + + Connection Status represented as a ushort + + + + + The client + + + + + Socket Status as represented by + + + + + System Info class + + + + + Constructor + + + + + Gets the current processor info + + + + + Gets the current ethernet info + + + + + Gets the current control subnet info + + + + + Gets the program info by index + + + + + + Gets the processor uptime and passes it to S+ + + + + + Gets the program uptime, by index, and passes it to S+ + + + + + + Sends command to console, passes response back using string change event + + + + + + private method to parse console messages + + + + + + + + + + Protected boolean change event handler + + + + + + + + Protected string change event handler + + + + + + + + Protected processor config change event handler + + + + + + + + Ethernet change event handler + + + + + + + + Control Subnet change event handler + + + + + + + + Program change event handler + + + + + + + + Generic RESTful communication class + + + + + Constructor + + + + + Generic RESTful submit request + + + + + + + + + + Private HTTP submit request + + + + + + + + + + Private HTTPS submit request + + + + + + + + + + Private method to encode username and password to Base64 string + + + + authorization + + + + Protected method to handle boolean change events + + + + + + + + Protected mehtod to handle ushort change events + + + + + + + + Protected method to handle string change events + + + + + + + + Boolean event handler + + + + + Ushort event handler + + + + + String event handler + + + + + Call this before doing anything else + + + + + + + + + Set the JPath to evaluate for a given bool out index. + + + + + Set the JPath for a ushort out index. + + + + + Set the JPath for a string output index. + + + + + Evalutates all outputs with defined paths. called by S+ when paths are ready to process + and by Master when file is read. + + + + + Processes a bool property, converting to bool, firing off a BoolChange event + + + + + Processes the given path. + + JPath formatted path to the desired property + The string value of the property, or a default value if it + doesn't exist + This will return false in the case that EvaulateAllOnJsonChange + is false and the path does not evaluate to a property in the incoming JSON. + + + + Called from Master to read inputs and update their values in master JObject + Callback should hit one of the following four methods + + + + + Called during Process(...) to get the path to a given property. By default, + returns PathPrefix+path+PathSuffix. Override to change the way path is built. + + + + + Use a callback to reduce task switch/threading + + + + + This will be prepended to all paths to allow path swapping or for more organized + sub-paths + + + + + This is added to the end of all paths + + + + + + For newer >=2.4.1 array lookups. + + + + + + + + + + + + + + + + + + + Provides the path append for GetFullPath + + + + + + + + + + + + Not in use + + + + + Not in use + + + + + Crestron Control Methods for a comm object + + + + + Processor info class + + + + + Constructor + + + + + Ethernet info class + + + + + Constructor + + + + + Control subnet info class + + + + + Constructor + + + + + Program info class + + + + + Constructor + + + + + Describes the folder location where a given program stores it's debug level memory. By default, the + file written will be named appNdebug where N is 1-10. + + + + + The name of the file containing the current debug settings. + + + + + When true, the IncludedExcludedKeys dict will contain keys to include. + When false (default), IncludedExcludedKeys will contain keys to exclude. + + + + + Used to save memory when shutting down + + + + + + Callback for console command + + + + + + Callback for console command + + + + + + Callback for console command + + + + + + Sets the debug level + + Valid values 0 (no debug), 1 (critical), 2 (all messages) + + + + sets the settings for a device or creates a new entry + + + + + + + + Gets the device settings for a device by key or returns null + + + + + + + Sets the flag to prevent application starting on next boot + + + + + + + + + + + Prints message to console if current debug level is equal to or higher than the level of this message. + Uses CrestronConsole.PrintLine. + + + Console format string + Object parameters + + + + Logs to Console when at-level, and all messages to error log, including device key + + + + + Logs to Console when at-level, and all messages to error log + + + + + Logs to both console and the custom user log (not the built-in error log). If appdebug level is set at + or above the level provided, then the output will be written to both console and the log. Otherwise + it will only be written to the log. + + + + + + + + Logs to both console and the custom user log (not the built-in error log). If appdebug level is set at + or above the level provided, then the output will be written to both console and the log. Otherwise + it will only be written to the log. + + + + String.format string + Parameters for substitution in the format string. + + + + Prints to log and error log + + + + + + + Writes the memory object after timeout + + + + + Writes the memory - use SaveMemoryOnTimeout + + + + + + + + + + Helper to get the file path for this app's debug memory + + + + + Reads the config file, checks if it needs a merge, merges and saves, then returns the merged Object. + + JObject of config file + + + + + + + + + + + Merges the contents of a base and a delta array, matching the entries on a top-level property + given by propertyName. Returns a merge of them. Items in the delta array that do not have + a matched item in base array will not be merged. Non keyed system items will replace the template items. + + + + + Helper for using with JTokens. Converts to JObject + + + + + Merge o2 onto o1 + + + + + + + Constructor + + + + + Initialize method + + + + + Retrieve password by index + + + + + + Password validation method + + + + + + Builds the user entered passwrod string, will attempt to validate the user entered + password against the selected password when the length of the 2 are equal + + + + + + Clears the user entered password and resets the LEDs + + + + + Protected boolean change event handler + + + + + + + + Protected ushort change event handler + + + + + + + + Protected string change event handler + + + + + + + + If password changes while selected change event will be notifed and update the client + + + + + + + Password selected + + + + + Password selected key + + + + + Used to build the password entered by the user + + + + + Boolean event + + + + + Ushort event + + + + + String event + + + + + JSON password configuration + + + + + Constructor + + + + + Password object configured password + + + + Privates * + + + + SIMPL+ default constructor. + + + + + Sets up class - overriding methods should always call this. + + + + + + Adds a child "module" to this master + + + + + + Called from the child to add changed or new values for saving + + + + Events * + + + + Mirrors the Unique ID for now. + + + + + Merely for use in debug messages + + + + + This will be prepended to all paths to allow path swapping or for more organized + sub-paths + + + + + This is added to the end of all paths + + + + + Enables debugging output to the console. Certain error messages will be logged to the + system's error log regardless of this setting + + + + + Ushort helper for Debug property + + + + Privates * + + + + SIMPL+ default constructor. + + + + + Read, evaluate and udpate status + + + + + Sets the filepath as well as registers this with the Global.Masters list + + + + Privates * + + + + SIMPL+ default constructor. + + + + + Read, evaluate and udpate status + + + + + Returns the FileInfo object for a given path, with possible wildcards + + + + + + + + + + + + + + + + + + Sets the filepath as well as registers this with the Global.Masters list + + + + + Client config object for TCP client with server that inherits from TcpSshPropertiesConfig and adds properties for shared key and heartbeat + + + + + TcpSsh Properties + + + + + Bool value for secure. Currently not implemented in TCP sockets as they are not dynamic + + + + + Require a shared key that both server and client negotiate. If negotiation fails server disconnects the client + + + + + The shared key that must match on the server and client + + + + + Require a heartbeat on the client/server connection that will cause the server/client to disconnect if the heartbeat is not received. + heartbeats do not raise received events. + + + + + The interval in seconds for the heartbeat from the client. If not received client is disconnected + + + + + HeartbeatString that will be checked against the message received. defaults to heartbeat if no string is provided. + + + + + Receive Queue size must be greater than 20 or defaults to 20 + + + + + Represents a device that implements IBasicCommunication and IStreamDebugging + + + + + + + + + + This delegate defines handler for IBasicCommunication status changes + + Device firing the status change + + + + + + + + + + Stupid S+ Constructor + + + + + + + + + + Stupid S+ Constructor + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + To prevent threading issues with the DeviceDebugSettings collection + + + + + + Gets a level or creates it if not existing + + + + + + + sets the settings for a device or creates a new entry + + + + + + + + Gets the device settings for a device by key or returns null + + + + + + + Collection of the debug settings for each device where the dictionary key is the device key + + + + + The level of debug messages to print + + + + + Property to tell the program not to intitialize when it boots, if desired + + + + Privates * + + + + SIMPL+ default constructor. + + + + + Loads in JSON and triggers evaluation on all children + + + + + + Loads JSON into JsonObject, but does not trigger evaluation by children + + + + + + + + + + + Constants + + + + + Generic boolean change + + + + + Generic Ushort change + + + + + Response Code Ushort change + + + + + Generic String chagne + + + + + Response string change + + + + + Error string change + + + + + An embedded JsonToSimpl master object. + + + + + SIMPL+ can only execute the default constructor. If you have variables that require initialization, please + use an Initialize method + + + + + + + + + + + + + + + + + + + After save operation on JSON master happens, send it to server + + + + + + Stupid S+ Constructor + + + + + Stupid S+ Constructor + + + + + Stupid S+ Constructor + + + + + Stupid S+ Constructor + + + + + Stupid S+ Constructor + + + + + Server listen lock + + + + + Queue lock + + + + + Queue to temporarily store received messages with the source IP and Port info. Defaults to size 20. Use constructor or set queue size property before + calling initialize. + + + + + A bandaid client that monitors whether the server is reachable + + + + + Timer to operate the bandaid monitor client in a loop. + + + + + + + + + + + + + + + constructor S+ Does not accept a key. Use initialze with key to set the debug key on this device. If using with + make sure to set all properties manually. + + + + + constructor with debug key set at instantiation. Make sure to set all properties before listening. + + + + + + Contstructor that sets all properties by calling the initialize method with a config object. This does set Queue size. + + + + + + Disconnects all clients and stops the server + + + + + Initialize Key for device using client name from SIMPL+. Called on Listen from SIMPL+ + + + + + + Start listening on the specified port + + + + + Stop Listeneing + + + + + Disconnects Client + + + + + + Disconnect All Clients + + + + + Broadcast text from server to all connected clients + + + + + + Not sure this is useful in library, maybe Pro?? + + + + + + + Secure Server Socket Status Changed Callback + + + + + + + + Secure TCP Client Connected to Secure Server Callback + + + + + + + Secure Received Data Async Callback + + + + + + + + This method gets spooled up in its own thread an protected by a CCriticalSection to prevent multiple threads from running concurrently. + It will dequeue items as they are enqueued automatically. + + + + + Private Event Handler method to handle the closing of connections when the program stops + + + + + + Starts the monitor client cycle. Timed wait, then call RunMonitorClient + + + + + + + + + + + + + + + On monitor connect, restart the operation + + + + + If the client hangs, add to counter and maybe fire the choke event + + + + + Event for Receiving text + + + + + Event for Receiving text. Once subscribed to this event the receive callback will start a thread that dequeues the messages and invokes the event on a new thread. + It is not recommended to use both the TextReceived event and the TextReceivedQueueInvoke event. + + + + + Event for client connection socket status change + + + + + Event for Server State Change + + + + + For a server with a pre shared key, this will fire after the communication is established and the key exchange is complete. If no shared key, this will fire + after connection is successful. Use this event to know when the client is ready for communication to avoid stepping on shared key. + + + + + A band aid event to notify user that the server has choked. + + + + + Receive Queue size. Defaults to 20. Will set to 20 if QueueSize property is less than 20. Use constructor or set queue size property before + calling initialize. + + + + + 3 by default + + + + + Text representation of the Socket Status enum values for the server + + + + + Bool showing if socket is connected + + + + + S+ helper for IsConnected + + + + + Bool showing if socket is connected + + + + + S+ helper for IsConnected + + + + + Max number of clients this server will allow for connection. Crestron max is 64. This number should be less than 65 + + + + + Number of clients currently connected. + + + + + Port Server should listen on + + + + + S+ helper for Port + + + + + Bool to show whether the server requires a preshared key. Must be set the same in the client, and if true shared keys must be identical on server/client + + + + + S+ helper for requires shared key bool + + + + + SharedKey is sent for varification to the server. Shared key can be any text (255 char limit in SIMPL+ Module), but must match the Shared Key on the Server module. + If SharedKey changes while server is listening or clients are connected, disconnect and stop listening will be called + + + + + Heartbeat Required bool sets whether server disconnects client if heartbeat is not received + + + + + S+ Helper for Heartbeat Required + + + + + Milliseconds before server expects another heartbeat. Set by property HeartbeatRequiredIntervalInSeconds which is driven from S+ + + + + + Simpl+ Heartbeat Analog value in seconds + + + + + String to Match for heartbeat. If null or empty any string will reset heartbeat timer + + + + + Defaults to 2000 + + + + + Private flag to note that the server has stopped intentionally + + + + + Controls the ability to disable/enable debugging of TX/RX data sent to/from a device with a built in timer to disable + + + + + Timer to disable automatically if not manually disabled + + + + + Sets the debugging setting and if not setting to off, assumes the default of 30 mintues + + + + + + Sets the debugging setting for the specified number of minutes + + + + + + + Disabled debugging + + + + + Device Key that this instance configures + + + + + Timeout in Minutes + + + + + The available settings for stream debugging + + + + + Constants for Simpl modules + + + + + S+ values delegate + + + + + S+ values wrapper + + + + + S+ types enum + + + + + Defines the string event handler for line events on the gather + + + + + + Attaches to IBasicCommunication as a text gather + + + + + For receive buffer + + + + + Delimiter, like it says! + + + + + Fires up a gather, given a IBasicCommunicaion port and char for de + + + + + + + + + + + + + + Disconnects this gather from the Port's TextReceived event. This will not fire LineReceived + after the this call. + + + + + Handler for raw data coming from port + + + + + + + + + + + + Deconstructor. Disconnects from port TextReceived events. + + + + + Event that fires when a line is received from the IBasicCommunication source. + The event merely contains the text, not an EventArgs type class. + + + + + The communication port that this gathers on + + + + + Default false. If true, the delimiter will be included in the line output + events + + + + + Background class that manages debug features for sockets + + + + + Sets up the backing class. Adds console commands for S#Pro programs + + + + + Helper for socket list, to show types + + + + + + + + + + + + + + + + + This is something of a band-aid callback. If the client times out during the connection process, because the server + is stuck, this will fire. It is intended to be used by the Server class monitor client, to help + keep a watch on the server and reset it if necessary. + + + + + Semaphore on connect method + + + + + Flag Set only when the disconnect method is called. + + + + + private Timer for auto reconnect + + + + + Used to force disconnection on a dead connect attempt + + + + + Internal secure client + + + + + Just to help S+ set the key + + + + + Handles closing this up when the program shuts down + + + + + Connect Method. Will return if already connected. Will write errors if missing address, port, or unique key/name. + + + + + + + + + + Internal call to close up client. ALWAYS use this when disconnecting. + + + + ff + Called from Connect failure or Socket Status change if + auto reconnect and socket disconnected (Not disconnected by user) + + + + + Receive callback + + + + + + + + + + + + General send method + + + + + + + + + + SocketStatusChange Callback + + + + + + + Helper for ConnectionChange event + + + + + Helper to fire ClientReadyForCommunications event + + + + + For a client with a pre shared key, this will fire after the communication is established and the key exchange is complete. If you require + a key and subscribe to the socket change event and try to send data on a connection the data sent will interfere with the key exchange and disconnect. + + + + + Address of server + + + + + Port on server + + + + + S+ helper + + + + + Bool to show whether the server requires a preshared key. This is used in the DynamicTCPServer class + + + + + S+ helper for requires shared key bool + + + + + SharedKey is sent for varification to the server. Shared key can be any text (255 char limit in SIMPL+ Module), but must match the Shared Key on the Server module + + + + + flag to show the client is waiting for the server to send the shared key + + + + + Defaults to 2000 + + + + + Bool showing if socket is connected + + + + + S+ helper for IsConnected + + + + + Bool showing if socket is ready for communication after shared key exchange + + + + + S+ helper for IsReadyForCommunication + + + + + Client socket status Read only + + + + + Contains the familiar Simpl analog status values. This drives the ConnectionChange event + and IsConnected would be true when this == 2. + + + + + Status text shows the message associated with socket status + + + + + bool to track if auto reconnect should be set on the socket + + + + + S+ helper for AutoReconnect + + + + + Milliseconds to wait before attempting to reconnect. Defaults to 5000 + + + + + Band aid delegate for choked server + + + + + + + + + + + + + + + For Simpl+ + + + + + True when user is found + + + + + For stupid S+ + + + + + + + + + + + + + + + For Simpl+ + + + + + True when the preset is found + + + + + S+ helper for stupid S+ + + + + + + + + + + Defaults to Environment.NewLine; + + + + + Public dictionary of known passwords + + + + + Private dictionary, used when passwords are updated + + + + + Timer used to wait until password changes have stopped before updating the dictionary + + + + + Timer length + + + + + Constructor + + + + + Initialize password manager + + + + + Updates password stored in the dictonary + + + + + + + CTimer callback function + + + + + Method to change the default timer value, (default 5000ms/5s) + + + + + + Helper method for debugging to see what passwords are in the lists + + + + + Protected boolean change event handler + + + + + + + + Protected ushort change event handler + + + + + + + + Protected string change event handler + + + + + + + + Protected password change event handler + + + + + + + + Boolean event + + + + + Ushort event + + + + + String event + + + + + Event to notify clients of an updated password at the specified index (uint) + + + + + A class to handle basic TCP/IP communications with a server + + + + + Set only when the disconnect method is called. + + + + + Constructor + + + + + + + + + Constructor + + + + + + Default constructor for S+ + + + + + Just to help S+ set the key + + + + + Handles closing this up when the program shuts down + + + + + + + + + + + Attempts to connect to the server + + + + + Attempts to disconnect the client + + + + + Does the actual disconnect business + + + + + Callback method for connection attempt + + + + + + Disconnects, waits and attemtps to connect again + + + + + Recieves incoming data + + + + + + + General send method + + + + + This is useful from console and...? + + + + + Sends Bytes to the server + + + + + + Socket Status Change Handler + + + + + + + Fires when data is received from the server and returns it as a Byte array + + + + + Fires when data is received from the server and returns it as text + + + + + + + + + + Address of server + + + + + Port on server + + + + + Another damn S+ helper because S+ seems to treat large port nums as signed ints + which screws up things + + + + + Defaults to 2000 + + + + + The actual client class + + + + + True if connected to the server + + + + + S+ helper for IsConnected + + + + + Status of the socket + + + + + Contains the familiar Simpl analog status values. This drives the ConnectionChange event + and IsConnected with be true when this == 2. + + + + + Status of the socket + + + + + Connection failure reason + + + + + If true, enables AutoConnect + + + + + S+ helper for AutoReconnect + + + + + Milliseconds to wait before attempting to reconnect. Defaults to 5000 + + + + + + + + + + Configuration properties for TCP/SSH Connections + + + + + Address to connect to + + + + + Port to connect to + + + + + Username credential + + + + + Passord credential + + + + + Defaults to 32768 + + + + + Defaults to true + + + + + Defaults to 5000ms + + + + + Tcp Server Config object with properties for a tcp server with shared key and heartbeat capabilities + + + + + Uique key + + + + + Max Clients that the server will allow to connect. + + + + + Bool value for secure. Currently not implemented in TCP sockets as they are not dynamic + + + + + Port for the server to listen on + + + + + Require a shared key that both server and client negotiate. If negotiation fails server disconnects the client + + + + + The shared key that must match on the server and client + + + + + Require a heartbeat on the client/server connection that will cause the server/client to disconnect if the heartbeat is not received. + heartbeats do not raise received events. + + + + + The interval in seconds for the heartbeat from the client. If not received client is disconnected + + + + + HeartbeatString that will be checked against the message received. defaults to heartbeat if no string is provided. + + + + + Client buffer size. See Crestron help. defaults to 2000 if not greater than 2000 + + + + + Receive Queue size must be greater than 20 or defaults to 20 + + + + + This is something of a band-aid callback. If the client times out during the connection process, because the server + is stuck, this will fire. It is intended to be used by the Server class monitor client, to help + keep a watch on the server and reset it if necessary. + + + + + Semaphore on connect method + + + + + Flag Set only when the disconnect method is called. + + + + + private Timer for auto reconnect + + + + + Used to force disconnection on a dead connect attempt + + + + + Internal secure client + + + + + Queue lock + + + + + Queue to temporarily store received messages with the source IP and Port info. Defaults to size 20. Use constructor or set queue size property before + calling initialize. + + + + + Contstructor that sets all properties by calling the initialize method with a config object. + + + + + + Just to help S+ set the key + + + + + Initialize called by the constructor that accepts a client config object. Can be called later to reset properties of client. + + + + + + Handles closing this up when the program shuts down + + + + + Connect Method. Will return if already connected. Will write errors if missing address, port, or unique key/name. + + + + + + + + + + Internal call to close up client. ALWAYS use this when disconnecting. + + + + ff + Called from Connect failure or Socket Status change if + auto reconnect and socket disconnected (Not disconnected by user) + + + + + Receive callback + + + + + + + This method gets spooled up in its own thread an protected by a CCriticalSection to prevent multiple threads from running concurrently. + It will dequeue items as they are enqueued automatically. + + + + + + + + + + General send method + + + + + + + + + + SocketStatusChange Callback + + + + + + + Helper for ConnectionChange event + + + + + Helper to fire ClientReadyForCommunications event + + + + + Event for Receiving text. Once subscribed to this event the receive callback will start a thread that dequeues the messages and invokes the event on a new thread. + It is not recommended to use both the TextReceived event and the TextReceivedQueueInvoke event. + + + + + For a client with a pre shared key, this will fire after the communication is established and the key exchange is complete. If you require + a key and subscribe to the socket change event and try to send data on a connection the data sent will interfere with the key exchange and disconnect. + + + + + Address of server + + + + + Port on server + + + + + S+ helper + + + + + Bool to show whether the server requires a preshared key. This is used in the DynamicTCPServer class + + + + + S+ helper for requires shared key bool + + + + + SharedKey is sent for varification to the server. Shared key can be any text (255 char limit in SIMPL+ Module), but must match the Shared Key on the Server module + + + + + flag to show the client is waiting for the server to send the shared key + + + + + Defaults to 2000 + + + + + Bool showing if socket is connected + + + + + S+ helper for IsConnected + + + + + Bool showing if socket is ready for communication after shared key exchange + + + + + S+ helper for IsReadyForCommunication + + + + + Client socket status Read only + + + + + Contains the familiar Simpl analog status values. This drives the ConnectionChange event + and IsConnected would be true when this == 2. + + + + + Status text shows the message associated with socket status + + + + + bool to track if auto reconnect should be set on the socket + + + + + S+ helper for AutoReconnect + + + + + Milliseconds to wait before attempting to reconnect. Defaults to 5000 + + + + + Milliseconds before server expects another heartbeat. Set by property HeartbeatRequiredIntervalInSeconds which is driven from S+ + + + + + Simpl+ Heartbeat Analog value in seconds + + + + + Receive Queue size. Defaults to 20. Will set to 20 if QueueSize property is less than 20. Use constructor or set queue size property before + calling initialize. + + + + + Band aid delegate for choked server + + + + diff --git a/packages/PepperDashCore/lib/net47/PepperDash_Core.clz b/packages/PepperDashCore/lib/net47/PepperDash_Core.clz new file mode 100644 index 00000000..8c63e5b9 Binary files /dev/null and b/packages/PepperDashCore/lib/net47/PepperDash_Core.clz differ diff --git a/packages/PepperDashCore/lib/net47/PepperDash_Core.dll b/packages/PepperDashCore/lib/net47/PepperDash_Core.dll new file mode 100644 index 00000000..75c88121 Binary files /dev/null and b/packages/PepperDashCore/lib/net47/PepperDash_Core.dll differ diff --git a/packages/PepperDashCore/lib/net47/PepperDash_Core.xml b/packages/PepperDashCore/lib/net47/PepperDash_Core.xml new file mode 100644 index 00000000..01661142 --- /dev/null +++ b/packages/PepperDashCore/lib/net47/PepperDash_Core.xml @@ -0,0 +1,3754 @@ + + + + PepperDash_Core + + + + + Constants + + + + + Generic boolean value change constant + + + + + Evaluated boolean change constant + + + + + Update busy change const + + + + + Password is valid change constant + + + + + Password LED change constant + + + + + Generic ushort value change constant + + + + + Password count + + + + + Password selecte index change constant + + + + + Password length + + + + + Generic string value change constant + + + + + Device class + + + + + Constructor + + + + + Initialize method + + + + + + + BoolChange event handler helper + + + + + + + + UshrtChange event handler helper + + + + + + + + StringChange event handler helper + + + + + + + + ObjectChange event handler helper + + + + + + + + JSON config key property + + + + + JSON config name property + + + + + JSON config type property + + + + + JSON config properties + + + + + Bool change event handler + + + + + Ushort change event handler + + + + + String change event handler + + + + + Object change event handler + + + + + An incoming communication stream + + + + + Unique key interface to require a unique key for the class + + + + + Unique Key + + + + + + + + + + + + + + + + + + + Stores the state of the request + + + + + Waithandle for main thread. + + + + + Constants + + + + + Processor Change Event Args Class + + + + + Constructor + + + + + Constructor overload + + + + + Constructor + + + + + Ethernet Change Event Args Class + + + + + Constructor + + + + + Constructor overload + + + + + + + Constructor overload + + + + + + + Control Subnet Chage Event Args Class + + + + + Constructor + + + + + Constructor overload + + + + + Constructor overload + + + + + Program Change Event Args Class + + + + + Constructor + + + + + Constructor overload + + + + + + + Constructor overload + + + + + + + The core event and status-bearing class that most if not all device and connectors can derive from. + + + + + Named Keyed device interface. Forces the devie to have a Unique Key and a name. + + + + + Isn't it obvious :) + + + + + Base constructor for all Devices. + + + + + + Gets this device ready to be used in the system. Runs any added pre-activation items, and + all post-activation at end. Classes needing additional logic to + run should override CustomActivate() + + + + + Called in between Pre and PostActivationActions when Activate() is called. + Override to provide addtitional setup when calling activation. Overriding classes + do not need to call base.CustomActivate() + + true if device activated successfully. + + + + Call to deactivate device - unlink events, etc. Overriding classes do not + need to call base.Deactivate() + + + + + + Helper method to check object for bool value false and fire an Action method + + Should be of type bool, others will be ignored + Action to be run when o is false + + + + Unique Key + + + + + Name of the devie + + + + + + + + + + + + + + + A bandaid client that monitors whether the server is reachable + + + + + Timer to operate the bandaid monitor client in a loop. + + + + + + + + + + + + + + + constructor S+ Does not accept a key. Use initialze with key to set the debug key on this device. If using with + make sure to set all properties manually. + + + + + constructor with debug key set at instantiation. Make sure to set all properties before listening. + + + + + + Contstructor that sets all properties by calling the initialize method with a config object. + + + + + + Disconnects all clients and stops the server + + + + + Initialize Key for device using client name from SIMPL+. Called on Listen from SIMPL+ + + + + + + Start listening on the specified port + + + + + Stop Listeneing + + + + + Disconnects Client + + + + + + Disconnect All Clients + + + + + Broadcast text from server to all connected clients + + + + + + Not sure this is useful in library, maybe Pro?? + + + + + + + Secure Server Socket Status Changed Callback + + + + + + + + Secure TCP Client Connected to Secure Server Callback + + + + + + + Secure Received Data Async Callback + + + + + + + + Private Event Handler method to handle the closing of connections when the program stops + + + + + + Starts the monitor client cycle. Timed wait, then call RunMonitorClient + + + + + + + + + + + + + + + On monitor connect, restart the operation + + + + + If the client hangs, add to counter and maybe fire the choke event + + + + + Event for Receiving text + + + + + Event for client connection socket status change + + + + + Event for Server State Change + + + + + For a server with a pre shared key, this will fire after the communication is established and the key exchange is complete. If no shared key, this will fire + after connection is successful. Use this event to know when the client is ready for communication to avoid stepping on shared key. + + + + + A band aid event to notify user that the server has choked. + + + + + 3 by default + + + + + Text representation of the Socket Status enum values for the server + + + + + Bool showing if socket is connected + + + + + S+ helper for IsConnected + + + + + Bool showing if socket is connected + + + + + S+ helper for IsConnected + + + + + Number of clients currently connected. + + + + + Port Server should listen on + + + + + S+ helper for Port + + + + + Bool to show whether the server requires a preshared key. Must be set the same in the client, and if true shared keys must be identical on server/client + + + + + S+ helper for requires shared key bool + + + + + SharedKey is sent for varification to the server. Shared key can be any text (255 char limit in SIMPL+ Module), but must match the Shared Key on the Server module. + If SharedKey changes while server is listening or clients are connected, disconnect and stop listening will be called + + + + + Heartbeat Required bool sets whether server disconnects client if heartbeat is not received + + + + + S+ Helper for Heartbeat Required + + + + + Milliseconds before server expects another heartbeat. Set by property HeartbeatRequiredIntervalInSeconds which is driven from S+ + + + + + Simpl+ Heartbeat Analog value in seconds + + + + + String to Match for heartbeat. If null or empty any string will reset heartbeat timer + + + + + Defaults to 2000 + + + + + Private flag to note that the server has stopped intentionally + + + + + Creates or gets a debug context + + + + + + + Do not use. For S+ access. + + + + + Used to save memory when shutting down + + + + + + Callback for console command + + + + + + Sets the debug level + + Valid values 0 (no debug), 1 (critical), 2 (all messages) + + + + Prints message to console if current debug level is equal to or higher than the level of this message. + Uses CrestronConsole.PrintLine. + + + Console format string + Object parameters + + + + Appends a device Key to the beginning of a message + + + + + Writes the memory object after timeout + + + + + Writes the memory - use SaveMemoryOnTimeout + + + + + + + + + + Helper to get the file path for this app's debug memory + + + + + Describes the folder location where a given program stores it's debug level memory. By default, the + file written will be named appNdebug where N is 1-10. + + + + + Device communication parameter class + + + + + Constructor + + + + + Device TCP/SSH properties class + + + + + Constructor + + + + + Device control class + + + + + Constructor + + + + + Device properties class + + + + + Constructor + + + + + Root device class + + + + + Constants for simpl modules + + + + + Json object evaluated constant + + + + + Json object changed constant + + + + + + + + + + Default constructor + + + + + Constructor overload + + + + + + + Constructor overload + + + + + + + + Device change event args object + + + + + Device change event args type + + + + + Device change event args index + + + + + Bool change event args + + + + + Constructor + + + + + Constructor overload + + + + + + + Constructor overload + + + + + + + + Boolean state property + + + + + Boolean ushort value property + + + + + Boolean change event args type + + + + + Boolean change event args index + + + + + Ushort change event args + + + + + Constructor + + + + + Constructor overload + + + + + + + Constructor overload + + + + + + + + Ushort change event args integer value + + + + + Ushort change event args type + + + + + Ushort change event args index + + + + + String change event args + + + + + Constructor + + + + + Constructor overload + + + + + + + Constructor overload + + + + + + + + String change event args value + + + + + String change event args type + + + + + string change event args index + + + + + Represents a device that implements ISocketStatus and IStreamDebugging + + + + + For IBasicCommunication classes that have SocketStatus. GenericSshClient, + GenericTcpIpClient + + + + + Represents a device that uses basic connection + + + + + Represents a device with stream debugging capablities + + + + + Queue to temporarily store received messages with the source IP and Port info + + + + + Constructor for S+. Make sure to set key, address, port, and buffersize using init method + + + + + + + + + + + + + + Call from S+ to initialize values + + + + + + + + + + + + + + + + + + + + Enables the UDP Server + + + + + Disabled the UDP Server + + + + + Recursive method to receive data + + + + + + + This method gets spooled up in its own thread an protected by a CCriticalSection to prevent multiple threads from running concurrently. + It will dequeue items as they are enqueued automatically. + + + + + General send method + + + + + + + + + + + + + + + + + + + + + + This event will fire when a message is dequeued that includes the source IP and Port info if needed to determine the source of the received data. + + + + + + + + + + + + + + + + + + + + + + + + + Address of server + + + + + Port on server + + + + + Another damn S+ helper because S+ seems to treat large port nums as signed ints + which screws up things + + + + + Indicates that the UDP Server is enabled + + + + + Defaults to 2000 + + + + + + + + + + + + + + + + + + + Stupid S+ Constructor + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Defaults to 32768 + + + + + Adds a file master. If the master's key or filename is equivalent to any existing + master, this will fail + + New master to add + + + + + Gets a master by its key. Case-insensitive + + + + + + + + + + Typical constructor. + + + + + S+ Constructor - Must set all properties before calling Connect + + + + + Just to help S+ set the key + + + + + Handles closing this up when the program shuts down + + + + + Connect to the server, using the provided properties. + + + + + Disconnect the clients and put away it's resources. + + + + + Kills the stream, cleans up the client and sets it to null + + + + + Anything to do with reestablishing connection on failures + + + + + Kills the stream + + + + + Handles the keyboard interactive authentication, should it be required. + + + + + Handler for data receive on ShellStream. Passes data across to queue for line parsing. + + + + + Error event handler for client events - disconnect, etc. Will forward those events via ConnectionChange + event + + + + + Helper for ConnectionChange event + + + + + Sends text to the server + + + + + + Sends Bytes to the server + + + + + + Event that fires when data is received. Delivers args with byte array + + + + + Event that fires when data is received. Delivered as text. + + + + + Event when the connection status changes. + + + + + Address of server + + + + + Port on server + + + + + Username for server + + + + + And... Password for server. That was worth documenting! + + + + + True when the server is connected - when status == 2. + + + + + S+ helper for IsConnected + + + + + + + + + + Contains the familiar Simpl analog status values. This drives the ConnectionChange event + and IsConnected with be true when this == 2. + + + + + Determines whether client will attempt reconnection on failure. Default is true + + + + + Will be set and unset by connect and disconnect only + + + + + S+ helper for AutoReconnect + + + + + Millisecond value, determines the timeout period in between reconnect attempts. + Set to 5000 by default + + + + + Fired when connection changes + + + + + S+ Constructor + + + + + EventArgs class + + Connection State + The Client + + + + Connection State + + + + + Connection Status represented as a ushort + + + + + The client + + + + + Socket Status as represented by + + + + + System Info class + + + + + Constructor + + + + + Gets the current processor info + + + + + Gets the current ethernet info + + + + + Gets the current control subnet info + + + + + Gets the program info by index + + + + + + Gets the processor uptime and passes it to S+ + + + + + Gets the program uptime, by index, and passes it to S+ + + + + + + Sends command to console, passes response back using string change event + + + + + + private method to parse console messages + + + + + + + + + + Protected boolean change event handler + + + + + + + + Protected string change event handler + + + + + + + + Protected processor config change event handler + + + + + + + + Ethernet change event handler + + + + + + + + Control Subnet change event handler + + + + + + + + Program change event handler + + + + + + + + Generic RESTful communication class + + + + + Constructor + + + + + Generic RESTful submit request + + + + + + + + + + Private HTTP submit request + + + + + + + + + + Private HTTPS submit request + + + + + + + + + + Private method to encode username and password to Base64 string + + + + authorization + + + + Protected method to handle boolean change events + + + + + + + + Protected mehtod to handle ushort change events + + + + + + + + Protected method to handle string change events + + + + + + + + Boolean event handler + + + + + Ushort event handler + + + + + String event handler + + + + + Call this before doing anything else + + + + + + + + + Set the JPath to evaluate for a given bool out index. + + + + + Set the JPath for a ushort out index. + + + + + Set the JPath for a string output index. + + + + + Evalutates all outputs with defined paths. called by S+ when paths are ready to process + and by Master when file is read. + + + + + Processes a bool property, converting to bool, firing off a BoolChange event + + + + + Processes the given path. + + JPath formatted path to the desired property + The string value of the property, or a default value if it + doesn't exist + This will return false in the case that EvaulateAllOnJsonChange + is false and the path does not evaluate to a property in the incoming JSON. + + + + Called from Master to read inputs and update their values in master JObject + Callback should hit one of the following four methods + + + + + Called during Process(...) to get the path to a given property. By default, + returns PathPrefix+path+PathSuffix. Override to change the way path is built. + + + + + Use a callback to reduce task switch/threading + + + + + This will be prepended to all paths to allow path swapping or for more organized + sub-paths + + + + + This is added to the end of all paths + + + + + + For newer >=2.4.1 array lookups. + + + + + + + + + + + + + + + + + + + Provides the path append for GetFullPath + + + + + + + + + + + + Not in use + + + + + Not in use + + + + + Crestron Control Methods for a comm object + + + + + Processor info class + + + + + Constructor + + + + + Ethernet info class + + + + + Constructor + + + + + Control subnet info class + + + + + Constructor + + + + + Program info class + + + + + Constructor + + + + + Describes the folder location where a given program stores it's debug level memory. By default, the + file written will be named appNdebug where N is 1-10. + + + + + The name of the file containing the current debug settings. + + + + + When true, the IncludedExcludedKeys dict will contain keys to include. + When false (default), IncludedExcludedKeys will contain keys to exclude. + + + + + Used to save memory when shutting down + + + + + + Callback for console command + + + + + + Callback for console command + + + + + + Callback for console command + + + + + + Sets the debug level + + Valid values 0 (no debug), 1 (critical), 2 (all messages) + + + + sets the settings for a device or creates a new entry + + + + + + + + Gets the device settings for a device by key or returns null + + + + + + + Sets the flag to prevent application starting on next boot + + + + + + + + + + + Prints message to console if current debug level is equal to or higher than the level of this message. + Uses CrestronConsole.PrintLine. + + + Console format string + Object parameters + + + + Logs to Console when at-level, and all messages to error log, including device key + + + + + Logs to Console when at-level, and all messages to error log + + + + + Logs to both console and the custom user log (not the built-in error log). If appdebug level is set at + or above the level provided, then the output will be written to both console and the log. Otherwise + it will only be written to the log. + + + + + + + + Logs to both console and the custom user log (not the built-in error log). If appdebug level is set at + or above the level provided, then the output will be written to both console and the log. Otherwise + it will only be written to the log. + + + + String.format string + Parameters for substitution in the format string. + + + + Prints to log and error log + + + + + + + Writes the memory object after timeout + + + + + Writes the memory - use SaveMemoryOnTimeout + + + + + + + + + + Helper to get the file path for this app's debug memory + + + + + Reads the config file, checks if it needs a merge, merges and saves, then returns the merged Object. + + JObject of config file + + + + + + + + + + + Merges the contents of a base and a delta array, matching the entries on a top-level property + given by propertyName. Returns a merge of them. Items in the delta array that do not have + a matched item in base array will not be merged. Non keyed system items will replace the template items. + + + + + Helper for using with JTokens. Converts to JObject + + + + + Merge o2 onto o1 + + + + + + + Constructor + + + + + Initialize method + + + + + Retrieve password by index + + + + + + Password validation method + + + + + + Builds the user entered passwrod string, will attempt to validate the user entered + password against the selected password when the length of the 2 are equal + + + + + + Clears the user entered password and resets the LEDs + + + + + Protected boolean change event handler + + + + + + + + Protected ushort change event handler + + + + + + + + Protected string change event handler + + + + + + + + If password changes while selected change event will be notifed and update the client + + + + + + + Password selected + + + + + Password selected key + + + + + Used to build the password entered by the user + + + + + Boolean event + + + + + Ushort event + + + + + String event + + + + + JSON password configuration + + + + + Constructor + + + + + Password object configured password + + + + Privates * + + + + SIMPL+ default constructor. + + + + + Sets up class - overriding methods should always call this. + + + + + + Adds a child "module" to this master + + + + + + Called from the child to add changed or new values for saving + + + + Events * + + + + Mirrors the Unique ID for now. + + + + + Merely for use in debug messages + + + + + This will be prepended to all paths to allow path swapping or for more organized + sub-paths + + + + + This is added to the end of all paths + + + + + Enables debugging output to the console. Certain error messages will be logged to the + system's error log regardless of this setting + + + + + Ushort helper for Debug property + + + + Privates * + + + + SIMPL+ default constructor. + + + + + Read, evaluate and udpate status + + + + + Sets the filepath as well as registers this with the Global.Masters list + + + + Privates * + + + + SIMPL+ default constructor. + + + + + Read, evaluate and udpate status + + + + + Returns the FileInfo object for a given path, with possible wildcards + + + + + + + + + + + + + + + + + + Sets the filepath as well as registers this with the Global.Masters list + + + + + Client config object for TCP client with server that inherits from TcpSshPropertiesConfig and adds properties for shared key and heartbeat + + + + + TcpSsh Properties + + + + + Bool value for secure. Currently not implemented in TCP sockets as they are not dynamic + + + + + Require a shared key that both server and client negotiate. If negotiation fails server disconnects the client + + + + + The shared key that must match on the server and client + + + + + Require a heartbeat on the client/server connection that will cause the server/client to disconnect if the heartbeat is not received. + heartbeats do not raise received events. + + + + + The interval in seconds for the heartbeat from the client. If not received client is disconnected + + + + + HeartbeatString that will be checked against the message received. defaults to heartbeat if no string is provided. + + + + + Receive Queue size must be greater than 20 or defaults to 20 + + + + + Represents a device that implements IBasicCommunication and IStreamDebugging + + + + + + + + + + This delegate defines handler for IBasicCommunication status changes + + Device firing the status change + + + + + + + + + + Stupid S+ Constructor + + + + + + + + + + Stupid S+ Constructor + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + To prevent threading issues with the DeviceDebugSettings collection + + + + + + Gets a level or creates it if not existing + + + + + + + sets the settings for a device or creates a new entry + + + + + + + + Gets the device settings for a device by key or returns null + + + + + + + Collection of the debug settings for each device where the dictionary key is the device key + + + + + The level of debug messages to print + + + + + Property to tell the program not to intitialize when it boots, if desired + + + + Privates * + + + + SIMPL+ default constructor. + + + + + Loads in JSON and triggers evaluation on all children + + + + + + Loads JSON into JsonObject, but does not trigger evaluation by children + + + + + + + + + + + Constants + + + + + Generic boolean change + + + + + Generic Ushort change + + + + + Response Code Ushort change + + + + + Generic String chagne + + + + + Response string change + + + + + Error string change + + + + + An embedded JsonToSimpl master object. + + + + + SIMPL+ can only execute the default constructor. If you have variables that require initialization, please + use an Initialize method + + + + + + + + + + + + + + + + + + + After save operation on JSON master happens, send it to server + + + + + + Stupid S+ Constructor + + + + + Stupid S+ Constructor + + + + + Stupid S+ Constructor + + + + + Stupid S+ Constructor + + + + + Stupid S+ Constructor + + + + + Server listen lock + + + + + Queue lock + + + + + Queue to temporarily store received messages with the source IP and Port info. Defaults to size 20. Use constructor or set queue size property before + calling initialize. + + + + + A bandaid client that monitors whether the server is reachable + + + + + Timer to operate the bandaid monitor client in a loop. + + + + + + + + + + + + + + + constructor S+ Does not accept a key. Use initialze with key to set the debug key on this device. If using with + make sure to set all properties manually. + + + + + constructor with debug key set at instantiation. Make sure to set all properties before listening. + + + + + + Contstructor that sets all properties by calling the initialize method with a config object. This does set Queue size. + + + + + + Disconnects all clients and stops the server + + + + + Initialize Key for device using client name from SIMPL+. Called on Listen from SIMPL+ + + + + + + Start listening on the specified port + + + + + Stop Listeneing + + + + + Disconnects Client + + + + + + Disconnect All Clients + + + + + Broadcast text from server to all connected clients + + + + + + Not sure this is useful in library, maybe Pro?? + + + + + + + Secure Server Socket Status Changed Callback + + + + + + + + Secure TCP Client Connected to Secure Server Callback + + + + + + + Secure Received Data Async Callback + + + + + + + + This method gets spooled up in its own thread an protected by a CCriticalSection to prevent multiple threads from running concurrently. + It will dequeue items as they are enqueued automatically. + + + + + Private Event Handler method to handle the closing of connections when the program stops + + + + + + Starts the monitor client cycle. Timed wait, then call RunMonitorClient + + + + + + + + + + + + + + + On monitor connect, restart the operation + + + + + If the client hangs, add to counter and maybe fire the choke event + + + + + Event for Receiving text + + + + + Event for Receiving text. Once subscribed to this event the receive callback will start a thread that dequeues the messages and invokes the event on a new thread. + It is not recommended to use both the TextReceived event and the TextReceivedQueueInvoke event. + + + + + Event for client connection socket status change + + + + + Event for Server State Change + + + + + For a server with a pre shared key, this will fire after the communication is established and the key exchange is complete. If no shared key, this will fire + after connection is successful. Use this event to know when the client is ready for communication to avoid stepping on shared key. + + + + + A band aid event to notify user that the server has choked. + + + + + Receive Queue size. Defaults to 20. Will set to 20 if QueueSize property is less than 20. Use constructor or set queue size property before + calling initialize. + + + + + 3 by default + + + + + Text representation of the Socket Status enum values for the server + + + + + Bool showing if socket is connected + + + + + S+ helper for IsConnected + + + + + Bool showing if socket is connected + + + + + S+ helper for IsConnected + + + + + Max number of clients this server will allow for connection. Crestron max is 64. This number should be less than 65 + + + + + Number of clients currently connected. + + + + + Port Server should listen on + + + + + S+ helper for Port + + + + + Bool to show whether the server requires a preshared key. Must be set the same in the client, and if true shared keys must be identical on server/client + + + + + S+ helper for requires shared key bool + + + + + SharedKey is sent for varification to the server. Shared key can be any text (255 char limit in SIMPL+ Module), but must match the Shared Key on the Server module. + If SharedKey changes while server is listening or clients are connected, disconnect and stop listening will be called + + + + + Heartbeat Required bool sets whether server disconnects client if heartbeat is not received + + + + + S+ Helper for Heartbeat Required + + + + + Milliseconds before server expects another heartbeat. Set by property HeartbeatRequiredIntervalInSeconds which is driven from S+ + + + + + Simpl+ Heartbeat Analog value in seconds + + + + + String to Match for heartbeat. If null or empty any string will reset heartbeat timer + + + + + Defaults to 2000 + + + + + Private flag to note that the server has stopped intentionally + + + + + Controls the ability to disable/enable debugging of TX/RX data sent to/from a device with a built in timer to disable + + + + + Timer to disable automatically if not manually disabled + + + + + Sets the debugging setting and if not setting to off, assumes the default of 30 mintues + + + + + + Sets the debugging setting for the specified number of minutes + + + + + + + Disabled debugging + + + + + Device Key that this instance configures + + + + + Timeout in Minutes + + + + + The available settings for stream debugging + + + + + Constants for Simpl modules + + + + + S+ values delegate + + + + + S+ values wrapper + + + + + S+ types enum + + + + + Defines the string event handler for line events on the gather + + + + + + Attaches to IBasicCommunication as a text gather + + + + + For receive buffer + + + + + Delimiter, like it says! + + + + + Fires up a gather, given a IBasicCommunicaion port and char for de + + + + + + + + + + + + + + Disconnects this gather from the Port's TextReceived event. This will not fire LineReceived + after the this call. + + + + + Handler for raw data coming from port + + + + + + + + + + + + Deconstructor. Disconnects from port TextReceived events. + + + + + Event that fires when a line is received from the IBasicCommunication source. + The event merely contains the text, not an EventArgs type class. + + + + + The communication port that this gathers on + + + + + Default false. If true, the delimiter will be included in the line output + events + + + + + Background class that manages debug features for sockets + + + + + Sets up the backing class. Adds console commands for S#Pro programs + + + + + Helper for socket list, to show types + + + + + + + + + + + + + + + + + This is something of a band-aid callback. If the client times out during the connection process, because the server + is stuck, this will fire. It is intended to be used by the Server class monitor client, to help + keep a watch on the server and reset it if necessary. + + + + + Semaphore on connect method + + + + + Flag Set only when the disconnect method is called. + + + + + private Timer for auto reconnect + + + + + Used to force disconnection on a dead connect attempt + + + + + Internal secure client + + + + + Just to help S+ set the key + + + + + Handles closing this up when the program shuts down + + + + + Connect Method. Will return if already connected. Will write errors if missing address, port, or unique key/name. + + + + + + + + + + Internal call to close up client. ALWAYS use this when disconnecting. + + + + ff + Called from Connect failure or Socket Status change if + auto reconnect and socket disconnected (Not disconnected by user) + + + + + Receive callback + + + + + + + + + + + + General send method + + + + + + + + + + SocketStatusChange Callback + + + + + + + Helper for ConnectionChange event + + + + + Helper to fire ClientReadyForCommunications event + + + + + For a client with a pre shared key, this will fire after the communication is established and the key exchange is complete. If you require + a key and subscribe to the socket change event and try to send data on a connection the data sent will interfere with the key exchange and disconnect. + + + + + Address of server + + + + + Port on server + + + + + S+ helper + + + + + Bool to show whether the server requires a preshared key. This is used in the DynamicTCPServer class + + + + + S+ helper for requires shared key bool + + + + + SharedKey is sent for varification to the server. Shared key can be any text (255 char limit in SIMPL+ Module), but must match the Shared Key on the Server module + + + + + flag to show the client is waiting for the server to send the shared key + + + + + Defaults to 2000 + + + + + Bool showing if socket is connected + + + + + S+ helper for IsConnected + + + + + Bool showing if socket is ready for communication after shared key exchange + + + + + S+ helper for IsReadyForCommunication + + + + + Client socket status Read only + + + + + Contains the familiar Simpl analog status values. This drives the ConnectionChange event + and IsConnected would be true when this == 2. + + + + + Status text shows the message associated with socket status + + + + + bool to track if auto reconnect should be set on the socket + + + + + S+ helper for AutoReconnect + + + + + Milliseconds to wait before attempting to reconnect. Defaults to 5000 + + + + + Band aid delegate for choked server + + + + + + + + + + + + + + + For Simpl+ + + + + + True when user is found + + + + + For stupid S+ + + + + + + + + + + + + + + + For Simpl+ + + + + + True when the preset is found + + + + + S+ helper for stupid S+ + + + + + + + + + + Defaults to Environment.NewLine; + + + + + Public dictionary of known passwords + + + + + Private dictionary, used when passwords are updated + + + + + Timer used to wait until password changes have stopped before updating the dictionary + + + + + Timer length + + + + + Constructor + + + + + Initialize password manager + + + + + Updates password stored in the dictonary + + + + + + + CTimer callback function + + + + + Method to change the default timer value, (default 5000ms/5s) + + + + + + Helper method for debugging to see what passwords are in the lists + + + + + Protected boolean change event handler + + + + + + + + Protected ushort change event handler + + + + + + + + Protected string change event handler + + + + + + + + Protected password change event handler + + + + + + + + Boolean event + + + + + Ushort event + + + + + String event + + + + + Event to notify clients of an updated password at the specified index (uint) + + + + + A class to handle basic TCP/IP communications with a server + + + + + Set only when the disconnect method is called. + + + + + Constructor + + + + + + + + + Constructor + + + + + + Default constructor for S+ + + + + + Just to help S+ set the key + + + + + Handles closing this up when the program shuts down + + + + + + + + + + + Attempts to connect to the server + + + + + Attempts to disconnect the client + + + + + Does the actual disconnect business + + + + + Callback method for connection attempt + + + + + + Disconnects, waits and attemtps to connect again + + + + + Recieves incoming data + + + + + + + General send method + + + + + This is useful from console and...? + + + + + Sends Bytes to the server + + + + + + Socket Status Change Handler + + + + + + + Fires when data is received from the server and returns it as a Byte array + + + + + Fires when data is received from the server and returns it as text + + + + + + + + + + Address of server + + + + + Port on server + + + + + Another damn S+ helper because S+ seems to treat large port nums as signed ints + which screws up things + + + + + Defaults to 2000 + + + + + The actual client class + + + + + True if connected to the server + + + + + S+ helper for IsConnected + + + + + Status of the socket + + + + + Contains the familiar Simpl analog status values. This drives the ConnectionChange event + and IsConnected with be true when this == 2. + + + + + Status of the socket + + + + + Connection failure reason + + + + + If true, enables AutoConnect + + + + + S+ helper for AutoReconnect + + + + + Milliseconds to wait before attempting to reconnect. Defaults to 5000 + + + + + + + + + + Configuration properties for TCP/SSH Connections + + + + + Address to connect to + + + + + Port to connect to + + + + + Username credential + + + + + Passord credential + + + + + Defaults to 32768 + + + + + Defaults to true + + + + + Defaults to 5000ms + + + + + Tcp Server Config object with properties for a tcp server with shared key and heartbeat capabilities + + + + + Uique key + + + + + Max Clients that the server will allow to connect. + + + + + Bool value for secure. Currently not implemented in TCP sockets as they are not dynamic + + + + + Port for the server to listen on + + + + + Require a shared key that both server and client negotiate. If negotiation fails server disconnects the client + + + + + The shared key that must match on the server and client + + + + + Require a heartbeat on the client/server connection that will cause the server/client to disconnect if the heartbeat is not received. + heartbeats do not raise received events. + + + + + The interval in seconds for the heartbeat from the client. If not received client is disconnected + + + + + HeartbeatString that will be checked against the message received. defaults to heartbeat if no string is provided. + + + + + Client buffer size. See Crestron help. defaults to 2000 if not greater than 2000 + + + + + Receive Queue size must be greater than 20 or defaults to 20 + + + + + This is something of a band-aid callback. If the client times out during the connection process, because the server + is stuck, this will fire. It is intended to be used by the Server class monitor client, to help + keep a watch on the server and reset it if necessary. + + + + + Semaphore on connect method + + + + + Flag Set only when the disconnect method is called. + + + + + private Timer for auto reconnect + + + + + Used to force disconnection on a dead connect attempt + + + + + Internal secure client + + + + + Queue lock + + + + + Queue to temporarily store received messages with the source IP and Port info. Defaults to size 20. Use constructor or set queue size property before + calling initialize. + + + + + Contstructor that sets all properties by calling the initialize method with a config object. + + + + + + Just to help S+ set the key + + + + + Initialize called by the constructor that accepts a client config object. Can be called later to reset properties of client. + + + + + + Handles closing this up when the program shuts down + + + + + Connect Method. Will return if already connected. Will write errors if missing address, port, or unique key/name. + + + + + + + + + + Internal call to close up client. ALWAYS use this when disconnecting. + + + + ff + Called from Connect failure or Socket Status change if + auto reconnect and socket disconnected (Not disconnected by user) + + + + + Receive callback + + + + + + + This method gets spooled up in its own thread an protected by a CCriticalSection to prevent multiple threads from running concurrently. + It will dequeue items as they are enqueued automatically. + + + + + + + + + + General send method + + + + + + + + + + SocketStatusChange Callback + + + + + + + Helper for ConnectionChange event + + + + + Helper to fire ClientReadyForCommunications event + + + + + Event for Receiving text. Once subscribed to this event the receive callback will start a thread that dequeues the messages and invokes the event on a new thread. + It is not recommended to use both the TextReceived event and the TextReceivedQueueInvoke event. + + + + + For a client with a pre shared key, this will fire after the communication is established and the key exchange is complete. If you require + a key and subscribe to the socket change event and try to send data on a connection the data sent will interfere with the key exchange and disconnect. + + + + + Address of server + + + + + Port on server + + + + + S+ helper + + + + + Bool to show whether the server requires a preshared key. This is used in the DynamicTCPServer class + + + + + S+ helper for requires shared key bool + + + + + SharedKey is sent for varification to the server. Shared key can be any text (255 char limit in SIMPL+ Module), but must match the Shared Key on the Server module + + + + + flag to show the client is waiting for the server to send the shared key + + + + + Defaults to 2000 + + + + + Bool showing if socket is connected + + + + + S+ helper for IsConnected + + + + + Bool showing if socket is ready for communication after shared key exchange + + + + + S+ helper for IsReadyForCommunication + + + + + Client socket status Read only + + + + + Contains the familiar Simpl analog status values. This drives the ConnectionChange event + and IsConnected would be true when this == 2. + + + + + Status text shows the message associated with socket status + + + + + bool to track if auto reconnect should be set on the socket + + + + + S+ helper for AutoReconnect + + + + + Milliseconds to wait before attempting to reconnect. Defaults to 5000 + + + + + Milliseconds before server expects another heartbeat. Set by property HeartbeatRequiredIntervalInSeconds which is driven from S+ + + + + + Simpl+ Heartbeat Analog value in seconds + + + + + Receive Queue size. Defaults to 20. Will set to 20 if QueueSize property is less than 20. Use constructor or set queue size property before + calling initialize. + + + + + Band aid delegate for choked server + + + +