Search in sources :

Example 1 with AddGroupCommand

use of com.zsmartsystems.zigbee.zcl.clusters.groups.AddGroupCommand 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 2 with AddGroupCommand

use of com.zsmartsystems.zigbee.zcl.clusters.groups.AddGroupCommand in project com.zsmartsystems.zigbee by zsmartsystems.

the class ZclGroupsCluster method addGroupCommand.

/**
 * The Add Group Command
 *
 * @param groupId {@link Integer} Group ID
 * @param groupName {@link String} Group Name
 * @return the {@link Future<CommandResult>} command result future
 */
public Future<CommandResult> addGroupCommand(Integer groupId, String groupName) {
    AddGroupCommand command = new AddGroupCommand();
    // Set the fields
    command.setGroupId(groupId);
    command.setGroupName(groupName);
    return send(command);
}
Also used : AddGroupCommand(com.zsmartsystems.zigbee.zcl.clusters.groups.AddGroupCommand)

Example 3 with AddGroupCommand

use of com.zsmartsystems.zigbee.zcl.clusters.groups.AddGroupCommand in project com.zsmartsystems.zigbee by zsmartsystems.

the class ZclCommandTypeTest method instantiateCommand.

@Test
public void instantiateCommand() {
    ZclCommandType cmd = ZclCommandType.ADD_GROUP_COMMAND;
    ZclCommand cmdClass = cmd.instantiateCommand();
    assertTrue(cmdClass instanceof AddGroupCommand);
}
Also used : AddGroupCommand(com.zsmartsystems.zigbee.zcl.clusters.groups.AddGroupCommand) ZclCommand(com.zsmartsystems.zigbee.zcl.ZclCommand) Test(org.junit.Test)

Aggregations

AddGroupCommand (com.zsmartsystems.zigbee.zcl.clusters.groups.AddGroupCommand)3 ZclCommand (com.zsmartsystems.zigbee.zcl.ZclCommand)1 ZclTransactionMatcher (com.zsmartsystems.zigbee.zcl.ZclTransactionMatcher)1 Test (org.junit.Test)1