Cnx |
This class will trigger ButtonStateChange and BaseEvent events.
public sealed class CnxB12 : CnxBBase
The CnxB12 type exposes the following members.
| Name | Description | |
|---|---|---|
| CnxB12(UInt32, CrestronControlSystem) | Constructor to generate a new CnxB12 device. | |
| CnxB12(UInt32, IDeviceBranch) | Constructor to generate a new CnxB12 device on IDeviceBranch. |
| Name | Description | |
|---|---|---|
| AudioVolume |
Property to set the audio volume for WAV file playback.
Use PercentToUshort(Single) to convert
the percentage to a ushort value or UshortToPercent(UInt16) to convert
the ushort value to percentage.
(Inherited from CnxBBase) | |
| BacklightIntensity |
Property to set the brightness of the backlight.
Use PercentToUshort(Single) to convert
the percentage to a ushort value or UshortToPercent(UInt16) to convert
the ushort value to percentage.
(Inherited from CnxBBase) | |
| BacklightOn |
Property to turn on the backlight.
(Inherited from CnxBBase) | |
| 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) | |
| EnableTemperatureReport |
Property to enable temperature reporting (via TemperatureFeedback).
(Inherited from CnxBBase) | |
| Feedbacks |
Property to get the collection of feedbacks on the device.
(Inherited from KeypadBase) | |
| ID |
Property to get the ID of the device.
(Inherited from GenericDevice) | |
| IndicatorIntensity |
Property to set the brightness of the LED indicators.
Use PercentToUshort(Single) to convert
the percentage to a ushort value or UshortToPercent(UInt16) to convert
the ushort value to percentage.
(Inherited from CnxBBase) | |
| IsOnline |
Property to get the current online state of the device.
(Inherited from GenericDevice) | |
| Name |
Get the name of this device.
(Inherited from GenericBase) | |
| Parent |
The parent that a given object was added to.
(Inherited from GenericBase) | |
| PlayingSoundFeedback |
Property to indicate that a WAV file is playing.
The BaseEvent event will trigger with PlayingSoundFeedbackEventId. (Inherited from CnxBBase) | |
| 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) | |
| SIMPLDeviceImplementation |
Internal protected member used for actual device control.
(Inherited from GenericDevice) | |
| TemperatureFeedback |
Property to report the ambient room temperature in tenths of a degree (1d = 0.1 degrees), and updates the reading every 2 seconds.
The BaseEvent event will trigger with TemperatureFeedbackEventId. (Inherited from CnxBBase) | |
| TemperatureFormat |
Property to set the temperature format. When the property is true, the temperature is reported in degrees Celsius; when false, degrees Fahrenheit.
(Inherited from CnxBBase) | |
| 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) | |
| 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 | |
|---|---|---|
| Dispose |
Clean up of resources.
(Inherited from GenericBase) | |
| Dispose(Boolean) |
Method to perform the actual disposing of the device.
(Inherited from GenericDevice) | |
| 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) | |
| Sound |
Method to play the specified WAV file.
(Inherited from CnxBBase) | |
| 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) | |
| OnlineStatusChange |
Event triggered when the Online status of the device changes.
(Inherited from GenericDevice) |
| Name | Description | |
|---|---|---|
| _Buttons |
Collection that contains button objects.
(Inherited from KeypadBase) |
static CnxB12 cnxBxxx; public ControlSystemCnxBxxx() { //Register console commands CrestronConsole.AddNewConsoleCommand(CreateDeviceCmd, "CreateDevice", "This is a CNX-Bxxx Keypad CreateDevice command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(PrintBacklightIntensityCmd, "PrintBacklightIntensity", "This is a CNX-Bxxx Keypad PrintBacklightIntensity command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(PrintIndicatorIntensityCmd, "PrintIndicatorIntensity", "This is a CNX-Bxxx Keypad PrintIndicatorIntensity command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(SetIndicatorIntensityCmd, "SetIndicatorIntensity", "This is a CNX-Bxxx Keypad SetIndicatorIntensity command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(SetBacklightIntensityCmd, "SetBacklightIntensity", "This is a CNX-Bxxx Keypad SetBacklightIntensity command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(SetVolumeCmd, "SetVolume", "This is a CNX-Bxxx Keypad SetVolume command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(SelectWavFileCmd, "SelectWavFile", "This is a CNX-Bxxx Keypad SelectWavFile command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(SetBacklightOnCmd, "SetBacklightOn", "This is a CNX-Bxxx Keypad SetBacklightOn command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(EnableTemperatureReportingCmd, "EnableTempRep", "This is a CNX-Bxxx Keypad EnableTempRep command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(PlayingSoundCmd, "PlayingSound", "This is a CNX-Bxxx Keypad PlayingSound command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(SetTemperatureFormatCmd, "SetTempFormat", "This is a CNX-Bxxx Keypad SetTempFormat command", ConsoleAccessLevelEnum.AccessOperator); } // Method to handle CNX-Bxxx top level sig change events. static void CnxBxxxKeypadEventHandler(GenericBase device, BaseEventArgs args) { if (args.EventId == CnxBBase.PlayingSoundFeedbackEventId) { CrestronConsole.PrintLine("Playing Sound Feedback Event received\r\n"); } else if (args.EventId == CnxBBase.TemperatureFeedbackEventId) { CrestronConsole.PrintLine("Temperature Feedback Event received\r\n"); } } // Method for handling CNX-Bxxx button events. static void CnxBxxxButtonChange(GenericBase currentDevice, ButtonEventArgs args) { CrestronConsole.PrintLine("Button{0}'s state is {1}\r\n", args.Button.Number, args.Button.State); } // Method to create the CNX-Bxxx device // How to use this command: CreateDevice public void CreateDeviceCmd(String args) { //Initialize the CNX-Bxxx device cnxBxxx = new CnxB12(0x18, this); cnxBxxx.BaseEvent += CnxBxxxKeypadEventHandler; cnxBxxx.ButtonStateChange += CnxBxxxButtonChange; //Register the CNX-Bxxx Keypad with the Control system cnxBxxx.Register(); if (cnxBxxx.Registered) { CrestronConsole.ConsoleCommandResponse("{0} device successfully registered\r\n", cnxBxxx.ToString()); } } // Method to print the backlight intensity. // How to use the command: PrintBacklightIntensity public void PrintBacklightIntensityCmd(String args) { CrestronConsole.ConsoleCommandResponse("BacklightIntensity% is {0}\r\n", SimplSharpDeviceHelper.UshortToPercent(cnxBxxx.BacklightIntensity.UShortValue)); } // Method to set the backlight intensity. // How to use the command: SetBacklightIntensity (value in % from 1 - 100) public void SetBacklightIntensityCmd(String args) { cnxBxxx.BacklightIntensity.UShortValue = SimplSharpDeviceHelper.PercentToUshort(Convert.ToUInt16(args)); CrestronConsole.ConsoleCommandResponse("BacklightIntensity% is set to {0}\r\n", SimplSharpDeviceHelper.UshortToPercent(cnxBxxx.BacklightIntensity.UShortValue)); } // Method to print the indicator intensity. // How to use the command: PrintIndicatorIntensity public void PrintIndicatorIntensityCmd(String args) { CrestronConsole.ConsoleCommandResponse("IndicatorIntensity% is {0}\r\n", SimplSharpDeviceHelper.UshortToPercent(cnxBxxx.IndicatorIntensity.UShortValue)); } // Method to set the indicator intensity. // How to use the command: SetIndicatorIntensity (value in % from 1 - 100) public void SetIndicatorIntensityCmd(String args) { cnxBxxx.IndicatorIntensity.UShortValue = SimplSharpDeviceHelper.PercentToUshort(Convert.ToUInt16(args)); CrestronConsole.ConsoleCommandResponse("IndicatorIntensity% is set to {0}\r\n", SimplSharpDeviceHelper.UshortToPercent(cnxBxxx.IndicatorIntensity.UShortValue)); } // Method to set the audio volume. // How to use the command: SetVolume (value in % from 1 -100) public void SetVolumeCmd(String args) { cnxBxxx.AudioVolume.UShortValue = SimplSharpDeviceHelper.PercentToUshort(Convert.ToUInt16(args)); CrestronConsole.ConsoleCommandResponse("AudioVolume% is set to {0}\r\n", SimplSharpDeviceHelper.UshortToPercent(cnxBxxx.AudioVolume.UShortValue)); } // Method to select the WAV file. // How to use the command: SelectWavFile (index - 1 - 101) public void SelectWavFileCmd(String args) { cnxBxxx.Sound(Convert.ToUInt16(args)); } // Method to set the backlight on. // How to use the command: SetBacklightOn Y To set backlight to on // SetBacklightOn N To set backlight to off public void SetBacklightOnCmd(String args) { if (args == "Y") { cnxBxxx.BacklightOn.BoolValue = true; } else { cnxBxxx.BacklightOn.BoolValue = false; } } // Method to enable temperature reporting. // How to use the command: EnableTemperatureReporting Y To enable Temperature reporting // EnableTemperatureReporting N To disable Temperature reporting public void EnableTemperatureReportingCmd(String args) { if (args == "Y") { cnxBxxx.EnableTemperatureReport.BoolValue = true; } else { cnxBxxx.EnableTemperatureReport.BoolValue = false; } } // Method to show if any WAV file is playing. // How to use the command: PlayingSound public void PlayingSoundCmd(String args) { if (cnxBxxx.PlayingSoundFeedback.BoolValue) { CrestronConsole.ConsoleCommandResponse("WAV file is playing\r\n"); } else { CrestronConsole.ConsoleCommandResponse("No WAV file is playing\r\n"); } } // Method to enable temperature format. // How to use the command: SetTemperatureFormat C to set format to degrees Celsius // SetTemperatureFormat F to set format to degrees Fahrenheit public void SetTemperatureFormatCmd(String args) { if (args == "C") { cnxBxxx.TemperatureFormat.BoolValue = true; } else if (args == "F") { cnxBxxx.TemperatureFormat.BoolValue = false; } }