Cresnet |
//The POE cresnet bridge. private DinCenCn2Poe CresnetBridge; //Create and register the cresnet bridge. public void CreateAndRegisterDevice() { CresnetBridge = new DinCenCn2Poe(5, this); var registrationResult = CresnetBridge.Register(); } //Query the cresnet bridge to find out what devices are connected to it. public void QueryCresnetBridge() { var queryResult = CresnetBridge.Helper.Query(); CrestronConsole.PrintLine("Devices on the cresnet bridge:"); foreach (var device in CresnetBridge.Helper.DiscoveredElementsList) { CrestronConsole.PrintLine(device.ToString()); } } //Put the devices that are on the cresnet bridge into light and poll mode. public void LightAndPoll() { var lightAllDevicesResult = CresnetBridge.Helper.LightAllDevices(LightAllDevicesCallback); } //Will get called when light and poll mode is stopped. public void LightAllDevicesCallback(CrestronCresnetHelper.DiscoveredDeviceElement[] discoveredDeviceElements) { CrestronConsole.PrintLine( "A button was pressed on the following devices when the devices on the cresnet bridge were in light and poll mode:"); foreach (var discoveredDevice in discoveredDeviceElements) { CrestronConsole.PrintLine(discoveredDevice.ToString()); } } //Take the devices that are on the cresnet bridge out of light and poll mode. public void StopLightAndPoll() { CresnetBridge.Helper.StopLightAndPoll(); }
public sealed class CresnetBridgeHelper
The CresnetBridgeHelper type exposes the following members.
| Name | Description | |
|---|---|---|
| DiscoveredElementsList | List of elements discovered by issuing the Query function. The List is empty until the function is executed or there are no cresnet devices in the system. |
| Name | Description | |
|---|---|---|
| DiscoverAllDevices | Function to discover all the devices on the cresnet bridge. This will report devices with duplicate Id's also. This will not report any cresnet devices which are in the loader. Please execute the Query function to detect those devices. | |
| Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) | |
| GetHashCode | Serves as the default hash function. (Inherited from Object) | |
| GetType | Gets the Type of the current instance. (Inherited from Object) | |
| LightAllDevices | Function to enable Light And Poll on all devices on the cresnet bridge. When StopLightAndPoll is called the call back will get called with a list of the devices that had a button pressed when cresnet bridge was in light and poll mode. This function can be called more than once to add more callbacks to be called when StopLightAndPoll is called. | |
| LightDeviceBySpecifiedTouchSettableId | Function to enable Light And Poll on a specific device based on the touch settable Id. When StopLightAndPoll is called the call back will get called with a list of the devices that had a button pressed when cresnet bridge was in light and poll mode. This function can be called more than once to add more callbacks to be called when StopLightAndPoll is called. | |
| Query | Function to report all the cresnet devices on the cresnet bridge. This might not work if there are devices with duplicate Id's on the network. Please execute the DiscoverAllDevices function to detect if there are duplicate Id's on your network. | |
| ReportCresnetIdByTouchSettableID(CrestronCresnetHelperDiscoveredDeviceElement, Byte) | Function to return the Id for the specified device based on the Touch Settable Id | |
| ReportCresnetIdByTouchSettableID(UInt32, Byte) | Function to return the Id for the specified device based on the Touch Settable Id | |
| ReportTouchSettableIDByCresnetId(Byte, UInt32) | Function to return the Touch Settable Id for a specified device based on the Id. | |
| ReportTouchSettableIDByCresnetId(CrestronCresnetHelperDiscoveredDeviceElement, UInt32) | Function to return the Touch Settable Id for a specified device based on the Id | |
| SendCommandToCresnetBridge | Method to send a console command to the Ethernet/Cresenet Bridge. | |
| SendCommandToCresnetBridgeAsync | Method to send a console command to the Ethernet/Cresenet Bridge and does not wait for the response to be received. When a callback is passed to this the same will be called once the response is received, otherwise the response is discarded. If no response is received from the device then the callback will not be called. | |
| SetCresnetIdByCurrentCresnetId(CrestronCresnetHelperDiscoveredDeviceElement, Byte) | Function to set the cresnet Id for a specified discovered element. | |
| SetCresnetIdByCurrentCresnetId(Byte, Byte, Byte) | Function to set the cresnet Id for a specific device based on the current cresnet Id of the device. | |
| SetCresnetIdByTouchSettableID(CrestronCresnetHelperDiscoveredDeviceElement, Byte) | Function to set the cresnet Id for a specified discovered element. | |
| SetCresnetIdByTouchSettableID(UInt32, Byte) | Function to set the cresnet Id for a specific device based on the Touch Settable Id of the device | |
| StopLightAndPoll | Function to stop the light and poll. | |
| ToString | Returns a string that represents the current object. (Inherited from Object) |