Click or drag to resize

XioCloudRoomSlot Class

Class to support the XIO Cloud Room Slot on the controllers. Also implements the methods to register/unregister the XIO Cloud Room Slot with the system. The BaseEvent will fire to indicate a change in the value of the corresponding sig.
Inheritance Hierarchy
SystemObject
  Crestron.SimplSharpProGenericBase
    Crestron.SimplSharpProGenericDevice
      Crestron.SimplSharpProXioCloudRoomSlot

Namespace: Crestron.SimplSharpPro
Assembly: SimplSharpPro (in SimplSharpPro.dll) Version: 2.21.121
Syntax
C#
public sealed class XioCloudRoomSlot : GenericDevice

The XioCloudRoomSlot type exposes the following members.

Properties
 NameDescription
Public propertyAlertsFeedback Response to XIO Cloud for the state of alerts.
Public propertyConnectedIpList A property containing the list of the ConnectedIpInformation objects which contain information about the devices that are connected to this IP ID. This property is only valid for an ethernet device. If this is not an ethernet device, then this property will return null. If this is an ethernet device, the list will be non-null. It will be empty if no devices are connected. The order of items in this list is not guaranteed.
(Inherited from GenericDevice)
Public propertyCurrentSourceFeedback Response to XIO Cloud for the state of current source.
Public propertyCode exampleDescription Get/Set the description of this device.
(Inherited from GenericBase)
Public propertyDisplayPowerFeedback Response to XIO Cloud for the state of display power.
Public propertyDisplayPowerOff Requested state of display power off from XIO Cloud.

This property will trigger BaseEvent event with DisplayPowerOffEventId.

Public propertyDisplayPowerOn Requested state of display power on from XIO Cloud.

This property will trigger BaseEvent event with DisplayPowerOnEventId.

Public propertyDisposed Property to indicate if the device has been disposed.
(Inherited from GenericDevice)
Public propertyID Property to get the ID of the device.
(Inherited from GenericDevice)
Public propertyIsOnline Property to get the current online state of the device.
(Inherited from GenericDevice)
Public propertyMaintenanceMode Requested state of maintenance mode from XIO Cloud.

This property will trigger BaseEvent event with MaintenanceModeEventId.

Public propertyName Get the name of this device.
(Inherited from GenericBase)
Public propertyOccupied Requested state of occupied from XIO Cloud.

This property will trigger BaseEvent event with OccupiedEventId.

Public propertyOccupiedFeedback Response to XIO Cloud for the state of occupied.
Public propertyParent The parent that a given object was added to.
(Inherited from GenericBase)
Public propertyRegisterable Property to indicate that this device can be registered.
(Inherited from GenericDevice)
Public propertyRegistered Property to get the current registration state of the device.
(Inherited from GenericDevice)
Public propertyRegistrationFailureReason Property to get the Registration Failure Reason, this will match the return value from the call to register.
(Inherited from GenericDevice)
Public propertyResolveAlertsFeedback Resolve specific alerts
Public propertyResolveAllAlertsFeedback Resolve all alerts
Public propertyRoomName Requested state of room name from XIO Cloud.

This property will trigger BaseEvent event with RoomNameEventId.

Protected propertySIMPLDeviceImplementation Internal protected member used for actual device control.
(Inherited from GenericDevice)
Public propertySystemCheck Requested state of system check from XIO Cloud.

This property will trigger BaseEvent event with SystemCheckEventId.

Public propertySystemCheckMessageFeedback Response to XIO Cloud for the state of system message.
Public propertySystemCheckStateFeedback Response to XIO Cloud for the state of system state.
Public propertySystemPowerFeedback Response to XIO Cloud for the state of system power.
Public propertySystemPowerOff Requested state of system power off from XIO Cloud.

This property will trigger BaseEvent event with SystemPowerOffEventId.

Public propertySystemPowerOn Requested state of system power on from XIO Cloud.

This property will trigger BaseEvent event with SystemPowerOnEventId.

Public propertyType Property to determine to type of device this is.
(Inherited from GenericDevice)
Public propertyUnRegistrationFailureReason Property to get the Unregistration Failure Reason, this will match the return value from the call to unregister.
(Inherited from GenericDevice)
Public propertyUserSpecifiedObject Can be assigned anything that user wants.
(Inherited from GenericBase)
Public propertyVacant Requested state of vacant from XIO Cloud.

This property will trigger BaseEvent event with VacantEventId.

Protected propertyXioEndpointStubSIMPLDevice The SIMPL "stub" Device that the XiO Director creates for an endpoint to send the 1C/0E to the correct place in hierarchy.
(Inherited from GenericDevice)
Top
Methods
 NameDescription
