Remove ConnectedClientVersionInfo and the per-client version dictionary in
MobileControlSystemController, which grew unbounded and depended on a UI
client connecting and self-reporting its APP_VERSION.
Add TouchpanelWrapperAppVersionChecker, which instead scans the deployed
mcUserApp files on disk for the configured versions.touchpanelWrapperApp
version string. This works without any client connected and doesn't
accumulate state. Wired into the mobileinfo console command output.
Backports PepperDash/Essentials#1439 (merged to main at 6ceddcf5) onto
dev/v3-routing (v3.0.0-dev-v3-routing.40):
- New GET /packageManifest CWS route reporting Essentials/plugin/touchpanel
UI package version info (GetPackageManifestRequestHandler).
- EssentialsConfig.Versions now round-trips via [JsonProperty("versions")].
- ConfigReader now detects v1 vs v2 config by presence of system/template
nodes (previously any versions node caused the v1->v2 merge to be
skipped), and re-applies the versions node after merge since
PortalConfigReader.MergeConfigs does not carry it forward.
- Mobile control: track and validate UI client app versions
(ConnectedClientVersionInfo, MobileControlSystemController changes merged
cleanly from the PR).
- Directory.Build.props: adds PackageId AssemblyMetadata item (kept this
branch's 3.0.0-local version).
Conflict resolution notes:
- This branch had already introduced its own AppVersion type (Version +
RepoUrl only) for TouchpanelWrapperApp/UserInterfaces. Replaced it with
the PR's unified NugetVersion (adds PackageId/RepoUrl/Name, all
NullValueHandling.Ignore) to match main's schema, since AppVersion had
no other references in the codebase.
- ConfigReader.LoadConfig on this branch had already fixed a double
Stream.ReadToEnd() bug (reading fileContents once); kept that fix and
layered the PR's v1/v2 detection fix + versions-node preservation on
top of it, plus this branch's null-ConfigObject-after-merge guard.
- EssentialsWebApi.SetupRoutes: inserted the new packageManifest route
into this branch's existing (longer) route list, which already
includes routing-specific endpoints not present on main.
Builds clean (dotnet build on the full solution, 0 errors).
Not pushed - pending local hardware/config testing before push.
feat: update MobileControlConfig to enable messenger subscriptions by default
fix: improve HandleBatchDeviceFullStatus to support granular device status requests and enhance error handling
- Added error log level change notification in Debug.cs.
- Updated appdebug command usage to include sink options and timeout parameters in Debug.cs.
- Implemented AddDefaultMessengersForDevice method in IMobileControl interface for better messenger registration.
- Modified EssentialsDevice to create mobile control messengers based on available interfaces.
- Introduced MessengerFactoryRegistry to streamline messenger creation for various device types.
- Refactored MobileControlSystemController to utilize the new messenger registration system and removed redundant setup methods.
Co-authored-by: Copilot <copilot@github.com>
- Renamed `UsbOutput` to `Usb` in `eRoutingSignalType.cs`.
- Removed unused `UsbInput` and `SecondaryAudio` signal types.
- Added new HTTP route for retrieving routing devices and tielines in `EssentialsWebApi.cs`.
- Implemented `GetRoutingDevicesAndTieLinesHandler` to handle requests for routing devices and tielines, including detailed port information.
- Updated `GenericSink` to remove `SecondaryAudio` from input port signal types.
- Created `ICurrentSourcesMessenger` to manage current source information and status updates.
- Introduced `IDeviceInfoProviderMessenger` for device information communication with debounce functionality.
- Updated `MobileControlSystemController` to use new messenger classes for current sources and device info.
- Added console commands for listing tielines and visualizing routes in `ControlSystem.cs`.
- Implemented methods for visualizing routes and current routes, including filtering options.
- Updated RelayControlledShade to utilize Timer for output pulsing.
- Refactored MockVC to replace CTimer with Timer for call status simulation.
- Modified VideoCodecBase to enhance documentation and improve feedback handling.
- Removed obsolete IHasCamerasMessenger and updated related classes to use IHasCamerasWithControls.
- Adjusted PressAndHoldHandler to implement Timer for button hold actions.
- Enhanced logging throughout MobileControl and RoomBridges for better debugging and information tracking.
- Cleaned up unnecessary comments and improved exception handling in various classes.
- Replaced CCriticalSection with lock statements in DeviceManager for better thread management.
- Updated AddDevice and RemoveDevice methods to use Monitor for locking.
- Enhanced event handling for device activation and registration.
- Modified FileIO class to utilize Task for asynchronous file operations instead of CrestronInvoke.
- Improved feedback mechanisms in FeedbackBase and SystemMonitorController using Task.Run.
- Refactored GenericQueue to remove Crestron threading dependencies and utilize System.Threading.
- Updated BlueJeansPc and VideoCodecBase classes to use Task for asynchronous operations.
- Cleaned up unnecessary critical sections and improved code documentation across various files.
In order to avoid updating the MC Edge API to send device interfaces, one of the responses to the clientJoined message will now be a message with the type `/system/deviceInterfaces`. This has a corresponding handler in the core library to put the interfaces in the correct location.
Previously, any exceptions that were occuring in a hander's action were being swalled due to being off on another thread. Now, those exceptions are caught and printed out.
Using the generated security token as an ID was presenting problems with duplicate connections using the same ID and trying to figure out where to send the messages. Now, the clients have a unique ID that's an increasing integer that restarts at 1 when the program restarts.
- Introduced `ICameraCapabilities` interface and `CameraCapabilities` class for defining camera features like pan, tilt, zoom, and focus.
- Modified `IHasCameras` interface to include a list of `IHasCameraControls` objects for improved camera management.
- Refactored `CameraBaseMessenger` to be generic, enhancing flexibility and type safety.
- Updated `SendCameraFullMessageObject` to include detailed camera capabilities in status messages.
- Added `CameraStateMessage` class to encapsulate camera state, including control support and capabilities.
- Updated `IHasCamerasWithControlMessenger` to use `IKeyName` for camera list and selected camera properties, improving type consistency.
- Enhanced `MobileControlSystemController` to manage devices implementing `IHasCameraControls`, creating appropriate messengers for different device types.
Mark IHasCamerasMessenger as obsolete and replace it with
IHasCamerasWithControlMessenger, which adds functionality
for devices with camera controls. A new state message class,
IHasCamerasWithControlsStateMessage, has been added to
encapsulate camera state. Update MobileControlSystemController
to use the new messenger implementation.
This change introduces a check for `_roomCombiner.CurrentScenario` being `null`. When it is `null`, a `MobileControlMessage` is created with the type `/system/roomKey`, `clientId`, and `roomKey`, which is then sent to the client. This improves the handling of scenarios without a current scenario by ensuring relevant room key information is communicated.
The `mobilewsdebug` console command can now be used to set the internal websocket logging level for both the API client and the direct server at the same time.
In order to help control traffic over the websocket, a subscription feature has been added:
* A config option, `enableMessengerSubscriptions` has been added
* When true, the MessengerBase class will assume that any message sent using the `PostStatusMessage` that has a valid client ID wants to send any subsequent unsolicited updates to that same client
* The client's ID will be added a list of subscribed client IDs
* Any subsequent messages sent using the `PostStatusMessage` methods that have a null clientId will ONLY be sent to subscribed clients
* When a client disconnects, it will be removed from the list of subscribed clients
This should cut down drastically on the traffic to the UI, especially when combined with requesting partial status updates from a device rather than the entire state.
UI Applications can now request status for specific feature sets instead of full status for a device. This will hopefully cut down on the traffic and messages required to get the data for the UI.
Updated the constructor of `IHasCamerasMessenger` to reorder parameters, placing `IHasCameras cameraController` last. Added logic in `MobileControlSystemController.cs` to instantiate and add `IHasCamerasMessenger` for devices implementing the `IHasCameras` interface.
In order to match up with how existing front-end apps are expecting to
recieve data for devices that implement the `IHasInputs<T>` interface,
there is now an IHasInputsMessengers that is implemented for devices
that implement `IHasInputs<string>`, `IHasInputs<int>` or
`IHasInputs<byte>` interfaces.
In order to satisfy the requirements for the `MessengerBase` class, the
`ISelectableItemsMessenger` class needs to take an `IHasInputs<T>`, as that is
the device that implements `IKeyName`. We may want to consider adding a
`IHasInputsMessenger` specifically for those devices that implement that
interface vs the `ISelectableItemsMessenger`.
In order to solve some dependency issues that keep cropping up, MC
should be moved back into the Essentials repo and loaded automatically
on startup. This will allow for all plugins that use the MC Messengers
library to use the same version without fear of overwriting a dll due to
loading of plugin libraries.