Click or drag to resize

C2nUni8IoD Class

An universal keypad interface, designed for mounting in a back box behind third party switches and has 8 digital inputs that are contact closure driven and 8 separate LED outputs rated 5V DC/ 5mA.

This class will trigger ButtonStateChange event.

Inheritance Hierarchy

Namespace: Crestron.SimplSharpPro.Keypads
Assembly: Crestron.SimplSharpPro.Keypads (in Crestron.SimplSharpPro.Keypads.dll) Version: 2.21.121
Syntax
C#
public sealed class C2nUni8IoD : C2nUni8IoBase

The C2nUni8IoD type exposes the following members.

Constructors
 NameDescription
Public methodC2nUni8IoD(UInt32, CrestronControlSystem) Constructor to generate a new C2N-UNI8IO-D Cameo International Keypad Interface device connected to Control System.
Public methodC2nUni8IoD(UInt32, IDeviceBranch) Constructor to generate a new C2N-UNI8IO-D Cameo International Keypad Interface device on IDeviceBranch.
Top
Properties
 NameDescription
Public propertyButton Collection of buttons supported by the device.
(Inherited from KeypadBase)
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 propertyCode exampleDescription Get/Set the description of this device.
(Inherited from GenericBase)
Public propertyDisposed Property to indicate if the device has been disposed.
(Inherited from GenericDevice)
Public propertyFeedbackIntensity Property to set the LED feedback level when the corresponding feedback sig value is 'true'.
(Inherited from C2nUni8IoBase)
Public propertyFeedbacks Property to get the collection of feedbacks on the device.
(Inherited from C2nUni8IoBase)
Public propertyGlowIntensity Property to set the glow intensity, which illuminates the keypad when the corresponding LED feedback is turned off, and glow mode is enabled.
(Inherited from C2nUni8IoBase)
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 propertyName Get the name of this device.
(Inherited from GenericBase)
Public propertyParameterDblTapSpeed Returns and sets the time between the end of the first tap and the start of the second tap for a "DblTap" to be recognized. Use the SimplSharpDeviceHelper.SecondsToUShort to convert the seconds to a ushort value or the SimplSharpDeviceHelper.UShortToSeconds to convert the ushort value to seconds.
(Inherited from C2nUni8IoBase)
Public propertyParameterHoldTime Returns and sets the time in seconds that a button must be held before it is recognized as a "Hold" instead of a "Tap". Use the SimplSharpDeviceHelper.SecondsToUShort to convert the seconds to a ushort value or the SimplSharpDeviceHelper.UShortToSeconds to convert the ushort value to seconds.
(Inherited from C2nUni8IoBase)
Public propertyParameterWaitForDoubleTap Returns and sets the setting that determines whether a "Tap" should be sent immediately on the release of the button, or if the unit should wait until a "DblTap" event occurs.
(Inherited from C2nUni8IoBase)
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)
Protected propertySIMPLDeviceImplementation Internal protected member used for actual device control.
(Inherited from GenericDevice)
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)
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 methodToString Return the name of the device.
(Inherited from GenericDevice)
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 eventButtonStateChange Event fired when a button state change was received from the device.
(Inherited from KeypadBase)
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
Protected field_Buttons Collection that contains button objects.
(Inherited from KeypadBase)
Top
Example
C#
 static C2nUni8IoD myKeypad;
 // Constructor for the Control system class and to add the console commands.