Public methodDispose Clean up of resources.
(Inherited from GenericBase)
Protected methodDispose(Boolean) Method to perform the actual disposing of the device.
(Inherited from GenericDevice)
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalize Destructor of the device.
(Inherited from GenericDevice)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Protected methodOnBaseEvent(Int32) Protected member used to fire the BaseEvent with the default extended information.
(Inherited from GenericBase)
Protected methodOnBaseEvent(Int32, UInt16) Protected member used to fine the BaseEvent with extended event information.
(Inherited from GenericBase)
Public methodRegister Register this device with the system.
(Inherited from GenericDevice)
Public methodRegister(Sig) Register the device by enabling or disabling the required sigs.
Public methodToString String representation of the XIO Cloud Room Slot.
(Overrides GenericDeviceToString)
Public methodUnRegister Unregister this device with the system. This function can not be called from the device's own SigChange event handler.

On successful unregistration, if this device supports the OnlineStatusChange event, it will trigger indicating the device when offline.


(Inherited from GenericDevice)
Top
Events
 NameDescription
Public eventBaseEvent Generic base event, triggered when the there are no other handlers available for a specific EventID.
(Inherited from GenericBase)
Public eventIpInformationChange Event that tells what IP Address is connected/disconnected from an IP ID for a non-UDP device. This is only valid for an Ethernet device. An exception will be thrown if it is not.
(Inherited from GenericDevice)
Public eventOnlineStatusChange Event triggered when the Online status of the device changes.
(Inherited from GenericDevice)
Top
Fields
 NameDescription
Public fieldStatic memberDisplayPowerOffEventId The state of DisplayPowerOff has changed.

The BaseEvent event will trigger for this event id.

Public fieldStatic memberDisplayPowerOnEventId The state of DisplayPowerOn has changed.

The BaseEvent event will trigger for this event id.

Public fieldStatic memberMaintenanceModeEventId The value of MaintenanceMode has changed.

The BaseEvent event will trigger for this event id.

Public fieldStatic memberOccupiedEventId The state of Occupied has changed.

The BaseEvent event will trigger for this event id.

Public fieldStatic memberRoomNameEventId The value of RoomName has changed.

The BaseEvent event will trigger for this event id.

Public fieldStatic memberSystemCheckEventId The value of SystemCheck has changed.

The BaseEvent event will trigger for this event id.

Public fieldStatic memberSystemPowerOffEventId The state of SystemPowerOff has changed.

The BaseEvent event will trigger for this event id.

Public fieldStatic memberSystemPowerOnEventId The state of SystemPowerOn has changed.

The BaseEvent event will trigger for this event id.

Public fieldStatic memberVacantEventId The state of Vacant has changed.

The BaseEvent event will trigger for this event id.

Top
Example
C#
public class ControlSystem : CrestronControlSystem
{
    GlsOirLclCCn _occSensor;
    Xpanel _xpanel;

    public ControlSystem()
    {
        // Register for incoming signals from XiO
        ControllerXioCloudRoomSlotDevice.BaseEvent += CloudRoom_PropertyChangeEventHandler;

        // Register for XiO connection status change
        ControllerXioCloudRoomSlotDevice.OnlineStatusChange += CloudRoom_OnlineStatusChange;

        _occSensor = new GlsOirLclCCn(0x17, this);
        _occSensor.BaseEvent += OccSensor_PropertyChangeEventHandler;

        _xpanel = new Xpanel(0x05, this);
    }

    public override void InitializeSystem()
    {
        // Register the CloudRoom slot with XiO; by default all signals on the slot are registered with XiO
        // Signals may be passed here to exclude their registration with XiO
        if (ControllerXioCloudRoomSlotDevice.Register(ControllerXioCloudRoomSlotDevice.Occupied, ControllerXioCloudRoomSlotDevice.Vacant) == eDeviceRegistrationUnRegistrationResponse.Success)
        {
            // AlertsFeedback may be sent at any time
            ControllerXioCloudRoomSlotDevice.AlertsFeedback.StringValue = "Program has started";
        }

        _occSensor.Register();
        _xpanel.Register();
    }

    private void CloudRoom_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
    {
        const uint XioOnlineStateJoin = 1;

        _xpanel.BooleanInput[XioOnlineStateJoin].BoolValue = args.DeviceOnLine;

        // Set current source feedback with enum value
        ControllerXioCloudRoomSlotDevice.CurrentSourceFeedback.Value = XioCloudRoomSlot.eCurrentSource.Laptop1;
    }

