Click or drag to resize

DeviceGroupTAdd Method

Adds a device to this group. All devices added must be on the same transport (e.g. a controller's Cresnet interface, a controller's RF gateway, an RF gateway). The first device added (either after the device group is created or after all devices have been removed from the group) determines the the group designated transport that all other added devices must be on. Devices must implement the appropriate IGroupableDevice interface (e.g. IGroupableDevice for a ShadeGroup) for device group. Devices cannot be added to separate groups that have the same group ID number. No devices can be at ID 255 on the group designated transport. There can be up to 252 groups on each transport. Devices must be registered after they are added to group. Group ID numbers must be unique per transport. For example if two groups are created with the ID 5 and then one of two different devices that are on the same transport are added added to each group an exception will be thrown with the second add attempt because it will be detected that there is already a group at ID 5 on the transport. At that point the group can either be disposed or another device that is on a different transport can be added to it.

Namespace: Crestron.SimplSharpPro.DeviceSupport
Assembly: Crestron.SimplSharpPro.DeviceSupport (in Crestron.SimplSharpPro.DeviceSupport.dll) Version: 2.21.121
Syntax
C#
public bool Add(
	T paramDevice
)

Parameters

paramDevice  T
Device to add.

Return Value

Boolean
Returns true if the device was added successfully. Returns false if there was an error.
Exceptions
ExceptionCondition
ArgumentNullExceptionDevice is null.
ArgumentExceptionDevice already added to group.
ArgumentExceptionDevice is part of a group that has the same group ID number.
ArgumentExceptionDevice already added to six device groups.
ArgumentException"Device not found on group designated transport."
ArgumentException"Device does not implement the correct IGroupableDevice interface for group."
ArgumentException"There is already a group on transport of device passed in that has this group number."
InvalidOperationException"There is a device at ID 255 on the group designated transport."
InvalidOperationException"There are already 252 groups on the group designated transport."
Remarks
This function is thread safe.

Version Information

.NET

Supported in: 6.0

.NET Compact Framework

Supported in: 3.5
See Also