feat: add ICommunicationMonitor support to MobileControlTouchpanelController - #1456
Open
jonnyarndt wants to merge 2 commits into
Open
feat: add ICommunicationMonitor support to MobileControlTouchpanelController#1456jonnyarndt wants to merge 2 commits into
jonnyarndt wants to merge 2 commits into
Conversation
…oller for Health page visibility
Contributor
There was a problem hiding this comment.
Pull request overview
Adds ICommunicationMonitor support to MobileControlTouchpanelController so Mobile Control touchpanels can surface online/offline health status to the Mobile Control “Tech Controls: Health” UI, aligning touchpanels with other monitored devices in the Essentials Mobile Control ecosystem.
Changes:
MobileControlTouchpanelControllernow implementsICommunicationMonitorand exposes aCommunicationMonitor(StatusMonitorBase).- Initializes a
CrestronGenericBaseCommunicationMonitoraround the panel’sOnlineStatusChangeevent. - Starts the monitor in
CustomActivate()and stops it in aDeactivate()override.
Comments suppressed due to low confidence (1)
src/PepperDash.Essentials.MobileControl/Touchpanel/MobileControlTouchpanelController.cs:139
- ICommunicationMonitorMessenger dereferences _communicationMonitor.CommunicationMonitor without null checks. If the touchpanel hardware is null, this current conditional leaves CommunicationMonitor unset, leading to runtime NullReferenceExceptions when messengers are registered. Always assign CommunicationMonitor, using a safe fallback when panel is null.
if (panel != null)
{
CommunicationMonitor = new CrestronGenericBaseCommunicationMonitor(this, panel, 120000, 300000);
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
ICommunicationMonitorsupport toMobileControlTouchpanelControllerso Mobile Control touchpanels (TSW/XPanel/Crestron App instances) can report online/offline health status to the Mobile Control "Tech Controls: Health" page, the same way otherICommunicationMonitordevices already do.Previously,
MobileControlTouchpanelControllerdid not implementICommunicationMonitor, soMobileControlSystemController.SetupDefaultDeviceMessengers()silently skipped creating a health messenger for it -- touchpanels had no way to surface online/offline state to the frontend, regardless of config.Changes
MobileControlTouchpanelControllernow implementsICommunicationMonitor.CommunicationMonitorproperty (StatusMonitorBase), backed byCrestronGenericBaseCommunicationMonitorwrapping the controller's ownBasicTriListWithSmartObjectpanel -- the same monitor class already used byCrestronGenericBaseDevice, reusing the panel's existingOnlineStatusChangeevent.CustomActivate()starts the monitor; newDeactivate()override stops it.Testing
Verified end-to-end on a bench RMC4 processor:
Notes