C2n |
This class will trigger ButtonStateChange, LightSensorChange, ThresholdStateChange and VersiportChange events.
public sealed class C2nCbdP : C2nCbdPBaseWithVersiport
The C2nCbdP type exposes the following members.
| Name | Description | |
|---|---|---|
| C2nCbdP(UInt32, CrestronControlSystem) | Constructor to generate a new C2N-CBD-P Cameo Professional Keypad device connected to Control System. | |
| C2nCbdP(UInt32, IDeviceBranch) | Constructor to generate a new C2N-CBD-P Cameo Professional Keypad device on IDeviceBranch. |
| Name | Description | |
|---|---|---|
| AboveThreshold |
This input is driven by the AboveThreshold_FB output on the master keypad.
This input is only active when EnableExtThreshold is set to true,
which signifies that the current button is operating in slave mode.
When the input goes true, this sets the backlight to the specified Day level (either custom or preset).
When the input goes false, it goes to the specified Night level (custom or preset).
(Inherited from C2nCbdPBase) | |
| AboveThresholdFeedback |
Updated to indicate the level of the ambient light in relation to the threshold. This field is only updated when EnableExtThreshold is set to false.
(Inherited from C2nCbdPBase) | |
| BacklightIntensity |
Property that returns a reference to the BacklightIntensity UShortInputSig.
(Inherited from C2nCbdPBase) | |
| BargraphValue |
Property to get or set the current bargraph value of the device.
On the C2niCb this property is the same as the LeftBargraphValue (Inherited from InetCbdex) | |
| BrightnessSettings |
Returns a BrightnessSettings instance that can be used to get and set brightness settings.
(Inherited from C2nCbdPBase) | |
| Button |
Collection of buttons supported by the device.
(Inherited from KeypadBase) | |
| ConnectedIpList |
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) | |
| Description |
Get/Set the description of this device.
(Inherited from GenericBase) | |
| Disposed |
Property to indicate if the device has been disposed.
(Inherited from GenericDevice) | |
| EnableExtThreshold |
When EnableExtThreshold is true, this puts the keypad into slave mode.
(Inherited from C2nCbdPBase) | |
| Feedbacks |
Property to get the collection of feedbacks on the device.
(Inherited from InetCbdex) | |
| ID |
Property to get the ID of the device.
(Inherited from GenericDevice) | |
| IndicatorIntensity |
Property to get or set the current intensity of the bargraph on the device.
(Inherited from InetCbdex) | |
| IsOnline |
Property to get the current online state of the device.
(Inherited from GenericDevice) | |
| LightSensorValue |
Updated with the ambient light level. ReportLightLevel must be set to true.
(Inherited from C2nCbdPBase) | |
| ManualBacklight |
Enables manual adjustment of the backlight via the BacklightIntensity input for as long as the input is true.
(Inherited from C2nCbdPBase) | |
| ManualIndicatorIntensity |
Enables manual adjustment of the LED brightness via the IndicatorIntensity input for as long as the input is true.
(Inherited from C2nCbdPBase) | |
| Name |
Get the name of this device.
(Inherited from GenericBase) | |
| NumberOfVersiPorts |
Number of versiports this device supports.
(Inherited from C2nCbdPBaseWithVersiport) | |
| ParameterBargraphTimeout |
Sets and gets the BargraphTimeout parameter.
Valid values are between 0 to 10 seconds
Use the SimplSharpDeviceHelper.SecondsToUShort to convert
the time to a ushort value or the SimplSharpDeviceHelper.UShortToSeconds to convert
the ushort value to seconds
(Inherited from InetCbdex) | |
| ParameterDblTapSpeed |
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 InetCbdex) | |
| ParameterHoldTime |
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 InetCbdex) | |
| ParameterWaitForDoubleTap |
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 InetCbdex) | |
| Parent |
The parent that a given object was added to.
(Inherited from GenericBase) | |
| Registerable |
Property to indicate that this device can be registered.
(Inherited from GenericDevice) | |
| Registered |
Property to get the current registration state of the device.
(Inherited from GenericDevice) | |
| RegistrationFailureReason |
Property to get the Registration Failure Reason, this will match the return value from the call to register.
(Inherited from GenericDevice) | |
| ReportLightLevel |
Enables the LightSensorValue property and the LightSensorChange event output to report the current light level for as long as the input is true. When the input is false the light level isn't reported.
(Inherited from C2nCbdPBase) | |
| SIMPLDeviceImplementation |
Internal protected member used for actual device control.
(Inherited from GenericDevice) | |
| Type |
Property to determine to type of device this is.
(Inherited from GenericDevice) | |
| UnRegistrationFailureReason |
Property to get the Unregistration Failure Reason, this will match the return value from the call to unregister.
(Inherited from GenericDevice) | |
| UserSpecifiedObject |
Can be assigned anything that user wants.
(Inherited from GenericBase) | |
| VersiPorts |
Collection of versiports on the control system.
(Inherited from C2nCbdPBaseWithVersiport) | |
| XioEndpointStubSIMPLDevice |
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) |
| Name | Description | |
|---|---|---|
| CancelActiveBargraph |
Cancels active bargraph.
(Inherited from InetCbdex) | |
| DisableBargraph |
Disables the bargraph functionality.
(Inherited from InetCbdex) | |
| Dispose |
Clean up of resources.
(Inherited from GenericBase) | |
| Dispose(Boolean) |
Method to perform the actual disposing of the device.
(Inherited from GenericDevice) | |
| EnableBargraph |
Enables the bargraph functionality.
(Inherited from InetCbdex) | |
| Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) | |
| Finalize |
Destructor of the device.
(Inherited from GenericDevice) | |
| GetHashCode | Serves as the default hash function. (Inherited from Object) | |
| GetType | Gets the Type of the current instance. (Inherited from Object) | |
| OnBaseEvent(Int32) |
Protected member used to fire the BaseEvent with the default extended information.
(Inherited from GenericBase) | |
| OnBaseEvent(Int32, UInt16) |
Protected member used to fine the BaseEvent with extended event information.
(Inherited from GenericBase) | |
| Register |
Register this device with the system.
(Inherited from GenericDevice) | |
| SendParameters |
This will send the parameters fields (if any) to the device. It allows the parameters to be modified and resent without unregistering and re-registering
a device. It requires firmware support on the device.
Not Currently implemented. This will throw a NotSupportedException
(Inherited from InetCbdex) | |
| ToString |
Return the name of the device.
(Inherited from GenericDevice) | |
| UnRegister |
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) |
| Name | Description | |
|---|---|---|
| BaseEvent |
Generic base event, triggered when the there are no other handlers available
for a specific EventID.
(Inherited from GenericBase) | |
| ButtonStateChange |
Event fired when a button state change was received from the device.
(Inherited from KeypadBase) | |
| IpInformationChange |
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) | |
| LightSensorChange |
Event triggered when the LightSensorValue is reported as a percentage from 0% to 100%, as determined by the internal light sensor. ReportLightLevel must be true.
(Inherited from C2nCbdPBase) | |
| OnlineStatusChange |
Event triggered when the Online status of the device changes.
(Inherited from GenericDevice) | |
| ThresholdStateChange |
Event triggered when the C2nCbdPBase reports ambient light is at or below or above the threshold, this event is only raised when EnableExtThreshold is set to false.
(Inherited from C2nCbdPBase) |
| Name | Description | |
|---|---|---|
| _Buttons |
Collection that contains button objects.
(Inherited from KeypadBase) |
static C2nCbdP myKeypad; public ControlSystemC2nCbdP() { //Register console commands CrestronConsole.AddNewConsoleCommand(CreateDeviceCmd, "CreateDevice", "This is a C2N-CBD-P CreateDevice command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(DisableBargraphCmd, "DisableBargraph", "This is a C2N-CBD-P DisableBargraph command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(EnableBargraphCmd, "EnableBargraph", "This is a C2N-CBD-P EnableBargraph command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(CancelBargraphCmd, "CancelBargraph", "This is a C2N-CBD-P CancelBargraph command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(AutoBackLightPresetcmd, "AutoBackLightPreset", "This is a C2N-CBD-P AutoBackLightPreset command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(LightSensorValueCmd, "LightSensorValue", "This is a C2N-CBD-P LightSensorValue command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(CustomDayNightThresholdCmd, "CustomDayNightThreshold", "This is a C2N-CBD-P CustomDayNightThreshold command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(SetCustomDayLightIntensityCmd, "SetCustomDayL", "This is a C2N-CBD-P SetBacklightIntensity command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(GetIndicatorIntensityCmd, "GetIndicatorIntensity", "This is a C2N-CBD-P GetIndicatorIntensity command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(SetIndicatorIntensityCmd, "SetIndicatorIntensity", "This is a C2N-CBD-P SetIndicatorIntensity command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(SetBargraphValueCmd, "SetBargraphValue", "This is a C2N-CBD-P SetBargraphValueCmd command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(RunAllCmdsCmd, "RunAll", "This is a C2N-CBD-P RunAll command", ConsoleAccessLevelEnum.AccessOperator); } // Method to create the C2N-CBD-P device and register it with the control system public void CreateDeviceCmd(String args) { // Initialize the C2N-CBD-P device for Cresnet Communication myKeypad = new C2nCbdP(0x03, this); myKeypad.BaseEvent += MyKeypadCameMyKeypadEventHandler; myKeypad.ButtonStateChange += MyKeypadButtonChange; myKeypad.LightSensorChange += MyKeypadLightSensorChange; myKeypad.ThresholdStateChange += MyKeypadThresholdStateChange; myKeypad.VersiPorts[1].VersiportChange += C2nCbdPVersiportStateChange_EventHandler; myKeypad.VersiPorts[2].VersiportChange += C2nCbdPVersiportStateChange_EventHandler; // Register the C2N-CBD-P Cameo Professional Keypad with the Control system myKeypad.Register(); if (myKeypad.Registered) { CrestronConsole.ConsoleCommandResponse("{0} device successfully registered\r\n", myKeypad.ToString()); } } // Method to set the bar graph value. public void SetBargraphValueCmd(String args) { myKeypad.BargraphValue.UShortValue = SimplSharpDeviceHelper.PercentToUshort(Convert.ToUInt16(args)); } // Method to set the custom daylight intensity parameter value. public void SetCustomDayLightIntensityCmd(String args) { myKeypad.BrightnessSettings.ParameterCustomDayBacklight = SimplSharpDeviceHelper.PercentToUshort(Convert.ToUInt16(args)); } // Method to set the custom nightlight intensity parameter value. public void SetCustomNightlightIntensityCmd(String args) { myKeypad.BrightnessSettings.ParameterCustomNightBacklight = SimplSharpDeviceHelper.PercentToUshort(Convert.ToUInt16(args)); } // Method to set the autobacklight preset parameter. // for setting it to InetBrightnessSettings.eAutoBacklightPreset.CustomSettings: AutoBackLightPreset 1 public void AutoBackLightPresetcmd(String args) { myKeypad.BrightnessSettings.ParameterAutoBacklightPreset = (InetBrightnessSettings.eAutoBacklightPreset)(Convert.ToUInt16(args) -1); } // Method to set the custom day night threshold parameter value. public void CustomDayNightThresholdCmd(String args) { myKeypad.BrightnessSettings.ParameterCustomDayNightThreshold = SimplSharpDeviceHelper.PercentToUshort(Convert.ToUInt16(args)); } // Method to print the indicator intensity parameter value. public void GetIndicatorIntensityCmd(String args) { CrestronConsole.ConsoleCommandResponse("IndicatorIntensity% is {0}\r\n", SimplSharpDeviceHelper.UshortToPercent(myKeypad.IndicatorIntensity.UShortValue)); } // Method to set the indicator intensity parameter value. public void SetIndicatorIntensityCmd(String args) { myKeypad.IndicatorIntensity.UShortValue = SimplSharpDeviceHelper.PercentToUshort(Convert.ToUInt16(args)); CrestronConsole.ConsoleCommandResponse("IndicatorIntensity% is set to {0}\r\n", SimplSharpDeviceHelper.UshortToPercent(myKeypad.IndicatorIntensity.UShortValue)); } // Method to print the light sensor value. public void LightSensorValueCmd(String args) { CrestronConsole.Print("Light Sensor Value: {0}\r\n", myKeypad.LightSensorValue); } // Method to disable the bar graph. public void DisableBargraphCmd(String args) { myKeypad.DisableBargraph(); } // Method to enable the bar graph. public void EnableBargraphCmd(String args) { myKeypad.EnableBargraph(); } // Method to cancel the bar graph. public void CancelBargraphCmd(String args) { myKeypad.CancelActiveBargraph(); } // Method to handle sig change events for C2N-CBD-P Cameo Professional Keypad. static private void MyKeypadCameMyKeypadEventHandler(GenericBase device, BaseEventArgs args) { if (args.EventId > 0) { CrestronConsole.PrintLine("Base Event {0} received\r\n", args.EventId); } } // Sig callback for handling C2N-CBD-P 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 C2nCbdP //Just print some information for now. CrestronConsole.PrintLine("Button{0}'s state is {1}\r\n", i, args.Button.State); } } } // Sig callback for handling C2N-CBD-P Light Sensor change events. static void MyKeypadLightSensorChange(GenericBase device, AmbientLightSensorEventArgs args) { CrestronConsole.Print("AmbientLightSensor event received, value is : {0}\r\n", args.SensorValue); if (myKeypad.ManualIndicatorIntensity.BoolValue == false) { if (myKeypad.LightSensorValue == 0) { myKeypad.IndicatorIntensity.UShortValue = myKeypad.BrightnessSettings.ParameterMinAutoIndicatorIntensity; } else if (myKeypad.LightSensorValue >= 65535u) { myKeypad.IndicatorIntensity.UShortValue = myKeypad.BrightnessSettings.ParameterMaxAutoIndicatorIntensity; } else { myKeypad.IndicatorIntensity.UShortValue = Convert.ToUInt16(65535u - myKeypad.LightSensorValue); } CrestronConsole.Print("IndicatorIntensity set to {0}\r\n", myKeypad.IndicatorIntensity.UShortValue); } } // Sig callback for handling C2N-CBD-P Threshold State change events. static void MyKeypadThresholdStateChange(object obj, ThresholdEventArgs args) { switch (args.ThresholdStatus) { case eThresholdStatus.AboveThreshold: CrestronConsole.Print("Threshold event {0} received\r\n", args.ThresholdStatus); if (myKeypad.ManualBacklight.BoolValue == false) { if (myKeypad.BrightnessSettings.ParameterAutoBacklightPreset == InetBrightnessSettings.eAutoBacklightPreset.CustomSettings) { myKeypad.BacklightIntensity.UShortValue = myKeypad.BrightnessSettings.ParameterCustomDayBacklight; CrestronConsole.Print("BacklightIntensity set to {0}\r\n", myKeypad.BacklightIntensity.UShortValue); } else { switch (myKeypad.BrightnessSettings.ParameterAutoBacklightPreset) { case InetBrightnessSettings.eAutoBacklightPreset.White: case InetBrightnessSettings.eAutoBacklightPreset.Almond: case InetBrightnessSettings.eAutoBacklightPreset.Gray: case InetBrightnessSettings.eAutoBacklightPreset.DarkAlmond: case InetBrightnessSettings.eAutoBacklightPreset.Dusk: case InetBrightnessSettings.eAutoBacklightPreset.Ivory: case InetBrightnessSettings.eAutoBacklightPreset.Latte: case InetBrightnessSettings.eAutoBacklightPreset.Brown: case InetBrightnessSettings.eAutoBacklightPreset.Black: myKeypad.BacklightIntensity.UShortValue = SimplSharpDeviceHelper.PercentToUshort(0); CrestronConsole.Print("BacklightIntensity set to {0}\r\n", myKeypad.BacklightIntensity.UShortValue); break; } } } break; case eThresholdStatus.AtOrBelowThreshold: CrestronConsole.Print("Threshold event {0} received\r\n", args.ThresholdStatus); if (myKeypad.ManualBacklight.BoolValue == false) { if (myKeypad.BrightnessSettings.ParameterAutoBacklightPreset == InetBrightnessSettings.eAutoBacklightPreset.CustomSettings) { myKeypad.BacklightIntensity.UShortValue = myKeypad.BrightnessSettings.ParameterCustomNightBacklight; } else { switch (myKeypad.BrightnessSettings.ParameterAutoBacklightPreset) { case InetBrightnessSettings.eAutoBacklightPreset.White: case InetBrightnessSettings.eAutoBacklightPreset.Almond: case InetBrightnessSettings.eAutoBacklightPreset.Gray: case InetBrightnessSettings.eAutoBacklightPreset.DarkAlmond: case InetBrightnessSettings.eAutoBacklightPreset.Dusk: case InetBrightnessSettings.eAutoBacklightPreset.Ivory: case InetBrightnessSettings.eAutoBacklightPreset.Latte: myKeypad.BacklightIntensity.UShortValue = SimplSharpDeviceHelper.PercentToUshort(25); break; case InetBrightnessSettings.eAutoBacklightPreset.Brown: case InetBrightnessSettings.eAutoBacklightPreset.Black: myKeypad.BacklightIntensity.UShortValue = SimplSharpDeviceHelper.PercentToUshort(15); break; } } CrestronConsole.Print("BacklightIntensity set to {0}\r\n", myKeypad.BacklightIntensity.UShortValue); } break; default: CrestronConsole.Print("Invalid Threshold event {0} received\r\n", args.ThresholdStatus); break; } } // Sig callback for handling C2N-CBD-P Versiport State change events. static void C2nCbdPVersiportStateChange_EventHandler(Versiport vport, VersiportEventArgs args) { switch (args.Event) { case eVersiportEvent.AnalogInChange: CrestronConsole.Print("AnalogInChange event for Versiport{0} received\r\n", vport.ID); break; case eVersiportEvent.DigitalInChange: CrestronConsole.Print("DigitalInChange event for Versiport{0} received\r\n", vport.ID); break; } }