Search in sources :

Example 1 with ZclTransactionMatcher

use of com.zsmartsystems.zigbee.zcl.ZclTransactionMatcher in project com.zsmartsystems.zigbee by zsmartsystems.

the class ZigBeeApi method getGroupMemberships.

/**
 * Gets group memberships from device.
 *
 * @param device the device
 * @return the command result future
 */
public Future<CommandResult> getGroupMemberships(final ZigBeeEndpoint device) {
    final GetGroupMembershipCommand command = new GetGroupMembershipCommand();
    command.setGroupCount(0);
    command.setGroupList(Collections.<Integer>emptyList());
    command.setDestinationAddress(device.getEndpointAddress());
    return networkManager.unicast(command, new ZclTransactionMatcher());
}
Also used : GetGroupMembershipCommand(com.zsmartsystems.zigbee.zcl.clusters.groups.GetGroupMembershipCommand) ZclTransactionMatcher(com.zsmartsystems.zigbee.zcl.ZclTransactionMatcher)

Example 2 with ZclTransactionMatcher

use of com.zsmartsystems.zigbee.zcl.ZclTransactionMatcher in project com.zsmartsystems.zigbee by zsmartsystems.

the class ZigBeeApi method removeMembership.

/**
 * Removes group membership from device.
 *
 * @param device the device
 * @param groupId the group ID
 * @return the command result future
 */
public Future<CommandResult> removeMembership(final ZigBeeEndpoint device, final int groupId) {
    final RemoveGroupCommand command = new RemoveGroupCommand();
    command.setGroupId(groupId);
    command.setDestinationAddress(device.getEndpointAddress());
    return networkManager.unicast(command, new ZclTransactionMatcher());
}
Also used : RemoveGroupCommand(com.zsmartsystems.zigbee.zcl.clusters.groups.RemoveGroupCommand) ZclTransactionMatcher(com.zsmartsystems.zigbee.zcl.ZclTransactionMatcher)

Example 3 with ZclTransactionMatcher

use of com.zsmartsystems.zigbee.zcl.ZclTransactionMatcher in project com.zsmartsystems.zigbee by zsmartsystems.

the class ZigBeeApi method addMembership.

/**
 * Adds group membership to device.
 *
 * @param device the device
 * @param groupId the group ID
 * @param groupName the group name
 * @return the command result future
 */
public Future<CommandResult> addMembership(final ZigBeeEndpoint device, final int groupId, final String groupName) {
    final AddGroupCommand command = new AddGroupCommand();
    command.setGroupId(groupId);
    command.setGroupName(groupName);
    command.setDestinationAddress(device.getEndpointAddress());
    return networkManager.unicast(command, new ZclTransactionMatcher());
}
Also used : AddGroupCommand(com.zsmartsystems.zigbee.zcl.clusters.groups.AddGroupCommand) ZclTransactionMatcher(com.zsmartsystems.zigbee.zcl.ZclTransactionMatcher)

Example 4 with ZclTransactionMatcher

use of com.zsmartsystems.zigbee.zcl.ZclTransactionMatcher in project com.zsmartsystems.zigbee by zsmartsystems.

the class ZigBeeApi method viewMembership.

/**
 * Views group membership from device.
 *
 * @param device the device
 * @param groupId the group ID
 * @return the command result future
 */
public Future<CommandResult> viewMembership(final ZigBeeEndpoint device, final int groupId) {
    final ViewGroupCommand command = new ViewGroupCommand();
    command.setGroupId(groupId);
    command.setDestinationAddress(device.getEndpointAddress());
    return networkManager.unicast(command, new ZclTransactionMatcher());
}
Also used : ViewGroupCommand(com.zsmartsystems.zigbee.zcl.clusters.groups.ViewGroupCommand) ZclTransactionMatcher(com.zsmartsystems.zigbee.zcl.ZclTransactionMatcher)

Aggregations

ZclTransactionMatcher (com.zsmartsystems.zigbee.zcl.ZclTransactionMatcher)4 AddGroupCommand (com.zsmartsystems.zigbee.zcl.clusters.groups.AddGroupCommand)1 GetGroupMembershipCommand (com.zsmartsystems.zigbee.zcl.clusters.groups.GetGroupMembershipCommand)1 RemoveGroupCommand (com.zsmartsystems.zigbee.zcl.clusters.groups.RemoveGroupCommand)1 ViewGroupCommand (com.zsmartsystems.zigbee.zcl.clusters.groups.ViewGroupCommand)1