public ControlSystemC2nUni8IoD()
{
    //Register console commands
    CrestronConsole.AddNewConsoleCommand(CreateDeviceCmd, "CreateDevice", "This is a C2N-UNI8IO-D Keypad interface CreateDevice command", ConsoleAccessLevelEnum.AccessOperator);
    CrestronConsole.AddNewConsoleCommand(SetFeedbackStateCmd, "SetFeedbackState", "This is a C2N-UNI8IO-D Keypad interface SetFeedbackState command", ConsoleAccessLevelEnum.AccessOperator);
    CrestronConsole.AddNewConsoleCommand(SetBlinkPatternCmd, "SetBlinkPattern", "This is a C2N-UNI8IO-D Keypad interface SetBlinkPattern command", ConsoleAccessLevelEnum.AccessOperator);
    CrestronConsole.AddNewConsoleCommand(SetGlowModeStateCmd, "SetGlowModeState", "This is a C2N-UNI8IO-D Keypad interface SetGlowModeState command", ConsoleAccessLevelEnum.AccessOperator);
}

 // Sig callback for handling C2N-UNI8IO-D button events.
 public void CreateDeviceCmd(String args)
{
    //Initialize the C2N-UNI8IO-D device for Cresnet Communication
    myKeypad = new C2nUni8IoD(0x17, this);

    myKeypad.ButtonStateChange += MyKeypadButtonChange;

   //Register the C2N-UNI8IO-D Cameo Professional Keypad with the Control system
    myKeypad.Register();

    if (myKeypad.Registered)
    {
        CrestronConsole.ConsoleCommandResponse("{0} device registered successfully\r\n", myKeypad.ToString());
    }
}

 // Method to set the LED feedback state
 // Example to set feedback 1 state to true : SetFeedbackState 1 Y
 // Example to set feedback 1 state to false : SetFeedbackState 1 N
 public void SetFeedbackStateCmd(string cmdparameters)
{
    var index = Convert.ToUInt16(cmdparameters.Substring(0, 1));
    bool state;

    if (cmdparameters.Substring(2, 1) == "Y")
    {
        state = true;
    }
    else
    {
        state = false;
    }
    myKeypad.Feedbacks[index].State = state;
    CrestronConsole.PrintLine("Feedback{0}'s state is {1}\r\n", index, myKeypad.Feedbacks[index].State);

}

 // Method to set the blink pattern
 // Example to set feedback 1 blink pattern to eButtonBlinkPattern.AlwaysOn : SetBlinkPattern 1 01
 // Example to set feedback 1 blink pattern to eButtonBlinkPattern.AlwaysOn : SetBlinkPattern 1 11
 public void SetBlinkPatternCmd(string cmdparameters)
 {
    var index = Convert.ToUInt16(cmdparameters.Substring(0, 1));
    var pattern = Convert.ToUInt16(cmdparameters.Substring(2, 2));

    myKeypad.Feedbacks[index].BlinkPattern = (eButtonBlinkPattern)(pattern-1);
    CrestronConsole.PrintLine("Feedback{0}'s Blink Pattern is {1}\r\n", index, myKeypad.Feedbacks[index].BlinkPattern);
}

 // Method to set the glow mode
 // Example to set feedback 1 glow mode to true : SetGlowModeState 1 Y
 // Example to set feedback 1 glow mode to false : SetGlowModeState 1 N
 public void SetGlowModeStateCmd(string cmdparameters)
 {
    var index = Convert.ToUInt16(cmdparameters.Substring(0, 1));
    bool state;

    if (cmdparameters.Substring(2, 1) == "Y")
    {
        state = true;
    }
    else
    {
        state = false;
    }
    myKeypad.Feedbacks[index].GlowModeEnableState.BoolValue = state;
    CrestronConsole.PrintLine("Feedback{0}'s Glow Mode State is {1}\r\n", index, myKeypad.Feedbacks[index].GlowModeEnableState.BoolValue);
}

 // Sig callback for handling C2N-UNI8IO-D button events.
    static void MyKeypadButtonChange(GenericBase currentDevice, ButtonEventArgs args)
    {
        for (uint i = 1; i <= 8; i++)
        {
            if (args.Button.Number == myKeypad.Button[i].Number)
            {
                //This means Bool "sig" changed on the C2nUni8IoD 
                //Just print some information for now.
                CrestronConsole.PrintLine("Button{0}'s state is {1}\r\n", i, args.Button.State);
            }
        }
    }

Version Information

.NET

Supported in: 6.0

.NET Compact Framework

Supported in: 3.5
See Also