    private void CloudRoom_PropertyChangeEventHandler(GenericBase device, BaseEventArgs args)
    {
        // Handle all events which come in from XiO

        switch (args.EventId)
        {
            case XioCloudRoomSlot.SystemPowerOnEventId:
                TurnSystemPowerOn();
                break;
            case XioCloudRoomSlot.SystemPowerOffEventId:
                TurnSystemPowerOff();
                break;
            case XioCloudRoomSlot.DisplayPowerOnEventId:
                TurnDisplayPowerOn();
                break;
            case XioCloudRoomSlot.DisplayPowerOffEventId:
                TurnDisplayPowerOff();
                break;
            case XioCloudRoomSlot.OccupiedEventId:
                HandleOccupiedEvent(ControllerXioCloudRoomSlotDevice.Occupied.BoolValue);
                break;
            case XioCloudRoomSlot.VacantEventId:
                HandleVacantEvent(ControllerXioCloudRoomSlotDevice.Vacant.BoolValue);
                break;
            case XioCloudRoomSlot.RoomNameEventId:
                HandleRoomNameEvent(ControllerXioCloudRoomSlotDevice.RoomName.StringValue);
                break;
            case XioCloudRoomSlot.MaintenanceModeEventId:
                HandleMaintenanceModeEvent(ControllerXioCloudRoomSlotDevice.MaintenanceMode.BoolValue);
                break;
            case XioCloudRoomSlot.SystemCheckEventId:
                RunSystemCheck();
                break;
        }
    }

    private void TurnSystemPowerOn()
    {
        // Send system power state to XiO
        ControllerXioCloudRoomSlotDevice.SystemPowerFeedback.BoolValue = true;
    }

    private void TurnSystemPowerOff()
    {
        // Send system power state to XiO
        ControllerXioCloudRoomSlotDevice.SystemPowerFeedback.BoolValue = false;
    }

    private void TurnDisplayPowerOn()
    {
        // Send display power state to XiO
        ControllerXioCloudRoomSlotDevice.DisplayPowerFeedback.BoolValue = true;
    }

    private void TurnDisplayPowerOff()
    {
        // Send display power state to XiO
        ControllerXioCloudRoomSlotDevice.DisplayPowerFeedback.BoolValue = false;
    }

    private void HandleOccupiedEvent(bool value)
    {
        const uint OccupiedStateJoin = 10;

        _xpanel.BooleanInput[OccupiedStateJoin].BoolValue = value;
    }

    private void HandleVacantEvent(bool value)
    {
        const uint VacantStateJoin = 11;

        _xpanel.BooleanInput[VacantStateJoin].BoolValue = value;
    }

    private void HandleRoomNameEvent(string value)
    {
        const uint RoomNameJoin = 12;

        _xpanel.StringInput[RoomNameJoin].StringValue = value;
    }

    private void HandleMaintenanceModeEvent(bool value)
    {
        const uint MaintenanceModeJoin = 13;

        if (value)
        {
            _xpanel.StringInput[MaintenanceModeJoin].StringValue = "Room is in maintenance mode";
        }
        else
        {
            _xpanel.StringInput[MaintenanceModeJoin].StringValue = "";
        }
    }

    private void RunSystemCheck()
    {
        ControllerXioCloudRoomSlotDevice.SystemCheckStateFeedback.Value = XioCloudRoomSlot.eSystemCheckState.Running;

        if (_occSensor.IsOnline)
        {
            ControllerXioCloudRoomSlotDevice.SystemCheckStateFeedback.Value = XioCloudRoomSlot.eSystemCheckState.Success;
        }
        else
        {
            // SystemCheckMessageFeedback may be sent to provide details about system check
            ControllerXioCloudRoomSlotDevice.SystemCheckMessageFeedback.StringValue = "Occupancy sensor offline";
            ControllerXioCloudRoomSlotDevice.SystemCheckStateFeedback.Value = XioCloudRoomSlot.eSystemCheckState.Error;
        }
    }

    public void OccSensor_PropertyChangeEventHandler(GenericBase device, BaseEventArgs args)
    {
        if (args.EventId == GlsOccupancySensorBase.RoomOccupiedFeedbackEventId)
        {
            // Send occupancy state to XiO
            ControllerXioCloudRoomSlotDevice.OccupiedFeedback.BoolValue = _occSensor.OccupancyDetectedFeedback.BoolValue;
        }
    }
}

Version Information

.NET

Supported in: 6.0

.NET Compact Framework

Supported in: 3.5
See Also