use of com.zsmartsystems.zigbee.zcl.clusters.general.ReadReportingConfigurationCommand in project com.zsmartsystems.zigbee by zsmartsystems.
the class ZclClusterTest method getReporting.
@Test
public void getReporting() {
createNetworkManager();
ZigBeeNode node = new ZigBeeNode(networkManager, new IeeeAddress());
node.setNetworkAddress(1234);
ZigBeeEndpoint device = new ZigBeeEndpoint(networkManager, node, 5);
ZclCluster cluster = new ZclOnOffCluster(networkManager, device);
ZclAttribute attribute = cluster.getAttribute(0);
cluster.getReporting(attribute);
assertEquals(1, commandCapture.getAllValues().size());
ZigBeeCommand command = commandCapture.getValue();
assertNotNull(command);
System.out.println(command);
assertTrue(command instanceof ReadReportingConfigurationCommand);
ReadReportingConfigurationCommand cfgCommand = (ReadReportingConfigurationCommand) command;
assertEquals(1, cfgCommand.getRecords().size());
AttributeRecord record = cfgCommand.getRecords().get(0);
assertEquals(0, record.getAttributeIdentifier());
assertEquals(0, record.getDirection());
}
use of com.zsmartsystems.zigbee.zcl.clusters.general.ReadReportingConfigurationCommand in project com.zsmartsystems.zigbee by zsmartsystems.
the class ZclGeneralCluster method readReportingConfigurationCommand.
/**
* The Read Reporting Configuration Command
* <p>
* The Read Reporting Configuration command is used to read the configuration
* details of the reporting mechanism for one or more of the attributes of a cluster.
*
* @param records {@link List<AttributeRecord>} Records
* @return the {@link Future<CommandResult>} command result future
*/
public Future<CommandResult> readReportingConfigurationCommand(List<AttributeRecord> records) {
ReadReportingConfigurationCommand command = new ReadReportingConfigurationCommand();
// Set the fields
command.setRecords(records);
return send(command);
}
use of com.zsmartsystems.zigbee.zcl.clusters.general.ReadReportingConfigurationCommand in project com.zsmartsystems.zigbee by zsmartsystems.
the class ZclCluster method getReporting.
/**
* Gets the reporting configuration for an attribute
*
* @param attribute the {@link ZclAttribute} on which to enable reporting
* @return command future {@link CommandResult}
*/
public Future<CommandResult> getReporting(final ZclAttribute attribute) {
final ReadReportingConfigurationCommand command = new ReadReportingConfigurationCommand();
command.setClusterId(clusterId);
AttributeRecord record = new AttributeRecord();
record.setAttributeIdentifier(attribute.getId());
record.setDirection(0);
command.setRecords(Collections.singletonList(record));
command.setDestinationAddress(zigbeeEndpoint.getEndpointAddress());
return send(command);
}
Aggregations