Click or drag to resize

CresnetBridgeHelper Class

Cresnet bridge helper.
Example
This example illustrates how you can query a cresnet bridge using the cresnet bridge's Helper member.
C#
//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();
}
Inheritance Hierarchy
SystemObject
  Crestron.SimplSharpPro.DeviceSupportCresnetBridgeHelper

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

The CresnetBridgeHelper type exposes the following members.

Properties
 NameDescription
Public propertyDiscoveredElementsList 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.
Top
Methods
 NameDescription
Public methodDiscoverAllDevices 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.
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodLightAllDevices 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.
Public methodLightDeviceBySpecifiedTouchSettableId 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.
Public methodQuery 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.
Public methodReportCresnetIdByTouchSettableID(CrestronCresnetHelperDiscoveredDeviceElement, Byte) Function to return the Id for the specified device based on the Touch Settable Id
Public methodReportCresnetIdByTouchSettableID(UInt32, Byte) Function to return the Id for the specified device based on the Touch Settable Id
Public methodReportTouchSettableIDByCresnetId(Byte, UInt32) Function to return the Touch Settable Id for a specified device based on the Id.
Public methodReportTouchSettableIDByCresnetId(CrestronCresnetHelperDiscoveredDeviceElement, UInt32) Function to return the Touch Settable Id for a specified device based on the Id
Public methodSendCommandToCresnetBridge Method to send a console command to the Ethernet/Cresenet Bridge.
Public methodSendCommandToCresnetBridgeAsync 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.
Public methodSetCresnetIdByCurrentCresnetId(CrestronCresnetHelperDiscoveredDeviceElement, Byte) Function to set the cresnet Id for a specified discovered element.
Public methodSetCresnetIdByCurrentCresnetId(Byte, Byte, Byte) Function to set the cresnet Id for a specific device based on the current cresnet Id of the device.
Public methodSetCresnetIdByTouchSettableID(CrestronCresnetHelperDiscoveredDeviceElement, Byte) Function to set the cresnet Id for a specified discovered element.
Public methodSetCresnetIdByTouchSettableID(UInt32, Byte) Function to set the cresnet Id for a specific device based on the Touch Settable Id of the device
Public methodStopLightAndPoll Function to stop the light and poll.
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top

Version Information

.NET

Supported in: 6.0

.NET Compact Framework

Supported in: 3.5
See Also