[zb4osgi-changeset] [scm] ZigBee 4 OSGi repository change: r551 - in /projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee: ./ .settings/ META-INF/ OSGI-INF/ OSGI-INF/metatype/ bin/ bin/it/ bin/it/telecomitalia/ bin/it/telecomitalia/ah/ bin/it/telecomitalia/ah/cluster/ bin/it/telecomitalia/ah/cluster/zigbee/ bin/it/telecomitalia/ah/ep/ bin/it/telecomitalia/ah/internal/ bin/it/telecomitalia/ah/internal/zcl/ bin/it/telecomitalia/ah/internal/zcl/cluster/ bin/it/telecomitalia/ah/internal/zigbee/ bin/it/telecomitalia/ah/internal/zigbee/test/ bin/it/telecomitalia/ah/utils/ bin/it/telecomitalia/ah/zigbee/ bin/it/telecomitalia/ah/zigbee/cluster/ bin/it/telecomitalia/ah/zigbee/cluster/general/ bin/it/telecomitalia/ah/zigbee/cluster/se/ bin/it/telecomitalia/ah/zigbee/zcl/ bin/it/telecomitalia/ah/zigbee/zcl/cluster/ bin/it/telecomitalia/ah/zigbee/zcl/cluster/custom/ bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ bin/it/telecomitalia/ah/zigbee/zcl/cluster/hvac/ bin/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ bin/it/telecomitalia/ah/zigbee/zcl/cluster/metering/ bin/it/telecomitalia/ah/zigbee/zcl/cluster/security/ bin/it/telecomitalia/ah/zigbee/zcl/clusters/ bin/it/telecomitalia/ah/zigbee/zcl/lib/ bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ bin/it/telecomitalia/hac/ bin/org/ bin/org/telecomitalia/ bin/org/telecomitalia/ah/ bin/org/telecomitalia/hac/ bin/org/telecomitalia/hac/zigbee/ build/ src/ src/it/ src/it/telecomitalia/ src/it/telecomitalia/ah/ src/it/telecomitalia/ah/cluster/ src/it/telecomitalia/ah/cluster/zigbee/ src/it/telecomitalia/ah/ep/ src/it/telecomitalia/ah/internal/ src/it/telecomitalia/ah/internal/zcl/ src/it/telecomitalia/ah/internal/zcl/cluster/ src/it/telecomitalia/ah/internal/zigbee/ src/it/telecomitalia/ah/internal/zigbee/test/ src/it/telecomitalia/ah/utils/ src/it/telecomitalia/ah/zigbee/ src/it/telecomitalia/ah/zigbee/cluster/ src/it/telecomitalia/ah/zigbee/cluster/general/ src/it/telecomitalia/ah/zigbee/cluster/se/ src/it/telecomitalia/ah/zigbee/zcl/ src/it/telecomitalia/ah/zigbee/zcl/cluster/ src/it/telecomitalia/ah/zigbee/zcl/cluster/custom/ src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ src/it/telecomitalia/ah/zigbee/zcl/cluster/hvac/ src/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ src/it/telecomitalia/ah/zigbee/zcl/cluster/metering/ src/it/telecomitalia/ah/zigbee/zcl/cluster/security/ src/it/telecomitalia/ah/zigbee/zcl/clusters/ src/it/telecomitalia/ah/zigbee/zcl/lib/ src/it/telecomitalia/ah/zigbee/zcl/lib/types/ src/it/telecomitalia/hac/ src/org/ src/org/telecomitalia/ src/org/telecomitalia/ah/ src/org/telecomitalia/hac/ src/org/telecomitalia/hac/zigbee/ xml/ xml/zigbee/
scm-notify at zb4osgi.aaloa.org
scm-notify at zb4osgi.aaloa.org
Mon Oct 22 13:55:46 CEST 2012
Author: ennio.grasso
Date: Mon Oct 22 13:55:46 2012
New Revision: 551
Log: (empty)
Added:
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/.classpath
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/.project
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/.settings/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/.settings/org.eclipse.jdt.core.prefs
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/.settings/org.eclipse.ltk.core.refactoring.prefs
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/.settings/org.eclipse.pde.core.prefs
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/META-INF/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/META-INF/MANIFEST.MF
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/OSGI-INF/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/OSGI-INF/metatype/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/OSGI-INF/metatype/metatype.xml
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/OSGI-INF/zbconsole.xml
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/OSGI-INF/zigbee.xml
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/cluster/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/cluster/zigbee/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/ep/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/internal/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/internal/zcl/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/internal/zcl/cluster/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/internal/zigbee/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/internal/zigbee/ActiveEpInstallationStatus.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/internal/zigbee/Hex.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/internal/zigbee/InstallationStatus.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/internal/zigbee/OSGiProperties.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/internal/zigbee/Utils.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/internal/zigbee/ZclAttributeDescriptor.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/internal/zigbee/ZigBeeCommandProvider.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/internal/zigbee/ZigBeeDeviceImpl.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/internal/zigbee/ZigBeeManagerImpl.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/internal/zigbee/ZigBeeManagerProperties.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/internal/zigbee/test/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/utils/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/IZclFrame.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/ZCL.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/ZclFrame.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/ZclSerializer.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/ZigBeeDevice.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/ZigBeeDeviceListener.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/ZigBeeException.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/ZigBeeMngrService.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/cluster/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/cluster/general/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/cluster/se/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/IZclAppliance.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/IZclAttributeDescriptor.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/IZclAttributeValue.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/IZclServiceCluster.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/IZclServiceEndPoint.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/ZclException.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/ZclValidationException.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/ZclWriteAttributeRecord.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/custom/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/custom/ZclSimpleMetering4NoksClient.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/custom/ZclSimpleMetering4NoksServer.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceControlClient.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceControlServer.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceEventsAndAlertsClient.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceEventsAndAlertsServer.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceIdentificationClient.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceIdentificationServer.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceStatisticsClient.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceStatisticsServer.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclDBFTR.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclDEFTR.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclDEFTWAR.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclEnergyPhasesScheduleResponse.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclEnergyPhasesScheduleStateResponse.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclGetEventsAndAlertsResponse.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclGetOverallSchedulePriceResponse.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclGetPowerProfilePriceExtendedResponse.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclGetPowerProfilePriceResponse.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclIndesitBridgeClient.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclIndesitBridgeServer.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclLoadManagementAcknowledge.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclLogQueueResponse.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclLogResponse.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclMeterIdentificationClient.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclMeterIdentificationServer.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfile.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileClient.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileResponse.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileScheduleConstraintsResponse.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileServer.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileStateResponse.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileTransferredPhase.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclReadHandshakeParamResponse.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclScheduledPhase.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclSignalStateResponse.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/PartitionClusterAttributes.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/PartitionedFrame.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclAddGroupResponse.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclAlarmsClient.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclAlarmsServer.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclBasicClient.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclBasicServer.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclDeviceTemperatureConfigurationClient.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclDeviceTemperatureConfigurationServer.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclGetAlarmResponse.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclGetGroupMembershipResponse.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclGroupsClient.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclGroupsServer.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclIdentifyClient.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclIdentifyQueryResponse.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclIdentifyServer.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclLevelControlClient.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclLevelControlServer.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclOnOffClient.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclOnOffServer.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclOnOffSwitchConfigurationClient.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclOnOffSwitchConfigurationServer.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclPartitionServer$PartitionTimerTask.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclPartitionServer$State.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclPartitionServer.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclPowerConfigurationClient.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclPowerConfigurationServer.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclRemoveGroupResponse.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclTimeClient.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclTimeServer.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclTransferPartitionedFrameCommand.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclViewGroupResponse.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/hvac/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/hvac/ZclThermostatClient.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/hvac/ZclThermostatServer.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclIlluminanceMeasurementClient.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclIlluminanceMeasurementServer.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclOccupancySensingClient.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclOccupancySensingServer.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclRelativeHumidityMeasurementClient.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclRelativeHumidityMeasurementServer.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclTemperatureMeasurementClient.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclTemperatureMeasurementServer.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/metering/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/metering/ZclSimpleMeteringClient.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/metering/ZclSimpleMeteringServer.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/security/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/security/ZclIASZoneClient.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/security/ZclIASZoneServer.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/security/ZclZoneEnrollResponse.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/clusters/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/ZclAppliance.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/ZclByteUtils.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/ZclEndPoint.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/ZclServiceCluster.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclAbstractDataType.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeBitmap16.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeBitmap24.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeBitmap32.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeBitmap8.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeBoolean.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeClusterID.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeEnum16.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeEnum8.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeI16.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeI24.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeI32.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeI8.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeOctets.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeString.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUI16.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUI24.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUI32.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUI48.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUI8.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUTCTime.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclTypes.class (with props)
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/hac/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/org/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/org/telecomitalia/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/org/telecomitalia/ah/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/org/telecomitalia/hac/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/org/telecomitalia/hac/zigbee/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/build/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/build.properties
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/changelog.txt
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/mybuild.xml
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/cluster/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/cluster/zigbee/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/ep/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/internal/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/internal/zcl/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/internal/zcl/cluster/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/internal/zigbee/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/internal/zigbee/Hex.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/internal/zigbee/OSGiProperties.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/internal/zigbee/Utils.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/internal/zigbee/ZclAttributeDescriptor.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/internal/zigbee/ZigBeeCommandProvider.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/internal/zigbee/ZigBeeDeviceImpl.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/internal/zigbee/ZigBeeManagerImpl.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/internal/zigbee/ZigBeeManagerProperties.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/internal/zigbee/test/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/utils/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/IZclFrame.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/ZCL.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/ZclFrame.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/ZclSerializer.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/ZigBeeDevice.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/ZigBeeDeviceListener.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/ZigBeeException.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/ZigBeeMngrService.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/cluster/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/cluster/general/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/cluster/se/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/IZclAppliance.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/IZclAttributeDescriptor.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/IZclAttributeValue.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/IZclServiceCluster.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/IZclServiceEndPoint.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/ZclException.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/ZclValidationException.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/ZclWriteAttributeRecord.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/custom/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/custom/ZclSimpleMetering4NoksClient.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/custom/ZclSimpleMetering4NoksServer.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceControlClient.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceControlServer.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceEventsAndAlertsClient.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceEventsAndAlertsServer.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceIdentificationClient.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceIdentificationServer.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceStatisticsClient.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceStatisticsServer.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclDBFTR.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclDEFTR.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclDEFTWAR.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclEnergyPhasesScheduleResponse.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclEnergyPhasesScheduleStateResponse.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclGetEventsAndAlertsResponse.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclGetOverallSchedulePriceResponse.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclGetPowerProfilePriceExtendedResponse.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclGetPowerProfilePriceResponse.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclIndesitBridgeClient.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclIndesitBridgeServer.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclLoadManagementAcknowledge.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclLogQueueResponse.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclLogResponse.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclMeterIdentificationClient.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclMeterIdentificationServer.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfile.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileClient.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileResponse.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileScheduleConstraintsResponse.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileServer.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileStateResponse.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileTransferredPhase.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclReadHandshakeParamResponse.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclScheduledPhase.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclSignalStateResponse.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclAddGroupResponse.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclAlarmsClient.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclAlarmsServer.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclBasicClient.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclBasicServer.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclDeviceTemperatureConfigurationClient.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclDeviceTemperatureConfigurationServer.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclGetAlarmResponse.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclGetGroupMembershipResponse.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclGroupsClient.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclGroupsServer.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclIdentifyClient.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclIdentifyQueryResponse.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclIdentifyServer.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclLevelControlClient.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclLevelControlServer.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclOnOffClient.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclOnOffServer.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclOnOffSwitchConfigurationClient.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclOnOffSwitchConfigurationServer.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclPartitionServer.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclPowerConfigurationClient.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclPowerConfigurationServer.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclRemoveGroupResponse.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclTimeClient.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclTimeServer.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclTransferPartitionedFrameCommand.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclViewGroupResponse.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/hvac/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/hvac/ZclThermostatClient.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/hvac/ZclThermostatServer.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclIlluminanceMeasurementClient.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclIlluminanceMeasurementServer.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclOccupancySensingClient.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclOccupancySensingServer.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclRelativeHumidityMeasurementClient.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclRelativeHumidityMeasurementServer.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclTemperatureMeasurementClient.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclTemperatureMeasurementServer.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/metering/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/metering/ZclSimpleMeteringClient.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/metering/ZclSimpleMeteringServer.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/security/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/security/ZclIASZoneClient.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/security/ZclIASZoneServer.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/security/ZclZoneEnrollResponse.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/clusters/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/ZclAppliance.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/ZclByteUtils.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/ZclEndPoint.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/ZclServiceCluster.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclAbstractDataType.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeBitmap16.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeBitmap24.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeBitmap32.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeBitmap8.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeBoolean.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeClusterID.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeEnum16.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeEnum8.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeI16.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeI24.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeI32.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeI8.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeOctets.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeString.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUI16.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUI24.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUI32.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUI48.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUI8.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUTCTime.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclTypes.java
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/hac/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/org/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/org/telecomitalia/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/org/telecomitalia/ah/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/org/telecomitalia/hac/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/org/telecomitalia/hac/zigbee/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/xml/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/xml/zigbee/
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/xml/zigbee/README.TXT
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/xml/zigbee/ha.xml
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/xml/zigbee/ha.xsd
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/xml/zigbee/ha_rel.xml
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/xml/zigbee/prova.xml
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/xml/zigbee/zcl.xml
projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/xml/zigbee/zcl_v2.xml
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/.classpath
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/.classpath (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/.classpath Mon Oct 22 13:55:46 2012
@@ -1,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/.project
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/.project (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/.project Mon Oct 22 13:55:46 2012
@@ -1,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>it.telecomitalia.osgi.ah.zigbee</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ds.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+ </natures>
+</projectDescription>
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/.settings/org.eclipse.jdt.core.prefs
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/.settings/org.eclipse.jdt.core.prefs (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/.settings/org.eclipse.jdt.core.prefs Mon Oct 22 13:55:46 2012
@@ -1,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/.settings/org.eclipse.ltk.core.refactoring.prefs
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/.settings/org.eclipse.ltk.core.refactoring.prefs (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/.settings/org.eclipse.ltk.core.refactoring.prefs Mon Oct 22 13:55:46 2012
@@ -1,0 +1,3 @@
+#Tue Oct 06 13:58:49 CEST 2009
+eclipse.preferences.version=1
+org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/.settings/org.eclipse.pde.core.prefs
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/.settings/org.eclipse.pde.core.prefs (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/.settings/org.eclipse.pde.core.prefs Mon Oct 22 13:55:46 2012
@@ -1,0 +1,4 @@
+#Mon Apr 11 14:32:27 CEST 2011
+eclipse.preferences.version=1
+pluginProject.equinox=false
+resolve.requirebundle=false
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/META-INF/MANIFEST.MF
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/META-INF/MANIFEST.MF (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/META-INF/MANIFEST.MF Mon Oct 22 13:55:46 2012
@@ -1,0 +1,39 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: ZigBee Network Manager
+Bundle-SymbolicName: it.telecomitalia.osgi.ah.zigbee
+Bundle-Version: 2.1.20.qualifier
+Bundle-Description: Insert a description.
+Service-Component: OSGI-INF/*.xml
+Import-Package: edu.emory.mathcs.backport.java.util.concurrent,
+ edu.emory.mathcs.backport.java.util.concurrent.locks,
+ it.telecomitalia.ah.hac,
+ it.telecomitalia.ah.hac.lib,
+ it.telecomitalia.ah.hac.lib.ext,
+ it.telecomitalia.ah.zigbee,
+ it.telecomitalia.ah.zigbee.zcl.lib.types,
+ it.telecomitalia.zgd;version="[1.4.0,1.5.0)",
+ it.telecomitalia.zgd.jaxb;version="[1.0.2,1.1.0)",
+ org.apache.commons.logging,
+ org.eclipse.equinox.internal.util.timer,
+ org.eclipse.osgi.framework.console,
+ org.osgi.framework;version="1.3.0",
+ org.osgi.service.component,
+ org.osgi.service.device,
+ org.osgi.service.event,
+ org.osgi.service.prefs;version="1.1.0"
+Bundle-Vendor: Telecom Italia
+Bundle-Category: Automation at Home
+Export-Package: it.telecomitalia.ah.zigbee;version="3.0.0",
+ it.telecomitalia.ah.zigbee.zcl;version="3.0.0",
+ it.telecomitalia.ah.zigbee.zcl.cluster.custom;version="3.0.0",
+ it.telecomitalia.ah.zigbee.zcl.cluster.eh;version="3.0.1",
+ it.telecomitalia.ah.zigbee.zcl.cluster.general;version="3.0.1",
+ it.telecomitalia.ah.zigbee.zcl.cluster.hvac;version="3.0.0",
+ it.telecomitalia.ah.zigbee.zcl.cluster.measurement;version="3.0.0",
+ it.telecomitalia.ah.zigbee.zcl.cluster.metering;version="3.0.0",
+ it.telecomitalia.ah.zigbee.zcl.cluster.security;version="3.0.0",
+ it.telecomitalia.ah.zigbee.zcl.lib;version="3.0.0",
+ it.telecomitalia.ah.zigbee.zcl.lib.types;version="3.0.0"
+Require-Bundle: it.telecomitalia.osgi.ah.hac.lib;bundle-version="[3.0.5,3.1.0)"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/OSGI-INF/metatype/metatype.xml
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/OSGI-INF/metatype/metatype.xml (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/OSGI-INF/metatype/metatype.xml Mon Oct 22 13:55:46 2012
@@ -1,0 +1,20 @@
+<metatype:MetaData xmlns:metatype="http://www.osgi.org/xmlns/metatype/v1.0.0">
+
+ <OCD description="ZigBee Network Manager"
+ name="ZigBee Network Manager"
+ id="it.telecomitalia.osgi.ah.adapter.zigbee">
+ <AD name="Reconnect to jGal Delay" id="it.telecomitalia.ah.adapter.zigbee.reconnect" required="true" type="Integer" default="5"/>
+ <AD name="LQI" id="it.telecomitalia.ah.adapter.zigbee.lqi" required="true" type="Boolean" default="true"/>
+ <AD name="Initial LQI Delay" id="it.telecomitalia.ah.adapter.zigbee.discovery.initialdelay" required="true" type="Integer" default="15"/>
+ <AD name="LQI Interval" id="it.telecomitalia.ah.adapter.zigbee.discovery.delay" required="true" type="Integer" default="0"/>
+ <AD name="Timeouts" id="it.telecomitalia.ah.adapter.zigbee.timeouts" required="true" type="Integer" default="7000"/>
+ </OCD>
+
+ <Designate pid="it.telecomitalia.osgi.ah.adapter.zigbee">
+ <Object ocdref="it.telecomitalia.osgi.ah.adapter.zigbee">
+ <Attribute adref="it.telecomitalia.ah.adapter.zigbee.reconnect" content="5"/>
+ <Attribute adref="it.telecomitalia.ah.adapter.zigbee.lqi" content="false"/>
+ </Object>
+ </Designate>
+
+</metatype:MetaData>
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/OSGI-INF/zbconsole.xml
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/OSGI-INF/zbconsole.xml (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/OSGI-INF/zbconsole.xml Mon Oct 22 13:55:46 2012
@@ -1,0 +1,11 @@
+<?xml version="1.0"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="ZigBee Network Manager Console">
+ <implementation class="it.telecomitalia.ah.internal.zigbee.ZigBeeCommandProvider" />
+ <service>
+ <provide interface="org.eclipse.osgi.framework.console.CommandProvider"/>
+ </service>
+ <reference bind="setZigBeeMngrService" cardinality="0..1" interface="it.telecomitalia.ah.zigbee.ZigBeeMngrService" name="ZigBeeMngrService" policy="dynamic" unbind="unsetZigBeeMngrService"/>
+</scr:component>
+
+
+
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/OSGI-INF/zigbee.xml
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/OSGI-INF/zigbee.xml (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/OSGI-INF/zigbee.xml Mon Oct 22 13:55:46 2012
@@ -1,0 +1,23 @@
+<?xml version="1.0"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" configuration-policy="optional" modified="modified" name="it.telecomitalia.osgi.ah.zigbee">
+ <implementation class="it.telecomitalia.ah.internal.zigbee.ZigBeeManagerImpl" />
+ <property name="network.type" value="ZigBee"/>
+ <service>
+ <provide interface="it.telecomitalia.ah.zigbee.ZigBeeMngrService"/>
+ <provide interface="it.telecomitalia.ah.hac.lib.ext.INetworkManager"/>
+ </service>
+
+ <reference name="Timer" interface="org.eclipse.equinox.internal.util.timer.Timer"
+ bind="setTimer" unbind="unsetTimer" cardinality="1..1" policy="dynamic" />
+
+ <reference name="GatewayInterface" interface="it.telecomitalia.zgd.GatewayInterface"
+ bind="setGatewayInterface" unbind="unsetGatewayInterface" cardinality="1..1"
+ policy="dynamic" />
+
+ <reference bind="setEventAdmin" cardinality="0..1" interface="org.osgi.service.event.EventAdmin" name="EventAdmin" policy="dynamic" unbind="unsetEventAdmin"/>
+
+ <reference name="PreferencesService" interface="org.osgi.service.prefs.PreferencesService"
+ bind="setPreferenceService" unbind="unsetPreferenceService"
+ cardinality="1..1" policy="dynamic" />
+
+</scr:component>
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/internal/zigbee/ActiveEpInstallationStatus.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/internal/zigbee/ActiveEpInstallationStatus.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/internal/zigbee/Hex.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/internal/zigbee/Hex.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/internal/zigbee/InstallationStatus.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/internal/zigbee/InstallationStatus.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/internal/zigbee/OSGiProperties.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/internal/zigbee/OSGiProperties.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/internal/zigbee/Utils.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/internal/zigbee/Utils.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/internal/zigbee/ZclAttributeDescriptor.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/internal/zigbee/ZclAttributeDescriptor.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/internal/zigbee/ZigBeeCommandProvider.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/internal/zigbee/ZigBeeCommandProvider.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/internal/zigbee/ZigBeeDeviceImpl.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/internal/zigbee/ZigBeeDeviceImpl.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/internal/zigbee/ZigBeeManagerImpl.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/internal/zigbee/ZigBeeManagerImpl.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/internal/zigbee/ZigBeeManagerProperties.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/internal/zigbee/ZigBeeManagerProperties.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/IZclFrame.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/IZclFrame.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/ZCL.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/ZCL.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/ZclFrame.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/ZclFrame.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/ZclSerializer.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/ZclSerializer.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/ZigBeeDevice.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/ZigBeeDevice.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/ZigBeeDeviceListener.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/ZigBeeDeviceListener.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/ZigBeeException.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/ZigBeeException.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/ZigBeeMngrService.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/ZigBeeMngrService.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/IZclAppliance.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/IZclAppliance.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/IZclAttributeDescriptor.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/IZclAttributeDescriptor.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/IZclAttributeValue.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/IZclAttributeValue.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/IZclServiceCluster.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/IZclServiceCluster.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/IZclServiceEndPoint.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/IZclServiceEndPoint.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/ZclException.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/ZclException.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/ZclValidationException.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/ZclValidationException.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/ZclWriteAttributeRecord.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/ZclWriteAttributeRecord.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/custom/ZclSimpleMetering4NoksClient.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/custom/ZclSimpleMetering4NoksClient.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/custom/ZclSimpleMetering4NoksServer.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/custom/ZclSimpleMetering4NoksServer.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceControlClient.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceControlClient.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceControlServer.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceControlServer.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceEventsAndAlertsClient.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceEventsAndAlertsClient.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceEventsAndAlertsServer.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceEventsAndAlertsServer.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceIdentificationClient.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceIdentificationClient.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceIdentificationServer.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceIdentificationServer.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceStatisticsClient.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceStatisticsClient.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceStatisticsServer.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceStatisticsServer.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclDBFTR.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclDBFTR.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclDEFTR.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclDEFTR.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclDEFTWAR.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclDEFTWAR.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclEnergyPhasesScheduleResponse.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclEnergyPhasesScheduleResponse.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclEnergyPhasesScheduleStateResponse.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclEnergyPhasesScheduleStateResponse.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclGetEventsAndAlertsResponse.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclGetEventsAndAlertsResponse.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclGetOverallSchedulePriceResponse.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclGetOverallSchedulePriceResponse.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclGetPowerProfilePriceExtendedResponse.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclGetPowerProfilePriceExtendedResponse.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclGetPowerProfilePriceResponse.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclGetPowerProfilePriceResponse.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclIndesitBridgeClient.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclIndesitBridgeClient.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclIndesitBridgeServer.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclIndesitBridgeServer.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclLoadManagementAcknowledge.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclLoadManagementAcknowledge.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclLogQueueResponse.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclLogQueueResponse.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclLogResponse.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclLogResponse.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclMeterIdentificationClient.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclMeterIdentificationClient.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclMeterIdentificationServer.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclMeterIdentificationServer.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfile.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfile.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileClient.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileClient.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileResponse.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileResponse.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileScheduleConstraintsResponse.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileScheduleConstraintsResponse.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileServer.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileServer.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileStateResponse.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileStateResponse.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileTransferredPhase.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileTransferredPhase.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclReadHandshakeParamResponse.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclReadHandshakeParamResponse.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclScheduledPhase.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclScheduledPhase.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclSignalStateResponse.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclSignalStateResponse.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/PartitionClusterAttributes.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/PartitionClusterAttributes.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/PartitionedFrame.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/PartitionedFrame.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclAddGroupResponse.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclAddGroupResponse.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclAlarmsClient.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclAlarmsClient.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclAlarmsServer.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclAlarmsServer.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclBasicClient.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclBasicClient.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclBasicServer.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclBasicServer.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclDeviceTemperatureConfigurationClient.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclDeviceTemperatureConfigurationClient.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclDeviceTemperatureConfigurationServer.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclDeviceTemperatureConfigurationServer.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclGetAlarmResponse.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclGetAlarmResponse.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclGetGroupMembershipResponse.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclGetGroupMembershipResponse.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclGroupsClient.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclGroupsClient.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclGroupsServer.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclGroupsServer.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclIdentifyClient.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclIdentifyClient.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclIdentifyQueryResponse.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclIdentifyQueryResponse.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclIdentifyServer.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclIdentifyServer.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclLevelControlClient.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclLevelControlClient.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclLevelControlServer.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclLevelControlServer.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclOnOffClient.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclOnOffClient.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclOnOffServer.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclOnOffServer.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclOnOffSwitchConfigurationClient.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclOnOffSwitchConfigurationClient.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclOnOffSwitchConfigurationServer.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclOnOffSwitchConfigurationServer.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclPartitionServer$PartitionTimerTask.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclPartitionServer$PartitionTimerTask.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclPartitionServer$State.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclPartitionServer$State.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclPartitionServer.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclPartitionServer.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclPowerConfigurationClient.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclPowerConfigurationClient.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclPowerConfigurationServer.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclPowerConfigurationServer.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclRemoveGroupResponse.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclRemoveGroupResponse.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclTimeClient.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclTimeClient.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclTimeServer.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclTimeServer.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclTransferPartitionedFrameCommand.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclTransferPartitionedFrameCommand.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclViewGroupResponse.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclViewGroupResponse.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/hvac/ZclThermostatClient.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/hvac/ZclThermostatClient.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/hvac/ZclThermostatServer.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/hvac/ZclThermostatServer.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclIlluminanceMeasurementClient.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclIlluminanceMeasurementClient.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclIlluminanceMeasurementServer.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclIlluminanceMeasurementServer.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclOccupancySensingClient.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclOccupancySensingClient.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclOccupancySensingServer.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclOccupancySensingServer.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclRelativeHumidityMeasurementClient.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclRelativeHumidityMeasurementClient.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclRelativeHumidityMeasurementServer.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclRelativeHumidityMeasurementServer.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclTemperatureMeasurementClient.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclTemperatureMeasurementClient.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclTemperatureMeasurementServer.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclTemperatureMeasurementServer.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/metering/ZclSimpleMeteringClient.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/metering/ZclSimpleMeteringClient.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/metering/ZclSimpleMeteringServer.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/metering/ZclSimpleMeteringServer.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/security/ZclIASZoneClient.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/security/ZclIASZoneClient.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/security/ZclIASZoneServer.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/security/ZclIASZoneServer.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/security/ZclZoneEnrollResponse.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/cluster/security/ZclZoneEnrollResponse.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/ZclAppliance.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/ZclAppliance.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/ZclByteUtils.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/ZclByteUtils.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/ZclEndPoint.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/ZclEndPoint.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/ZclServiceCluster.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/ZclServiceCluster.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclAbstractDataType.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclAbstractDataType.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeBitmap16.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeBitmap16.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeBitmap24.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeBitmap24.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeBitmap32.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeBitmap32.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeBitmap8.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeBitmap8.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeBoolean.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeBoolean.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeClusterID.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeClusterID.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeEnum16.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeEnum16.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeEnum8.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeEnum8.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeI16.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeI16.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeI24.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeI24.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeI32.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeI32.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeI8.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeI8.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeOctets.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeOctets.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeString.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeString.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUI16.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUI16.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUI24.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUI24.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUI32.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUI32.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUI48.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUI48.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUI8.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUI8.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUTCTime.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUTCTime.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclTypes.class
==============================================================================
Binary file - no diff available.
Propchange: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/bin/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclTypes.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/build.properties
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/build.properties (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/build.properties Mon Oct 22 13:55:46 2012
@@ -1,0 +1,12 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ .classpath,\
+ xml/,\
+ OSGI-INF/,\
+ changelog.txt
+src.includes = xml/,\
+ bin/,\
+ changelog.txt
+additional.bundles = it.telecomitalia.osgi.ah.hac
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/changelog.txt
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/changelog.txt (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/changelog.txt Mon Oct 22 13:55:46 2012
@@ -1,0 +1,246 @@
+Version 2.1.20.qualifier:
+
+** Bugs
+ * Fixed problems in the Power Profile cluster implementation:
+ - Marshalling and unmarshalling code of EnergyPhasesScheduleStateResponse revised.
+ - Removed a response not used anymore.
+ * Fix on ZclPartitionClusterServer: sending default response if requested
+
+ * Added in Basic Server Cluster the DisableLocalConfig and LocationDescription attributes
+ * Updated Appliance Control, Appliance Events And Alerts and Appliance Statistics
+ according to E at H spec 0.95 rel 1.10
+ * Fix in ZclServiceCluster in handling incoming Read Attrs Zcl command.
+ The value calculated as expected length of the outgoing frame was wrong.
+ * Fix in ZclTimeClient in mashalling attribute records.
+ * Now handles the cohesistence of Client and Server side clusters in the same appliance.
+ * Now handles some incoming reading operation for power profile server cluster (instantaneous
+ power and demand formatting)
+ * Fix: now accept as result of an issueExec(), in addition to the expected response,
+ also a default response containing an error code.
+ * The issueExec() and readAttribute method of the ZclServiceCluster now handle
+ correctly a EndPointRequestContext with isConfirmationRequired() disabled.
+
+ * Fixed bug on ApplianceStatistics. The logNotification() didn't unmarshall
+ correctly the incoming Partitioned frame.
+
+** New Features:
+ * Compatible with jgal 1.4.0
+ * Compatible with JRE1.5
+ * In IZclFrame added parseArray() and appendArray() methods to marshall and
+ unmarshall generic arrays.
+ * ZclSimpleMetering cluster now is able to handle incoming ReadAttr for
+ the IstantaneousDemand attr.
+ * In ZclLogResponse removed LogLength field
+ * Wip on adding a new way to manage configuration options
+ * Swapped hac with hac lib.
+
+Version 2.1.20:
+
+** Bugs:
+ * The Partition Server Cluster handles wrong message order (i.e. a PartitionFrame that
+ arrives whithout a previous writeHandskakeParameters.
+ * The Partition Server Cluster now perform the right calculation of certain parameters
+ that do depend from other.
+
+
+** Improvements
+ * Added createOutgoingZclFrame() to create a ZclFrame and refactored the code to use
+ this new method.
+ * Updated raiseServiceClusterException() method
+ * Handles correctly general but unsupported commands in handleGeneralCommands().
+ A ZclException is raised
+ * Checking the direction field of the incoming messages with checkResponseFrameDirection()
+ and checkIncomingFrameDirection(). The two methods are identical but raise respectively a
+ ServiceClusterException and a ZclExeption.
+ * First attempt to clean the way exeptions are used inside the ZclServiceCluster class: the
+ idea is that if an exception is going back to an appliance it must inherit from class
+ ServiceClusterException. If the exception goes to the ZigBeeNetworkManager it must
+ be a ZclException.
+ * Updated to JRE 1.5
+
+
+Version 2.1.19:
+
+** New Features
+ * Generic hac API refactoring
+ * Added generic network manager service interface
+ * Added multi end point device management
+
+Version 2.1.18:
+
+** Bugs
+ * Missing attributes in Time Server Cluster
+ * Incorrect handling of incoming ReadAttributeRequests in ServiceCluster
+ * Incorrect handling of incoming ReadAttributeRequests in cluster Time Server
+ * Application Device Version exposed by the Gateway Service Descriptor not set
+
+** Improvements
+ * Aligned Power Profile Cluster to E at H specs v0.95
+ * Aligned Meter Identification Cluster to E at H specs v0.95
+
+** New Features
+ * Added support for Range Extender ZigBee device
+ * Added IAS Zone Cluster for supporting Cleode ZDoor ZigBee device
+ * Added TemperatureMeasurements Cluster
+
+Bundle version 2.1.17:
+ - Fixed problems related to index used for internal hash tables.
+ The disconnect didn't work!
+
+Bundle version 2.1.16:
+ - All the logs uses hex format
+ - The base10 format is used only for appliance pid (for backward compatibility).
+ - Added missing input and output clusters (the list is still NOT complete).
+
+Bundle version 2.1.15:
+ - Fixed a locking problem that happens when an appliance calls in the
+ notifyAttributeValue() a blocking operation (i.e. a read attribute command on a cluster).
+ The problem is still present in the notifyPeerApplianceConnected() callback.
+ - Changed the initial sequence number to 30.
+ - Fixed a bug in calculating the zcl frame hash.
+ - Changed some logs adding the thread number and the hex node mac address
+
+Bundle version 2.1.14:
+ Modifications:
+ - Moved the following calls: startNodeDiscovery and subscribeNodeRemovals
+ to the right place.
+
+Bundle version 2.1.13:
+ Modifications:
+
+
+Bundle version 2.1.12:
+ Modifications:
+ - Added/changed some logs
+
+Bundle version 2.1.12:
+
+ Modifications:
+ - Rollback on 2.1.9 regarding use nvm case
+ - Added infostructure to handle correctly the leave to devices joined but not
+ configured.
+ - Added some additional locks.
+ - Added support for jgal 1.3.0+ (i.e. new reset callback)
+ - Added many new log messages (for debugging purposes).
+ - Removed dead code
+ - Do not close the zb network anymore because now the gal does it by itself at
+ startup.
+ - Improved logs, including logging error conditions
+ - Configure the gal endpoint to provide the set of output clusters
+ needed by E at H.
+ - Ported on Apache Felix and Prosyst mBS OSGi frameworks
+ - Updated zgd version
+
+ Bugfix:
+ - More resilient in case of jgal timeouts
+ - Fixed the Device ID of the gal endpoint (right value is 0x0050).
+
+
+Bundle version 2.1.11:
+ - This is a rollback to 2.1.9. The code adde in 2.1.10 is not wrong but the leave has
+ to be sent only if the node came in with a join and not a rejoin.
+ The solution is to store the already joined device in order to distinquish them
+ from the newly ones.
+
+Bundle version 2.1.10:
+ - Send leave to nodes still not completely installed when the network is closed or the bundle is stopped
+
+Bundle version 2.1.9:
+ - Added timer on jgal api.
+
+Bundle version 2.1.8:
+ - Using a property file instead of the PreferencesService
+ previously stored nvm usage status.
+ - Added a timer to send the CLOSE_NETWORK event when the permitJoinAll
+ timeout is expired (the gal doesn't provide such specific callback).
+ - Added console commands: usenvm and getusenvm to set and retrieve the status
+ of the nvm usage flag.
+ - Disabled lqi discovery
+
+
+
+Bundle version 2.1.6:
+ - Added integration with event admin service to generate ah/zigbee/OPEN_NETWORK and
+ CLOSE_NETWORK events
+
+Bundle version 2.1.4:
+ New Features:
+ - Compatible with both jGal 1.1.x and 1.2.x versions
+
+ Changes:
+ - If jGal 1.2.x and gal 4.2.x are detected the lqi discovery is not launched
+
+ Bundle version 2.1.1:
+
+ Dependences:
+ - Requires bundle it.telecomitalia.ah.hac version [2.2.0, 2.3.0)
+ - Requires package it.telecomitalia.osgi.zgd version [1.1.0, 1.2.0)
+
+ Changes:
+ - Changed localEndpoint to 1 for Electrolux (They have hardcoded 1 in their appliance)
+ - Reduced retryCount from 5 to 4.
+ - Added compatibility mode Clusters for Electrolux (old E at H cluster ids)
+
+ Bugfix:
+
+ - Fixed some problems on the management of shared attributes subscriptions
+ (ZclServiceCluster class)
+ - Fixed data types in attributes of SimpleMetering4Noks server cluster.
+ - Subscriptions not working properly with Clusters different from
+ SimpleMeteringServer
+ - Problems reading some attributes of the ApplianceIdentificationServer Cluster
+ like the ProductType.
+ - The local endpoint was 8. Replacing with localEndpoint
+ - Completely revised the discovery procedure that is now more reliable.
+
+ New Features:
+
+ - Backported to OSGi Minimum 1.2
+ - Zcl Clusters source files generated with Zcl Cluster Generator v2.0.5
+ - Added cache support in cluster's getter and setters
+ - In attribute read and and configure reportings handles correctly
+ the passed context regarding the Confirmation Required flag.
+ - Added new exception class inheriting from class ServiceClusterException
+ - 4Noks Smart Plugs are now integrated.
+ - Using jGal lqi discovery support
+ - Using jGal freshness support
+ - Cleaned a lot the Client and Server cluster implementation by removing
+ the zclAttach() and zclDetach() callbacks (now in ServiceCluster) and
+ by removing unnecessary code.
+ - Managing installation progress of new discovered devices. The installation
+ process goes trough several step: Node discovery, Active EPs discovery,
+ Services discovery. If one of these steps fails the device is not
+ created at all. One device at a time is installed.
+ - Integrated with Configuration Admin service through Declarative Services
+ and MetaType services (this bundle is configurable from the Web Admin Console
+ - Added an Equinox command provider.
+ - Read Node descriptor and manifacturer code.
+ - Refined some debug messages (aps messages)
+ - Added Thermostat and RelativeHumidity Clusters
+ - Added support for Zanussi and 4 Noks Thermostat devices (as result of the 30 May 2011 plugfest in Turin).
+ - Added IAS Zone and Power Configuration clusters
+ - If the driver is under installation it replies with a default response with TIMEOUT error
+ - The same as before for driver not found.
+
+Bundle version 1.0.3:
+
+ New Features:
+
+ - Integrated with the new ZigBee Gateway Device (formerly GAL).
+
+Bundle version 1.0.2:
+
+ New Features:
+
+ - In case of mBS Equinox Edition the xml files describing the HA profile
+ are extracted from the bundle and stored in the bundle's data
+ storage. This is a workaround to a possible bug of the XInclude
+ implementation provided with this OSGi implementation.
+
+Bundle version 1.0.1:
+
+ New Features:
+
+ - Added the Simple Metering cluster specification in zcl.xml. The cluster
+ definition is limited to those attributes that are actually used by
+ the White Goods profile specified by Indesit.
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/mybuild.xml
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/mybuild.xml (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/mybuild.xml Mon Oct 22 13:55:46 2012
@@ -1,0 +1,25 @@
+<?xml version="1.0"?>
+<project name="usbdevice" default="all">
+ <target name="all" depends="init,compile,jar"/>
+ <target name="init">
+ <mkdir dir="./build"/>
+ </target>
+ <target name="compile">
+ <javac destdir = "./bin"
+ debug = "on"
+ srcdir = "./src">
+ </javac>
+ </target>
+ <target name="jar">
+ <jar basedir = "./bin"
+ jarfile = "./build/org.telecomitalia.zigbee_1.0.2.jar"
+ compress = "true"
+ includes = "**/*"
+ manifest = "./meta-inf/MANIFEST.MF">
+
+ <fileset dir="." includes="**/OSGI-INF/*" />
+ <fileset dir="." includes="**/xml/**" />
+ </jar>
+
+ </target>
+</project>
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/internal/zigbee/Hex.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/internal/zigbee/Hex.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/internal/zigbee/Hex.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,40 @@
+package it.telecomitalia.ah.internal.zigbee;
+
+public class Hex {
+ public static String byteToHex(byte[] data, int i) {
+ if (data == null) {
+ return "";
+ }
+
+ StringBuffer buf = new StringBuffer();
+ for (; i < data.length; i++) {
+ buf.append(toHexChar((data[i] >>> 4) & 0x0F));
+ buf.append(toHexChar(data[i] & 0x0F));
+ }
+ return buf.toString();
+ }
+
+ public static String byteToHex(byte[] data) {
+ return byteToHex(data, 0);
+ }
+
+ public static char toHexChar(long i) {
+ if ((0 <= i) && (i <= 9)) {
+ return (char) ('0' + i);
+ } else {
+ return (char) ('A' + (i - 10));
+ }
+ }
+
+ public static String toHexString(long value, int size) {
+ StringBuffer buf = new StringBuffer();
+ long data = (long) (value);
+ for (int i = 0; i < size; i++) {
+ buf.insert(0, toHexChar(data & 0x0F));
+ buf.insert(0, toHexChar((data >>> 4) & 0x0F));
+ data >>>= 8;
+ }
+
+ return buf.toString();
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/internal/zigbee/OSGiProperties.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/internal/zigbee/OSGiProperties.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/internal/zigbee/OSGiProperties.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,50 @@
+package it.telecomitalia.ah.internal.zigbee;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class OSGiProperties {
+ private Map defaults = new HashMap();
+
+ public void setProperty(String name, int value) {
+ this.defaults.put(name, new Integer(value));
+ }
+
+ public void setProperty(String name, boolean value) {
+ this.defaults.put(name, new Boolean(value));
+ }
+
+ public void setProperty(String name, String value) {
+ this.defaults.put(name, value);
+ }
+
+ public int getIntProperty(String name) {
+ String prop = System.getProperty(name);
+ if (prop != null) {
+ try {
+ return Integer.valueOf(prop).intValue();
+ } catch (Exception e) {
+ }
+ }
+ return ((Integer) defaults.get(name)).intValue();
+ }
+
+ public String getProperty(String name) {
+ String prop = System.getProperty(name);
+ if (prop != null) {
+ return prop;
+ }
+ return (String) defaults.get(name);
+ }
+
+ public boolean getBooleanProperty(String name) {
+ String prop = System.getProperty(name);
+ if (prop != null) {
+ try {
+ return Boolean.valueOf(prop).booleanValue();
+ } catch (Exception e) {
+ }
+ }
+ return ((Boolean) defaults.get(name)).booleanValue();
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/internal/zigbee/Utils.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/internal/zigbee/Utils.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/internal/zigbee/Utils.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,7 @@
+package it.telecomitalia.ah.internal.zigbee;
+
+public class Utils {
+
+ public static final String padding[] = { "0000000000000000", "000000000000000", "00000000000000", "0000000000000", "000000000000",
+ "00000000000", "0000000000", "000000000", "00000000", "0000000", "000000", "00000", "0000", "000", "00", "0", "" };
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/internal/zigbee/ZclAttributeDescriptor.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/internal/zigbee/ZclAttributeDescriptor.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/internal/zigbee/ZclAttributeDescriptor.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,52 @@
+package it.telecomitalia.ah.internal.zigbee;
+
+import it.telecomitalia.ah.zigbee.zcl.IZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclAbstractDataType;
+
+public class ZclAttributeDescriptor implements IZclAttributeDescriptor {
+
+ private Class javaClass = null;
+ private String name = null;
+ private ZclAbstractDataType zclAbstractDataType = null;
+ private int attrId;
+ private boolean isReportable = false;
+ private int accessType;
+ private int size;
+
+ public ZclAttributeDescriptor(int attrId, String name, ZclAbstractDataType zclAbstractDataType, Class javaClass, boolean isReportable, int accessType) {
+ this.attrId = attrId;
+ this.name = name;
+ this.zclAbstractDataType = zclAbstractDataType;
+ this.javaClass = javaClass;
+ this.isReportable = isReportable;
+ this.accessType = accessType;
+ this.size = 0;
+ }
+
+ public Class getJavaClass() {
+ return javaClass;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public ZclAbstractDataType zclGetDataType() {
+ return zclAbstractDataType;
+ }
+
+ public int zclGetId() {
+ return attrId;
+ }
+ public boolean isWritable() {
+ return ((accessType == IZclAttributeDescriptor.ACCESS_RW) || (accessType == IZclAttributeDescriptor.ACCESS_RO));
+ }
+
+ public int accessMode() {
+ return this.accessType;
+ }
+
+ public boolean isReportable() {
+ return isReportable;
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/internal/zigbee/ZigBeeCommandProvider.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/internal/zigbee/ZigBeeCommandProvider.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/internal/zigbee/ZigBeeCommandProvider.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,180 @@
+package it.telecomitalia.ah.internal.zigbee;
+
+import it.telecomitalia.ah.zigbee.ZigBeeDevice;
+import it.telecomitalia.ah.zigbee.ZigBeeMngrService;
+
+import java.lang.reflect.Method;
+import java.util.Collection;
+import java.util.Dictionary;
+import java.util.Iterator;
+import java.util.Vector;
+
+import org.eclipse.osgi.framework.console.CommandInterpreter;
+import org.eclipse.osgi.framework.console.CommandProvider;
+
+public class ZigBeeCommandProvider implements CommandProvider {
+
+ ZigBeeMngrService zbMngr = null;
+
+ public void setZigBeeMngrService(ZigBeeMngrService s) {
+ synchronized (this) {
+ this.zbMngr = s;
+ }
+ }
+
+ public void unsetZigBeeMngrService(ZigBeeMngrService s) {
+ synchronized (this) {
+ if (this.zbMngr == s) {
+ this.zbMngr = null;
+ }
+ }
+ }
+
+ public void _permitjoin(CommandInterpreter ci) {
+ if (!this.checkZbMngrService(ci))
+ return;
+
+ String durationStr = ci.nextArgument();
+
+ short duration = 0;
+
+ if (durationStr != null) {
+ duration = Short.parseShort(durationStr);
+ }
+
+ try {
+ ((ZigBeeManagerImpl) this.zbMngr).permitJoin(duration);
+ } catch (Exception e) {
+ System.out.println("Error in permt join: " + e.getMessage());
+ }
+ }
+
+ public void _config(CommandInterpreter ci) {
+ synchronized (this) {
+ if (!this.checkZbMngrService(ci))
+ return;
+
+ try {
+ Dictionary config = ((ZigBeeManagerImpl) this.zbMngr).getConfiguration();
+ ci.printDictionary(config, "Configuration");
+ } catch (Exception e) {
+ System.out.println("Error in permt join: " + e.getMessage());
+ }
+ }
+ }
+
+ public void _usenvm(CommandInterpreter ci) {
+ synchronized (this) {
+ if (!this.checkZbMngrService(ci))
+ return;
+
+ String useNVM_str = ci.nextArgument();
+
+ try {
+ ((ZigBeeManagerImpl) this.zbMngr).setUseNVM(Boolean.parseBoolean(useNVM_str));
+ } catch (Exception e) {
+ ci.println(this.getHelp());
+ }
+ }
+ }
+
+ public void _getusenvm(CommandInterpreter ci) {
+ synchronized (this) {
+ if (!this.checkZbMngrService(ci))
+ return;
+
+ try {
+ ci.println("usenvm is currently " + ((ZigBeeManagerImpl) this.zbMngr).getUseNVM());
+ } catch (Exception e) {
+ ci.println(this.getHelp());
+ }
+ }
+ }
+
+ public void _lsdevs(CommandInterpreter ci) {
+ synchronized (this) {
+ if (!this.checkZbMngrService(ci))
+ return;
+
+ try {
+ Collection nodes = ((ZigBeeManagerImpl) this.zbMngr).getNodes();
+ for (Iterator iterator = nodes.iterator(); iterator.hasNext();) {
+ Vector devices = (Vector) iterator.next();
+ for (int i = 0; i < devices.size(); i++) {
+ ZigBeeDevice zbDevice = (ZigBeeDevice) devices.get(i);
+ ci.println(this.printDevice(zbDevice));
+ }
+ }
+ } catch (Exception e) {
+ System.out.println("Error in permt join: " + e.getMessage());
+ }
+ }
+ }
+
+ private String printDevice(ZigBeeDevice zbDevice) {
+ String out = "";
+
+ out += "ieee address = " + zbDevice.getIeeeAddress() + ", ep = " + zbDevice.getServiceDescriptor().getEndPoint();
+ out += ", profileid = " + zbDevice.getServiceDescriptor().getSimpleDescriptor().getApplicationProfileIdentifier();
+ out += ", deviceid = " + zbDevice.getServiceDescriptor().getSimpleDescriptor().getApplicationDeviceIdentifier();
+ return out;
+ }
+
+ public void _status(CommandInterpreter ci) {
+ synchronized (this) {
+ if (!this.checkZbMngrService(ci))
+ return;
+
+ try {
+ boolean isGalRunning = ((ZigBeeManagerImpl) this.zbMngr).isGalRunning();
+ ci.print("" + isGalRunning);
+
+ } catch (Exception e) {
+ System.out.println("Error in permt join: " + e.getMessage());
+ }
+ }
+ }
+
+ public String getHelp() {
+ String help = "---ZigBee---\n";
+ help += "\tzb permitjoin [<timeout>] - open the ZigBee network. <timeout> (ms) permits to specify how long. Infinite othewise.\n";
+ help += "\t\tIf <timeout> is zero, the join is cosed\n";
+ help += "\tzb usenvm true | false - enable/disable the usage of NVM next time the gal is launced\n";
+ help += "\tzb getusenvm - gets the current status of the nvm usage\n";
+ help += "\tzb status - true if zgd is running, false otherwise\n";
+ help += "\tzb config - print the current service configuration (configadmin)\n";
+ help += "\tzb lsdevs - list currently discovered devices\n";
+ return help;
+ }
+
+ public void _zb(CommandInterpreter ci) {
+ if (!checkZbMngrService(ci))
+ return;
+
+ String command = ci.nextArgument();
+ Method method = null;
+
+ try {
+ method = this.getClass().getMethod("_" + command, new Class[] { CommandInterpreter.class });
+ } catch (SecurityException e) {
+ return;
+ } catch (NoSuchMethodException e) {
+ return;
+ }
+
+ try {
+ method.invoke(this, new Object[] { ci });
+ } catch (Exception e) {
+ return;
+ }
+ }
+
+ private boolean checkZbMngrService(CommandInterpreter ci) {
+ if (this.zbMngr == null) {
+ ci.print("ZigBee Network Manager Service not running");
+ return false;
+ }
+
+ return true;
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/internal/zigbee/ZigBeeDeviceImpl.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/internal/zigbee/ZigBeeDeviceImpl.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/internal/zigbee/ZigBeeDeviceImpl.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,528 @@
+package it.telecomitalia.ah.internal.zigbee;
+
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZigBeeDevice;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.ZigBeeException;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.cluster.general.ZclPartitionServer;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.zgd.jaxb.NodeDescriptor;
+import it.telecomitalia.zgd.jaxb.NodeServices;
+import it.telecomitalia.zgd.jaxb.ServiceDescriptor;
+
+import java.util.Hashtable;
+import java.util.Vector;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.eclipse.equinox.internal.util.timer.Timer;
+import org.eclipse.equinox.internal.util.timer.TimerListener;
+import org.osgi.framework.ServiceReference;
+
+import edu.emory.mathcs.backport.java.util.concurrent.SynchronousQueue;
+import edu.emory.mathcs.backport.java.util.concurrent.TimeUnit;
+import edu.emory.mathcs.backport.java.util.concurrent.locks.Lock;
+import edu.emory.mathcs.backport.java.util.concurrent.locks.ReentrantLock;
+
+/**
+ * The ZigBeeDeviceImpl class implements the ZigBeeDevice interface. The purpose
+ * of this class is to implement the following features:
+ * <ul>
+ * <li>Automatic ping of the ZigBee device in order to verify if it is still
+ * turned on or off. This is accolplished by doing the following things:
+ * <ul>
+ * <li>It keeps track of the successful configureReporting sent to the device.
+ * Because the ZigBeeDeviceImpl instance is knows the timing it can start a
+ * still-alive timer accordingly.</li>
+ * <li>Each time a message arrives from the hw device this timer is restarted.</li>
+ * <li>If no attribute reporting has been called by the driver, the ZigBeeDevice
+ * polls the hw device after a certain amount of time. This time should be
+ * greater than the poll time of the device, if the device is a sleeping device.
+ * </li>
+ * </ul>
+ * </ul>
+ */
+
+public class ZigBeeDeviceImpl implements ZigBeeDevice, TimerListener {
+
+ public static final int Disconnected = 0;
+ public static final int Connected = 1;
+
+ private ServiceDescriptor service;
+ private int availState = Disconnected;
+
+ int timeout = 3; // timeout
+
+ private final int KeepAliveTimer = 0;
+ private final int PingTimeoutTimer = 1;
+
+ private int keepAliveTimeout = 60; // 1 minute
+
+ private ZigBeeDeviceListener listener = null;
+ private int consecutiveFailures = 0;
+ private int maxFailuresBeforeDeadState = 3;
+
+ byte seq = 30;
+
+ private Timer timer;
+
+ boolean warnings = false;
+
+ private Hashtable pendingReplies = new Hashtable();
+ private Hashtable listenersListClientSide = new Hashtable();
+ private Hashtable listenersListServerSide = new Hashtable();
+
+ private Lock messagesLock = new ReentrantLock();
+ private Object lock = new Object();
+
+ protected Log log = LogFactory.getLog(this.getClass());
+ private ZigBeeDeviceListener driver;
+ private ZigBeeManagerImpl zigbeeManager;
+ private NodeDescriptor node = null;
+ private NodeServices nodeServices;
+
+ public ZigBeeDeviceImpl(ZigBeeManagerImpl zigbeeManager, Timer timer, ServiceDescriptor service) {
+ this.zigbeeManager = zigbeeManager;
+ this.timer = timer;
+ this.service = service;
+ }
+
+ public ZigBeeDeviceImpl(ZigBeeManagerImpl zigbeeManager, Timer timer, NodeServices nodeServices, NodeDescriptor node, ServiceDescriptor service) {
+ this.zigbeeManager = zigbeeManager;
+ this.timer = timer;
+ this.service = service;
+ this.node = node;
+ this.nodeServices = nodeServices;
+ }
+
+ /**
+ * Called by the Device Admin service to attach the device
+ *
+ * @param driverRef
+ */
+
+ public void attach(ServiceReference driverRef) {
+ synchronized (lock) {
+ this.driver = zigbeeManager.getService(driverRef);
+ zigbeeManager.attach(this);
+ }
+ }
+
+ public void detach() {
+ synchronized (lock) {
+ driver = null;
+ }
+ }
+
+ public void noDriverFound() {
+ synchronized (lock) {
+ zigbeeManager.noDriverFound(this);
+ }
+ }
+
+ String padding[] = { "0000000000000000", "000000000000000", "00000000000000", "0000000000000", "000000000000", "00000000000",
+ "0000000000", "000000000", "00000000", "0000000", "000000", "00000", "0000", "000", "00", "0", "" };
+ private boolean trackNode;
+
+ public String getIeeeAddress() {
+ String ieee = service.getAddress().getIeeeAddress().toString(16).toUpperCase();
+ ieee = padding[ieee.length()] + ieee;
+ return ieee;
+ }
+
+ protected short getEp() {
+ return this.service.getEndPoint();
+ }
+
+ public ServiceDescriptor getServiceDescriptor() {
+ return service;
+ }
+
+ public NodeDescriptor getNodeDescriptor() {
+ return node;
+ }
+
+ public NodeServices getNodeServices() {
+ return nodeServices;
+ }
+
+ public String getPid() {
+ return getIeeeAddress();
+ }
+
+ public IZclFrame invoke(short clusterId, IZclFrame zclFrame) throws ZigBeeException {
+ return invoke((short) this.service.getSimpleDescriptor().getApplicationProfileIdentifier().intValue(), clusterId, zclFrame);
+ }
+
+ public IZclFrame invoke(short profileId, short clusterId, IZclFrame zclFrame) throws ZigBeeException {
+ // check if the message contains requires a default answer
+
+ long hash = calculateTxRxHash(clusterId, zclFrame);
+
+ SynchronousQueue sq = new SynchronousQueue();
+
+ messagesLock.lock();
+ pendingReplies.put(new Long(hash), sq);
+ messagesLock.unlock();
+
+ if (log.isDebugEnabled())
+ this.logZclMessage(true, hash, profileId, clusterId, zclFrame);
+
+ synchronized (lock) {
+ // TODO: do we need to synchronize here?
+ boolean res = zigbeeManager.post(this, profileId, clusterId, zclFrame);
+ if (!res)
+ throw new ZigBeeException("error sending message to ZigBee device");
+ }
+ try {
+ // here it should block till the matching response is received
+ // or a timeout has occurred.
+
+ timeout = 4;
+
+ if (clusterId == 2819)
+ timeout = 100;
+
+ IZclFrame zclResponseFrame = (IZclFrame) sq.poll(timeout, TimeUnit.SECONDS);
+ if (zclResponseFrame == null) {
+ this.logZclMessage(false, hash, profileId, clusterId, null);
+
+ if (trackNode) {
+ synchronized (lock) {
+ this.transmissionFailed();
+ }
+ }
+ messagesLock.lock();
+ pendingReplies.remove(new Long(hash));
+ messagesLock.unlock();
+ throw new ZigBeeException("timeout");
+ }
+
+ if (log.isDebugEnabled())
+ this.logZclMessage(false, hash, profileId, clusterId, zclFrame);
+
+ return zclResponseFrame;
+ } catch (InterruptedException e) {
+ throw new ZigBeeException("interrupted system call during post");
+ }
+
+ }
+
+ private void logZclMessage(boolean outgoing, long hash, short profileId, short clusterId, IZclFrame zclFrame) {
+ if (zclFrame != null) {
+ if (outgoing) {
+ if (hash != -1)
+ log.debug(this.getPid() + ": " + Hex.toHexString(hash, 4) + " [hash]: Tx > 0x" + Hex.toHexString(clusterId, 2)
+ + " [clusterId] " + zclFrame.toString());
+ else
+ log.debug(this.getPid() + ": " + " " + " [hash]: Tx > 0x" + Hex.toHexString(clusterId, 2)
+ + " [clusterId] " + zclFrame.toString());
+ }
+ else
+ log.debug(this.getPid() + ": " + Hex.toHexString(hash, 4) + " [hash]: Rx > 0x" + Hex.toHexString(clusterId, 2)
+ + " [clusterId] " + zclFrame.toString());
+ } else {
+ log.debug(this.getPid() + ": " + Hex.toHexString(hash, 4) + " [hash]: Rx > timeout in poll");
+ }
+ }
+
+ /**
+ * Handles messages received for this device from the ZigBee Manager
+ *
+ * @return true, if the message has been handled TODO: throw an exception in
+ * case of errors in the incoming message
+ */
+
+ public boolean notifyZclFrame(short clusterId, IZclFrame zclFrame) {
+
+ long hash = calculateTxRxHash(clusterId, zclFrame);
+
+ if (log.isDebugEnabled())
+ this.logZclMessage(false, hash,
+ (short) this.service.getSimpleDescriptor().getApplicationProfileIdentifier().intValue(), clusterId, zclFrame);
+
+ if (trackNode) {
+ deviceAlive();
+ }
+
+ if (isPartitioningCluster(clusterId)) {
+ // the incoming frame is directed to the Partitioning Cluster
+ // TODO: checks if client to server o server to client
+
+ if (zclFrame.isClientToServer()) {
+ // this is a message sent from the PartitioningClient to the Partitioning Server clusters
+ if (this.partitionFsmServer != null) {
+ try {
+ boolean handled = this.partitionFsmServer.notifyZclFrame(clusterId, zclFrame);
+ if (handled)
+ return handled;
+ } catch (Exception e) {
+ log.error("Exception in calling partition frame notifyZclFrame", e);
+ }
+ }
+ }
+ }
+
+ messagesLock.lock();
+ SynchronousQueue sq = (SynchronousQueue) pendingReplies.remove(new Long(hash));
+ messagesLock.unlock();
+
+ if (sq == null) {
+ // simply send the message up
+ try {
+ notifyListeners(clusterId, zclFrame);
+ } catch (ZclValidationException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ } else {
+ try {
+ sq.put(zclFrame);
+ } catch (InterruptedException e) {
+ if (log.isErrorEnabled())
+ log.error("exception", e);
+
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ private void notifyListeners(short clusterId, IZclFrame zclFrame) throws ZclValidationException {
+ log.debug("notify listeners for cluster " + clusterId);
+ Vector listeners = null;
+
+ if (zclFrame.isClientToServer()) {
+ listeners = (Vector) listenersListClientSide.get(new Short(clusterId));
+ }
+ else {
+ listeners = (Vector) listenersListServerSide.get(new Short(clusterId));
+ }
+
+ if (listeners != null) {
+ if (listeners.size() == 0) {
+ log.debug("no listeners set");
+ return;
+ }
+ for (int i = 0; i < listeners.size(); i++) {
+ ZigBeeDeviceListener listener = (ZigBeeDeviceListener) listeners.get(i);
+ boolean handled = false;
+ try {
+ handled = listener.notifyZclFrame(clusterId, zclFrame);
+ } catch (Exception e) {
+ // FIXME reply with an error sent to the peer device
+ log.error("Exception while notifyZclFrame to clusterId " + clusterId, e);
+ }
+ // TODO if the message has not been handled send back a response
+ // with an error code
+ }
+ } else {
+ log.debug("no listeners set");
+ }
+ }
+
+ private void notifyListeners(int event) {
+ if (this.listener != null)
+ this.listener.notifyEvent(event);
+ }
+
+ public boolean post(short clusterId, IZclFrame zclFrame) {
+ return this.post((short) this.service.getSimpleDescriptor().getApplicationProfileIdentifier().intValue(), clusterId,
+ zclFrame);
+ }
+
+ public boolean post(short profileId, short clusterId, IZclFrame zclFrame) {
+
+ if (log.isDebugEnabled())
+ this.logZclMessage(true, -1, profileId, clusterId, zclFrame);
+ //log.debug(this.getPid() + ": Sync T > 0x" + Hex.toHexString(clusterId, 2) + "(clusterId) " + zclFrame.toString());
+
+ synchronized (lock) {
+ return zigbeeManager.post(this, profileId, clusterId, zclFrame);
+ }
+ }
+
+ public boolean isConnected() {
+ synchronized (lock) {
+ return (availState == Connected);
+ }
+ }
+
+ private void deviceAlive() {
+ timerStart(KeepAliveTimer, keepAliveTimeout);
+ this.consecutiveFailures = 0;
+ updateAvailableState(Connected);
+ }
+
+ private void deviceNotResponding() {
+ this.notifyListeners(ZigBeeDeviceListener.LEAVE);
+ }
+
+ private void timerStart(int event, int timePeriod) {
+ Timer time = (Timer) this.getTimer();
+ time.notifyAfter(this, timePeriod, event);
+ }
+
+ private Timer getTimer() {
+ return timer;
+ }
+
+ public void timer(int event) {
+ switch (event) {
+ case KeepAliveTimer:
+ break;
+
+ case PingTimeoutTimer:
+ synchronized (lock) {
+ this.transmissionFailed();
+ }
+ break;
+ }
+ }
+
+ private void updateAvailableState(int newState) {
+ if (availState != newState) {
+ availState = newState;
+ zigbeeManager.availStateUpdated(this, availState);
+ }
+ }
+
+ private void transmissionFailed() {
+ this.consecutiveFailures++;
+ if (this.consecutiveFailures > maxFailuresBeforeDeadState) {
+ this.consecutiveFailures = 0;
+ this.deviceNotResponding();
+ }
+ }
+
+ private long calculateTxRxHash(short clusterId, IZclFrame zclFrame) {
+ long hash = clusterId;
+ hash = hash << 8;
+ return zclFrame.getSequenceNumber() & 0xFF | hash;
+ }
+
+ protected void announce() {
+ synchronized (lock) {
+ deviceAlive();
+ log.debug("received an announcement on device " + getIeeeAddress());
+ this.notifyListeners(ZigBeeDeviceListener.ANNOUNCEMENT);
+ }
+ }
+
+ public boolean setListener(short clusterId, int side, ZigBeeDeviceListener listener) {
+ synchronized (lock) {
+ Hashtable listenersList = null;
+ if (side == ZclServiceCluster.CLIENT_SIDE) {
+ listenersList = listenersListClientSide;
+ }
+ else if (side == ZclServiceCluster.SERVER_SIDE) {
+ listenersList = listenersListServerSide;
+ } else {
+ return false;
+ }
+
+ Vector listeners = (Vector) listenersList.get(new Short(clusterId));
+ if (listeners == null) {
+ listeners = new Vector();
+ listenersList.put(new Short(clusterId), listeners);
+ }
+
+ listeners.add(listener);
+ return true;
+ }
+ }
+
+ protected Vector getListeners(short clusterId) {
+ synchronized (lock) {
+ Vector listeners = (Vector) listenersListClientSide.get(new Short(clusterId));
+ return listeners;
+ }
+ }
+
+ public boolean removeListener(short clusterId, int side, ZigBeeDeviceListener listener) {
+ synchronized (lock) {
+ Hashtable listenersList = null;
+ if (side == ZclServiceCluster.CLIENT_SIDE) {
+ listenersList = listenersListClientSide;
+ }
+ else if (side == ZclServiceCluster.SERVER_SIDE) {
+ listenersList = listenersListServerSide;
+ } else {
+ return false;
+ }
+
+ Vector listeners = (Vector) listenersList.get(new Short(clusterId));
+ if (listeners != null) {
+ return listeners.remove(listener);
+ }
+ return false;
+ }
+ }
+
+ public boolean setListener(ZigBeeDeviceListener listener) {
+ synchronized (lock) {
+ if (this.listener != null)
+ log.fatal("error. Another listener already set!");
+
+ this.listener = listener;
+ return true;
+ }
+ }
+
+ public boolean removeListener(ZigBeeDeviceListener listener) {
+ synchronized (lock) {
+ if (this.listener == listener) {
+ this.listener = null;
+ return true;
+ } else {
+ log.fatal("error. Removing a listener never set!");
+ }
+
+ return false;
+ }
+ }
+
+ public void remove() {
+ synchronized (lock) {
+ try {
+ this.zigbeeManager.remove(this);
+ } catch (Exception e) {
+ log.error("", e);
+ }
+ }
+ }
+
+ ZclPartitionServer partitionFsmServer = null;
+
+ public boolean enablePartitionServer(short clusterId, short commandId) {
+ if (partitionFsmServer == null) {
+ try {
+ partitionFsmServer = new ZclPartitionServer((ZigBeeDevice) this);
+ partitionFsmServer.zclAttach(this);
+
+ } catch (ApplianceException e) {
+ log.debug("Error creating ZclPartitionFsmServer", e);
+ return false;
+ }
+ }
+ return partitionFsmServer.enablePartitioning(clusterId, commandId);
+ }
+
+ public boolean disablePartitionServer(short clusterId, short commandId) {
+ if (partitionFsmServer == null)
+ return false;
+ return partitionFsmServer.disablePartitioning(clusterId, commandId);
+ }
+
+ protected boolean isPartitioningCluster(short clusterId) {
+ return (clusterId == 0x0016);
+ }
+
+ public void injectZclFrame(short clusterId, IZclFrame zclFrame) {
+ this.notifyZclFrame(clusterId, zclFrame);
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/internal/zigbee/ZigBeeManagerImpl.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/internal/zigbee/ZigBeeManagerImpl.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/internal/zigbee/ZigBeeManagerImpl.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,1982 @@
+package it.telecomitalia.ah.internal.zigbee;
+
+import it.telecomitalia.ah.cluster.zigbee.general.IdentifyQueryResponse;
+import it.telecomitalia.ah.hac.lib.ext.INetworkManager;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZCL;
+import it.telecomitalia.ah.zigbee.ZclFrame;
+import it.telecomitalia.ah.zigbee.ZigBeeDevice;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.ZigBeeMngrService;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.cluster.eh.ZclApplianceControlClient;
+import it.telecomitalia.ah.zigbee.zcl.cluster.eh.ZclPowerProfileClient;
+import it.telecomitalia.ah.zigbee.zcl.cluster.general.ZclBasicClient;
+import it.telecomitalia.ah.zigbee.zcl.cluster.general.ZclBasicServer;
+import it.telecomitalia.ah.zigbee.zcl.cluster.general.ZclIdentifyClient;
+import it.telecomitalia.ah.zigbee.zcl.cluster.general.ZclIdentifyQueryResponse;
+import it.telecomitalia.ah.zigbee.zcl.cluster.general.ZclIdentifyServer;
+import it.telecomitalia.ah.zigbee.zcl.cluster.general.ZclOnOffClient;
+import it.telecomitalia.ah.zigbee.zcl.cluster.general.ZclOnOffServer;
+import it.telecomitalia.ah.zigbee.zcl.cluster.general.ZclPartitionServer;
+import it.telecomitalia.ah.zigbee.zcl.cluster.general.ZclTimeServer;
+import it.telecomitalia.ah.zigbee.zcl.cluster.measurement.ZclIlluminanceMeasurementClient;
+import it.telecomitalia.ah.zigbee.zcl.cluster.measurement.ZclOccupancySensingClient;
+import it.telecomitalia.ah.zigbee.zcl.cluster.measurement.ZclTemperatureMeasurementClient;
+import it.telecomitalia.ah.zigbee.zcl.cluster.metering.ZclSimpleMeteringClient;
+import it.telecomitalia.ah.zigbee.zcl.cluster.metering.ZclSimpleMeteringServer;
+import it.telecomitalia.ah.zigbee.zcl.cluster.security.ZclIASZoneClient;
+import it.telecomitalia.zgd.APSMessageListener;
+import it.telecomitalia.zgd.GatewayConstants;
+import it.telecomitalia.zgd.GatewayEventListener;
+import it.telecomitalia.zgd.GatewayException;
+import it.telecomitalia.zgd.GatewayInterface;
+import it.telecomitalia.zgd.jaxb.APSMessage;
+import it.telecomitalia.zgd.jaxb.APSMessageEvent;
+import it.telecomitalia.zgd.jaxb.Address;
+import it.telecomitalia.zgd.jaxb.BindingList;
+import it.telecomitalia.zgd.jaxb.NodeDescriptor;
+import it.telecomitalia.zgd.jaxb.NodeServices;
+import it.telecomitalia.zgd.jaxb.NodeServices.ActiveEndpoints;
+import it.telecomitalia.zgd.jaxb.ServiceDescriptor;
+import it.telecomitalia.zgd.jaxb.SimpleDescriptor;
+import it.telecomitalia.zgd.jaxb.Status;
+import it.telecomitalia.zgd.jaxb.TxOptions;
+import it.telecomitalia.zgd.jaxb.WSNNode;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.net.URL;
+import java.util.Collection;
+import java.util.ConcurrentModificationException;
+import java.util.Dictionary;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Properties;
+import java.util.Set;
+import java.util.Vector;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.eclipse.equinox.internal.util.timer.Timer;
+import org.eclipse.equinox.internal.util.timer.TimerListener;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.ServiceRegistration;
+import org.osgi.service.component.ComponentContext;
+import org.osgi.service.event.Event;
+import org.osgi.service.event.EventAdmin;
+import org.osgi.service.prefs.BackingStoreException;
+import org.osgi.service.prefs.Preferences;
+import org.osgi.service.prefs.PreferencesService;
+
+import edu.emory.mathcs.backport.java.util.concurrent.locks.ReentrantReadWriteLock;
+
+class InstallationStatus {
+ public static final int ANNOUNCEMENT_RECEIVED = 1;
+ public static final int WAITING_FOR_SERVICES = 2;
+ public static final int ACTIVE_ENDPOINTS_RETRIEVED = 3;
+ public static final int WAITING_FOR_SERVICE_DESCRIPTOR = 4;
+ public static final int WAITING_FOR_NODE_DESCRIPTOR = 5;
+ public static final int INSTALLED = 6;
+ public static final int SERVICE_DESCRIPTOR_RETRIEVED = 7;
+
+ private int status = 0;
+ private Address address;
+ private int retryCounter = 5;
+ private NodeDescriptor nodeDescriptor;
+ private int currentEpIndex = -1;
+ private long time;
+ private HashMap activeEpsMap = new HashMap();
+ private NodeServices services;
+
+ public InstallationStatus(Address a) {
+ this.address = a;
+ }
+
+ public int getStatus() {
+ return status;
+ }
+
+ public Address getAddress() {
+ return this.address;
+ }
+
+ public void setCurrentService(int i) {
+ this.currentEpIndex = i;
+ }
+
+ public int getRetryCounter() {
+ return retryCounter--;
+ }
+
+ public void resetRetryCounter() {
+ retryCounter = 4;
+ }
+
+ public void setStatus(int status) {
+ this.status = status;
+ }
+
+ public void setNodeDescriptor(NodeDescriptor node) {
+ this.nodeDescriptor = node;
+ }
+
+ public void setNodeServices(NodeServices services) {
+ this.services = services;
+ }
+
+ public NodeServices getNodeServices() {
+ return this.services;
+ }
+
+ public int getCurrentService() {
+ return this.currentEpIndex;
+ }
+
+ public NodeDescriptor getNodeDescriptor() {
+ return this.nodeDescriptor;
+ }
+
+ public long getTime() {
+ return time;
+ }
+
+ public void refreshTime() {
+ this.time = System.currentTimeMillis();
+ }
+
+ public ServiceDescriptor getServiceDescriptor(short endPoint) {
+ return (ServiceDescriptor) this.activeEpsMap.get(new Short(endPoint));
+ }
+
+ public void putServiceDescriptor(short endPoint, ServiceDescriptor service) {
+ this.activeEpsMap.put(new Short(endPoint), service);
+ }
+
+ public void addServiceDescriptor(short endPoint, ServiceDescriptor service) {
+ this.activeEpsMap.put(new Short(endPoint), service);
+ }
+
+ public String toString() {
+ return "InstallationStatus [ieee=" + ZigBeeManagerImpl.getIeeeAddressHex(this.getAddress()) + ", status: " + this.status
+ + "]";
+ }
+}
+
+class ActiveEpInstallationStatus {
+ short activeEndPoint;
+ ServiceDescriptor service;
+
+}
+
+public class ZigBeeManagerImpl implements TimerListener, APSMessageListener, GatewayEventListener, ZigBeeMngrService,
+ INetworkManager {
+
+ private Timer timer;
+
+ private Vector zigbeeDevices = new Vector();
+
+ // private Hashtable ieee2service = new Hashtable();
+ private Hashtable ieee2devices = new Hashtable();
+ private Hashtable ieee2sr = new Hashtable();
+
+ /**
+ * Used to track the status of a ZigBee device installation phase. This is a
+ * dictionary indexed on ieee address { String ieeeAddress,
+ * InstallationStatus status }
+ */
+
+ private Hashtable devicesUnderInstallation = new Hashtable();
+ private LinkedList discoveredNodesQueue = new LinkedList();
+ private LinkedList inProcessNode = new LinkedList();
+ private Hashtable installedDevices = new Hashtable();
+
+ private int reconnectToJGalDelay = 5;
+ private int discoveryDelay = 60;
+ private int initialDiscoveryDelay = 40;
+ private boolean enableLqi = false;
+
+ private boolean enableRxTxLogs = true;
+ private boolean enableLockingLogs = false;
+ private boolean enableNotifyFrameLogs = false;
+ private boolean enableDiscoveryLogs = false;
+
+ private static final int JGalReconnectTimer = 2;
+ private static final int discoveryTimer = 3;
+ private static final int permitJoinAllTimer = 4;
+ private static final int galCommandTimer = 5;
+
+ private GatewayInterface gateway;
+
+ // FIXME: currently we use EP 8 because of a problem in the GAL
+ private short localEndpoint = 1;
+ protected long callbackId = -1;
+
+ private long timeout = 7000;
+ private int timeoutOffset = 2;
+
+ int galRunning = 0;
+ // for accessing the data structures
+ private ReentrantReadWriteLock rwLock = new ReentrantReadWriteLock();
+
+ private Object sLock = new Object(); // for DS bind and unbind methods
+ private ComponentContext ctxt;
+
+ private boolean useNVMNetworkSetting = false;
+
+ private PreferencesService preferenceService;
+
+ private boolean handleMultipleEps = true;
+ private boolean fastStartup = false;
+ private boolean usePreferenceService = false;
+
+ private Properties properties;
+
+ private EventAdmin eventAdmin;
+
+ private static final Log log = LogFactory.getLog(ZigBeeManagerImpl.class);
+
+ static final String PROP_ENABLE_LQI = "it.telecomitalia.ah.adapter.zigbee.lqi";
+ static final String PROP_DISCOVERY_DELAY = "it.telecomitalia.ah.adapter.zigbee.discovery.delay";
+ static final String PROP_DISCOVERY_INITIAL_DELAY = "it.telecomitalia.ah.adapter.zigbee.discovery.initialdelay";
+ static final String PROP_ZGD_RECONNECT_DELAY = "it.telecomitalia.ah.adapter.zigbee.reconnect";
+ static final String PROP_TIMEOUTS = "it.telecomitalia.ah.adapter.zigbee.timeouts";
+
+ public static final String propertyFilename = "it.telecomitalia.ah.zigbee.properties";
+
+ private String propertiesFilename = ".";
+
+ static final boolean DEFAULT_ENABLE_LQI = false;
+ static final int DEFAULT_DISCOVERY_DELAY = 0;
+ static final int DEFAULT_DISCOVERY_INITIAL_DELAY = 15;
+ static final int DEFAULT_ZGD_RECONNECT_DELAY = 5;
+ static final int DEFAULT_TIMEOUTS = 7000;
+
+ protected void activate(ComponentContext ctxt, Map props) {
+ rwLock.writeLock().lock();
+ try {
+ this.ctxt = ctxt;
+ log.debug("activated");
+
+ this.propertiesFilename = this.ctxt.getBundleContext().getProperty("osgi.instance.area") + propertyFilename;
+
+ update(props);
+
+ if (this.usePreferenceService) {
+ useNVMNetworkSetting = this.read("useNVMNetworkSetting", false);
+ log.debug("useNVMNetworkSetting at startup is " + useNVMNetworkSetting);
+ } else {
+ handleBundleUpgrade();
+ }
+
+ if (fastStartup) {
+ loadData();
+ }
+
+ if (!isGalRunning()) {
+ this.bindGal();
+ }
+ } finally {
+ rwLock.writeLock().unlock();
+ }
+ }
+
+ private void handleBundleUpgrade() {
+ this.loadProperties();
+ }
+
+ private void update(Map props) {
+ log.debug("received configuration");
+ boolean enableLqi = getProperty(props, PROP_ENABLE_LQI, DEFAULT_ENABLE_LQI);
+ this.discoveryDelay = getProperty(props, PROP_DISCOVERY_DELAY, DEFAULT_DISCOVERY_DELAY);
+ this.initialDiscoveryDelay = getProperty(props, PROP_DISCOVERY_INITIAL_DELAY, DEFAULT_DISCOVERY_INITIAL_DELAY);
+ this.reconnectToJGalDelay = getProperty(props, PROP_ZGD_RECONNECT_DELAY, DEFAULT_ZGD_RECONNECT_DELAY);
+ this.timeout = getProperty(props, PROP_TIMEOUTS, DEFAULT_TIMEOUTS);
+
+ if (this.enableLqi != enableLqi) {
+ if (isGalRunning()) {
+ if (enableLqi) {
+ timerStart(discoveryTimer, initialDiscoveryDelay);
+ } else {
+ timerCancel(discoveryTimer);
+ }
+ }
+
+ log.debug("updated enableLqi to '" + enableLqi + "'");
+ this.enableLqi = enableLqi;
+ }
+ }
+
+ private boolean getProperty(Map props, String name, boolean value) {
+ Object prop = props.get(name);
+ if (prop == null) {
+ return value;
+ }
+ return ((Boolean) prop).booleanValue();
+ }
+
+ private int getProperty(Map props, String name, int value) {
+ Object prop = props.get(name);
+ if (prop == null) {
+ return value;
+ }
+ return ((Integer) prop).intValue();
+ }
+
+ protected void deactivate(ComponentContext ctxt) {
+ rwLock.writeLock().lock();
+ try {
+ log.debug("deactivated");
+ timerCancel(discoveryTimer);
+ timerCancel(JGalReconnectTimer);
+ timerCancel(permitJoinAllTimer);
+ timerCancel(galCommandTimer);
+
+ try {
+ unbindGal();
+ } catch (Exception e) {
+ log.error("error unbinding gal", e);
+ }
+
+ if (fastStartup) {
+ saveData();
+ }
+ } finally {
+ rwLock.writeLock().unlock();
+ }
+ }
+
+ protected void modified(ComponentContext ctxt, Map props) {
+ rwLock.writeLock().lock();
+ try {
+ update(props);
+ } finally {
+ rwLock.writeLock().unlock();
+ }
+ }
+
+ protected void setTimer(Timer timer) {
+ synchronized (sLock) {
+ this.timer = timer;
+ }
+ }
+
+ protected void unsetTimer(Timer timer) {
+ synchronized (sLock) {
+ this.timer = null;
+ }
+ }
+
+ private void timerStart(int event, int timePeriod) {
+ synchronized (sLock) {
+ Timer time = (Timer) getTimer();
+ time.notifyAfter(this, timePeriod, event);
+ }
+ }
+
+ private Timer getTimer() {
+ return timer;
+ }
+
+ protected void setPreferenceService(PreferencesService s) {
+ synchronized (sLock) {
+ this.preferenceService = s;
+ }
+ }
+
+ protected void unsetPreferenceService(PreferencesService s) {
+ synchronized (sLock) {
+ if (this.preferenceService == s) {
+ this.preferenceService = null;
+ }
+ }
+ }
+
+ public void setEventAdmin(EventAdmin eventAdmin) {
+ synchronized (sLock) {
+ this.eventAdmin = eventAdmin;
+ }
+ }
+
+ public synchronized void unsetEventAdmin(EventAdmin eventAdmin) {
+ synchronized (sLock) {
+ if (this.eventAdmin == eventAdmin)
+ this.eventAdmin = null;
+ }
+ }
+
+ private void timerCancel(int event) {
+ synchronized (sLock) {
+ Timer time = (Timer) getTimer();
+ time.removeListener(this, event);
+ }
+ }
+
+ private void printAPSMessageEvent(APSMessageEvent msg) {
+ String s = "";
+ s += getIeeeAddressHex(msg.getSourceAddress()) + ":" + " Thr " + Thread.currentThread().getId() + ": notifyAPSMessage()"
+ + " " + msg.getClusterID() + " ";
+ s += Hex.byteToHex(msg.getData(), 0);
+ log.debug(s);
+ }
+
+ private boolean trackNode;
+
+
+
+ /**
+ * Utility method for retrieving the ieee address from the Address class
+ *
+ * @param address
+ * The Address class instance
+ *
+ * @return A string representing the hex representation (16 Hex digits) of
+ * the IEEE address.
+ */
+
+ public static final String getIeeeAddressHex(Address address) {
+ if (address == null)
+ return null;
+
+ if (address.getIeeeAddress() != null) {
+ String ieee = address.getIeeeAddress().toString(16).toUpperCase();
+ ieee = Utils.padding[ieee.length()] + ieee;
+ return ieee;
+ } else
+ return null;
+ }
+
+ public static final String getNodePid(Address address) {
+
+ if (address == null)
+ return null;
+
+ if (address.getIeeeAddress() != null) {
+ String ieee = address.getIeeeAddress().toString(16).toUpperCase();
+ ieee = Utils.padding[ieee.length()] + ieee;
+ return ieee;
+ } else
+ return null;
+ }
+
+ protected static String getIeeeAddress(Address a) {
+ if (a.getIeeeAddress() != null)
+ return a.getIeeeAddress().toString();
+ else
+ return null;
+ }
+
+ /**
+ * Called when a message has been received from ZigBee
+ */
+ public void notifyAPSMessage(APSMessageEvent msg) {
+ if (enableNotifyFrameLogs)
+ this.printAPSMessageEvent(msg);
+
+ // forward the message to the peer device
+ Address srcAddress = msg.getSourceAddress();
+ String nodePid = getNodePid(srcAddress);
+
+ if (nodePid == null) {
+ log.debug("message discarded because the src node ieee address is not present");
+ return;
+ }
+
+ if ((log != null) && (enableNotifyFrameLogs)) {
+ log.debug(getIeeeAddressHex(srcAddress) + ": Thr " + Thread.currentThread().getId() + ": messageReceived()");
+ }
+
+ if (msg.getDestinationEndpoint() == 0xFF) {
+ handleBroadcastMessages(msg);
+ return;
+ }
+ rwLock.readLock().lock();
+ if (enableLockingLogs) {
+ if (rwLock.getReadLockCount() > 1) {
+ log.debug("Thr: " + Thread.currentThread().getId() + ": There are multiple read lock" + rwLock.getReadLockCount());
+ }
+ }
+
+ this.printAPSMessageEvent(msg);
+
+ try {
+ Vector devices = (Vector) ieee2devices.get(nodePid);
+
+ ZclFrame zclFrame = new ZclFrame(msg.getData());
+
+ if (devices != null) {
+ Iterator it = devices.iterator();
+ boolean epFound = false;
+ while (it.hasNext()) {
+ ZigBeeDeviceImpl device = (ZigBeeDeviceImpl) it.next();
+ if (device.getEp() == msg.getSourceEndpoint()) {
+ if (enableNotifyFrameLogs) {
+ log.debug("notifyZclFrame() : Thr " + Thread.currentThread().getId() + " " + msg.getClusterID()
+ + " message to ep " + device.getEp());
+ }
+ device.notifyZclFrame((short) msg.getClusterID(), new ZclFrame(msg.getData()));
+
+ if (enableNotifyFrameLogs) {
+ log.debug("after notifyZclFrame() : Thr " + Thread.currentThread().getId() + " " + msg.getClusterID()
+ + " message to ep " + device.getEp());
+ }
+ epFound = true;
+
+ break;
+ }
+ }
+ if (!epFound && log.isDebugEnabled())
+ log.error("not found any matching ep for the incoming message");
+
+ } else {
+ IZclFrame zclResponseFrame;
+ InstallationStatus installationStatus = this.getInstallingDevice(srcAddress);
+ if (installationStatus != null) {
+ log.error(getIeeeAddressHex(srcAddress)
+ + ": received a message from a node that is not installed. Reply with TIMEOUT");
+ zclResponseFrame = this.getDefaultResponse(zclFrame, 0x94);
+ } else {
+ log.error("received a message from an unknown node " + getIeeeAddressHex(srcAddress) + " . Reply with TIMEOUT");
+
+ zclResponseFrame = this.getDefaultResponse(zclFrame, 0x94);
+ }
+
+ this.post(msg, zclResponseFrame);
+ }
+ } finally {
+ if (enableLockingLogs) {
+ log.debug("Thr: " + Thread.currentThread().getId() + ": unlocking and read lock count is: "
+ + rwLock.getReadLockCount());
+ }
+ rwLock.readLock().unlock();
+ }
+
+ if (enableNotifyFrameLogs) {
+ log.debug(getIeeeAddressHex(msg.getSourceAddress()) + ": " + " Thr " + Thread.currentThread().getId()
+ + ": leave notifyAPSMessage()");
+ }
+ }
+
+ private IZclFrame getDefaultResponse(IZclFrame zclFrame, int statusCode) {
+ IZclFrame responseZclFrame = zclFrame.createResponseFrame(2);
+ responseZclFrame.setCommandId(ZCL.ZclDefaultRsp);
+ responseZclFrame.appendUInt8(zclFrame.getCommandId());
+ responseZclFrame.setFrameType(IZclFrame.GENERAL_COMMAND);
+ responseZclFrame.appendUInt8(statusCode);
+ return responseZclFrame;
+ }
+
+ public void inquiryCompleted(int inquiryStatus) {
+ log.debug("inquiryCompleted: not used!");
+ }
+
+ public void nodeDiscovered(Status status, WSNNode node) {
+ if (status.getCode() != GatewayConstants.SUCCESS) {
+ log.error("called nodeDiscovered with status different from SUCCESS, message is '" + status.getMessage() + "'");
+ return;
+ }
+
+ Address a = node.getAddress();
+
+ log.info(getIeeeAddressHex(a) + ": node discovered");
+
+ // skip the coordinator
+ if (a.getNetworkAddress().intValue() == 0) {
+ log.debug("discovered node with address 0. Skipping it");
+ return;
+ }
+
+ nodeDiscovered(a);
+ }
+
+ private void nodeDiscovered(Address a) {
+ rwLock.writeLock().lock();
+ try {
+ this.printTables();
+
+ String nodePid = getNodePid(a);
+ Vector devices = (Vector) this.getDevices(nodePid);
+ if (devices == null) {
+ // This is a new node
+ log.info(getIeeeAddressHex(a) + ": announcement from a new node");
+
+ // starts installation process
+ InstallationStatus installationStatus = this.getInstallingDevice(a);
+ if (installationStatus == null) {
+ log.debug(getIeeeAddressHex(a) + ": discovered new device ... installing it");
+ installationStatus = this.addInstallingDevice(a);
+ installationStatus.refreshTime();
+ installationStatus.setStatus(InstallationStatus.ANNOUNCEMENT_RECEIVED);
+ this.discoveredNodesQueue.addLast(installationStatus);
+ } else {
+ if (installationStatus.getStatus() == InstallationStatus.ANNOUNCEMENT_RECEIVED) {
+ log.debug(getIeeeAddressHex(a) + ": duplicate announcement");
+ long age = System.currentTimeMillis() - installationStatus.getTime();
+ log.debug(getIeeeAddressHex(a) + ": the announcement has an age of " + age + " ms");
+ if (age > 20000) {
+ if (!this.discoveredNodesQueue.contains(installationStatus)) {
+ this.discoveredNodesQueue.addLast(installationStatus);
+ } else {
+ log.debug(getIeeeAddressHex(a) + ": restartarting discovery");
+ }
+ }
+ } else {
+ log.debug(getIeeeAddressHex(a) + ": discovery process in progress for device ");
+ }
+ }
+
+ this.handleNextDiscoveredNode();
+ } else {
+ log.info(getIeeeAddressHex(a) + ": received announcement from an already known node");
+ // notifies all devices
+ Iterator it = devices.iterator();
+ while (it.hasNext()) {
+ ZigBeeDeviceImpl device = (ZigBeeDeviceImpl) it.next();
+ device.announce();
+ }
+ }
+ } finally {
+ rwLock.writeLock().unlock();
+ }
+ }
+
+ private void printTables() {
+ Collection nodes = getNodes();
+ log.debug("devices (" + nodes.size() + "):");
+ for (Iterator iterator = nodes.iterator(); iterator.hasNext();) {
+ Vector devices = (Vector) iterator.next();
+ for (Iterator iterator2 = devices.iterator(); iterator2.hasNext();) {
+ ZigBeeDeviceImpl device = (ZigBeeDeviceImpl) iterator2.next();
+ log.debug("\t" + getIeeeAddressHex(device.getServiceDescriptor().getAddress()));
+ }
+ }
+
+ if (enableDiscoveryLogs) {
+ log.debug("inProcessNode (" + inProcessNode.size() + "):");
+ }
+ for (Iterator iterator = inProcessNode.iterator(); iterator.hasNext();) {
+ log.debug("\t" + ((InstallationStatus) iterator.next()).toString());
+ }
+
+ if (enableDiscoveryLogs) {
+ log.debug("discoveredNodesQueue(" + discoveredNodesQueue.size() + "):");
+ }
+ for (Iterator iterator = discoveredNodesQueue.iterator(); iterator.hasNext();) {
+ log.debug("\t" + ((InstallationStatus) iterator.next()).toString());
+ }
+
+ if (enableDiscoveryLogs) {
+ log.debug("devicesUnderInstallation (" + devicesUnderInstallation.size() + "):");
+ }
+ for (Iterator iterator = devicesUnderInstallation.values().iterator(); iterator.hasNext();) {
+ log.debug("\t" + ((InstallationStatus) iterator.next()).toString());
+ }
+
+ if (enableDiscoveryLogs) {
+ log.debug("installedDevices (" + installedDevices.size() + "):");
+ }
+ for (Iterator iterator = installedDevices.values().iterator(); iterator.hasNext();) {
+ log.debug("\t" + ((InstallationStatus) iterator.next()).toString());
+ }
+ }
+
+ private void startNodeDiscoveryProcess(InstallationStatus installationStatus) {
+ Address a = installationStatus.getAddress();
+ String nodePid = getNodePid(installationStatus.getAddress());
+ Vector devices = (Vector) this.getDevices(nodePid);
+ if (devices == null) {
+ try {
+ if (enableDiscoveryLogs) {
+ log.debug(getIeeeAddressHex(a) + ": beginning device discovery");
+ }
+ installationStatus.setStatus(InstallationStatus.WAITING_FOR_NODE_DESCRIPTOR);
+ gateway.getNodeDescriptor(timeout, a);
+ timerStart(galCommandTimer, (int) (timeout / 1000) + timeoutOffset);
+ if (enableDiscoveryLogs) {
+ log.debug(getIeeeAddressHex(a) + ": called getNodeDescriptor()");
+ }
+ } catch (Exception e) {
+ this.terminateDeviceDiscovery(installationStatus);
+ this.handleNextDiscoveredNode();
+ }
+ }
+
+ }
+
+ public void servicesDiscovered(Status status, NodeServices services) {
+ if (status.getCode() != GatewayConstants.SUCCESS) {
+ rwLock.writeLock().lock();
+ try {
+ this.timerCancel(galCommandTimer);
+
+ // in case of failure services is null and there is no way to
+ // retrieve the Address so try to guess it.
+ InstallationStatus installingDevice = this.getInstallingDevice(InstallationStatus.WAITING_FOR_SERVICES);
+ Address a = installingDevice.getAddress();
+ if (installingDevice != null) {
+ log.error(getIeeeAddressHex(a) + ": servicesDiscovered callback returned error code " + status.getCode()
+ + "'. Guessed address '" + getIeeeAddressHex(a));
+
+ // retries until retry counter goes to 0
+ if (installingDevice.getRetryCounter() > 0) {
+ try {
+ log.debug(getIeeeAddressHex(a) + ": retry startServiceDiscovery()");
+ gateway.startServiceDiscovery(timeout, a);
+ timerStart(galCommandTimer, (int) (timeout / 1000) + timeoutOffset);
+ return;
+ } catch (Exception e) {
+ log.error("exception in startServiceDiscovery() ", e);
+ }
+ }
+
+ // abort installation of this node
+ log.error(getIeeeAddressHex(a) + ": too many retries for getting services");
+ this.terminateDeviceDiscovery(installingDevice);
+ this.handleNextDiscoveredNode();
+ return;
+ }
+ } finally {
+ rwLock.writeLock().unlock();
+ }
+ return;
+ }
+
+ Address a = services.getAddress();
+
+ synchronized (rwLock) {
+ this.timerCancel(galCommandTimer);
+ InstallationStatus installingDevice = this.getInstallingDevice(a);
+ if (installingDevice == null) {
+ log.error(getIeeeAddressHex(a) + ": unsolicited serviceDiscovered()");
+ this.terminateDeviceDiscovery(installingDevice);
+ this.handleNextDiscoveredNode();
+ return;
+ }
+
+ log.debug(getIeeeAddressHex(installingDevice.getAddress()) + ": discovered " + services.getActiveEndpoints().size()
+ + " endpoint(s)");
+
+ if ((services.getActiveEndpoints().size() > 1) && (!handleMultipleEps)) {
+ log.warn("sorry but currently (in this version) we handle only the first one!");
+ }
+
+ installingDevice.setNodeServices(services);
+ installingDevice.setStatus(InstallationStatus.ACTIVE_ENDPOINTS_RETRIEVED);
+
+ List activeEndpoints = services.getActiveEndpoints();
+ for (int i = 0; i < activeEndpoints.size(); i++) {
+ installingDevice.setCurrentService(i);
+ ActiveEndpoints ep = (ActiveEndpoints) activeEndpoints.get(i);
+
+ try {
+ installingDevice.setStatus(InstallationStatus.WAITING_FOR_SERVICE_DESCRIPTOR);
+ log.debug(getIeeeAddressHex(a) + ": getting Service Descriptor for EP " + ep.getEndPoint());
+ gateway.getServiceDescriptor(timeout, a, ep.getEndPoint());
+ timerStart(galCommandTimer, (int) (timeout / 1000) + timeoutOffset);
+ } catch (Exception e) {
+ this.terminateDeviceDiscovery(installingDevice);
+ this.handleNextDiscoveredNode();
+ }
+ break;
+ }
+ }
+ }
+
+ public void serviceDescriptorRetrieved(Status status, ServiceDescriptor service) {
+
+ rwLock.writeLock().lock();
+ try {
+ this.timerCancel(galCommandTimer);
+
+ if (status.getCode() != GatewayConstants.SUCCESS) {
+ // in case of failure services is null and there is no way to
+ // retrieve the Address so try to guess it.
+
+ InstallationStatus installingDevice = this.getInstallingDevice(InstallationStatus.WAITING_FOR_SERVICE_DESCRIPTOR);
+ if (installingDevice != null) {
+ Address a = installingDevice.getAddress();
+ log.error(getIeeeAddressHex(a) + ": serviceDescriptorRetrieved callback returned error code "
+ + status.getCode() + "'. Guessed address '" + getIeeeAddressHex(a));
+
+ // retries until retry counter goes to 0
+ if (installingDevice.getRetryCounter() > 0) {
+ try {
+ int i = installingDevice.getCurrentService();
+ if (i >= 0) {
+ NodeServices services = installingDevice.getNodeServices();
+ ActiveEndpoints ep = (ActiveEndpoints) services.getActiveEndpoints().get(i);
+ log.debug(getIeeeAddressHex(a) + ": getting Service Descriptor for EP " + ep.getEndPoint());
+ gateway.getServiceDescriptor(timeout, a, ep.getEndPoint());
+ timerStart(galCommandTimer, (int) (timeout / 1000) + timeoutOffset);
+ return;
+ } else {
+ log.fatal(getIeeeAddressHex(a)
+ + ": wrong ep index stored into InstallationStatus. Abort installation of this node");
+ }
+ } catch (Exception e) {
+ log.error(getIeeeAddressHex(a)
+ + ": exception in startServiceDiscovery(). Abort installation of this node", e);
+ }
+ } else {
+ int i = installingDevice.getCurrentService();
+ if (i >= 0) {
+ NodeServices services = installingDevice.getNodeServices();
+ ActiveEndpoints ep = (ActiveEndpoints) services.getActiveEndpoints().get(i);
+ log.error(getIeeeAddressHex(a) + ": too many retries for serviceDescriptor for ep " + ep.getEndPoint()
+ + ". Abort installation of this node");
+ }
+ }
+
+ this.terminateDeviceDiscovery(installingDevice);
+ this.handleNextDiscoveredNode();
+ return;
+ } else {
+ log.fatal("unable to find an associated installation status: unsolicited serviceDescriptorRetrieved()");
+ }
+ return;
+ }
+
+ Address a = service.getAddress();
+ String ieeeAddress = getIeeeAddressHex(a);
+ InstallationStatus installingDevice = this.getInstallingDevice(a);
+ installingDevice.addServiceDescriptor(service.getEndPoint(), service);
+
+ if (handleMultipleEps) {
+ int retrievedServiceIndex = installingDevice.getCurrentService();
+ List activeEndpoints = installingDevice.getNodeServices().getActiveEndpoints();
+ retrievedServiceIndex++;
+ if (retrievedServiceIndex < activeEndpoints.size()) {
+ try {
+ installingDevice.setCurrentService(retrievedServiceIndex);
+ installingDevice.setStatus(InstallationStatus.WAITING_FOR_SERVICE_DESCRIPTOR);
+ ActiveEndpoints ep = (ActiveEndpoints) activeEndpoints.get(retrievedServiceIndex);
+ log.debug(getIeeeAddressHex(a) + ": getting Service Descriptor for EP " + ep.getEndPoint());
+ gateway.getServiceDescriptor(timeout, a, ep.getEndPoint());
+ timerStart(galCommandTimer, (int) (timeout / 1000) + timeoutOffset);
+ return;
+ } catch (Exception e) {
+ this.terminateDeviceDiscovery(installingDevice);
+ this.handleNextDiscoveredNode();
+ }
+ }
+ }
+
+ installingDevice.setStatus(InstallationStatus.INSTALLED);
+ try {
+ this.finalizeNode(installingDevice);
+ } catch (Exception e) {
+ log.error("exception", e);
+ this.terminateDeviceDiscovery(installingDevice);
+ this.handleNextDiscoveredNode();
+ }
+
+ if (fastStartup) {
+ this.updateDiscoveredDevicesDb(ieeeAddress, installingDevice);
+ }
+
+ this.terminateDeviceDiscovery(installingDevice);
+ this.handleNextDiscoveredNode();
+ } finally {
+ rwLock.writeLock().unlock();
+ }
+ }
+
+ /**
+ * Stores the newly discovered infos into a persistent storage
+ *
+ * @param ieeeAddress
+ * @param installingDevice
+ */
+ private void updateDiscoveredDevicesDb(String ieeeAddress, InstallationStatus installingDevice) {
+ InstallationStatus is = (InstallationStatus) this.installedDevices.get(ieeeAddress);
+ if (is == null) {
+ this.installedDevices.put(ieeeAddress, installingDevice);
+ }
+ }
+
+ private void finalizeNode(InstallationStatus installingDevice) {
+
+ NodeServices nodeServices = installingDevice.getNodeServices();
+ List activeEndpoints = nodeServices.getActiveEndpoints();
+ Address a = nodeServices.getAddress();
+ String nodePid = getNodePid(a);
+
+ String[] endPoints = new String[activeEndpoints.size()];
+
+ for (int i = 0; i < activeEndpoints.size(); i++) {
+ ActiveEndpoints ep = (ActiveEndpoints) activeEndpoints.get(i);
+ ServiceDescriptor service = installingDevice.getServiceDescriptor(ep.getEndPoint());
+
+ endPoints[i] = service.getSimpleDescriptor().getApplicationProfileIdentifier() + "."
+ + service.getSimpleDescriptor().getApplicationDeviceIdentifier() + "." + new Short(service.getEndPoint());
+ }
+ for (int i = 0; i < activeEndpoints.size(); i++) {
+ ActiveEndpoints ep = (ActiveEndpoints) activeEndpoints.get(i);
+ ServiceDescriptor service = installingDevice.getServiceDescriptor(ep.getEndPoint());
+ if (service == null) {
+ log.error(getIeeeAddressHex(installingDevice.getAddress()) + ": Service descriptor is null while finalizing ep "
+ + ep.getEndPoint() + ": skip it!");
+ continue;
+ }
+
+ ZigBeeDevice device = createDevice(installingDevice, service, endPoints);
+ if (device != null) {
+ // add the device to our db
+ Vector devices = this.getDevices(nodePid);
+ if (devices == null) {
+ devices = new Vector();
+ this.ieee2devices.put(nodePid, devices);
+ }
+
+ devices.add(device);
+ }
+ }
+ }
+
+ private void handleNextDiscoveredNode() {
+ if (inProcessNode.size() > 0) {
+ // still discovering node properties
+ return;
+ }
+
+ InstallationStatus is = null;
+ try {
+ is = (InstallationStatus) this.discoveredNodesQueue.removeFirst();
+ inProcessNode.addLast(is);
+ this.startNodeDiscoveryProcess(is);
+ } catch (NoSuchElementException e) {
+ log.debug("installation queue is empty");
+ return;
+ }
+ }
+
+ private Vector getDevices(String nodePid) {
+ return (Vector) this.ieee2devices.get(nodePid);
+ }
+
+ protected Collection getNodes() {
+ return ieee2devices.values();
+ }
+
+ /**
+ * Creates a new service representing the newly detected ZigBee device. This
+ * OSGi Device follows the Device Admin sepcification.
+ *
+ * @param node
+ * @param ep
+ * @return
+ */
+
+ private ZigBeeDevice createDevice(InstallationStatus installingDevice, ServiceDescriptor service, String[] endPoints) {
+
+ Hashtable deviceProps = new Hashtable();
+
+ NodeDescriptor node = installingDevice.getNodeDescriptor();
+ int deviceId = service.getSimpleDescriptor().getApplicationDeviceIdentifier().intValue();
+ int profileId = service.getSimpleDescriptor().getApplicationProfileIdentifier().intValue();
+
+ String ieeeAddr = getIeeeAddress(service.getAddress());
+
+ log.debug("new node detected ieeeAddr = '" + ieeeAddr + "', ");
+ log.debug("profileId = '" + Integer.toString(profileId) + "', ");
+ log.debug("deviceId = '" + Integer.toString(deviceId) + "', ");
+
+ if (node == null) {
+ log.fatal("here node should not be null");
+ }
+
+ log.debug("manufacturerCode = '" + node.getManufacturerCode() + "', ");
+
+ deviceProps.put(org.osgi.service.device.Constants.DEVICE_CATEGORY, "ZigBee");
+ deviceProps.put(org.osgi.service.device.Constants.DEVICE_SERIAL, ieeeAddr);
+ deviceProps.put(org.osgi.framework.Constants.SERVICE_PID, ieeeAddr);
+
+ deviceProps.put("zigbee.device.ep.id", new Short(service.getEndPoint()));
+ deviceProps.put("zigbee.device.profile.id", new Integer(profileId));
+ deviceProps.put("zigbee.device.device.id", new Integer(deviceId));
+ deviceProps.put("zigbee.device.eps", endPoints);
+ deviceProps.put("zigbee.device.eps.number", new Integer(endPoints.length));
+
+ deviceProps.put("zigbee.device.manufacturer.id", node.getManufacturerCode());
+ ZigBeeDeviceImpl device = new ZigBeeDeviceImpl(this, timer, installingDevice.getNodeServices(), node, service);
+
+ // this registration starts the driver location process!
+ ServiceRegistration deviceServiceReg = ctxt.getBundleContext().registerService(ZigBeeDevice.class.getName(), device,
+ deviceProps);
+ Vector deviceRegs = null;
+ String nodePid = getNodePid(service.getAddress());
+ synchronized (ieee2sr) {
+ deviceRegs = (Vector) ieee2sr.get(nodePid);
+ if (deviceRegs == null) {
+ deviceRegs = new Vector();
+ ieee2sr.put(nodePid, deviceRegs);
+ }
+ }
+ deviceRegs.add(deviceServiceReg);
+ return device;
+ }
+
+ private boolean add(ZigBeeDevice hacDevice) {
+ zigbeeDevices.add(hacDevice);
+ return true;
+ }
+
+ protected boolean post(ZigBeeDevice device, short profileId, short clusterId, IZclFrame zclFrame) {
+ if (gateway == null) {
+ log.error("post(): jgal not bound");
+ return false;
+ }
+
+ APSMessage msg = new APSMessage();
+
+ ServiceDescriptor service = device.getServiceDescriptor();
+
+ // patch to clean the network address, otherwise the GAL uses it,
+ // instead of ieee address
+ // TODO: move this patch when the service descriptor is assigned to
+ // the
+ // device.
+ Address a = service.getAddress();
+ a.setNetworkAddress(null);
+
+ log.debug(getIeeeAddressHex(a) + ": sending message");
+
+ msg.setDestinationAddressMode(new Long(GatewayConstants.EXTENDED_ADDRESS_MODE));
+ msg.setDestinationAddress(service.getAddress());
+ msg.setDestinationEndpoint(service.getEndPoint());
+ msg.setSourceEndpoint(localEndpoint);
+
+ msg.setClusterID(clusterId & 0xffff);
+ msg.setProfileID(new Integer(profileId & 0xffff));
+ msg.setData(zclFrame.getData());
+
+ TxOptions tx = new TxOptions();
+ tx.setAcknowledged(true);
+ tx.setPermitFragmentation(false);
+ tx.setSecurityEnabled(false);
+ tx.setUseNetworkKey(true);
+ msg.setTxOptions(tx);
+ msg.setRadius((short) 10);
+
+ try {
+ gateway.sendAPSMessage(msg);
+ } catch (IOException e) {
+ log.error("IOException, message not sent :" + e.getMessage());
+ return false;
+ } catch (GatewayException e) {
+ log.error("GatewayException, message not sent :" + e.getMessage());
+ return false;
+ } catch (Exception e) {
+ log.error("Exception, message not sent :" + e.getMessage(), e);
+ return false;
+ }
+
+ return true;
+ }
+
+ protected boolean post(APSMessageEvent srcMsgEvent, IZclFrame zclFrame) {
+ if (gateway == null) {
+ log.error("post(): jgal not bound");
+ return false;
+ }
+
+ APSMessage msg = new APSMessage();
+
+ msg.setDestinationAddressMode(new Long(GatewayConstants.EXTENDED_ADDRESS_MODE));
+ msg.setDestinationAddress(srcMsgEvent.getSourceAddress());
+ msg.setDestinationEndpoint(srcMsgEvent.getSourceEndpoint());
+ msg.setSourceEndpoint(localEndpoint);
+
+ msg.setClusterID(srcMsgEvent.getClusterID() & 0xffff);
+ msg.setProfileID(srcMsgEvent.getProfileID());
+ msg.setData(zclFrame.getData());
+
+ TxOptions tx = new TxOptions();
+ tx.setAcknowledged(true);
+ tx.setPermitFragmentation(false);
+ tx.setSecurityEnabled(false);
+ tx.setUseNetworkKey(true);
+ msg.setTxOptions(tx);
+ msg.setRadius((short) 10);
+
+ try {
+ gateway.sendAPSMessage(msg);
+ } catch (IOException e) {
+ log.error("IOException, message not sent :" + e.getMessage());
+ return false;
+ } catch (GatewayException e) {
+ log.error("GatewayException, message not sent :" + e.getMessage());
+ return false;
+ } catch (Exception e) {
+ log.error("Exception, message not sent :" + e.getMessage(), e);
+ return false;
+ }
+
+ log.debug("Thread " + Thread.currentThread().getId() + ": message sent");
+ return true;
+ }
+
+ public void noDriverFound(ZigBeeDevice device) {
+ log.error("no driver found for device " + device.getIeeeAddress());
+ }
+
+ public void attach(ZigBeeDevice device) {
+ // a driver has been attached to the device.
+ try {
+ add(device);
+ } catch (Exception e) {
+ log.error("element not present in intstalling Devices list");
+ }
+ }
+
+ public void timer(int event) {
+ switch (event) {
+ case JGalReconnectTimer:
+ synchronized (sLock) {
+ if (!bindGal()) {
+ tryReconnectToJGal(reconnectToJGalDelay);
+ }
+ }
+ break;
+
+ case discoveryTimer:
+ synchronized (sLock) {
+ if (gateway != null) {
+ try {
+ log.debug("started discovery");
+ int discoveryTimeout = ((discoveryDelay - 2) > 10 ? 10 : (discoveryDelay - 2)) * 1000;
+ gateway.startNodeDiscovery(discoveryTimeout, GatewayConstants.DISCOVERY_LQI);
+ } catch (Exception e) {
+ tryReconnectToJGal(reconnectToJGalDelay);
+ break;
+ }
+ if (discoveryDelay > 0)
+ timerStart(discoveryTimer, discoveryDelay);
+ }
+ }
+
+ break;
+
+ case permitJoinAllTimer:
+ rwLock.writeLock().lock();
+ try {
+ timerCancel(permitJoinAllTimer);
+ this.terminateDeviceDiscoveryForJoinedDevices();
+ this.postEvent("ah/zigbee/CLOSE_NETWORK", null);
+ } finally {
+ rwLock.writeLock().unlock();
+ }
+ break;
+
+ case galCommandTimer:
+ rwLock.writeLock().lock();
+
+ log.warn("galCommandTimer expired");
+ // if this timer expires, it means that the GAL was not sending a
+ // calback for node descriptor or service discriptor or active
+ // endpoints
+
+ try {
+ log.debug("inside lock");
+ if (this.inProcessNode.size() == 0) {
+ log.fatal("galCommandTimer expired but no nodes are in the inProcessNode queue");
+ break;
+ }
+
+ // try to recover
+ InstallationStatus installingDevice = (InstallationStatus) this.inProcessNode.getFirst();
+ log.error(getIeeeAddressHex(installingDevice.getAddress()) + ": no response from jgal. Try to recover.");
+ Status status = new Status();
+
+ switch (installingDevice.getStatus()) {
+
+ case InstallationStatus.WAITING_FOR_NODE_DESCRIPTOR:
+ status.setCode((short) GatewayConstants.TIMEOUT);
+ this.nodeDescriptorRetrieved(status, null);
+ break;
+
+ case InstallationStatus.WAITING_FOR_SERVICES:
+ status.setCode((short) GatewayConstants.TIMEOUT);
+ this.servicesDiscovered(status, null);
+ break;
+
+ case InstallationStatus.WAITING_FOR_SERVICE_DESCRIPTOR:
+ status.setCode((short) GatewayConstants.TIMEOUT);
+ this.serviceDescriptorRetrieved(status, null);
+ break;
+
+ default:
+ log.debug("no actions to recover!");
+ this.terminateDeviceDiscovery(installingDevice);
+ this.handleNextDiscoveredNode();
+ }
+ } finally {
+ rwLock.writeLock().unlock();
+ }
+ break;
+ }
+ }
+
+ protected void availStateUpdated(ZigBeeDevice device, int availState) {
+ if (availState == ZigBeeDeviceImpl.Disconnected) {
+ log.debug("device " + device.getIeeeAddress() + " is unreachable");
+ } else if (availState == ZigBeeDeviceImpl.Connected) {
+ log.debug("device " + device.getIeeeAddress() + " is now reachable");
+ }
+ }
+
+ protected ZigBeeDeviceListener getService(ServiceReference driverRef) {
+ return (ZigBeeDeviceListener) ctxt.getBundleContext().getService(driverRef);
+ }
+
+ protected void setGatewayInterface(GatewayInterface r) {
+ synchronized (sLock) {
+ gateway = r;
+ }
+ }
+
+ protected void unsetGatewayInterface(GatewayInterface r) {
+ synchronized (sLock) {
+ if (r == gateway) {
+ gateway = null;
+ }
+ }
+ }
+
+ public void gatewayStartResult(Status status) {
+ if (status.getCode() == 0) {
+ if (log != null)
+ log.info("zigbee network up and running.");
+
+ synchronized (sLock) {
+ this.galRunning = 2;
+
+ if (this.usePreferenceService) {
+ this.useNVMNetworkSetting = true;
+ this.store("useNVMNetworkSetting", useNVMNetworkSetting);
+
+ } else {
+ this.useNVMNetworkSetting = true;
+ this.saveProperties();
+
+ }
+
+ if (enableLqi)
+ timerStart(discoveryTimer, initialDiscoveryDelay);
+ }
+
+ } else {
+ if (status.getCode() == GatewayConstants.NETWORK_FAILURE) {
+ synchronized (sLock) {
+ log.info("ZigBeeGateway started with status code: NETWORK_FAILURE");
+ if (this.usePreferenceService) {
+ this.useNVMNetworkSetting = false;
+ this.store("useNVMNetworkSetting", useNVMNetworkSetting);
+ } else {
+ this.useNVMNetworkSetting = false;
+ this.properties.setProperty("usenvm", "false");
+ this.saveProperties();
+ }
+ }
+ } else {
+ log.info("ZigBeeGateway started with status code " + status.getCode());
+ }
+ }
+ }
+
+ public void dongleResetResult(Status status) {
+
+ if (status.getCode() == GatewayConstants.SUCCESS) {
+ synchronized (sLock) {
+ try {
+ if (gateway == null) {
+ log.warn("dongleResetResult(): gateway is null");
+ return;
+ }
+ // configure local endpoint
+ gateway.clearEndpoint(localEndpoint);
+ // TODO the following input clusters have to be configurable
+ // from Config Admin or props file
+ SimpleDescriptor sd = new SimpleDescriptor();
+ sd.setEndPoint(new Short(localEndpoint));
+ sd.setApplicationDeviceVersion(new Short((short) 0x01));
+ sd.setApplicationDeviceIdentifier(new Integer(0x0050)); // ESP
+ sd.setApplicationProfileIdentifier(new Integer(0x0104)); // HA
+ List outputClusters = sd.getApplicationOutputCluster();
+ List inputClusters = sd.getApplicationInputCluster();
+
+ // TODO the following input clusters have to be configurable
+ // from Config Admin or props file
+
+ // Still missing. To be commented out!
+ // outputClusters.add(new Integer(0x0b02)); // Appliance
+ // Events &Alert
+ // outputClusters.add(new Integer(0x0b03)); // Appliance
+ // statistics
+
+ // This is the list of Client side clusters supported by E at H
+ outputClusters.add(new Integer(ZclBasicClient.CLUSTER_ID));
+ outputClusters.add(new Integer(ZclIdentifyClient.CLUSTER_ID));
+ outputClusters.add(new Integer(ZclSimpleMeteringClient.CLUSTER_ID));
+ // outputClusters.add(new
+ // Integer(ZclMeterIdentificationClient.CLUSTER_ID));
+ outputClusters.add(new Integer(ZclPowerProfileClient.CLUSTER_ID));
+ outputClusters.add(new Integer(ZclApplianceControlClient.CLUSTER_ID));
+ outputClusters.add(new Integer(ZclOnOffClient.CLUSTER_ID));
+ outputClusters.add(new Integer(ZclOccupancySensingClient.CLUSTER_ID));
+ outputClusters.add(new Integer(ZclIASZoneClient.CLUSTER_ID));
+ outputClusters.add(new Integer(ZclTemperatureMeasurementClient.CLUSTER_ID));
+ outputClusters.add(new Integer(ZclIlluminanceMeasurementClient.CLUSTER_ID));
+
+ // This is the list of Server side clusters supported by E at H
+ inputClusters.add(new Integer(ZclBasicServer.CLUSTER_ID));
+ inputClusters.add(new Integer(ZclIdentifyServer.CLUSTER_ID));
+ inputClusters.add(new Integer(ZclTimeServer.CLUSTER_ID));
+ inputClusters.add(new Integer(ZclSimpleMeteringServer.CLUSTER_ID));
+ inputClusters.add(new Integer(ZclPartitionServer.CLUSTER_ID));
+ inputClusters.add(new Integer(ZclOnOffServer.CLUSTER_ID));
+
+ // TODO: add partitioning when it will be available.
+ localEndpoint = gateway.configureEndpoint(100, sd);
+ // start discovery announcement
+ gateway.startNodeDiscovery(0, GatewayConstants.DISCOVERY_ANNOUNCEMENTS);
+ // subscribe liveness
+ gateway.subscribeNodeRemoval(0, GatewayConstants.DISCOVERY_FRESHNESS);
+ // register local callback
+ this.callbackId = gateway.createAPSCallback(localEndpoint, this);
+ if (this.callbackId == -1) {
+ log.fatal("createAPSCallback returned -1");
+ }
+
+ // start gateway device
+ gateway.startGatewayDevice(0);
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+
+ public void leaveResult(Status status) {
+ rwLock.writeLock().lock();
+ rwLock.writeLock().unlock();
+ }
+
+ public void permitJoinResult(Status status) {
+ synchronized (sLock) {
+ log.debug("t" + 5);
+ log.debug("permit join returned status " + status.getCode());
+ if (status.getCode() == 0) {
+ this.postEvent("ah/zigbee/OPEN_NETWORK", null);
+ }
+ }
+ }
+
+ private void tryReconnectToJGal(int delay) {
+ timerStart(JGalReconnectTimer, delay);
+ if (log != null)
+ log.info("retry to reconnect to ZigbeeGatewayDevice in " + delay + " s");
+ }
+
+ private boolean bindGal() {
+ if ((this.gateway == null) || ((this.preferenceService == null) && this.usePreferenceService) || (this.timer == null)) {
+ return false;
+ }
+
+ this.terminateDeviceDiscoveryAll();
+ gateway.setGatewayEventListener(this);
+
+ try {
+ if (useNVMNetworkSetting) {
+ // use the non volatile memory ram
+ gateway.resetDongle(0, GatewayConstants.RESET_USE_NVMEMORY);
+ } else {
+ // call the handler directly
+ dongleResetResult(new Status());
+ }
+ } catch (IOException e) {
+ log.error("exception when starting zigbee gateway: " + e.getMessage());
+ return false;
+ } catch (GatewayException e) {
+ log.error("exception when starting zigbee gateway: " + e.getMessage());
+ return false;
+ } catch (Exception e) {
+ log.error("exception when starting zigbee gateway: " + e.getMessage());
+ return false;
+ }
+
+ galRunning = 1;
+
+ // connected!
+ return true;
+ }
+
+ private boolean unbindGal() {
+ log.debug("unbindGal");
+
+ this.terminateDeviceDiscoveryAll();
+
+ gateway.setGatewayEventListener(null);
+
+ try {
+ gateway.startNodeDiscovery(0, GatewayConstants.DISCOVERY_STOP);
+ } catch (Exception e) {
+ log.error("exception while stopping node discovery", e);
+ }
+ try {
+ if (callbackId != -1)
+ gateway.deleteCallback(this.callbackId);
+ callbackId = -1;
+ } catch (Exception e) {
+ log.error(e);
+ }
+
+ unregisterAllDevices();
+
+ galRunning = 0;
+ return true;
+ }
+
+ private void unregisterAllDevices() {
+ Set keys = ieee2sr.keySet();
+ for (Iterator iterator = keys.iterator(); iterator.hasNext();) {
+ // FIXME: la seguente riga da spesso un'eccezione 'concurrent
+ // modification'. Chi la sta modificando?
+ // questa cosa succedeva sicuramente con la versione 2.1.9. L'ho
+ // corretta?
+ try {
+ String nodePid = (String) iterator.next();
+ Vector deviceRegs = (Vector) this.ieee2sr.get(nodePid);
+ if (deviceRegs != null) {
+ iterator.remove();
+ this.ieee2devices.remove(nodePid);
+ for (Iterator iterator2 = deviceRegs.iterator(); iterator2.hasNext();) {
+ ServiceRegistration deviceReg = (ServiceRegistration) iterator2.next();
+ deviceReg.unregister();
+ }
+ }
+ } catch (ConcurrentModificationException e) {
+ e.printStackTrace();
+ return;
+ }
+ }
+ }
+
+ public void nodeDescriptorRetrieved(Status status, NodeDescriptor node) {
+ // guess the installing device because the node descriptor doesn't
+ // contain the address of the device
+ rwLock.writeLock().lock();
+ try {
+ this.timerCancel(galCommandTimer);
+ if (gateway == null) {
+ log.warn("in nodeDescriptorRetrieved() detected that gateway has been removed");
+ return;
+ }
+
+ InstallationStatus installingDevice = this.getInstallingDevice(InstallationStatus.WAITING_FOR_NODE_DESCRIPTOR);
+ if (installingDevice == null) {
+ log.warn("received a node descriptor from an unsolicited node");
+ this.handleNextDiscoveredNode();
+ return;
+ }
+
+ String nodePid = getNodePid(installingDevice.getAddress());
+ String nodeIeeeAddressHex = getIeeeAddressHex(installingDevice.getAddress());
+
+ if (status.getCode() != 0) {
+ log.error(nodeIeeeAddressHex + ": nodeDescriptorRetrieved callback returned error code " + status.getCode()
+ + "'. Guessed pid '" + nodePid);
+ if (installingDevice.getRetryCounter() > 0) {
+ try {
+ gateway.getNodeDescriptor(timeout, installingDevice.getAddress());
+ log.debug(nodeIeeeAddressHex + ": called getNodeDescriptor()");
+ timerStart(galCommandTimer, (int) (timeout / 1000) + timeoutOffset);
+ return;
+ } catch (Exception e) {
+ log.error(e);
+ }
+ }
+
+ // abort installation of this node
+ log.error(nodeIeeeAddressHex + ": too many retries for getting node descriptor");
+ this.terminateDeviceDiscovery(installingDevice);
+ this.handleNextDiscoveredNode();
+ return;
+ }
+
+ log.debug(nodeIeeeAddressHex + ": retrieved node descriptor");
+
+ // update the state
+ installingDevice.setStatus(InstallationStatus.WAITING_FOR_SERVICES);
+ installingDevice.resetRetryCounter();
+ installingDevice.setNodeDescriptor(node);
+
+ try {
+ log.debug(nodeIeeeAddressHex + ": startServiceDiscovery()");
+ gateway.startServiceDiscovery(timeout, installingDevice.getAddress());
+ timerStart(galCommandTimer, (int) (timeout / 1000) + timeoutOffset);
+ } catch (Exception e) {
+ this.terminateDeviceDiscovery(installingDevice);
+ this.handleNextDiscoveredNode();
+ }
+ } finally {
+ rwLock.writeLock().unlock();
+ }
+ }
+
+ protected Dictionary getConfiguration() {
+ Dictionary config = new Hashtable();
+ config.put("it.telecomitalia.ah.adapter.zigbee.lqi", this.enableLqi + "");
+ config.put("it.telecomitalia.ah.adapter.zigbee.reconnect", this.reconnectToJGalDelay + "");
+ config.put("it.telecomitalia.ah.adapter.zigbee.discovery.delay", this.discoveryDelay + "");
+ config.put("it.telecomitalia.ah.adapter.zigbee.discovery.initialdelay", this.initialDiscoveryDelay + "");
+ return config;
+ }
+
+ public void nodeRemoved(Status status, WSNNode node) {
+ rwLock.writeLock().lock();
+ try {
+ // notifies the node
+ // TODO: if the node has short address 0 it means that the dongle is
+ // crashed.
+ if (status.getCode() == 0) {
+ String nodePid = getNodePid(node.getAddress());
+ Vector deviceRegs = (Vector) this.ieee2sr.get(nodePid);
+ if (deviceRegs != null) {
+ log.debug(getIeeeAddressHex(node.getAddress()) + ": node has been removed");
+ this.ieee2sr.remove(nodePid);
+ this.ieee2devices.remove(nodePid);
+ for (Iterator iterator = deviceRegs.iterator(); iterator.hasNext();) {
+ ServiceRegistration deviceReg = (ServiceRegistration) iterator.next();
+ deviceReg.unregister();
+ }
+ } else {
+ log.warn(nodePid + ": unknown node has been removed");
+ }
+ }
+ } finally {
+ rwLock.writeLock().unlock();
+ }
+ }
+
+ protected boolean isGalRunning() {
+ return this.galRunning == 2;
+ }
+
+ public void permitJoin(short duration) throws Exception {
+ rwLock.writeLock().lock();
+ try {
+ if (gateway == null) {
+ throw new Exception("zgd not started");
+ }
+
+ gateway.permitJoinAll(timeout, duration);
+ if (duration == 0) {
+ this.postEvent("ah/zigbee/CLOSE_NETWORK", null);
+ this.terminateDeviceDiscoveryForJoinedDevices();
+ this.handleNextDiscoveredNode();
+ } else {
+ timerCancel(permitJoinAllTimer);
+ this.postEvent("ah/zigbee/OPEN_NETWORK", null);
+ timerStart(permitJoinAllTimer, duration);
+ }
+ } catch (Exception e) {
+ log.error("Exception in PermitJoin()", e);
+ throw e;
+ } finally {
+ rwLock.writeLock().unlock();
+ }
+ }
+
+ /**
+ * Stops the discovery process for all those devices that were not in the
+ * network
+ */
+
+ private void terminateDeviceDiscoveryAll() {
+ // send leave to any new node under processing
+ for (Iterator iterator = this.inProcessNode.iterator(); iterator.hasNext();) {
+ InstallationStatus installationStatus = (InstallationStatus) iterator.next();
+ this.timerCancel(galCommandTimer);
+ this.terminateDeviceDiscovery(installationStatus);
+ }
+
+ // the following device are not under processing
+ for (Iterator iterator = this.discoveredNodesQueue.iterator(); iterator.hasNext();) {
+ InstallationStatus installationStatus = (InstallationStatus) iterator.next();
+ this.terminateDeviceDiscovery(installationStatus);
+ }
+
+ if (inProcessNode.size() > 0) {
+ log.fatal("inProcessNode is not empty!");
+ }
+
+ if (discoveredNodesQueue.size() > 0) {
+ log.fatal("discoveredNodesQueue is not empty!");
+ }
+
+ if (devicesUnderInstallation.size() > 0) {
+ log.fatal("devicesUnderInstallation is not empty!");
+ }
+
+ this.inProcessNode.clear();
+ this.discoveredNodesQueue.clear();
+ this.devicesUnderInstallation.clear();
+ }
+
+ // remove from our list (and send a leave) only those devices just entered
+ // because the network has been opened
+ private void terminateDeviceDiscoveryForJoinedDevices() {
+ // send leave to any new node under processing
+ for (Iterator iterator = this.inProcessNode.iterator(); iterator.hasNext();) {
+ InstallationStatus installationStatus = (InstallationStatus) iterator.next();
+ if (this.hasJoined(installationStatus)) {
+ this.timerCancel(galCommandTimer);
+ this.terminateDeviceDiscovery(installationStatus);
+ }
+ }
+
+ // the following device are not under processing.
+ for (Iterator iterator = this.discoveredNodesQueue.iterator(); iterator.hasNext();) {
+ InstallationStatus installationStatus = (InstallationStatus) iterator.next();
+
+ if (this.hasJoined(installationStatus)) {
+ this.terminateDeviceDiscovery(installationStatus);
+ }
+ }
+ }
+
+ /**
+ * Given an InstallationStatus remove the device from any queue.
+ *
+ * @param installationStatus
+ */
+ private void terminateDeviceDiscovery(InstallationStatus installationStatus) {
+ String nodePid = getNodePid(installationStatus.getAddress());
+ if (hasJoined(installationStatus)) {
+ try {
+ log.debug("in terminateDeviceDiscovery() sending leave to node "
+ + getIeeeAddressHex(installationStatus.getAddress()));
+ gateway.leave(100, installationStatus.getAddress());
+ } catch (Exception e) {
+ log.error(e);
+ }
+ }
+ this.devicesUnderInstallation.remove(nodePid);
+ this.discoveredNodesQueue.remove(installationStatus);
+ this.inProcessNode.remove(installationStatus);
+ }
+
+ private boolean hasJoined(InstallationStatus installationStatus) {
+ return false;
+ }
+
+ private InstallationStatus addInstallingDevice(Address a) {
+ rwLock.writeLock().lock();
+ try {
+ String nodePid = getNodePid(a);
+ InstallationStatus installationStatus = new InstallationStatus(a);
+ this.devicesUnderInstallation.put(nodePid, installationStatus);
+ return installationStatus;
+ } finally {
+ rwLock.writeLock().unlock();
+ }
+ }
+
+ private InstallationStatus getInstallingDevice(Address a) {
+ synchronized (rwLock) {
+ String nodePid = getNodePid(a);
+ return (InstallationStatus) this.devicesUnderInstallation.get(nodePid);
+ }
+ }
+
+ private InstallationStatus getInstallingDevice(int deviceStatus) {
+ Enumeration keys = this.devicesUnderInstallation.keys();
+ while (keys.hasMoreElements()) {
+ String nodePid = (String) keys.nextElement();
+ InstallationStatus installationStatus = (InstallationStatus) this.devicesUnderInstallation.get(nodePid);
+ if (installationStatus.getStatus() == deviceStatus) {
+ // this.devicesUnderInstallation.remove(nodeIeeeAddress);
+ // log.debug("error in getting EPs, removing node '" +
+ // nodeIeeeAddress + "' from installing devices");
+ return installationStatus;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * The following method is called when a broadcast message arrives. It
+ * handles the IdentifyQuery message. FIXME: this must not be here but the
+ * IdentifyQuery must be handled by the driver.
+ *
+ * @param msg
+ */
+
+ private void handleBroadcastMessages(APSMessageEvent msg) {
+
+ ZclFrame zclFrame = new ZclFrame(msg.getData());
+
+ int commandId = zclFrame.getCommandId();
+ if (zclFrame.isServerToClient()) {
+ log.error("invalid direction field in broadcast message");
+ return;
+ }
+
+ IZclFrame zclResponseFrame = null;
+
+ switch (commandId) {
+ case 1:
+ IdentifyQueryResponse r = new IdentifyQueryResponse(0xFFFF);
+ int size;
+ try {
+ size = ZclIdentifyQueryResponse.zclSize(r);
+ zclResponseFrame = zclFrame.createResponseFrame(size);
+ zclResponseFrame.setCommandId(0);
+ ZclIdentifyQueryResponse.zclSerialize(zclResponseFrame, r);
+ } catch (ZclValidationException e) {
+ log.error(e);
+ }
+
+ break;
+ }
+
+ if (zclResponseFrame != null) {
+ APSMessage responseMsg = new APSMessage();
+
+ if (log.isDebugEnabled())
+ log.debug("Gateway" + ": Sync T > 0x" + Hex.toHexString(msg.getClusterID() & 0xffff, 2) + "(clusterId) "
+ + zclResponseFrame.toString());
+
+ log.debug("sending message to node " + getIeeeAddressHex(msg.getSourceAddress()));
+
+ responseMsg.setDestinationAddressMode(msg.getSourceAddressMode());
+ responseMsg.setDestinationAddress(msg.getSourceAddress());
+ responseMsg.setDestinationEndpoint(msg.getSourceEndpoint());
+ responseMsg.setSourceEndpoint(localEndpoint);
+
+ responseMsg.setClusterID(msg.getClusterID() & 0xffff);
+ responseMsg.setProfileID(msg.getProfileID() & 0xffff);
+ responseMsg.setData(zclResponseFrame.getData());
+
+ TxOptions tx = new TxOptions();
+ tx.setAcknowledged(true);
+ tx.setPermitFragmentation(false);
+ tx.setSecurityEnabled(false);
+ tx.setUseNetworkKey(true);
+ responseMsg.setTxOptions(tx);
+ responseMsg.setRadius((short) 10);
+
+ try {
+ gateway.sendAPSMessage(responseMsg);
+ } catch (IOException e) {
+ log.error("IOException, message not sent :" + e.getMessage());
+ } catch (GatewayException e) {
+ log.error("GatewayException, message not sent :" + e.getMessage());
+ } catch (Exception e) {
+ log.error("Exception, message not sent :" + e.getMessage(), e);
+ }
+ }
+ }
+
+ private void unregisterDevice(String nodePid) {
+ Vector deviceRegs = (Vector) this.ieee2sr.get(nodePid);
+ if (deviceRegs != null) {
+ this.ieee2sr.remove(nodePid);
+ this.ieee2devices.remove(nodePid);
+ for (Iterator iterator = deviceRegs.iterator(); iterator.hasNext();) {
+ ServiceRegistration deviceReg = (ServiceRegistration) iterator.next();
+ deviceReg.unregister();
+ }
+ }
+ }
+
+ public void removeDevice(String nodePid) throws Exception {
+ rwLock.writeLock().lock();
+ try {
+ Vector devices = (Vector) ieee2devices.get(nodePid);
+ if (devices == null || devices.size() == 0)
+ return;
+ log.debug(nodePid + ": deleting node with ieee address ");
+ log.debug("in terminateDeviceDiscovery() sending leave to node " + nodePid);
+ gateway.leave(timeout, ((ZigBeeDevice) devices.get(0)).getServiceDescriptor().getAddress());
+ this.unregisterDevice(nodePid);
+ } finally {
+ rwLock.writeLock().unlock();
+ }
+ }
+
+ protected void remove(ZigBeeDevice device) throws Exception {
+ ServiceDescriptor service = device.getServiceDescriptor();
+ this.removeDevice(getIeeeAddressHex(service.getAddress()));
+ }
+
+ protected void setUseNVM(boolean useNVM) {
+ synchronized (sLock) {
+ if (this.usePreferenceService) {
+ this.store("useNVMNetworkSetting", useNVM);
+ this.useNVMNetworkSetting = useNVM;
+ } else {
+ this.useNVMNetworkSetting = useNVM;
+ this.saveProperties();
+ }
+ }
+ }
+
+ private void store(String s, boolean value) {
+ Preferences userPrefs = this.preferenceService.getSystemPreferences().node("configuration");
+ userPrefs.putBoolean(s, value);
+
+ try {
+ userPrefs.flush();
+ userPrefs.sync();
+ } catch (BackingStoreException e) {
+ log.fatal(e);
+ }
+ }
+
+ private boolean read(String name, boolean defaultValue) {
+ Preferences userPrefs = this.preferenceService.getSystemPreferences().node("configuration");
+ try {
+ userPrefs.sync();
+ } catch (BackingStoreException e) {
+ log.fatal("unable to store 'coinfiguration' node", e);
+ }
+
+ boolean value = userPrefs.getBoolean(name, defaultValue);
+ if (defaultValue != value) {
+
+ }
+ return value;
+ }
+
+ String dataFilename = "time.ser";
+
+ private boolean useDataFileDir = false;
+
+ private void loadData() {
+ FileInputStream fis = null;
+ ObjectInputStream in = null;
+ try {
+ fis = new FileInputStream(dataFilename);
+ in = new ObjectInputStream(fis);
+ this.installedDevices = (Hashtable) in.readObject();
+ in.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ }
+ }
+
+ private void saveData() {
+
+ FileOutputStream fos = null;
+ ObjectOutputStream out = null;
+ try {
+ fos = new FileOutputStream(dataFilename);
+ out = new ObjectOutputStream(fos);
+ out.writeObject(this.installedDevices);
+ out.close();
+ } catch (IOException ex) {
+ ex.printStackTrace();
+ }
+ }
+
+ private void loadProperties() {
+ if (this.properties != null)
+ return;
+
+ this.properties = new Properties();
+
+ try {
+ File propertiesFile;
+ if (useDataFileDir)
+ propertiesFile = this.ctxt.getBundleContext().getDataFile(propertyFilename);
+ else {
+ URL url = new URL(propertiesFilename);
+ propertiesFile = new File(url.getFile());
+ }
+
+ this.properties.load(new FileInputStream(propertiesFile));
+ this.useNVMNetworkSetting = Boolean.parseBoolean(this.properties.getProperty("usenvm", "false"));
+ } catch (Exception e) {
+ this.useNVMNetworkSetting = false;
+ }
+ }
+
+ private boolean saveProperties() {
+ if (properties == null)
+ properties = new Properties();
+
+ try {
+ if (this.properties != null) {
+ File propertiesFile;
+ if (useDataFileDir) {
+ propertiesFile = this.ctxt.getBundleContext().getDataFile(propertyFilename);
+ } else {
+ URL url = new URL(propertiesFilename);
+ propertiesFile = new File(url.getFile());
+ }
+ this.properties.setProperty("usenvm", Boolean.toString(this.useNVMNetworkSetting));
+ properties.store(new FileOutputStream(propertiesFile), null);
+ }
+ } catch (IOException e) {
+ log.error("unable to save " + propertiesFilename, e);
+ return false;
+ }
+ return true;
+ }
+
+ private void postEvent(String topic, Map props) {
+ if (this.eventAdmin != null) {
+ try {
+ this.eventAdmin.postEvent(new Event(topic, props));
+ } catch (Exception e) {
+ log.error(e);
+ }
+ }
+ }
+
+ protected boolean getUseNVM() {
+ return this.useNVMNetworkSetting;
+ }
+
+ public void openNetwork() throws Exception {
+ openNetwork((short) 60);
+ }
+
+ public void openNetwork(int duration) throws Exception {
+ permitJoin((short) duration);
+ }
+
+ public void closeNetwork() throws Exception {
+ permitJoin((short) 0);
+ }
+
+ public void bindingResult(Status status) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void unbindingResult(Status status) {
+ // TODO Auto-generated method stub
+ log.debug("Received unbindingResult()");
+ }
+
+ public void nodeBindingsRetrieved(Status status, BindingList bindings) {
+ // TODO Auto-generated method stub
+ log.debug("Received nodeBindingsRetrieved()");
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/internal/zigbee/ZigBeeManagerProperties.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/internal/zigbee/ZigBeeManagerProperties.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/internal/zigbee/ZigBeeManagerProperties.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,24 @@
+package it.telecomitalia.ah.internal.zigbee;
+
+
+public class ZigBeeManagerProperties extends OSGiProperties {
+ public static final String PROP_ENABLE_LQI = "it.telecomitalia.ah.adapter.zigbee.lqi";
+ public static final String PROP_DISCOVERY_DELAY = "it.telecomitalia.ah.adapter.zigbee.discovery.delay";
+ public static final String PROP_DISCOVERY_INITIAL_DELAY = "it.telecomitalia.ah.adapter.zigbee.discovery.initialdelay";
+ public static final String PROP_ZGD_RECONNECT_DELAY = "it.telecomitalia.ah.adapter.zigbee.reconnect";
+ public static final String PROP_TIMEOUTS = "it.telecomitalia.ah.adapter.zigbee.timeouts";
+
+ static final boolean DEFAULT_ENABLE_LQI = false;
+ static final int DEFAULT_DISCOVERY_DELAY = 0;
+ static final int DEFAULT_DISCOVERY_INITIAL_DELAY = 15;
+ static final int DEFAULT_ZGD_RECONNECT_DELAY = 5;
+ static final int DEFAULT_TIMEOUTS = 7000;
+
+ ZigBeeManagerProperties() {
+ this.setProperty(PROP_ENABLE_LQI, false);
+ this.setProperty(PROP_DISCOVERY_DELAY, 0);
+ this.setProperty(PROP_DISCOVERY_INITIAL_DELAY, DEFAULT_DISCOVERY_INITIAL_DELAY);
+ this.setProperty(PROP_ZGD_RECONNECT_DELAY, DEFAULT_ZGD_RECONNECT_DELAY);
+ this.setProperty(PROP_TIMEOUTS, DEFAULT_TIMEOUTS);
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/IZclFrame.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/IZclFrame.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/IZclFrame.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,103 @@
+package it.telecomitalia.ah.zigbee;
+
+public interface IZclFrame {
+
+ public static final byte FRAME_TYPE_MASK = 0x03;
+ public static final byte MANUFACTURER_SPECIFIC_MASK = 0x04;
+ public static final byte DIRECTION_MASK = 0x08;
+ public static final byte DISABLE_DEFAULT_RESPONSE_MASK = 0x10;
+
+ public static final byte SERVER_TO_CLIENT_DIRECTION = 0x01;
+ public static final byte CLIENT_TO_SERVER_DIRECTION = 0x00;
+
+ public static final byte GENERAL_COMMAND = 0x00;
+ public static final byte CLUSTER_COMMAND = 0x01;
+
+ public void disableDefaultResponse(boolean disableDefaultResponse);
+
+ public byte getFrameControlField();
+
+ public byte getSequenceNumber();
+
+ public int getManufacturerCode() throws ZigBeeException;
+
+ public byte[] getData();
+
+ public boolean isDefaultResponseDisabled();
+
+ public boolean isManufacturerSpecific();
+
+ public boolean isClientToServer();
+
+ public boolean isServerToClient();
+
+ public byte getDirection();
+
+ public void setDirection(byte direction);
+
+ public void setSequence(int sequence);
+
+ public void setFrameType(byte generalCommand);
+
+ public IZclFrame createResponseFrame(int payloadSize);
+
+ public void appendUInt8(int uint8);
+
+ public void appendUInt16(int uint16);
+
+ public void appendUInt24(int uint24);
+
+ public void appendUInt32(long uint32);
+
+ public void appendInt8(short uint8);
+
+ public void appendInt16(int uint16);
+
+ public void appendInt24(int uint24);
+
+ public void appendInt32(long uint32);
+
+ public void appendBoolean(boolean value);
+
+ public short parseUInt8();
+
+ public int parseUInt16();
+
+ public int parseUInt24();
+
+ public long parseUInt32();
+
+ public boolean parseBoolean();
+
+ public byte[] parseOctets();
+
+ public String parseString();
+
+ public byte[] parseArray(int len);
+
+ public int getCommandId();
+
+ public void appendOctets(byte[] value);
+
+ public void appendString(String value);
+
+ public void appendArray(byte[] array);
+
+ public long parseUTCTime();
+
+ public void appendUTCTime(long value);
+
+ public long parseUInt48();
+
+ public void appendUInt48(long value);
+
+ public void setCommandId(int commandId);
+
+ public String toString();
+
+ public byte getFrameType();
+
+ public short getPayloadSize();
+
+ public void shrink();
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/ZCL.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/ZCL.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/ZCL.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,60 @@
+package it.telecomitalia.ah.zigbee;
+
+/**
+ * Contains constants related to the Zigbee Cluster Library like: profile ids,
+ * commands ids, attributes ids
+ */
+public interface ZCL {
+
+ /* ZCL command frames */
+ public static final int ZclReadAttrs = 0;
+ public static final int ZclReadAttrsRsp = 1;
+
+ public static final int ZclWriteAttrs = 2;
+ public static final int ZclWriteAttrsUndivided = 3;
+ public static final int ZclWriteAttrsRsp = 4;
+ public static final int ZclWriteAttrsNoRsp = 5;
+
+ public static final int ZclConfigRep = 6;
+ public static final int ZclConfigRepRsp = 7;
+
+ public static final int ZclRepConf = 8;
+ public static final int ZclRepConfRsp = 9;
+
+ public static final int ZclReportAttrs = 0x0A;
+
+ public static final int ZclDefaultRsp = 0x0B;
+
+ public static final int ZclDiscoverAttrs = 0x0c;
+ public static final int ZclDiscoverAttrsRsp = 0x0d;
+ public static final int ZclReadAttrsStructured = 0x0e;
+ public static final int ZclWriteAttrsStructured = 0x0f;
+ public static final int ZclWriteAttrsStructuredRsp = 0x10;
+
+
+ public static final short SUCCESS = 0x00;
+ public static final short FAILURE = 0x01;
+ public static final short NOT_AUTHORIZED = 0x7e;
+ public static final short RESERVED_FIELD_NOT_ZERO = 0x7f;
+ public static final short MALFORMED_COMMAND = 0x80;
+ public static final short UNSUP_CLUSTER_COMMAND = 0x81;
+ public static final short UNSUP_GENERAL_COMMAND = 0x82;
+ public static final short UNSUP_MANUF_CLUSTER_COMMAND = 0x83;
+ public static final short UNSUP_MANUF_GENERAL_COMMAND = 0x84;
+ public static final short INVALID_FIELD = 0x85;
+ public static final short UNSUPPORTED_ATTRIBUTE = 0x86;
+ public static final short INVALID_VALUE = 0x87;
+ public static final short READ_ONLY = 0x88;
+ public static final short INSUFFICIENT_SPACE = 0x89;
+ public static final short DUPLICATE_EXISTS = 0x8a;
+ public static final short NOT_FOUND = 0x8b;
+ public static final short UNREPORTABLE_ATTRIBUTE = 0x8c;
+ public static final short INVALID_DATA_TYPE = 0x8d;
+ public static final short INVALID_SELECTOR = 0x8e;
+ public static final short WRITE_ONLY = 0x8f;
+ public static final short INCONSISTENT_STARTUP_STATE = 0x90;
+ public static final short DEFINED_OUT_OF_BAND = 0x91;
+ public static final short HARDWARE_FAILURE = 0xc0;
+ public static final short SOFTWARE_FAILURE = 0xc1;
+ public static final short CALIBRATION_ERROR = 0xc3;
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/ZclFrame.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/ZclFrame.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/ZclFrame.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,374 @@
+package it.telecomitalia.ah.zigbee;
+
+import it.telecomitalia.ah.internal.zigbee.Hex;
+
+public class ZclFrame implements IZclFrame {
+
+ byte[] data;
+
+ int pos = 0;
+
+ public ZclFrame(int fcf, int payloadSize) {
+ this((byte) fcf, payloadSize);
+ }
+
+ public ZclFrame(int fcf) {
+ this((byte) fcf, 0);
+ }
+
+ public ZclFrame(byte fcf, int payloadSize) {
+
+ if ((fcf & MANUFACTURER_SPECIFIC_MASK) > 0) {
+ // 5 is the sum of Frame Control Field + Seq + Manufacturer ID +
+ // Command Id
+ data = new byte[5 + payloadSize];
+ pos = 5;
+ } else {
+ // 3 is the sum of Frame Control Field + Seq + Command Id
+ data = new byte[3 + payloadSize];
+ pos = 3;
+ }
+ data[0] = fcf;
+ }
+
+ public ZclFrame(byte[] data) {
+ this.data = data;
+ if (data.length < 3)
+ System.out.println("FIXME: check size, NOW IS INCORRECT!!!");
+ // throw new ZclException("Frame too short");
+
+ if (isManufacturerSpecific())
+ pos = 5;
+ else
+ pos = 3;
+ }
+
+ public short getZclHeaderSize() {
+ if (isManufacturerSpecific())
+ return 5;
+ else
+ return 3;
+ }
+
+ public void disableDefaultResponse(boolean disableDefaultResponse) {
+ if (disableDefaultResponse)
+ data[0] = (byte) (data[0] | DISABLE_DEFAULT_RESPONSE_MASK);
+ else
+ data[0] = (byte) (data[0] & 0xEF);
+ }
+
+ public IZclFrame createResponseFrame(int payloadSize) {
+ short size = getZclHeaderSize();
+ byte[] responseData = new byte[size + payloadSize];
+ System.arraycopy(this.data, 0, responseData, 0, size);
+ IZclFrame zclResponseFrame = new ZclFrame(responseData);
+ responseData[0] = (byte) (responseData[0] ^ DIRECTION_MASK);
+ responseData[0] = (byte) (responseData[0] | DISABLE_DEFAULT_RESPONSE_MASK);
+ return zclResponseFrame;
+ }
+
+ public byte[] getData() {
+ return data;
+ }
+
+ public byte getFrameControlField() {
+ return data[0];
+ }
+
+ public byte getSequenceNumber() {
+ if (isManufacturerSpecific())
+ return data[3];
+ else
+ return data[1];
+ }
+
+ public boolean isClientToServer() {
+ return !isServerToClient();
+ }
+
+ public boolean isServerToClient() {
+ return ((data[0] & DIRECTION_MASK) > 0);
+ }
+
+ public boolean isDefaultResponseDisabled() {
+ return (data[0] & DISABLE_DEFAULT_RESPONSE_MASK) > 0;
+ }
+
+ public void setDirection(byte direction) {
+ if (direction == SERVER_TO_CLIENT_DIRECTION)
+ data[0] = (byte) ((data[0] & 0xff) | DIRECTION_MASK);
+ else
+ data[0] = (byte) (data[0] & ~DIRECTION_MASK);
+ }
+
+ public void setSequence(int sequence) {
+ sequence = sequence % 0xff;
+ if (isManufacturerSpecific())
+ data[3] = (byte) sequence;
+ else
+ data[1] = (byte) sequence;
+ }
+
+ public int getCommandId() {
+ if (isManufacturerSpecific())
+ return data[4] & 0xff;
+ else
+ return data[2] & 0xff;
+ }
+
+ public void setCommandId(int commandId) {
+ if (isManufacturerSpecific())
+ data[4] = (byte) commandId;
+ else
+ data[2] = (byte) commandId;
+ }
+
+ public int getManufacturerCode() throws ZigBeeException {
+ if (isManufacturerSpecific())
+ return ((data[1] & 0xff) | ((data[2] & 0xff) << 8));
+ else
+ throw new ZigBeeException();
+ }
+
+ public boolean isManufacturerSpecific() {
+ return (data[0] & MANUFACTURER_SPECIFIC_MASK) > 0;
+ }
+
+ public void appendULongWithSize(long l, int size) {
+ for (int i = 0; i < size; i++) {
+ data[pos++] = (byte) (l & 0xFF);
+ l >>= 8;
+ }
+ }
+
+ public long readULongWithSize(int size) {
+ long l = 0;
+ pos += size;
+ for (int i = 0; i < size; i++) {
+ l <<= 8;
+ short s = (short) (data[--pos] & 0xFF);
+ l = l | s;
+ }
+ pos += size;
+ return l;
+ }
+
+ public void appendUInt8(int uint8) {
+ data[pos++] = (byte) (uint8 & 0xff);
+ }
+
+ public void appendUInt16(int uint16) {
+ data[pos++] = (byte) (uint16 & 0xFF);
+ data[pos++] = (byte) (uint16 >> 8);
+ }
+
+ public void appendUInt24(int uint24) {
+ data[pos++] = (byte) (uint24 & 0xFF);
+ data[pos++] = (byte) (uint24 >> 8);
+ data[pos++] = (byte) (uint24 >> 16);
+ }
+
+ public void appendUInt32(long uint32) {
+ data[pos++] = (byte) (uint32 & 0xFF);
+ data[pos++] = (byte) (uint32 >> 8);
+ data[pos++] = (byte) (uint32 >> 16);
+ data[pos++] = (byte) (uint32 >> 24);
+ }
+
+ public void appendBoolean(boolean b) {
+ if (b)
+ data[pos++] = 1;
+ else
+ data[pos++] = 0;
+ }
+
+ public void appendOctets(byte[] octets) {
+ // TODO: optimize
+ if (octets == null)
+ appendUInt8((short) 0xFF); // invalid value
+
+ appendUInt8((short) octets.length);
+ for (int i = 0; i < octets.length; i++) {
+ data[pos++] = octets[i];
+ }
+ }
+
+ public void appendString(String s, int size) throws ZigBeeException {
+ // FIXME: optimize
+ if (s.length() > size) {
+ throw new ZigBeeException();
+ }
+
+ appendOctets(s.getBytes());
+ }
+
+ public void appendInt8(short int8) {
+ appendUInt8(int8);
+ }
+
+ public void appendInt16(int int16) {
+ appendUInt16(int16);
+ }
+
+ public void appendInt24(int int24) {
+ appendUInt24(int24);
+ }
+
+ public void appendInt32(long int32) {
+ // TODO Auto-generated method stub
+ appendUInt32(int32);
+ }
+
+ public short parseUInt8() {
+ return (short) this.readULongWithSize(1);
+ }
+
+ public int parseUInt16() {
+ return (int) this.readULongWithSize(2);
+ }
+
+ public int parseUInt24() {
+ return (int) this.readULongWithSize(3);
+ }
+
+ public long parseUInt32() {
+ return (int) this.readULongWithSize(4);
+ }
+
+ public boolean parseBoolean() {
+ return (parseUInt8() > 0);
+ }
+
+ public byte[] parseOctets() {
+ long len = parseUInt8();
+ if (len == 0xff) {
+ return null;
+ }
+
+ byte[] d = new byte[(int) len];
+ // TODO: optimize it
+ for (int i = 0; i < len; i++) {
+ d[i] = data[pos++];
+ }
+ return d;
+ }
+
+ public String parseString() {
+ int len = parseUInt8();
+ if (len == 0xff) {
+ return null;
+ }
+
+ String s = new String(data, pos, len);
+ return s;
+ }
+
+ public void appendString(String value) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void appendUTCTime(long epoch) {
+ appendUInt32(epoch);
+ }
+
+ public long parseUTCTime() {
+ return parseUInt32();
+ }
+
+ public void appendUInt48(long value) {
+ appendULongWithSize(value, 6);
+ }
+
+ public long parseUInt48() {
+ return readULongWithSize(6);
+ }
+
+ public String toString() {
+ if (data == null)
+ return "null";
+
+ if (data.length == 0)
+ return "empty message";
+
+ if (this.isManufacturerSpecific()) {
+ if (data.length < 5)
+ return "wrong message, must be at least 5 bytes long";
+ else if (data.length < 3)
+ return "wrong message, must be at least 5 bytes long";
+ }
+
+ String out = "";
+
+ // OK, print the message
+
+ byte frameType = getFrameType();
+ if (frameType == 0x00)
+ out += "P";
+ else
+ out += "C";
+
+ if (this.isManufacturerSpecific())
+ out += "M";
+ else
+ out += "_";
+
+ if (this.isServerToClient())
+ out += "S";
+ else
+ out += "C";
+
+ if (!isDefaultResponseDisabled())
+ out += "R";
+ else
+ out += "_";
+
+ int i;
+ if (isManufacturerSpecific())
+ i = 5;
+ else
+ i = 3;
+
+ out += " 0x" + Hex.toHexString(getSequenceNumber() & 0xff, 1) + " [seq] ";
+
+ out += " 0x" + Hex.toHexString(getCommandId(), 1) + " [cmdId] ";
+
+ out += Hex.byteToHex(data, i);
+
+ return out;
+ }
+
+ public byte getFrameType() {
+ return (byte) (data[0] & FRAME_TYPE_MASK);
+ }
+
+ public short getPayloadSize() {
+ return (short) (data.length - this.getZclHeaderSize());
+ }
+
+ public void shrink() {
+ if (pos != data.length) {
+ byte[] d = new byte[pos];
+ System.arraycopy(data, 0, d, 0, pos);
+ data = d;
+ }
+ }
+
+ public void setFrameType(byte frameType) {
+ data[0] = (byte) ((data[0] & ~FRAME_TYPE_MASK) | (frameType & FRAME_TYPE_MASK));
+ }
+
+ public void appendArray(byte[] array) {
+ System.arraycopy(array, 0, this.data, pos, array.length);
+ }
+
+ public byte getDirection() {
+ return (byte) ((data[0] & DIRECTION_MASK) >> 3);
+ }
+
+ public byte[] parseArray(int len) {
+ byte[] array = new byte[len];
+ System.arraycopy(this.data, pos, array,0 , len);
+ return array;
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/ZclSerializer.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/ZclSerializer.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/ZclSerializer.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,253 @@
+package it.telecomitalia.ah.zigbee;
+
+public class ZclSerializer {
+
+ private int pos = 0;
+ public int profileId;
+ public int clusterId;
+ public byte data[];
+ private int seq;
+
+ public ZclSerializer() {
+ data = new byte[300];
+ pos = 0;
+ }
+
+ public byte readByte() {
+ return data[pos++];
+ }
+
+ public long readUInt8() {
+ return data[pos++] & 0xFF;
+ }
+
+ public int readShort() {
+ int ret = (int) ((data[pos + 1] & 0xFF) << 8 | (data[pos] & 0xFF));
+ pos += 2;
+ return ret;
+ }
+
+ public int readInt32() {
+ // FIXME: order is correct?
+ long res = 0;
+ short val;
+ for (int i = 3; i >= 0; i--) {
+ val = (short) (data[pos + i] & 0xFF);
+ res = (res << 8) | val;
+ }
+ pos += 4;
+ return (int) res;
+ }
+
+ public void writeByte(byte v) {
+ data[pos++] = v;
+ }
+
+ public void writeShort(int i) {
+ data[pos++] = (byte) (i & 0xFF);
+ data[pos++] = (byte) (i >> 8);
+ }
+
+ public int readInt() {
+ // FIXME: order is correct?
+ long res = 0;
+ short val;
+ for (int i = 3; i >= 0; i--) {
+ val = (short) (data[pos + i] & 0xFF);
+ res = (res << 8) | val;
+ }
+ pos += 4;
+ return (int) res;
+ }
+
+ public void resetData() {
+ pos = 0;
+ }
+
+ /**
+ * Returns the payload
+ */
+ public byte[] getPayload() {
+ byte[] newarray = new byte[pos];
+ System.arraycopy(data, 0, newarray, 0, newarray.length);
+ return newarray;
+ }
+
+ public int getPosition() {
+ return pos;
+ }
+
+ public int getDataLeftLength() {
+ return (data.length - pos);
+ }
+
+ /**
+ * Returns the payload
+ */
+ public byte[] getDataLeft() {
+ byte[] newarray = new byte[data.length - pos];
+ try {
+ System.arraycopy(data, pos, newarray, 0, newarray.length);
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return newarray;
+ }
+
+ public void setPayload(byte[] data, int pos) {
+ this.data = data;
+ this.pos = pos;
+ }
+
+ public void writeUInt32(long i32) {
+ data[pos++] = (byte) (i32 & 0xFF);
+ data[pos++] = (byte) (i32 >> 8);
+ data[pos++] = (byte) (i32 >> 16);
+ data[pos++] = (byte) (i32 >> 24);
+ }
+
+ public int readInt24() {
+ // FIXME: order is correct?
+ long res = 0;
+ short val;
+ for (int i = 2; i >= 0; i--) {
+ val = (short) (data[pos + i] & 0xFF);
+ res = (res << 8) | val;
+ }
+ pos += 4;
+ return (int) res;
+ }
+
+ public int readInt16() {
+ // FIXME: order is correct?
+ long res = 0;
+ short val;
+ for (int i = 1; i >= 0; i--) {
+ val = (short) (data[pos + i] & 0xFF);
+ res = (res << 8) | val;
+ }
+ pos += 4;
+ return (int) res;
+ }
+
+ public void writeInt16(int i16) {
+ data[pos++] = (byte) (i16 & 0xFF);
+ data[pos++] = (byte) (i16 >> 8);
+ }
+
+ public void writeInt24(byte i24) {
+ data[pos++] = (byte) (i24 & 0xFF);
+ data[pos++] = (byte) (i24 >> 8);
+ data[pos++] = (byte) (i24 >> 16);
+ }
+
+ public void writeBytes(byte[] data2) {
+ for (int i = 0; i < data2.length; i++) {
+ data[pos++] = data2[i];
+ }
+ }
+
+ public void setSeq(int seq) {
+ this.seq = seq;
+ writeByte((byte) seq);
+ }
+
+ public String readString() {
+ long len = readUInt8();
+ if (len == 0xff) {
+ return null;
+ }
+
+ String s = "";
+
+ // FIXME: optimize
+ for (int i = 0; i < len; i++) {
+ s = s + data[pos++];
+ }
+
+ return s;
+ }
+
+ public byte[] readData() {
+ long len = readUInt8();
+ if (len == 0xff) {
+ return null;
+ }
+
+ byte[] d = new byte[(int) len];
+
+ String s = "";
+
+ // FIXME: optimize
+ for (int i = 0; i < len; i++) {
+ d[i] = data[pos++];
+ }
+
+ return d;
+ }
+
+ public int getSeq() {
+ // System.out.println("Seq is " + seq);
+ return seq;
+ }
+
+ public short getFrameControlField() {
+ if (pos > 0) {
+ return (short) (data[0] & 0xFF);
+ }
+ return -1;
+ }
+
+ public void undo(int i) {
+ if (pos > i) {
+ pos -= i;
+ }
+ }
+
+ public long readULongWithSize(int size) {
+ long l = 0;
+ pos += size;
+ for (int i = 0; i < size; i++) {
+ l <<= 8;
+ short s = (short) (data[--pos] & 0xFF);
+ l = l | s;
+ }
+ pos += size;
+ return l;
+ }
+
+ public void append_uint8(byte uint8) {
+ data[pos++] = uint8;
+ }
+
+ public void append_uint16(short uint16) {
+ data[pos++] = (byte) (uint16 & 0xFF);
+ data[pos++] = (byte) (uint16 >> 8);
+ }
+
+ public void append_uint24(int uint24) {
+ data[pos++] = (byte) (uint24 & 0xFF);
+ data[pos++] = (byte) (uint24 >> 8);
+ data[pos++] = (byte) (uint24 >> 16);
+ }
+ public void append_uint32(int uint32) {
+ data[pos++] = (byte) (uint32 & 0xFF);
+ data[pos++] = (byte) (uint32 >> 8);
+ data[pos++] = (byte) (uint32 >> 16);
+ data[pos++] = (byte) (uint32 >> 24);
+ }
+
+ public void append_ulong(long l, int size) {
+ for (int i = 0; i < size; i++) {
+ data[pos++] = (byte) (l & 0xFF);
+ l >>= 8;
+ }
+ }
+
+ public void append_octets (byte[] octets) {
+ for (int i = 0; i < octets.length; i++) {
+ data[pos++] = octets[i];
+ }
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/ZigBeeDevice.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/ZigBeeDevice.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/ZigBeeDevice.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,101 @@
+package it.telecomitalia.ah.zigbee;
+
+import it.telecomitalia.ah.hac.IHacDevice;
+import it.telecomitalia.zgd.jaxb.NodeDescriptor;
+import it.telecomitalia.zgd.jaxb.NodeServices;
+import it.telecomitalia.zgd.jaxb.ServiceDescriptor;
+
+public interface ZigBeeDevice extends IHacDevice {
+
+ public void remove();
+
+ public String getIeeeAddress();
+
+ public ServiceDescriptor getServiceDescriptor();
+
+ public NodeDescriptor getNodeDescriptor();
+
+ public NodeServices getNodeServices();
+
+ /**
+ * The invoke method sends the passed frame and wait for the answer from the
+ * destination zigbee node. The caller remains blocked until the answer has
+ * been received. A ZigBeeException exception is raised in case of error
+ * (for instance a timeout)
+ *
+ * @param clusterId
+ * The clusterId of the zcl frame
+ *
+ * @param zclFrame
+ * The ZCL frame
+ *
+ * @return The ZCL frame containing the response from the remote node or
+ * null if the zclFrame parameter indicates that the default
+ * response is disabled.
+ *
+ * @throws ZigBeeException
+ */
+ public IZclFrame invoke(short clusterId, IZclFrame zclFrame) throws ZigBeeException;
+
+ /**
+ * The invoke method sends the passed frame and wait for the answer from the
+ * destination zigbee node. The caller remains blocked until the answer has
+ * been received. A ZigBeeException exception is raised in case of error
+ * (for instance a timeout)
+ * * @param profileId
+ * The profileId of the zcl frame
+ *
+ * @param clusterId
+ * The clusterId of the zcl frame
+ *
+ * @param zclFrame
+ * The ZCL frame
+ *
+ * @return The ZCL frame containing the response from the remote node or
+ * null if the zclFrame parameter indicates that the default
+ * response is disabled.
+ *
+ * @throws ZigBeeException
+ */
+ public IZclFrame invoke(short profileId, short clusterId, IZclFrame zclFrame) throws ZigBeeException;
+
+ /**
+ * This method sends the frame and don't wait for the answer. The response
+ * will be notified to the caller by means of the listener.
+ *
+ * @param clusterId
+ * @param zclFrame
+ * @return True if successful.
+ */
+ public boolean post(short clusterId, IZclFrame zclFrame);
+
+ /**
+ * This method sends the frame and don't wait for the answer. The response
+ * will be notified to the caller by means of the listener.
+ *
+ * @param clusterId
+ * @param profileId
+ * @param zclFrame
+ * @return True if successful.
+ */
+ public boolean post(short profileId, short clusterId, IZclFrame zclFrame);
+
+ public boolean setListener(ZigBeeDeviceListener listener);
+
+ public boolean setListener(short clusterId, int side, ZigBeeDeviceListener listener);
+
+ public boolean removeListener(short clusterId, int side, ZigBeeDeviceListener listener);
+
+ public boolean removeListener(ZigBeeDeviceListener listener);
+
+ /**
+ * Enables the partition cluster on specific clusterId, commandId
+ * @param clusterId
+ * @return
+ */
+
+ public boolean enablePartitionServer(short clusterId, short commandId);
+ public boolean disablePartitionServer(short clusterId, short commandId);
+
+ public void injectZclFrame(short clusterId, IZclFrame assembledZclFrame);
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/ZigBeeDeviceListener.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/ZigBeeDeviceListener.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/ZigBeeDeviceListener.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,10 @@
+package it.telecomitalia.ah.zigbee;
+
+public interface ZigBeeDeviceListener {
+
+ static final int ANNOUNCEMENT = 1;
+ static final int LEAVE = 2;
+
+ public boolean notifyZclFrame(short clusterId, IZclFrame zclFrame) throws Exception;
+ public void notifyEvent(int event);
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/ZigBeeException.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/ZigBeeException.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/ZigBeeException.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,15 @@
+package it.telecomitalia.ah.zigbee;
+
+import it.telecomitalia.ah.hac.ApplianceException;
+
+public class ZigBeeException extends ApplianceException {
+ private static final long serialVersionUID = -9061173261520561187L;
+
+ public ZigBeeException(String errorDescription) {
+ super(errorDescription);
+ }
+
+ public ZigBeeException() {
+ super("");
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/ZigBeeMngrService.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/ZigBeeMngrService.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/ZigBeeMngrService.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,6 @@
+package it.telecomitalia.ah.zigbee;
+
+public interface ZigBeeMngrService {
+ void permitJoin(short duration) throws Exception;
+ void removeDevice(String devicePid) throws Exception;
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/IZclAppliance.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/IZclAppliance.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/IZclAppliance.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,7 @@
+package it.telecomitalia.ah.zigbee.zcl;
+
+import it.telecomitalia.ah.hac.IAppliance;
+
+public interface IZclAppliance extends IAppliance {
+ public String zclGetNodeMacAddress();
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/IZclAttributeDescriptor.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/IZclAttributeDescriptor.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/IZclAttributeDescriptor.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,22 @@
+package it.telecomitalia.ah.zigbee.zcl;
+
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclAbstractDataType;
+
+public interface IZclAttributeDescriptor {
+
+ public static final int ACCESS_RW = 0;
+ public static final int ACCESS_RO = 1;
+ public static final int ACCESS_WO = 1;
+
+ public String getName();
+
+ public Class getJavaClass();
+
+ public int zclGetId();
+
+ public ZclAbstractDataType zclGetDataType();
+
+ public boolean isReportable();
+
+ public int accessMode();
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/IZclAttributeValue.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/IZclAttributeValue.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/IZclAttributeValue.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,7 @@
+package it.telecomitalia.ah.zigbee.zcl;
+
+import it.telecomitalia.ah.hac.IAttributeValue;
+
+public interface IZclAttributeValue extends IAttributeValue {
+ public int zclGetAttributeId();
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/IZclServiceCluster.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/IZclServiceCluster.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/IZclServiceCluster.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,10 @@
+package it.telecomitalia.ah.zigbee.zcl;
+
+import it.telecomitalia.ah.hac.IServiceCluster;
+import it.telecomitalia.ah.zigbee.ZigBeeDevice;
+
+public interface IZclServiceCluster extends IServiceCluster {
+ public void zclAttach(ZigBeeDevice device);
+
+ public void zclDetach(ZigBeeDevice device);
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/IZclServiceEndPoint.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/IZclServiceEndPoint.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/IZclServiceEndPoint.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,10 @@
+package it.telecomitalia.ah.zigbee.zcl;
+
+import it.telecomitalia.ah.hac.IEndPoint;
+import it.telecomitalia.ah.zigbee.ZigBeeDevice;
+
+public interface IZclServiceEndPoint extends IEndPoint {
+ public ZigBeeDevice zclGetZigBeeDevice();
+
+ public void zclSetZigBeeDevice(ZigBeeDevice device);
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/ZclException.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/ZclException.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/ZclException.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,37 @@
+package it.telecomitalia.ah.zigbee.zcl;
+
+/**
+ * This exception class is used to represent ZCL status codes.
+ */
+public class ZclException extends Exception {
+ private static final long serialVersionUID = 1528742844625466431L;
+
+ private int statusCode = -1;
+
+ /**
+ * Creates an ZclException on the specified ZCL status code
+ *
+ * @param errorDescription
+ * describes the type of error
+ */
+ public ZclException(int statusCode) {
+ this.statusCode = statusCode;
+ }
+
+ public ZclException(String message, int statusCode) {
+ super(message);
+ this.statusCode = statusCode;
+ }
+
+ /**
+ * getter to retrieve the ZCL status code associated to this exception
+ * class. The ZCL status codes are well described in the ZigBee Clusster
+ * Library specifications
+ *
+ * @return the ZCL status code.
+ */
+
+ public int getStatusCode() {
+ return this.statusCode;
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/ZclValidationException.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/ZclValidationException.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/ZclValidationException.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,22 @@
+package it.telecomitalia.ah.zigbee.zcl;
+
+import it.telecomitalia.ah.hac.ServiceClusterException;
+
+
+public class ZclValidationException extends ServiceClusterException {
+ private static final long serialVersionUID = 6593768542224312233L;
+ private int reason = -1;
+
+ public ZclValidationException(String errorDescription) {
+ super(errorDescription);
+ }
+
+ public ZclValidationException(int reason, String errorDescription) {
+ super(errorDescription);
+ this.reason = reason;
+ }
+
+ public int getReason() {
+ return reason;
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/ZclWriteAttributeRecord.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/ZclWriteAttributeRecord.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/ZclWriteAttributeRecord.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,7 @@
+package it.telecomitalia.ah.zigbee.zcl;
+
+public class ZclWriteAttributeRecord {
+ public int Id;
+ public short DataType;
+ public Object ZclData;
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/custom/ZclSimpleMetering4NoksClient.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/custom/ZclSimpleMetering4NoksClient.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/custom/ZclSimpleMetering4NoksClient.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,20 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.custom;
+
+import it.telecomitalia.ah.cluster.zigbee.custom.SimpleMetering4NoksClient;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+
+public class ZclSimpleMetering4NoksClient extends ZclServiceCluster implements SimpleMetering4NoksClient, ZigBeeDeviceListener {
+
+ final static short CLUSTER_ID = 12;
+
+ public ZclSimpleMetering4NoksClient() throws ApplianceException {
+ super();
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/custom/ZclSimpleMetering4NoksServer.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/custom/ZclSimpleMetering4NoksServer.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/custom/ZclSimpleMetering4NoksServer.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,100 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.custom;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import it.telecomitalia.ah.cluster.zigbee.custom.SimpleMetering4NoksServer;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.IEndPointRequestContext;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.internal.zigbee.ZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.IZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI32;
+
+public class ZclSimpleMetering4NoksServer extends ZclServiceCluster implements SimpleMetering4NoksServer, ZigBeeDeviceListener {
+
+ final static short CLUSTER_ID = 12;
+ final static HashMap attributesMapByName = new HashMap();
+ final static HashMap attributesMapById = new HashMap();
+
+ static {
+ attributesMapByName.put(ZclSimpleMetering4NoksServer.ATTR_Power_NAME, new ZclAttributeDescriptor(0,
+ ZclSimpleMetering4NoksServer.ATTR_Power_NAME, new ZclDataTypeUI32(), null, true, 1));
+ attributesMapByName.put(ZclSimpleMetering4NoksServer.ATTR_Energy_NAME, new ZclAttributeDescriptor(1,
+ ZclSimpleMetering4NoksServer.ATTR_Energy_NAME, new ZclDataTypeUI32(), null, true, 1));
+ attributesMapByName.put(ZclSimpleMetering4NoksServer.ATTR_TimeValue_NAME, new ZclAttributeDescriptor(2,
+ ZclSimpleMetering4NoksServer.ATTR_TimeValue_NAME, new ZclDataTypeUI32(), null, true, 1));
+ }
+
+ public ZclSimpleMetering4NoksServer() throws ApplianceException {
+ super();
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ protected int getProfileId() {
+ return 0xC23C;
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(String name) {
+ return ((IZclAttributeDescriptor) attributesMapByName.get(name));
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(int id) {
+ Iterator iterator = attributesMapByName.values().iterator();
+ // FIXME: generate it and optimize!!!!
+ for (; iterator.hasNext();) {
+ IZclAttributeDescriptor attributeDescriptor = (IZclAttributeDescriptor) iterator.next();
+ if (attributeDescriptor.zclGetId() == id)
+ return attributeDescriptor;
+ }
+ return null;
+ }
+
+ public long getPower(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Long objectResult = null;
+ objectResult = ((Long) getValidCachedAttributeObject(0, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.longValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(0, context);
+ long v = ZclDataTypeUI32.zclParse(zclFrame);
+ setCachedAttributeObject(0, new Long(v));
+ return v;
+ }
+
+ public long getEnergy(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Long objectResult = null;
+ objectResult = ((Long) getValidCachedAttributeObject(1, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.longValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(1, context);
+ long v = ZclDataTypeUI32.zclParse(zclFrame);
+ setCachedAttributeObject(1, new Long(v));
+ return v;
+ }
+
+ public long getTimeValue(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Long objectResult = null;
+ objectResult = ((Long) getValidCachedAttributeObject(2, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.longValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(2, context);
+ long v = ZclDataTypeUI32.zclParse(zclFrame);
+ setCachedAttributeObject(2, new Long(v));
+ return v;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceControlClient.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceControlClient.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceControlClient.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,134 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.eh;
+
+import it.telecomitalia.ah.cluster.zigbee.eh.ApplianceControlClient;
+import it.telecomitalia.ah.cluster.zigbee.eh.ApplianceControlServer;
+import it.telecomitalia.ah.cluster.zigbee.eh.SignalStateResponse;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.IEndPointRequestContext;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZCL;
+import it.telecomitalia.ah.zigbee.ZclFrame;
+import it.telecomitalia.ah.zigbee.ZigBeeDevice;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeEnum8;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI24;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+public class ZclApplianceControlClient extends ZclServiceCluster implements ApplianceControlClient, ZigBeeDeviceListener {
+
+ public final static short CLUSTER_ID = 27;
+
+ public ZclApplianceControlClient() throws ApplianceException {
+ super();
+ }
+
+ public boolean notifyZclFrame(short clusterId, IZclFrame zclFrame) throws Exception {
+ boolean handled;
+ handled = super.notifyZclFrame(clusterId, zclFrame);
+ if (handled) {
+ return handled;
+ }
+ int commandId = zclFrame.getCommandId();
+ if (zclFrame.isServerToClient()) {
+ throw new ZclValidationException("invalid direction field");
+ }
+ IZclFrame responseZclFrame = null;
+ ZigBeeDevice device = getZigBeeDevice();
+ int statusCode = ZCL.SUCCESS;
+ ApplianceControlServer c = ((ApplianceControlServer) getSinglePeerCluster((ApplianceControlServer.class.getName())));
+ switch (commandId) {
+ case 0:
+ responseZclFrame = parseCommandExecution(c, zclFrame);
+ break;
+ case 1:
+ responseZclFrame = parseSignalState(c, zclFrame);
+ break;
+ case 2:
+ responseZclFrame = parseWriteFunctions(c, zclFrame);
+ break;
+ case 3:
+ responseZclFrame = parseOverloadPauseResume(c, zclFrame);
+ break;
+ case 4:
+ responseZclFrame = parseOverloadPause(c, zclFrame);
+ break;
+ case 5:
+ responseZclFrame = parseOverloadWarning(c, zclFrame);
+ break;
+ }
+ if (responseZclFrame == null) {
+ if (!zclFrame.isDefaultResponseDisabled()) {
+ responseZclFrame = getDefaultResponse(zclFrame, statusCode);
+ }
+ }
+ if (!(responseZclFrame == null)) {
+ device.post(ZclApplianceControlClient.CLUSTER_ID, responseZclFrame);
+ return true;
+ }
+ return false;
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ public void execSignalStateNotification(short ApplianceStatus, short RemoteEnableFlags, int ApplianceStatus2,
+ IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ int size = 0;
+ size += ZclDataTypeEnum8.zclSize(ApplianceStatus);
+ size += ZclDataTypeUI8.zclSize(RemoteEnableFlags);
+ size += ZclDataTypeUI24.zclSize(ApplianceStatus2);
+ ZclFrame zclFrame = new ZclFrame(1, size);
+ zclFrame.setCommandId(1);
+ ZclDataTypeEnum8.zclSerialize(zclFrame, ApplianceStatus);
+ ZclDataTypeUI8.zclSerialize(zclFrame, RemoteEnableFlags);
+ ZclDataTypeUI24.zclSerialize(zclFrame, ApplianceStatus2);
+ issueExec(zclFrame, 11, context);
+ }
+
+ protected IZclFrame parseCommandExecution(ApplianceControlServer o, IZclFrame zclFrame) throws ApplianceException,
+ ServiceClusterException {
+ short CommandId = ZclDataTypeEnum8.zclParse(zclFrame);
+ o.execCommandExecution(CommandId, null);
+ return null;
+ }
+
+ protected IZclFrame parseSignalState(ApplianceControlServer o, IZclFrame zclFrame) throws ApplianceException,
+ ServiceClusterException {
+ SignalStateResponse r = o.execSignalState(null);
+ int size = ZclSignalStateResponse.zclSize(r);
+ IZclFrame zclResponseFrame = zclFrame.createResponseFrame(size);
+ zclResponseFrame.setCommandId(0);
+ ZclSignalStateResponse.zclSerialize(zclResponseFrame, r);
+ return zclResponseFrame;
+ }
+
+ protected IZclFrame parseWriteFunctions(ApplianceControlServer o, IZclFrame zclFrame) throws ApplianceException,
+ ServiceClusterException {
+ // TODO: implement this!
+ return null;
+ }
+
+ protected IZclFrame parseOverloadPauseResume(ApplianceControlServer o, IZclFrame zclFrame) throws ApplianceException,
+ ServiceClusterException {
+ o.execOverloadPauseResume(null);
+ return null;
+ }
+
+ protected IZclFrame parseOverloadPause(ApplianceControlServer o, IZclFrame zclFrame) throws ApplianceException,
+ ServiceClusterException {
+ o.execOverloadPause(null);
+ return null;
+ }
+
+ protected IZclFrame parseOverloadWarning(ApplianceControlServer o, IZclFrame zclFrame) throws ApplianceException,
+ ServiceClusterException {
+ short WarningEvent = ZclDataTypeEnum8.zclParse(zclFrame);
+ o.execOverloadWarning(WarningEvent, null);
+ return null;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceControlServer.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceControlServer.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceControlServer.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,205 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.eh;
+
+import it.telecomitalia.ah.cluster.zigbee.eh.ApplianceControlClient;
+import it.telecomitalia.ah.cluster.zigbee.eh.ApplianceControlServer;
+import it.telecomitalia.ah.cluster.zigbee.eh.SignalStateResponse;
+import it.telecomitalia.ah.cluster.zigbee.eh.WriteAttributeRecord;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.IEndPointRequestContext;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.internal.zigbee.ZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZCL;
+import it.telecomitalia.ah.zigbee.ZclFrame;
+import it.telecomitalia.ah.zigbee.ZigBeeDevice;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.IZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclAbstractDataType;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeEnum8;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI16;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI24;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+import java.util.HashMap;
+import java.util.Iterator;
+
+public class ZclApplianceControlServer extends ZclServiceCluster implements ApplianceControlServer, ZigBeeDeviceListener {
+
+ final static short CLUSTER_ID = 27;
+ final static HashMap attributesMapByName = new HashMap();
+ final static HashMap attributesMapById = new HashMap();
+
+ static {
+ attributesMapByName.put(ZclApplianceControlServer.ATTR_StartTime_NAME, new ZclAttributeDescriptor(256,
+ ZclApplianceControlServer.ATTR_StartTime_NAME, new ZclDataTypeUI16(), null, true, 1));
+ attributesMapByName.put(ZclApplianceControlServer.ATTR_FinishTime_NAME, new ZclAttributeDescriptor(257,
+ ZclApplianceControlServer.ATTR_FinishTime_NAME, new ZclDataTypeUI16(), null, true, 1));
+ attributesMapByName.put(ZclApplianceControlServer.ATTR_RemainingTime_NAME, new ZclAttributeDescriptor(258,
+ ZclApplianceControlServer.ATTR_RemainingTime_NAME, new ZclDataTypeUI16(), null, true, 1));
+ }
+
+ public ZclApplianceControlServer() throws ApplianceException {
+ super();
+ }
+
+ public boolean notifyZclFrame(short clusterId, IZclFrame zclFrame) throws Exception {
+ boolean handled;
+ handled = super.notifyZclFrame(clusterId, zclFrame);
+ if (handled) {
+ return handled;
+ }
+ int commandId = zclFrame.getCommandId();
+ if (zclFrame.isClientToServer()) {
+ throw new ZclValidationException("invalid direction field");
+ }
+ IZclFrame responseZclFrame = null;
+ ZigBeeDevice device = getZigBeeDevice();
+ int statusCode = ZCL.SUCCESS;
+ ApplianceControlClient c = ((ApplianceControlClient) getSinglePeerCluster((ApplianceControlClient.class.getName())));
+ switch (commandId) {
+ case 1:
+ responseZclFrame = parseSignalStateNotification(c, zclFrame);
+ break;
+ }
+ if (responseZclFrame == null) {
+ if (!zclFrame.isDefaultResponseDisabled()) {
+ responseZclFrame = getDefaultResponse(zclFrame, statusCode);
+ }
+ }
+ if (!(responseZclFrame == null)) {
+ device.post(ZclApplianceControlServer.CLUSTER_ID, responseZclFrame);
+ return true;
+ }
+ return false;
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(String name) {
+ return ((IZclAttributeDescriptor) attributesMapByName.get(name));
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(int id) {
+ Iterator iterator = attributesMapByName.values().iterator();
+ // FIXME: generate it and optimize!!!!
+ for (; iterator.hasNext();) {
+ IZclAttributeDescriptor attributeDescriptor = (IZclAttributeDescriptor) iterator.next();
+ if (attributeDescriptor.zclGetId() == id)
+ return attributeDescriptor;
+ }
+ return null;
+ }
+
+ public void execCommandExecution(short CommandId, IEndPointRequestContext context) throws ApplianceException,
+ ServiceClusterException {
+ int size = 0;
+ size += ZclDataTypeEnum8.zclSize(CommandId);
+ ZclFrame zclFrame = new ZclFrame(1, size);
+ zclFrame.setCommandId(0);
+ ZclDataTypeEnum8.zclSerialize(zclFrame, CommandId);
+ issueExec(zclFrame, 11, context);
+ }
+
+ public SignalStateResponse execSignalState(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ ZclFrame zclFrame = new ZclFrame(1);
+ zclFrame.setCommandId(1);
+ IZclFrame zclResponseFrame = issueExec(zclFrame, 0, context);
+ return (ZclSignalStateResponse.zclParse(zclResponseFrame));
+ }
+
+ public void execWriteFunctions(WriteAttributeRecord[] WriteAttributeRecords, IEndPointRequestContext context)
+ throws ApplianceException, ServiceClusterException {
+ int size = 255;
+ ZclFrame zclFrame = new ZclFrame(1, size);
+ zclFrame.setCommandId(2);
+
+ for (int i = 0; i < WriteAttributeRecords.length; i++) {
+ IZclAttributeDescriptor attributeDescriptor = getAttributeDescriptor(WriteAttributeRecords[i].name);
+ zclFrame.appendUInt16(attributeDescriptor.zclGetId());
+ ZclAbstractDataType zclDataType = attributeDescriptor.zclGetDataType();
+ zclFrame.appendUInt8(zclDataType.zclGetDataType());
+ zclDataType.zclObjectSerialize(zclFrame, WriteAttributeRecords[i].value);
+ }
+
+ zclFrame.shrink();
+ issueExec(zclFrame, 11, context);
+ }
+
+ public void execOverloadPauseResume(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ ZclFrame zclFrame = new ZclFrame(1);
+ zclFrame.setCommandId(3);
+ issueExec(zclFrame, 11, context);
+ }
+
+ public void execOverloadPause(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ ZclFrame zclFrame = new ZclFrame(1);
+ zclFrame.setCommandId(4);
+ issueExec(zclFrame, 11, context);
+ }
+
+ public void execOverloadWarning(short WarningEvent, IEndPointRequestContext context) throws ApplianceException,
+ ServiceClusterException {
+ int size = 0;
+ size += ZclDataTypeEnum8.zclSize(WarningEvent);
+ ZclFrame zclFrame = new ZclFrame(1, size);
+ zclFrame.setCommandId(5);
+ ZclDataTypeEnum8.zclSerialize(zclFrame, WarningEvent);
+ issueExec(zclFrame, 11, context);
+ }
+
+ protected IZclFrame parseSignalStateNotification(ApplianceControlClient o, IZclFrame zclFrame) throws ApplianceException,
+ ServiceClusterException {
+ short ApplianceStatus = ZclDataTypeEnum8.zclParse(zclFrame);
+ short RemoteEnableFlags = ZclDataTypeUI8.zclParse(zclFrame);
+ int ApplianceStatus2 = ZclDataTypeUI24.zclParse(zclFrame);
+ o.execSignalStateNotification(ApplianceStatus, RemoteEnableFlags, ApplianceStatus2, null);
+ return null;
+ }
+
+ public int getStartTime(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(256, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(256, context);
+ int v = ZclDataTypeUI16.zclParse(zclFrame);
+ setCachedAttributeObject(256, new Integer(v));
+ return v;
+ }
+
+ public int getFinishTime(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(257, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(257, context);
+ int v = ZclDataTypeUI16.zclParse(zclFrame);
+ setCachedAttributeObject(257, new Integer(v));
+ return v;
+ }
+
+ public int getRemainingTime(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(258, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(258, context);
+ int v = ZclDataTypeUI16.zclParse(zclFrame);
+ setCachedAttributeObject(258, new Integer(v));
+ return v;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceEventsAndAlertsClient.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceEventsAndAlertsClient.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceEventsAndAlertsClient.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,87 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.eh;
+
+import it.telecomitalia.ah.cluster.zigbee.eh.ApplianceEventsAndAlertsClient;
+import it.telecomitalia.ah.cluster.zigbee.eh.ApplianceEventsAndAlertsServer;
+import it.telecomitalia.ah.cluster.zigbee.eh.GetEventsAndAlertsResponse;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.IEndPointRequestContext;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZCL;
+import it.telecomitalia.ah.zigbee.ZclFrame;
+import it.telecomitalia.ah.zigbee.ZigBeeDevice;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI24;
+
+public class ZclApplianceEventsAndAlertsClient extends ZclServiceCluster implements ApplianceEventsAndAlertsClient,
+ ZigBeeDeviceListener {
+
+ public final static short CLUSTER_ID = 2818;
+
+ public ZclApplianceEventsAndAlertsClient() throws ApplianceException {
+ super();
+ }
+
+ public boolean notifyZclFrame(short clusterId, IZclFrame zclFrame) throws Exception {
+ boolean handled;
+ handled = super.notifyZclFrame(clusterId, zclFrame);
+ if (handled) {
+ return handled;
+ }
+ int commandId = zclFrame.getCommandId();
+ if (zclFrame.isServerToClient()) {
+ throw new ZclValidationException("invalid direction field");
+ }
+ IZclFrame responseZclFrame = null;
+ ZigBeeDevice device = getZigBeeDevice();
+ int statusCode = ZCL.SUCCESS;
+ ApplianceEventsAndAlertsServer c = ((ApplianceEventsAndAlertsServer) getSinglePeerCluster((ApplianceEventsAndAlertsServer.class
+ .getName())));
+ switch (commandId) {
+ case 0:
+ responseZclFrame = parseGetEventsAndAlerts(c, zclFrame);
+ break;
+ }
+ if (responseZclFrame == null) {
+ if (!zclFrame.isDefaultResponseDisabled()) {
+ responseZclFrame = getDefaultResponse(zclFrame, statusCode);
+ }
+ }
+ if (!(responseZclFrame == null)) {
+ device.post(ZclApplianceEventsAndAlertsClient.CLUSTER_ID, responseZclFrame);
+ return true;
+ }
+ return false;
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ public void execEventsAndAlertsNotification(int[] Events, IEndPointRequestContext context) throws ApplianceException,
+ ServiceClusterException {
+ int size = 0;
+ size += (Events.length * ZclDataTypeUI24.zclSize(0));
+ size += 1;
+ ZclFrame zclFrame = new ZclFrame(1, size);
+ zclFrame.setCommandId(0);
+ int i;
+ for (i = 0; (i < Events.length); i++) {
+ ZclDataTypeUI24.zclSerialize(zclFrame, Events[i]);
+ }
+ issueExec(zclFrame, 11, context);
+ }
+
+ protected IZclFrame parseGetEventsAndAlerts(ApplianceEventsAndAlertsServer o, IZclFrame zclFrame) throws ApplianceException,
+ ServiceClusterException {
+ GetEventsAndAlertsResponse r = o.execGetEventsAndAlerts(null);
+ int size = ZclGetEventsAndAlertsResponse.zclSize(r);
+ IZclFrame zclResponseFrame = zclFrame.createResponseFrame(size);
+ zclResponseFrame.setCommandId(0);
+ ZclGetEventsAndAlertsResponse.zclSerialize(zclResponseFrame, r);
+ return zclResponseFrame;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceEventsAndAlertsServer.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceEventsAndAlertsServer.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceEventsAndAlertsServer.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,86 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.eh;
+
+import it.telecomitalia.ah.cluster.zigbee.eh.ApplianceEventsAndAlertsClient;
+import it.telecomitalia.ah.cluster.zigbee.eh.ApplianceEventsAndAlertsServer;
+import it.telecomitalia.ah.cluster.zigbee.eh.GetEventsAndAlertsResponse;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.IEndPointRequestContext;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZCL;
+import it.telecomitalia.ah.zigbee.ZclFrame;
+import it.telecomitalia.ah.zigbee.ZigBeeDevice;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI24;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+public class ZclApplianceEventsAndAlertsServer extends ZclServiceCluster implements ApplianceEventsAndAlertsServer,
+ ZigBeeDeviceListener {
+
+ public final static short CLUSTER_ID = 2818;
+
+ public ZclApplianceEventsAndAlertsServer() throws ApplianceException {
+ super();
+ }
+
+ public boolean notifyZclFrame(short clusterId, IZclFrame zclFrame) throws Exception {
+ boolean handled;
+ handled = super.notifyZclFrame(clusterId, zclFrame);
+ if (handled) {
+ return handled;
+ }
+ int commandId = zclFrame.getCommandId();
+ if (zclFrame.isClientToServer()) {
+ throw new ZclValidationException("invalid direction field");
+ }
+ IZclFrame responseZclFrame = null;
+ ZigBeeDevice device = getZigBeeDevice();
+ int statusCode = ZCL.SUCCESS;
+ ApplianceEventsAndAlertsClient c = ((ApplianceEventsAndAlertsClient) getSinglePeerCluster((ApplianceEventsAndAlertsClient.class
+ .getName())));
+ switch (commandId) {
+ case 0:
+ responseZclFrame = parseEventsAndAlertsNotification(c, zclFrame);
+ break;
+ }
+ if (responseZclFrame == null) {
+ if (!zclFrame.isDefaultResponseDisabled()) {
+ responseZclFrame = getDefaultResponse(zclFrame, statusCode);
+ }
+ }
+ if (!(responseZclFrame == null)) {
+ device.post(ZclApplianceEventsAndAlertsServer.CLUSTER_ID, responseZclFrame);
+ return true;
+ }
+ return false;
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ public GetEventsAndAlertsResponse execGetEventsAndAlerts(IEndPointRequestContext context) throws ApplianceException,
+ ServiceClusterException {
+ ZclFrame zclFrame = new ZclFrame(1);
+ zclFrame.setCommandId(0);
+ IZclFrame zclResponseFrame = issueExec(zclFrame, 0, context);
+ return (ZclGetEventsAndAlertsResponse.zclParse(zclResponseFrame));
+ }
+
+ protected IZclFrame parseEventsAndAlertsNotification(ApplianceEventsAndAlertsClient o, IZclFrame zclFrame)
+ throws ApplianceException, ServiceClusterException {
+ int size;
+ size = ZclDataTypeUI8.zclParse(zclFrame);
+ int[] Events;
+ Events = new int[size];
+ int i;
+ for (i = 0; (i < size); i++) {
+ Events[i] = ZclDataTypeUI24.zclParse(zclFrame);
+ }
+ o.execEventsAndAlertsNotification(Events, null);
+ return null;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceIdentificationClient.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceIdentificationClient.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceIdentificationClient.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,21 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.eh;
+
+import it.telecomitalia.ah.cluster.zigbee.eh.ApplianceIdentificationClient;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+
+public class ZclApplianceIdentificationClient extends ZclServiceCluster implements ApplianceIdentificationClient,
+ ZigBeeDeviceListener {
+
+ public final static short CLUSTER_ID = 2816;
+
+ public ZclApplianceIdentificationClient() throws ApplianceException {
+ super();
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceIdentificationServer.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceIdentificationServer.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceIdentificationServer.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,244 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.eh;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import it.telecomitalia.ah.cluster.zigbee.eh.ApplianceIdentificationServer;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.IEndPointRequestContext;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.internal.zigbee.ZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.IZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeOctets;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeString;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI16;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+public class ZclApplianceIdentificationServer extends ZclServiceCluster implements ApplianceIdentificationServer,
+ ZigBeeDeviceListener {
+
+ final static short CLUSTER_ID = 2816;
+ final static HashMap attributesMapByName = new HashMap();
+ final static HashMap attributesMapById = new HashMap();
+
+ static {
+ attributesMapByName.put(ZclApplianceIdentificationServer.ATTR_BasicIdentification_NAME, new ZclAttributeDescriptor(0,
+ ZclApplianceIdentificationServer.ATTR_BasicIdentification_NAME, new ZclDataTypeOctets(7), null, false, 1));
+ attributesMapByName.put(ZclApplianceIdentificationServer.ATTR_CompanyName_NAME, new ZclAttributeDescriptor(16,
+ ZclApplianceIdentificationServer.ATTR_CompanyName_NAME, new ZclDataTypeString(16), null, false, 1));
+ attributesMapByName.put(ZclApplianceIdentificationServer.ATTR_CompanyId_NAME, new ZclAttributeDescriptor(17,
+ ZclApplianceIdentificationServer.ATTR_CompanyId_NAME, new ZclDataTypeUI16(), null, false, 1));
+ attributesMapByName.put(ZclApplianceIdentificationServer.ATTR_BrandName_NAME, new ZclAttributeDescriptor(18,
+ ZclApplianceIdentificationServer.ATTR_BrandName_NAME, new ZclDataTypeString(16), null, false, 1));
+ attributesMapByName.put(ZclApplianceIdentificationServer.ATTR_BrandId_NAME, new ZclAttributeDescriptor(19,
+ ZclApplianceIdentificationServer.ATTR_BrandId_NAME, new ZclDataTypeUI16(), null, false, 1));
+ attributesMapByName.put(ZclApplianceIdentificationServer.ATTR_Model_NAME, new ZclAttributeDescriptor(20,
+ ZclApplianceIdentificationServer.ATTR_Model_NAME, new ZclDataTypeString(16), null, false, 1));
+ attributesMapByName.put(ZclApplianceIdentificationServer.ATTR_PartNumber_NAME, new ZclAttributeDescriptor(21,
+ ZclApplianceIdentificationServer.ATTR_PartNumber_NAME, new ZclDataTypeString(16), null, false, 1));
+ attributesMapByName.put(ZclApplianceIdentificationServer.ATTR_ProductRevision_NAME, new ZclAttributeDescriptor(22,
+ ZclApplianceIdentificationServer.ATTR_ProductRevision_NAME, new ZclDataTypeString(6), null, false, 1));
+ attributesMapByName.put(ZclApplianceIdentificationServer.ATTR_SoftwareRevision_NAME, new ZclAttributeDescriptor(23,
+ ZclApplianceIdentificationServer.ATTR_SoftwareRevision_NAME, new ZclDataTypeString(6), null, false, 1));
+ attributesMapByName.put(ZclApplianceIdentificationServer.ATTR_ProductTypeName_NAME, new ZclAttributeDescriptor(24,
+ ZclApplianceIdentificationServer.ATTR_ProductTypeName_NAME, new ZclDataTypeString(2), null, false, 1));
+ attributesMapByName.put(ZclApplianceIdentificationServer.ATTR_ProductTypeId_NAME, new ZclAttributeDescriptor(25,
+ ZclApplianceIdentificationServer.ATTR_ProductTypeId_NAME, new ZclDataTypeUI16(), null, false, 1));
+ attributesMapByName.put(ZclApplianceIdentificationServer.ATTR_CECEDSpecificationVersion_NAME, new ZclAttributeDescriptor(
+ 26, ZclApplianceIdentificationServer.ATTR_CECEDSpecificationVersion_NAME, new ZclDataTypeUI8(), null, false, 1));
+ }
+
+ public ZclApplianceIdentificationServer() throws ApplianceException {
+ super();
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(String name) {
+ return ((IZclAttributeDescriptor) attributesMapByName.get(name));
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(int id) {
+ Iterator iterator = attributesMapByName.values().iterator();
+ // FIXME: generate it and optimize!!!!
+ for (; iterator.hasNext();) {
+ IZclAttributeDescriptor attributeDescriptor = (IZclAttributeDescriptor) iterator.next();
+ if (attributeDescriptor.zclGetId() == id)
+ return attributeDescriptor;
+ }
+ return null;
+ }
+
+ public byte[] getBasicIdentification(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ byte[] objectResult = null;
+ objectResult = ((byte[]) getValidCachedAttributeObject(0, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult;
+ }
+ }
+ IZclFrame zclFrame = readAttribute(0, context);
+ byte[] v = ZclDataTypeOctets.zclParse(zclFrame);
+ setCachedAttributeObject(0, v);
+ return v;
+ }
+
+ public String getCompanyName(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ String objectResult = null;
+ objectResult = ((String) getValidCachedAttributeObject(16, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult;
+ }
+ }
+ IZclFrame zclFrame = readAttribute(16, context);
+ String v = ZclDataTypeString.zclParse(zclFrame);
+ setCachedAttributeObject(16, v);
+ return v;
+ }
+
+ public int getCompanyId(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(17, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(17, context);
+ int v = ZclDataTypeUI16.zclParse(zclFrame);
+ setCachedAttributeObject(17, new Integer(v));
+ return v;
+ }
+
+ public String getBrandName(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ String objectResult = null;
+ objectResult = ((String) getValidCachedAttributeObject(18, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult;
+ }
+ }
+ IZclFrame zclFrame = readAttribute(18, context);
+ String v = ZclDataTypeString.zclParse(zclFrame);
+ setCachedAttributeObject(18, v);
+ return v;
+ }
+
+ public int getBrandId(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(19, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(19, context);
+ int v = ZclDataTypeUI16.zclParse(zclFrame);
+ setCachedAttributeObject(19, new Integer(v));
+ return v;
+ }
+
+ public String getModel(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ String objectResult = null;
+ objectResult = ((String) getValidCachedAttributeObject(20, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult;
+ }
+ }
+ IZclFrame zclFrame = readAttribute(20, context);
+ String v = ZclDataTypeString.zclParse(zclFrame);
+ setCachedAttributeObject(20, v);
+ return v;
+ }
+
+ public String getPartNumber(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ String objectResult = null;
+ objectResult = ((String) getValidCachedAttributeObject(21, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult;
+ }
+ }
+ IZclFrame zclFrame = readAttribute(21, context);
+ String v = ZclDataTypeString.zclParse(zclFrame);
+ setCachedAttributeObject(21, v);
+ return v;
+ }
+
+ public String getProductRevision(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ String objectResult = null;
+ objectResult = ((String) getValidCachedAttributeObject(22, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult;
+ }
+ }
+ IZclFrame zclFrame = readAttribute(22, context);
+ String v = ZclDataTypeString.zclParse(zclFrame);
+ setCachedAttributeObject(22, v);
+ return v;
+ }
+
+ public String getSoftwareRevision(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ String objectResult = null;
+ objectResult = ((String) getValidCachedAttributeObject(23, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult;
+ }
+ }
+ IZclFrame zclFrame = readAttribute(23, context);
+ String v = ZclDataTypeString.zclParse(zclFrame);
+ setCachedAttributeObject(23, v);
+ return v;
+ }
+
+ public String getProductTypeName(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ String objectResult = null;
+ objectResult = ((String) getValidCachedAttributeObject(24, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult;
+ }
+ }
+ IZclFrame zclFrame = readAttribute(24, context);
+ String v = ZclDataTypeString.zclParse(zclFrame);
+ setCachedAttributeObject(24, v);
+ return v;
+ }
+
+ public int getProductTypeId(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(25, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(25, context);
+ int v = ZclDataTypeUI16.zclParse(zclFrame);
+ setCachedAttributeObject(25, new Integer(v));
+ return v;
+ }
+
+ public short getCECEDSpecificationVersion(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Short objectResult = null;
+ objectResult = ((Short) getValidCachedAttributeObject(26, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.shortValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(26, context);
+ short v = ZclDataTypeUI8.zclParse(zclFrame);
+ setCachedAttributeObject(26, new Short(v));
+ return v;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceStatisticsClient.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceStatisticsClient.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceStatisticsClient.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,110 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.eh;
+
+import it.telecomitalia.ah.cluster.zigbee.eh.ApplianceStatisticsClient;
+import it.telecomitalia.ah.cluster.zigbee.eh.ApplianceStatisticsServer;
+import it.telecomitalia.ah.cluster.zigbee.eh.LogQueueResponse;
+import it.telecomitalia.ah.cluster.zigbee.eh.LogResponse;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.IEndPointRequestContext;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZCL;
+import it.telecomitalia.ah.zigbee.ZclFrame;
+import it.telecomitalia.ah.zigbee.ZigBeeDevice;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeOctets;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI32;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUTCTime;
+
+public class ZclApplianceStatisticsClient extends ZclServiceCluster implements ApplianceStatisticsClient, ZigBeeDeviceListener {
+
+ public final static short CLUSTER_ID = 2819;
+
+ public ZclApplianceStatisticsClient() throws ApplianceException {
+ super();
+ }
+
+ public boolean notifyZclFrame(short clusterId, IZclFrame zclFrame) throws Exception {
+ boolean handled;
+ handled = super.notifyZclFrame(clusterId, zclFrame);
+ if (handled) {
+ return handled;
+ }
+ int commandId = zclFrame.getCommandId();
+ if (zclFrame.isServerToClient()) {
+ throw new ZclValidationException("invalid direction field");
+ }
+ IZclFrame responseZclFrame = null;
+ ZigBeeDevice device = getZigBeeDevice();
+ int statusCode = ZCL.SUCCESS;
+ ApplianceStatisticsServer c = ((ApplianceStatisticsServer) getSinglePeerCluster((ApplianceStatisticsServer.class.getName())));
+ switch (commandId) {
+ case 0:
+ responseZclFrame = parseLogRequest(c, zclFrame);
+ break;
+ case 1:
+ responseZclFrame = parseLogQueueRequest(c, zclFrame);
+ break;
+ }
+ if (responseZclFrame == null) {
+ if (!zclFrame.isDefaultResponseDisabled()) {
+ responseZclFrame = getDefaultResponse(zclFrame, statusCode);
+ }
+ }
+ if (!(responseZclFrame == null)) {
+ device.post(ZclApplianceStatisticsClient.CLUSTER_ID, responseZclFrame);
+ return true;
+ }
+ return false;
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ public void execLogNotification(long Timestamp, long LogID, long LogLength, byte[] LogPayload, IEndPointRequestContext context)
+ throws ApplianceException, ServiceClusterException {
+ int size = 0;
+ size += ZclDataTypeUTCTime.zclSize(Timestamp);
+ size += ZclDataTypeUI32.zclSize(LogID);
+ size += ZclDataTypeUI32.zclSize(LogLength);
+ size += ZclDataTypeOctets.zclSize(LogPayload);
+ ZclFrame zclFrame = new ZclFrame(1, size);
+ zclFrame.setCommandId(0);
+ ZclDataTypeUTCTime.zclSerialize(zclFrame, Timestamp);
+ ZclDataTypeUI32.zclSerialize(zclFrame, LogID);
+ ZclDataTypeUI32.zclSerialize(zclFrame, LogLength);
+ ZclDataTypeOctets.zclSerialize(zclFrame, LogPayload);
+ issueExec(zclFrame, 11, context);
+ }
+
+ public void execStatisticsAvailable(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ ZclFrame zclFrame = new ZclFrame(1);
+ zclFrame.setCommandId(3);
+ issueExec(zclFrame, 11, context);
+ }
+
+ protected IZclFrame parseLogRequest(ApplianceStatisticsServer o, IZclFrame zclFrame) throws ApplianceException,
+ ServiceClusterException {
+ long LogID = ZclDataTypeUI32.zclParse(zclFrame);
+ LogResponse r = o.execLogRequest(LogID, null);
+ int size = ZclLogResponse.zclSize(r);
+ IZclFrame zclResponseFrame = zclFrame.createResponseFrame(size);
+ zclResponseFrame.setCommandId(1);
+ ZclLogResponse.zclSerialize(zclResponseFrame, r);
+ return zclResponseFrame;
+ }
+
+ protected IZclFrame parseLogQueueRequest(ApplianceStatisticsServer o, IZclFrame zclFrame) throws ApplianceException,
+ ServiceClusterException {
+ LogQueueResponse r = o.execLogQueueRequest(null);
+ int size = ZclLogQueueResponse.zclSize(r);
+ IZclFrame zclResponseFrame = zclFrame.createResponseFrame(size);
+ zclResponseFrame.setCommandId(2);
+ ZclLogQueueResponse.zclSerialize(zclResponseFrame, r);
+ return zclResponseFrame;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceStatisticsServer.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceStatisticsServer.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclApplianceStatisticsServer.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,177 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.eh;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import it.telecomitalia.ah.cluster.zigbee.eh.ApplianceStatisticsClient;
+import it.telecomitalia.ah.cluster.zigbee.eh.ApplianceStatisticsServer;
+import it.telecomitalia.ah.cluster.zigbee.eh.LogQueueResponse;
+import it.telecomitalia.ah.cluster.zigbee.eh.LogResponse;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.IEndPointRequestContext;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.internal.zigbee.ZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZCL;
+import it.telecomitalia.ah.zigbee.ZclFrame;
+import it.telecomitalia.ah.zigbee.ZigBeeDevice;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.IZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeOctets;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI32;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUTCTime;
+
+public class ZclApplianceStatisticsServer extends ZclServiceCluster implements ApplianceStatisticsServer, ZigBeeDeviceListener {
+
+ public final static short CLUSTER_ID = 2819;
+ final static HashMap attributesMapByName = new HashMap();
+ final static HashMap attributesMapById = new HashMap();
+
+ static {
+ attributesMapByName.put(ZclApplianceStatisticsServer.ATTR_LogMaxSize_NAME, new ZclAttributeDescriptor(0,
+ ZclApplianceStatisticsServer.ATTR_LogMaxSize_NAME, new ZclDataTypeUI32(), null, false, 1));
+ attributesMapByName.put(ZclApplianceStatisticsServer.ATTR_LogQueueMaxSize_NAME, new ZclAttributeDescriptor(1,
+ ZclApplianceStatisticsServer.ATTR_LogQueueMaxSize_NAME, new ZclDataTypeUI8(), null, false, 1));
+ }
+
+ public ZclApplianceStatisticsServer() throws ApplianceException {
+ super();
+ }
+
+ public void zclAttach(ZigBeeDevice device) {
+ super.zclAttach(device);
+
+ // LogResponse
+ device.enablePartitionServer(CLUSTER_ID, (short) 0x01);
+ // LogNotification
+ device.enablePartitionServer(CLUSTER_ID, (short) 0x00);
+ }
+
+ public void zclDetach(ZigBeeDevice device) {
+ super.zclDetach(device);
+
+ // LogResponse
+ device.disablePartitionServer(CLUSTER_ID, (short) 0x01);
+ // LogNotification
+ device.disablePartitionServer(CLUSTER_ID, (short) 0x00);
+ }
+
+ public boolean notifyZclFrame(short clusterId, IZclFrame zclFrame) throws Exception {
+ boolean handled;
+ handled = super.notifyZclFrame(clusterId, zclFrame);
+ if (handled) {
+ return handled;
+ }
+ int commandId = zclFrame.getCommandId();
+ if (zclFrame.isClientToServer()) {
+ throw new ZclValidationException("invalid direction field");
+ }
+ IZclFrame responseZclFrame = null;
+ ZigBeeDevice device = getZigBeeDevice();
+ int statusCode = ZCL.SUCCESS;
+ ApplianceStatisticsClient c = ((ApplianceStatisticsClient) getSinglePeerCluster((ApplianceStatisticsClient.class.getName())));
+ switch (commandId) {
+ case 0:
+ responseZclFrame = parseLogNotification(c, zclFrame);
+ break;
+ case 3:
+ responseZclFrame = parseStatisticsAvailable(c, zclFrame);
+ break;
+ }
+ if (responseZclFrame == null) {
+ if (!zclFrame.isDefaultResponseDisabled()) {
+ responseZclFrame = getDefaultResponse(zclFrame, statusCode);
+ }
+ }
+ if (!(responseZclFrame == null)) {
+ device.post(ZclApplianceStatisticsServer.CLUSTER_ID, responseZclFrame);
+ return true;
+ }
+ return false;
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(String name) {
+ return ((IZclAttributeDescriptor) attributesMapByName.get(name));
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(int id) {
+ Iterator iterator = attributesMapByName.values().iterator();
+ // FIXME: generate it and optimize!!!!
+ for (; iterator.hasNext();) {
+ IZclAttributeDescriptor attributeDescriptor = (IZclAttributeDescriptor) iterator.next();
+ if (attributeDescriptor.zclGetId() == id)
+ return attributeDescriptor;
+ }
+ return null;
+ }
+
+ public LogResponse execLogRequest(long LogID, IEndPointRequestContext context) throws ApplianceException,
+ ServiceClusterException {
+ int size = 0;
+ size += ZclDataTypeUI32.zclSize(LogID);
+ ZclFrame zclFrame = new ZclFrame(1, size);
+ zclFrame.setCommandId(0);
+ ZclDataTypeUI32.zclSerialize(zclFrame, LogID);
+ IZclFrame zclResponseFrame = issueExec(zclFrame, 1, context);
+ return (ZclLogResponse.zclParse(zclResponseFrame));
+ }
+
+ public LogQueueResponse execLogQueueRequest(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ ZclFrame zclFrame = new ZclFrame(1);
+ zclFrame.setCommandId(1);
+ IZclFrame zclResponseFrame = issueExec(zclFrame, 2, context);
+ return (ZclLogQueueResponse.zclParse(zclResponseFrame));
+ }
+
+ protected IZclFrame parseLogNotification(ApplianceStatisticsClient o, IZclFrame zclFrame) throws ApplianceException,
+ ServiceClusterException {
+ long Timestamp = ZclDataTypeUTCTime.zclParse(zclFrame);
+ long LogID = ZclDataTypeUI32.zclParse(zclFrame);
+ long LogLength = ZclDataTypeUI32.zclParse(zclFrame);
+ // FIXME: parse array must accept a long type.
+ byte[] LogPayload = zclFrame.parseArray((int) LogLength);
+ o.execLogNotification(Timestamp, LogID, LogLength, LogPayload, null);
+ return null;
+ }
+
+ protected IZclFrame parseStatisticsAvailable(ApplianceStatisticsClient o, IZclFrame zclFrame) throws ApplianceException,
+ ServiceClusterException {
+ o.execStatisticsAvailable(null);
+ return null;
+ }
+
+ public long getLogMaxSize(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Long objectResult = null;
+ objectResult = ((Long) getValidCachedAttributeObject(0, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.longValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(0, context);
+ long v = ZclDataTypeUI32.zclParse(zclFrame);
+ setCachedAttributeObject(0, new Long(v));
+ return v;
+ }
+
+ public short getLogQueueMaxSize(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Short objectResult = null;
+ objectResult = ((Short) getValidCachedAttributeObject(1, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.shortValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(1, context);
+ short v = ZclDataTypeUI8.zclParse(zclFrame);
+ setCachedAttributeObject(1, new Short(v));
+ return v;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclDBFTR.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclDBFTR.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclDBFTR.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,42 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.eh;
+
+import it.telecomitalia.ah.cluster.zigbee.eh.DBFTR;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeOctets;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+public class ZclDBFTR {
+
+ public static DBFTR zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ DBFTR r = new DBFTR();
+ r.Acknowledge = ZclDataTypeUI8.zclParse(zclFrame);
+ if (r.Acknowledge == 0x5a) {
+ r.FrameHeader = ZclDataTypeUI8.zclParse(zclFrame);
+ r.FrameType = ZclDataTypeUI8.zclParse(zclFrame);
+ r.FramePayload = ZclDataTypeOctets.zclParse(zclFrame);
+ }
+ return r;
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, DBFTR r) throws ZclValidationException {
+
+ ZclDataTypeUI8.zclSerialize(zclFrame, r.Acknowledge);
+ if (r.Acknowledge == 0x5a) {
+ ZclDataTypeUI8.zclSerialize(zclFrame, r.FrameHeader);
+ ZclDataTypeUI8.zclSerialize(zclFrame, r.FrameType);
+ ZclDataTypeOctets.zclSerialize(zclFrame, r.FramePayload);
+ }
+ }
+
+ public static int zclSize(DBFTR r) throws ZclValidationException {
+ int size = 0;
+ size += ZclDataTypeUI8.zclSize(r.Acknowledge);
+ if (r.Acknowledge == 0x5a) {
+ size += ZclDataTypeUI8.zclSize(r.FrameHeader);
+ size += ZclDataTypeUI8.zclSize(r.FrameType);
+ size += ZclDataTypeOctets.zclSize(r.FramePayload);
+ }
+ return size;
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclDEFTR.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclDEFTR.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclDEFTR.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,42 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.eh;
+
+import it.telecomitalia.ah.cluster.zigbee.eh.DEFTR;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeOctets;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+public class ZclDEFTR {
+
+ public static DEFTR zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ DEFTR r = new DEFTR();
+
+ r.Acknowledge = ZclDataTypeUI8.zclParse(zclFrame);
+ if (r.Acknowledge == 0x5a) {
+ r.FrameHeader = ZclDataTypeUI8.zclParse(zclFrame);
+ r.FrameType = ZclDataTypeUI8.zclParse(zclFrame);
+ r.FramePayload = ZclDataTypeOctets.zclParse(zclFrame);
+ }
+ return r;
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, DEFTR r) throws ZclValidationException {
+ ZclDataTypeUI8.zclSerialize(zclFrame, r.Acknowledge);
+ if (r.Acknowledge == 0x5a) {
+ ZclDataTypeUI8.zclSerialize(zclFrame, r.FrameHeader);
+ ZclDataTypeUI8.zclSerialize(zclFrame, r.FrameType);
+ ZclDataTypeOctets.zclSerialize(zclFrame, r.FramePayload);
+ }
+ }
+
+ public static int zclSize(DEFTR r) throws ZclValidationException {
+ int size = 0;
+ size += ZclDataTypeUI8.zclSize(r.Acknowledge);
+ if (r.Acknowledge == 0x5a) {
+ size += ZclDataTypeUI8.zclSize(r.FrameHeader);
+ size += ZclDataTypeUI8.zclSize(r.FrameType);
+ size += ZclDataTypeOctets.zclSize(r.FramePayload);
+ }
+ return size;
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclDEFTWAR.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclDEFTWAR.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclDEFTWAR.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,26 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.eh;
+
+import it.telecomitalia.ah.cluster.zigbee.eh.DEFTWAR;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+public class ZclDEFTWAR {
+
+ public static DEFTWAR zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ DEFTWAR r = new DEFTWAR();
+ r.Acknowledge = ZclDataTypeUI8.zclParse(zclFrame);
+ return r;
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, DEFTWAR r) throws ZclValidationException {
+ ZclDataTypeUI8.zclSerialize(zclFrame, r.Acknowledge);
+ }
+
+ public static int zclSize(DEFTWAR r) throws ZclValidationException {
+ int size = 0;
+ size += ZclDataTypeUI8.zclSize(r.Acknowledge);
+ return size;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclEnergyPhasesScheduleResponse.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclEnergyPhasesScheduleResponse.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclEnergyPhasesScheduleResponse.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,40 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.eh;
+
+import it.telecomitalia.ah.cluster.zigbee.eh.EnergyPhasesScheduleResponse;
+import it.telecomitalia.ah.cluster.zigbee.eh.ScheduledPhase;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+public class ZclEnergyPhasesScheduleResponse {
+
+ public static EnergyPhasesScheduleResponse zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ EnergyPhasesScheduleResponse r = new EnergyPhasesScheduleResponse();
+ r.PowerProfileID = ZclDataTypeUI8.zclParse(zclFrame);
+
+ short NumsScheduledPhases = ZclDataTypeUI8.zclParse(zclFrame);
+
+ ScheduledPhase[] ScheduledPhases = new ScheduledPhase[NumsScheduledPhases];
+ for (int i = 0; i < NumsScheduledPhases; i++) {
+ ScheduledPhases[i] = ZclScheduledPhase.zclParse(zclFrame);
+ }
+ r.ScheduledPhases = ScheduledPhases;
+ return r;
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, EnergyPhasesScheduleResponse r) throws ZclValidationException {
+ ZclDataTypeUI8.zclSerialize(zclFrame, r.PowerProfileID);
+ ZclDataTypeUI8.zclSerialize(zclFrame, (short) r.ScheduledPhases.length);
+ for (int i = 0; i < r.ScheduledPhases.length; i++) {
+ ZclScheduledPhase.zclSerialize(zclFrame, r.ScheduledPhases[i]);
+ }
+ }
+
+ public static int zclSize(EnergyPhasesScheduleResponse r) throws ZclValidationException {
+ int size = 0;
+ size += ZclDataTypeUI8.zclSize(r.PowerProfileID);
+ size += 1;
+ size += ZclScheduledPhase.zclSize(null) * r.ScheduledPhases.length;
+ return size;
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclEnergyPhasesScheduleStateResponse.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclEnergyPhasesScheduleStateResponse.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclEnergyPhasesScheduleStateResponse.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,66 @@
+
+package it.telecomitalia.ah.zigbee.zcl.cluster.eh;
+
+import it.telecomitalia.ah.cluster.zigbee.eh.EnergyPhasesScheduleStateResponse;
+import it.telecomitalia.ah.cluster.zigbee.eh.ScheduledPhase;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+public class ZclEnergyPhasesScheduleStateResponse {
+
+
+ public static EnergyPhasesScheduleStateResponse zclParse(IZclFrame zclFrame)
+ throws ZclValidationException
+ {
+ EnergyPhasesScheduleStateResponse r = new EnergyPhasesScheduleStateResponse();
+ r.PowerProfileID = ZclDataTypeUI8 .zclParse(zclFrame);
+ // r.NumOfScheduledEnergyPhases = ZclDataTypeUI8 .zclParse(zclFrame);
+
+ // Nicola: start
+ short NumsScheduledPhases = ZclDataTypeUI8.zclParse(zclFrame);
+
+ ScheduledPhase[] ScheduledPhases = new ScheduledPhase[NumsScheduledPhases];
+ for (int i = 0; i < NumsScheduledPhases; i++) {
+ ScheduledPhases[i] = ZclScheduledPhase.zclParse(zclFrame);
+ }
+
+ r.ScheduledPhases = ScheduledPhases;
+
+ // Nicola: end
+
+ return r;
+ }
+
+// public static void zclSerialize(IZclFrame zclFrame, EnergyPhasesScheduleStateResponse r)
+// throws ZclValidationException
+// {
+// ZclDataTypeUI8 .zclSerialize(zclFrame, r.PowerProfileID);
+// ZclDataTypeUI8 .zclSerialize(zclFrame, r.NumOfScheduledEnergyPhases);
+// }
+//
+// public static int zclSize(EnergyPhasesScheduleStateResponse r)
+// throws ZclValidationException
+// {
+// int size = 0;
+// size += ZclDataTypeUI8 .zclSize(r.PowerProfileID);
+// size += ZclDataTypeUI8 .zclSize(r.NumOfScheduledEnergyPhases);
+// return size;
+// }
+
+ public static void zclSerialize(IZclFrame zclFrame, EnergyPhasesScheduleStateResponse r) throws ZclValidationException {
+ ZclDataTypeUI8.zclSerialize(zclFrame, r.PowerProfileID);
+ ZclDataTypeUI8.zclSerialize(zclFrame, (short) r.ScheduledPhases.length);
+ for (int i = 0; i < r.ScheduledPhases.length; i++) {
+ ZclScheduledPhase.zclSerialize(zclFrame, r.ScheduledPhases[i]);
+ }
+ }
+
+ public static int zclSize(EnergyPhasesScheduleStateResponse r) throws ZclValidationException {
+ int size = 0;
+ size += ZclDataTypeUI8.zclSize(r.PowerProfileID);
+ size += 1;
+ size += ZclScheduledPhase.zclSize(null) * r.ScheduledPhases.length;
+ return size;
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclGetEventsAndAlertsResponse.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclGetEventsAndAlertsResponse.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclGetEventsAndAlertsResponse.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,35 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.eh;
+
+import it.telecomitalia.ah.cluster.zigbee.eh.GetEventsAndAlertsResponse;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI24;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+public class ZclGetEventsAndAlertsResponse {
+
+ public static GetEventsAndAlertsResponse zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ GetEventsAndAlertsResponse r = new GetEventsAndAlertsResponse();
+ int size = ZclDataTypeUI8.zclParse(zclFrame);
+ r.Events = new int[size];
+ for (int i = 0; i < size; i++) {
+ r.Events[i] = ZclDataTypeUI24.zclParse(zclFrame);
+ }
+ return r;
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, GetEventsAndAlertsResponse r) throws ZclValidationException {
+ ZclDataTypeUI8.zclSerialize(zclFrame, (short) r.Events.length);
+ for (int i = 0; (i < r.Events.length); i++) {
+ ZclDataTypeUI24.zclSerialize(zclFrame, r.Events[i]);
+ }
+ }
+
+ public static int zclSize(GetEventsAndAlertsResponse r) throws ZclValidationException {
+ int size = 0;
+ size += ZclDataTypeUI8.zclSize((short) 0);
+ size += (r.Events.length * ZclDataTypeUI24.zclSize(0));
+ return size;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclGetOverallSchedulePriceResponse.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclGetOverallSchedulePriceResponse.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclGetOverallSchedulePriceResponse.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,41 @@
+
+package it.telecomitalia.ah.zigbee.zcl.cluster.eh;
+
+import it.telecomitalia.ah.cluster.zigbee.eh.GetOverallSchedulePriceResponse;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI32;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+public class ZclGetOverallSchedulePriceResponse {
+
+
+ public static GetOverallSchedulePriceResponse zclParse(IZclFrame zclFrame)
+ throws ZclValidationException
+ {
+ GetOverallSchedulePriceResponse r = new GetOverallSchedulePriceResponse();
+ r.Currency = ZclDataTypeUI32 .zclParse(zclFrame);
+ r.Price = ZclDataTypeUI32 .zclParse(zclFrame);
+ r.PriceTrailingDigit = ZclDataTypeUI8 .zclParse(zclFrame);
+ return r;
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, GetOverallSchedulePriceResponse r)
+ throws ZclValidationException
+ {
+ ZclDataTypeUI32 .zclSerialize(zclFrame, r.Currency);
+ ZclDataTypeUI32 .zclSerialize(zclFrame, r.Price);
+ ZclDataTypeUI8 .zclSerialize(zclFrame, r.PriceTrailingDigit);
+ }
+
+ public static int zclSize(GetOverallSchedulePriceResponse r)
+ throws ZclValidationException
+ {
+ int size = 0;
+ size += ZclDataTypeUI32 .zclSize(r.Currency);
+ size += ZclDataTypeUI32 .zclSize(r.Price);
+ size += ZclDataTypeUI8 .zclSize(r.PriceTrailingDigit);
+ return size;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclGetPowerProfilePriceExtendedResponse.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclGetPowerProfilePriceExtendedResponse.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclGetPowerProfilePriceExtendedResponse.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,37 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.eh;
+
+import it.telecomitalia.ah.cluster.zigbee.eh.GetPowerProfilePriceExtendedResponse;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI16;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI32;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+public class ZclGetPowerProfilePriceExtendedResponse {
+
+ public static GetPowerProfilePriceExtendedResponse zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ GetPowerProfilePriceExtendedResponse r = new GetPowerProfilePriceExtendedResponse();
+ r.PowerProfileID = ZclDataTypeUI8.zclParse(zclFrame);
+ r.Currency = ZclDataTypeUI16.zclParse(zclFrame);
+ r.Price = ZclDataTypeUI32.zclParse(zclFrame);
+ r.PriceTrailingDigit = ZclDataTypeUI8.zclParse(zclFrame);
+ return r;
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, GetPowerProfilePriceExtendedResponse r) throws ZclValidationException {
+ ZclDataTypeUI8.zclSerialize(zclFrame, r.PowerProfileID);
+ ZclDataTypeUI16.zclSerialize(zclFrame, r.Currency);
+ ZclDataTypeUI32.zclSerialize(zclFrame, r.Price);
+ ZclDataTypeUI8.zclSerialize(zclFrame, r.PriceTrailingDigit);
+ }
+
+ public static int zclSize(GetPowerProfilePriceExtendedResponse r) throws ZclValidationException {
+ int size = 0;
+ size += ZclDataTypeUI8.zclSize(r.PowerProfileID);
+ size += ZclDataTypeUI16.zclSize(r.Currency);
+ size += ZclDataTypeUI32.zclSize(r.Price);
+ size += ZclDataTypeUI8.zclSize(r.PriceTrailingDigit);
+ return size;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclGetPowerProfilePriceResponse.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclGetPowerProfilePriceResponse.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclGetPowerProfilePriceResponse.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,37 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.eh;
+
+import it.telecomitalia.ah.cluster.zigbee.eh.GetPowerProfilePriceResponse;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI16;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI32;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+public class ZclGetPowerProfilePriceResponse {
+
+ public static GetPowerProfilePriceResponse zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ GetPowerProfilePriceResponse r = new GetPowerProfilePriceResponse();
+ r.PowerProfileID = ZclDataTypeUI8.zclParse(zclFrame);
+ r.Currency = ZclDataTypeUI16.zclParse(zclFrame);
+ r.Price = ZclDataTypeUI32.zclParse(zclFrame);
+ r.PriceTrailingDigit = ZclDataTypeUI8.zclParse(zclFrame);
+ return r;
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, GetPowerProfilePriceResponse r) throws ZclValidationException {
+ ZclDataTypeUI8.zclSerialize(zclFrame, r.PowerProfileID);
+ ZclDataTypeUI16.zclSerialize(zclFrame, r.Currency);
+ ZclDataTypeUI32.zclSerialize(zclFrame, r.Price);
+ ZclDataTypeUI8.zclSerialize(zclFrame, r.PriceTrailingDigit);
+ }
+
+ public static int zclSize(GetPowerProfilePriceResponse r) throws ZclValidationException {
+ int size = 0;
+ size += ZclDataTypeUI8.zclSize(r.PowerProfileID);
+ size += ZclDataTypeUI16.zclSize(r.Currency);
+ size += ZclDataTypeUI32.zclSize(r.Price);
+ size += ZclDataTypeUI8.zclSize(r.PriceTrailingDigit);
+ return size;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclIndesitBridgeClient.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclIndesitBridgeClient.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclIndesitBridgeClient.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,107 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.eh;
+
+import it.telecomitalia.ah.cluster.zigbee.eh.DBFTR;
+import it.telecomitalia.ah.cluster.zigbee.eh.DEFTR;
+import it.telecomitalia.ah.cluster.zigbee.eh.DEFTWAR;
+import it.telecomitalia.ah.cluster.zigbee.eh.IndesitBridgeClient;
+import it.telecomitalia.ah.cluster.zigbee.eh.IndesitBridgeServer;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZCL;
+import it.telecomitalia.ah.zigbee.ZigBeeDevice;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeOctets;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+public class ZclIndesitBridgeClient extends ZclServiceCluster implements IndesitBridgeClient, ZigBeeDeviceListener {
+
+ final static short CLUSTER_ID = 2566;
+
+ public ZclIndesitBridgeClient() throws ApplianceException {
+ super();
+ }
+
+ public boolean notifyZclFrame(short clusterId, IZclFrame zclFrame) throws Exception {
+ boolean handled;
+ handled = super.notifyZclFrame(clusterId, zclFrame);
+ if (handled) {
+ return handled;
+ }
+ int commandId = zclFrame.getCommandId();
+ if (zclFrame.isServerToClient()) {
+ throw new ZclValidationException("invalid direction field");
+ }
+ IZclFrame responseZclFrame = null;
+ ZigBeeDevice device = getZigBeeDevice();
+ int statusCode = ZCL.SUCCESS;
+ IndesitBridgeServer c = ((IndesitBridgeServer) getSinglePeerCluster((IndesitBridgeServer.class.getName())));
+ switch (commandId) {
+ case 147:
+ responseZclFrame = parseDBFT(c, zclFrame);
+ break;
+ case 149:
+ responseZclFrame = parseDEFT(c, zclFrame);
+ break;
+ case 157:
+ responseZclFrame = parseDEFTWA(c, zclFrame);
+ break;
+ }
+ if (responseZclFrame == null) {
+ if (!zclFrame.isDefaultResponseDisabled()) {
+ responseZclFrame = getDefaultResponse(zclFrame, statusCode);
+ }
+ }
+ if (!(responseZclFrame == null)) {
+ device.post(ZclIndesitBridgeClient.CLUSTER_ID, responseZclFrame);
+ return true;
+ }
+ return false;
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ protected IZclFrame parseDBFT(IndesitBridgeServer o, IZclFrame zclFrame) throws ApplianceException, ServiceClusterException {
+ short I2CBusAddress = ZclDataTypeUI8.zclParse(zclFrame);
+ short FrameHeader = ZclDataTypeUI8.zclParse(zclFrame);
+ short FrameType = ZclDataTypeUI8.zclParse(zclFrame);
+ byte[] FramePayload = ZclDataTypeOctets.zclParse(zclFrame);
+ DBFTR r = o.execDBFT(I2CBusAddress, FrameHeader, FrameType, FramePayload, null);
+ int size = ZclDBFTR.zclSize(r);
+ IZclFrame zclResponseFrame = zclFrame.createResponseFrame(size);
+ zclResponseFrame.setCommandId(147);
+ ZclDBFTR.zclSerialize(zclResponseFrame, r);
+ return zclResponseFrame;
+ }
+
+ protected IZclFrame parseDEFT(IndesitBridgeServer o, IZclFrame zclFrame) throws ApplianceException, ServiceClusterException {
+ short I2CBusAddress = ZclDataTypeUI8.zclParse(zclFrame);
+ short FrameHeader = ZclDataTypeUI8.zclParse(zclFrame);
+ short FrameType = ZclDataTypeUI8.zclParse(zclFrame);
+ byte[] FramePayload = ZclDataTypeOctets.zclParse(zclFrame);
+ DEFTR r = o.execDEFT(I2CBusAddress, FrameHeader, FrameType, FramePayload, null);
+ int size = ZclDEFTR.zclSize(r);
+ IZclFrame zclResponseFrame = zclFrame.createResponseFrame(size);
+ zclResponseFrame.setCommandId(149);
+ ZclDEFTR.zclSerialize(zclResponseFrame, r);
+ return zclResponseFrame;
+ }
+
+ protected IZclFrame parseDEFTWA(IndesitBridgeServer o, IZclFrame zclFrame) throws ApplianceException, ServiceClusterException {
+ short I2CBusAddress = ZclDataTypeUI8.zclParse(zclFrame);
+ short FrameHeader = ZclDataTypeUI8.zclParse(zclFrame);
+ short FrameType = ZclDataTypeUI8.zclParse(zclFrame);
+ byte[] FramePayload = ZclDataTypeOctets.zclParse(zclFrame);
+ DEFTWAR r = o.execDEFTWA(I2CBusAddress, FrameHeader, FrameType, FramePayload, null);
+ int size = ZclDEFTWAR.zclSize(r);
+ IZclFrame zclResponseFrame = zclFrame.createResponseFrame(size);
+ zclResponseFrame.setCommandId(157);
+ ZclDEFTWAR.zclSerialize(zclResponseFrame, r);
+ return zclResponseFrame;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclIndesitBridgeServer.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclIndesitBridgeServer.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclIndesitBridgeServer.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,80 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.eh;
+
+import it.telecomitalia.ah.cluster.zigbee.eh.DBFTR;
+import it.telecomitalia.ah.cluster.zigbee.eh.DEFTR;
+import it.telecomitalia.ah.cluster.zigbee.eh.DEFTWAR;
+import it.telecomitalia.ah.cluster.zigbee.eh.IndesitBridgeServer;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.IEndPointRequestContext;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZclFrame;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeOctets;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+public class ZclIndesitBridgeServer extends ZclServiceCluster implements IndesitBridgeServer, ZigBeeDeviceListener {
+
+ final static short CLUSTER_ID = 2566;
+
+ public ZclIndesitBridgeServer() throws ApplianceException {
+ super();
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ public DBFTR execDBFT(short I2CBusAddress, short FrameHeader, short FrameType, byte[] FramePayload,
+ IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ int size = 0;
+ size += ZclDataTypeUI8.zclSize(I2CBusAddress);
+ size += ZclDataTypeUI8.zclSize(FrameHeader);
+ size += ZclDataTypeUI8.zclSize(FrameType);
+ size += ZclDataTypeOctets.zclSize(FramePayload);
+ ZclFrame zclFrame = new ZclFrame(1, size);
+ zclFrame.setCommandId(147);
+ ZclDataTypeUI8.zclSerialize(zclFrame, I2CBusAddress);
+ ZclDataTypeUI8.zclSerialize(zclFrame, FrameHeader);
+ ZclDataTypeUI8.zclSerialize(zclFrame, FrameType);
+ ZclDataTypeOctets.zclSerialize(zclFrame, FramePayload);
+ IZclFrame zclResponseFrame = issueExec(zclFrame, 147, context);
+ return (ZclDBFTR.zclParse(zclResponseFrame));
+ }
+
+ public DEFTR execDEFT(short I2CBusAddress, short FrameHeader, short FrameType, byte[] FramePayload,
+ IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ int size = 0;
+ size += ZclDataTypeUI8.zclSize(I2CBusAddress);
+ size += ZclDataTypeUI8.zclSize(FrameHeader);
+ size += ZclDataTypeUI8.zclSize(FrameType);
+ size += ZclDataTypeOctets.zclSize(FramePayload);
+ ZclFrame zclFrame = new ZclFrame(1, size);
+ zclFrame.setCommandId(149);
+ ZclDataTypeUI8.zclSerialize(zclFrame, I2CBusAddress);
+ ZclDataTypeUI8.zclSerialize(zclFrame, FrameHeader);
+ ZclDataTypeUI8.zclSerialize(zclFrame, FrameType);
+ ZclDataTypeOctets.zclSerialize(zclFrame, FramePayload);
+ IZclFrame zclResponseFrame = issueExec(zclFrame, 149, context);
+ return (ZclDEFTR.zclParse(zclResponseFrame));
+ }
+
+ public DEFTWAR execDEFTWA(short I2CBusAddress, short FrameHeader, short FrameType, byte[] FramePayload,
+ IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ int size = 0;
+ size += ZclDataTypeUI8.zclSize(I2CBusAddress);
+ size += ZclDataTypeUI8.zclSize(FrameHeader);
+ size += ZclDataTypeUI8.zclSize(FrameType);
+ size += ZclDataTypeOctets.zclSize(FramePayload);
+ ZclFrame zclFrame = new ZclFrame(1, size);
+ zclFrame.setCommandId(157);
+ ZclDataTypeUI8.zclSerialize(zclFrame, I2CBusAddress);
+ ZclDataTypeUI8.zclSerialize(zclFrame, FrameHeader);
+ ZclDataTypeUI8.zclSerialize(zclFrame, FrameType);
+ ZclDataTypeOctets.zclSerialize(zclFrame, FramePayload);
+ IZclFrame zclResponseFrame = issueExec(zclFrame, 157, context);
+ return (ZclDEFTWAR.zclParse(zclResponseFrame));
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclLoadManagementAcknowledge.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclLoadManagementAcknowledge.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclLoadManagementAcknowledge.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,26 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.eh;
+
+import it.telecomitalia.ah.cluster.zigbee.eh.LoadManagementAcknowledge;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeEnum8;
+
+public class ZclLoadManagementAcknowledge {
+
+ public static LoadManagementAcknowledge zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ LoadManagementAcknowledge r = new LoadManagementAcknowledge();
+ r.LoadManagementAcknowledge = ZclDataTypeEnum8.zclParse(zclFrame);
+ return r;
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, LoadManagementAcknowledge r) throws ZclValidationException {
+ ZclDataTypeEnum8.zclSerialize(zclFrame, r.LoadManagementAcknowledge);
+ }
+
+ public static int zclSize(LoadManagementAcknowledge r) throws ZclValidationException {
+ int size = 0;
+ size += ZclDataTypeEnum8.zclSize(r.LoadManagementAcknowledge);
+ return size;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclLogQueueResponse.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclLogQueueResponse.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclLogQueueResponse.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,33 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.eh;
+
+import it.telecomitalia.ah.cluster.zigbee.eh.LogQueueResponse;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI32;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+public class ZclLogQueueResponse {
+
+ public static LogQueueResponse zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ LogQueueResponse r = new LogQueueResponse();
+ int size = ZclDataTypeUI8.zclParse(zclFrame);
+ r.LogIds = new long[size];
+ for (int i = 0; i < size; i++) {
+ r.LogIds[i] = ZclDataTypeUI32.zclParse(zclFrame);
+ }
+ return r;
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, LogQueueResponse r) throws ZclValidationException {
+ ZclDataTypeUI8.zclSerialize(zclFrame, (short) (r.LogIds.length * 4));
+ for (int i = 0; i< r.LogIds.length; i++) {
+ ZclDataTypeUI32.zclSerialize(zclFrame, r.LogIds[i]);
+ }
+ }
+
+ public static int zclSize(LogQueueResponse r) throws ZclValidationException {
+ int size = r.LogIds.length * 4 + 1;
+ return size;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclLogResponse.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclLogResponse.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclLogResponse.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,36 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.eh;
+
+import it.telecomitalia.ah.cluster.zigbee.eh.LogResponse;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI32;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUTCTime;
+
+public class ZclLogResponse {
+
+ public static LogResponse zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ LogResponse r = new LogResponse();
+ r.Timestamp = ZclDataTypeUTCTime.zclParse(zclFrame);
+ r.LogID = ZclDataTypeUI32.zclParse(zclFrame);
+ long LogLength = ZclDataTypeUI32.zclParse(zclFrame);
+ r.LogPayload = zclFrame.parseArray((int) LogLength);
+ return r;
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, LogResponse r) throws ZclValidationException {
+ ZclDataTypeUTCTime.zclSerialize(zclFrame, r.Timestamp);
+ ZclDataTypeUI32.zclSerialize(zclFrame, r.LogID);
+ ZclDataTypeUI32.zclSerialize(zclFrame, r.LogPayload.length);
+ zclFrame.appendArray(r.LogPayload);
+ }
+
+ public static int zclSize(LogResponse r) throws ZclValidationException {
+ int size = 0;
+ size += ZclDataTypeUTCTime.zclSize(r.Timestamp);
+ size += ZclDataTypeUI32.zclSize(r.LogID);
+ size += ZclDataTypeUI32.zclSize(r.LogPayload.length);
+ size += r.LogPayload.length;
+ return size;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclMeterIdentificationClient.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclMeterIdentificationClient.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclMeterIdentificationClient.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,26 @@
+
+package it.telecomitalia.ah.zigbee.zcl.cluster.eh;
+
+import it.telecomitalia.ah.cluster.zigbee.eh.MeterIdentificationClient;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+
+public class ZclMeterIdentificationClient
+ extends ZclServiceCluster
+ implements MeterIdentificationClient, ZigBeeDeviceListener
+{
+
+ public final static short CLUSTER_ID = 2817;
+
+ public ZclMeterIdentificationClient()
+ throws ApplianceException
+ {
+ super();
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclMeterIdentificationServer.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclMeterIdentificationServer.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclMeterIdentificationServer.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,275 @@
+
+package it.telecomitalia.ah.zigbee.zcl.cluster.eh;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import it.telecomitalia.ah.cluster.zigbee.eh.MeterIdentificationServer;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.IEndPointRequestContext;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.internal.zigbee.ZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZclFrame;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.IZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeI24;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeOctets;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeString;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI16;
+
+public class ZclMeterIdentificationServer
+ extends ZclServiceCluster
+ implements MeterIdentificationServer, ZigBeeDeviceListener
+{
+
+ public final static short CLUSTER_ID = 2817;
+ final static HashMap attributesMapByName = new HashMap();
+ final static HashMap attributesMapById = new HashMap();
+
+ static {
+ attributesMapByName.put(ZclMeterIdentificationServer.ATTR_CompanyName_NAME, new ZclAttributeDescriptor(0, ZclMeterIdentificationServer.ATTR_CompanyName_NAME, new ZclDataTypeString(16), null, false, 1));
+ attributesMapByName.put(ZclMeterIdentificationServer.ATTR_MeterTypeID_NAME, new ZclAttributeDescriptor(1, ZclMeterIdentificationServer.ATTR_MeterTypeID_NAME, new ZclDataTypeUI16(), null, false, 1));
+ attributesMapByName.put(ZclMeterIdentificationServer.ATTR_DataQualityID_NAME, new ZclAttributeDescriptor(4, ZclMeterIdentificationServer.ATTR_DataQualityID_NAME, new ZclDataTypeUI16(), null, false, 1));
+ attributesMapByName.put(ZclMeterIdentificationServer.ATTR_CustomerName_NAME, new ZclAttributeDescriptor(5, ZclMeterIdentificationServer.ATTR_CustomerName_NAME, new ZclDataTypeString(16), null, false, 0));
+ attributesMapByName.put(ZclMeterIdentificationServer.ATTR_Model_NAME, new ZclAttributeDescriptor(6, ZclMeterIdentificationServer.ATTR_Model_NAME, new ZclDataTypeOctets(16), null, false, 1));
+ attributesMapByName.put(ZclMeterIdentificationServer.ATTR_PartNumber_NAME, new ZclAttributeDescriptor(7, ZclMeterIdentificationServer.ATTR_PartNumber_NAME, new ZclDataTypeOctets(16), null, false, 1));
+ attributesMapByName.put(ZclMeterIdentificationServer.ATTR_ProductRevision_NAME, new ZclAttributeDescriptor(8, ZclMeterIdentificationServer.ATTR_ProductRevision_NAME, new ZclDataTypeOctets(6), null, false, 1));
+ attributesMapByName.put(ZclMeterIdentificationServer.ATTR_SoftwareRevision_NAME, new ZclAttributeDescriptor(10, ZclMeterIdentificationServer.ATTR_SoftwareRevision_NAME, new ZclDataTypeOctets(6), null, false, 1));
+ attributesMapByName.put(ZclMeterIdentificationServer.ATTR_UtilityName_NAME, new ZclAttributeDescriptor(11, ZclMeterIdentificationServer.ATTR_UtilityName_NAME, new ZclDataTypeString(16), null, false, 1));
+ attributesMapByName.put(ZclMeterIdentificationServer.ATTR_POD_NAME, new ZclAttributeDescriptor(12, ZclMeterIdentificationServer.ATTR_POD_NAME, new ZclDataTypeString(16), null, false, 1));
+ attributesMapByName.put(ZclMeterIdentificationServer.ATTR_AvailablePower_NAME, new ZclAttributeDescriptor(13, ZclMeterIdentificationServer.ATTR_AvailablePower_NAME, new ZclDataTypeI24(), null, false, 1));
+ attributesMapByName.put(ZclMeterIdentificationServer.ATTR_PowerThreshold_NAME, new ZclAttributeDescriptor(14, ZclMeterIdentificationServer.ATTR_PowerThreshold_NAME, new ZclDataTypeI24(), null, false, 1));
+ }
+
+ public ZclMeterIdentificationServer()
+ throws ApplianceException
+ {
+ super();
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(String name) {
+ return ((IZclAttributeDescriptor) attributesMapByName.get(name));
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(int id) {
+ Iterator iterator = attributesMapByName.values().iterator();
+ // FIXME: generate it and optimize!!!!
+ for (; iterator.hasNext();) {
+ IZclAttributeDescriptor attributeDescriptor = (IZclAttributeDescriptor) iterator.next();
+ if (attributeDescriptor.zclGetId() == id)
+ return attributeDescriptor;
+ }
+ return null;
+ }
+
+ public String getCompanyName(IEndPointRequestContext context)
+ throws ApplianceException, ServiceClusterException
+ {
+ if (context!= null) {
+ String objectResult = null;
+ objectResult = ((String) getValidCachedAttributeObject(0, context.getMaxAgeForAttributeValues()));
+ if (objectResult!= null) {
+ return objectResult;
+ }
+ }
+ IZclFrame zclFrame = readAttribute(0, context);
+ String v = ZclDataTypeString.zclParse(zclFrame);
+ setCachedAttributeObject(0, v);
+ return v;
+ }
+
+ public int getMeterTypeID(IEndPointRequestContext context)
+ throws ApplianceException, ServiceClusterException
+ {
+ if (context!= null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(1, context.getMaxAgeForAttributeValues()));
+ if (objectResult!= null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(1, context);
+ int v = ZclDataTypeUI16 .zclParse(zclFrame);
+ setCachedAttributeObject(1, new Integer(v));
+ return v;
+ }
+
+ public int getDataQualityID(IEndPointRequestContext context)
+ throws ApplianceException, ServiceClusterException
+ {
+ if (context!= null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(4, context.getMaxAgeForAttributeValues()));
+ if (objectResult!= null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(4, context);
+ int v = ZclDataTypeUI16 .zclParse(zclFrame);
+ setCachedAttributeObject(4, new Integer(v));
+ return v;
+ }
+
+ public void setCustomerName(String CustomerName, IEndPointRequestContext context)
+ throws ApplianceException, ServiceClusterException
+ {
+ int attrId = 5;
+ int size = 3;
+ size += ZclDataTypeString.zclSize(CustomerName);
+ IZclFrame zclFrame = new ZclFrame(0, size);
+ zclFrame.appendUInt16(attrId);
+ zclFrame.appendUInt8(ZclDataTypeString.ZCL_DATA_TYPE);
+ ZclDataTypeString.zclSerialize(zclFrame, CustomerName);
+ issueSet(ZclMeterIdentificationServer.CLUSTER_ID, zclFrame, attrId, context);
+ }
+
+ public String getCustomerName(IEndPointRequestContext context)
+ throws ApplianceException, ServiceClusterException
+ {
+ if (context!= null) {
+ String objectResult = null;
+ objectResult = ((String) getValidCachedAttributeObject(5, context.getMaxAgeForAttributeValues()));
+ if (objectResult!= null) {
+ return objectResult;
+ }
+ }
+ IZclFrame zclFrame = readAttribute(5, context);
+ String v = ZclDataTypeString.zclParse(zclFrame);
+ setCachedAttributeObject(5, v);
+ return v;
+ }
+
+ public byte[] getModel(IEndPointRequestContext context)
+ throws ApplianceException, ServiceClusterException
+ {
+ if (context!= null) {
+ byte[] objectResult = null;
+ objectResult = ((byte[]) getValidCachedAttributeObject(6, context.getMaxAgeForAttributeValues()));
+ if (objectResult!= null) {
+ return objectResult;
+ }
+ }
+ IZclFrame zclFrame = readAttribute(6, context);
+ byte[] v = ZclDataTypeOctets.zclParse(zclFrame);
+ setCachedAttributeObject(6, v);
+ return v;
+ }
+
+ public byte[] getPartNumber(IEndPointRequestContext context)
+ throws ApplianceException, ServiceClusterException
+ {
+ if (context!= null) {
+ byte[] objectResult = null;
+ objectResult = ((byte[]) getValidCachedAttributeObject(7, context.getMaxAgeForAttributeValues()));
+ if (objectResult!= null) {
+ return objectResult;
+ }
+ }
+ IZclFrame zclFrame = readAttribute(7, context);
+ byte[] v = ZclDataTypeOctets.zclParse(zclFrame);
+ setCachedAttributeObject(7, v);
+ return v;
+ }
+
+ public byte[] getProductRevision(IEndPointRequestContext context)
+ throws ApplianceException, ServiceClusterException
+ {
+ if (context!= null) {
+ byte[] objectResult = null;
+ objectResult = ((byte[]) getValidCachedAttributeObject(8, context.getMaxAgeForAttributeValues()));
+ if (objectResult!= null) {
+ return objectResult;
+ }
+ }
+ IZclFrame zclFrame = readAttribute(8, context);
+ byte[] v = ZclDataTypeOctets.zclParse(zclFrame);
+ setCachedAttributeObject(8, v);
+ return v;
+ }
+
+ public byte[] getSoftwareRevision(IEndPointRequestContext context)
+ throws ApplianceException, ServiceClusterException
+ {
+ if (context!= null) {
+ byte[] objectResult = null;
+ objectResult = ((byte[]) getValidCachedAttributeObject(10, context.getMaxAgeForAttributeValues()));
+ if (objectResult!= null) {
+ return objectResult;
+ }
+ }
+ IZclFrame zclFrame = readAttribute(10, context);
+ byte[] v = ZclDataTypeOctets.zclParse(zclFrame);
+ setCachedAttributeObject(10, v);
+ return v;
+ }
+
+ public String getUtilityName(IEndPointRequestContext context)
+ throws ApplianceException, ServiceClusterException
+ {
+ if (context!= null) {
+ String objectResult = null;
+ objectResult = ((String) getValidCachedAttributeObject(11, context.getMaxAgeForAttributeValues()));
+ if (objectResult!= null) {
+ return objectResult;
+ }
+ }
+ IZclFrame zclFrame = readAttribute(11, context);
+ String v = ZclDataTypeString.zclParse(zclFrame);
+ setCachedAttributeObject(11, v);
+ return v;
+ }
+
+ public String getPOD(IEndPointRequestContext context)
+ throws ApplianceException, ServiceClusterException
+ {
+ if (context!= null) {
+ String objectResult = null;
+ objectResult = ((String) getValidCachedAttributeObject(12, context.getMaxAgeForAttributeValues()));
+ if (objectResult!= null) {
+ return objectResult;
+ }
+ }
+ IZclFrame zclFrame = readAttribute(12, context);
+ String v = ZclDataTypeString.zclParse(zclFrame);
+ setCachedAttributeObject(12, v);
+ return v;
+ }
+
+ public int getAvailablePower(IEndPointRequestContext context)
+ throws ApplianceException, ServiceClusterException
+ {
+ if (context!= null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(13, context.getMaxAgeForAttributeValues()));
+ if (objectResult!= null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(13, context);
+ int v = ZclDataTypeI24 .zclParse(zclFrame);
+ setCachedAttributeObject(13, new Integer(v));
+ return v;
+ }
+
+ public int getPowerThreshold(IEndPointRequestContext context)
+ throws ApplianceException, ServiceClusterException
+ {
+ if (context!= null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(14, context.getMaxAgeForAttributeValues()));
+ if (objectResult!= null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(14, context);
+ int v = ZclDataTypeI24 .zclParse(zclFrame);
+ setCachedAttributeObject(14, new Integer(v));
+ return v;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfile.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfile.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfile.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,33 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.eh;
+
+import it.telecomitalia.ah.cluster.zigbee.eh.PowerProfile;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeBoolean;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeEnum8;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+public class ZclPowerProfile {
+
+ public static PowerProfile zclParse(IZclFrame zclFrame) throws ZclValidationException {
+
+ PowerProfile p = new PowerProfile();
+ p.PowerProfileID = ZclDataTypeUI8.zclParse(zclFrame);
+ p.EnergyPhaseID = ZclDataTypeUI8.zclParse(zclFrame);
+ p.PowerProfileRemoteControl = ZclDataTypeBoolean.zclParse(zclFrame);
+ p.PowerProfileState = ZclDataTypeEnum8.zclParse(zclFrame);
+
+ return p;
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, PowerProfile value) throws ZclValidationException {
+ ZclDataTypeUI8.zclSerialize(zclFrame, value.PowerProfileID);
+ ZclDataTypeUI8.zclSerialize(zclFrame, value.EnergyPhaseID);
+ ZclDataTypeBoolean.zclSerialize(zclFrame, value.PowerProfileRemoteControl);
+ ZclDataTypeEnum8.zclSerialize(zclFrame, value.PowerProfileState);
+ }
+
+ public static int zclSize(PowerProfile value) throws ZclValidationException {
+ return 4;
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileClient.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileClient.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileClient.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,251 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.eh;
+
+import it.telecomitalia.ah.cluster.zigbee.eh.EnergyPhasesScheduleResponse;
+import it.telecomitalia.ah.cluster.zigbee.eh.EnergyPhasesScheduleStateResponse;
+import it.telecomitalia.ah.cluster.zigbee.eh.GetOverallSchedulePriceResponse;
+import it.telecomitalia.ah.cluster.zigbee.eh.GetPowerProfilePriceExtendedResponse;
+import it.telecomitalia.ah.cluster.zigbee.eh.GetPowerProfilePriceResponse;
+import it.telecomitalia.ah.cluster.zigbee.eh.PowerProfile;
+import it.telecomitalia.ah.cluster.zigbee.eh.PowerProfileClient;
+import it.telecomitalia.ah.cluster.zigbee.eh.PowerProfileResponse;
+import it.telecomitalia.ah.cluster.zigbee.eh.PowerProfileScheduleConstraintsResponse;
+import it.telecomitalia.ah.cluster.zigbee.eh.PowerProfileServer;
+import it.telecomitalia.ah.cluster.zigbee.eh.PowerProfileStateResponse;
+import it.telecomitalia.ah.cluster.zigbee.eh.PowerProfileTransferredPhase;
+import it.telecomitalia.ah.cluster.zigbee.eh.ScheduledPhase;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.IEndPointRequestContext;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZCL;
+import it.telecomitalia.ah.zigbee.ZclFrame;
+import it.telecomitalia.ah.zigbee.ZigBeeDevice;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeBitmap8;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI16;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+public class ZclPowerProfileClient extends ZclServiceCluster implements PowerProfileClient, ZigBeeDeviceListener {
+
+ public final static short CLUSTER_ID = 26;
+
+ public ZclPowerProfileClient() throws ApplianceException {
+ super();
+ }
+
+ public boolean notifyZclFrame(short clusterId, IZclFrame zclFrame) throws Exception {
+ boolean handled;
+ handled = super.notifyZclFrame(clusterId, zclFrame);
+ if (handled) {
+ return handled;
+ }
+ int commandId = zclFrame.getCommandId();
+ if (zclFrame.isServerToClient()) {
+ throw new ZclValidationException("invalid direction field");
+ }
+ IZclFrame responseZclFrame = null;
+ ZigBeeDevice device = getZigBeeDevice();
+ int statusCode = ZCL.SUCCESS;
+ PowerProfileServer c = ((PowerProfileServer) getSinglePeerCluster((PowerProfileServer.class.getName())));
+ switch (commandId) {
+ case 0:
+ responseZclFrame = parsePowerProfileRequest(c, zclFrame);
+ break;
+ case 1:
+ responseZclFrame = parsePowerProfileStateRequest(c, zclFrame);
+ break;
+ case 4:
+ responseZclFrame = parseEnergyPhasesScheduleNotification(c, zclFrame);
+ break;
+ case 6:
+ responseZclFrame = parsePowerProfileScheduleConstraintsRequest(c, zclFrame);
+ break;
+ case 7:
+ responseZclFrame = parseEnergyPhasesScheduleStateRequest(c, zclFrame);
+ break;
+ }
+ if (responseZclFrame == null) {
+ if (!zclFrame.isDefaultResponseDisabled()) {
+ responseZclFrame = getDefaultResponse(zclFrame, statusCode);
+ }
+ }
+ if (!(responseZclFrame == null)) {
+ device.post(ZclPowerProfileClient.CLUSTER_ID, responseZclFrame);
+ return true;
+ }
+ return false;
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ public void execPowerProfileNotification(short TotalProfileNum, short PowerProfileID,
+ PowerProfileTransferredPhase[] PowerProfileTransferredPhases, IEndPointRequestContext context)
+ throws ApplianceException, ServiceClusterException {
+ int size = 0;
+ size += ZclDataTypeUI8.zclSize(TotalProfileNum);
+ size += ZclDataTypeUI8.zclSize(PowerProfileID);
+ size += (PowerProfileTransferredPhases.length * ZclPowerProfileTransferredPhase.zclSize(null));
+ ZclFrame zclFrame = new ZclFrame(1, size);
+ zclFrame.setCommandId(0);
+ ZclDataTypeUI8.zclSerialize(zclFrame, TotalProfileNum);
+ ZclDataTypeUI8.zclSerialize(zclFrame, PowerProfileID);
+ size += (PowerProfileTransferredPhases.length * ZclPowerProfileTransferredPhase.zclSize(null));
+ int i;
+ for (i = 0; (i < PowerProfileTransferredPhases.length); i++) {
+ ZclPowerProfileTransferredPhase.zclSerialize(zclFrame, PowerProfileTransferredPhases[i]);
+ }
+ issueExec(zclFrame, 11, context);
+ }
+
+ public GetPowerProfilePriceResponse execGetPowerProfilePrice(short PowerProfileID, IEndPointRequestContext context)
+ throws ApplianceException, ServiceClusterException {
+ int size = 0;
+ size += ZclDataTypeUI8.zclSize(PowerProfileID);
+ ZclFrame zclFrame = new ZclFrame(1, size);
+ zclFrame.setCommandId(3);
+ ZclDataTypeUI8.zclSerialize(zclFrame, PowerProfileID);
+ IZclFrame zclResponseFrame = issueExec(zclFrame, 2, context);
+ return (ZclGetPowerProfilePriceResponse.zclParse(zclResponseFrame));
+ }
+
+ public void execPowerProfilesStateNotification(PowerProfile[] PowerProfiles, IEndPointRequestContext context)
+ throws ApplianceException, ServiceClusterException {
+ int size = 0;
+ size += (PowerProfiles.length * ZclPowerProfile.zclSize(null));
+ ZclFrame zclFrame = new ZclFrame(1, size);
+ zclFrame.setCommandId(4);
+ ZclDataTypeUI8.zclSerialize(zclFrame, (short) PowerProfiles.length);
+ size += (PowerProfiles.length * ZclPowerProfile.zclSize(null));
+ int i;
+ for (i = 0; (i < PowerProfiles.length); i++) {
+ ZclPowerProfile.zclSerialize(zclFrame, PowerProfiles[i]);
+ }
+ issueExec(zclFrame, 11, context);
+ }
+
+ public GetOverallSchedulePriceResponse execGetOverallSchedulePrice(IEndPointRequestContext context) throws ApplianceException,
+ ServiceClusterException {
+ ZclFrame zclFrame = new ZclFrame(1);
+ zclFrame.setCommandId(5);
+ IZclFrame zclResponseFrame = issueExec(zclFrame, 3, context);
+ return (ZclGetOverallSchedulePriceResponse.zclParse(zclResponseFrame));
+ }
+
+ public EnergyPhasesScheduleResponse execEnergyPhasesScheduleRequest(short PowerProfileID, IEndPointRequestContext context)
+ throws ApplianceException, ServiceClusterException {
+ int size = 0;
+ size += ZclDataTypeUI8.zclSize(PowerProfileID);
+ ZclFrame zclFrame = new ZclFrame(1, size);
+ zclFrame.setCommandId(6);
+ ZclDataTypeUI8.zclSerialize(zclFrame, PowerProfileID);
+ IZclFrame zclResponseFrame = issueExec(zclFrame, 5, context);
+ return (ZclEnergyPhasesScheduleResponse.zclParse(zclResponseFrame));
+ }
+
+ public void execEnergyPhasesScheduleStateNotification(short PowerProfileID, ScheduledPhase[] ScheduledPhases,
+ IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ int size = 0;
+ size += ZclDataTypeUI8.zclSize(PowerProfileID);
+ size += (ScheduledPhases.length * ZclScheduledPhase.zclSize(null));
+ ZclFrame zclFrame = new ZclFrame(1, size);
+ zclFrame.setCommandId(8);
+ ZclDataTypeUI8.zclSerialize(zclFrame, PowerProfileID);
+ size += (ScheduledPhases.length * ZclScheduledPhase.zclSize(null));
+ int i;
+ for (i = 0; (i < ScheduledPhases.length); i++) {
+ ZclScheduledPhase.zclSerialize(zclFrame, ScheduledPhases[i]);
+ }
+ }
+
+ public void execPowerProfileScheduleConstraintsNotification(short PowerProfileID, int StartAfter, int StopBefore,
+ IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ int size = 0;
+ size += ZclDataTypeUI8.zclSize(PowerProfileID);
+ size += ZclDataTypeUI16.zclSize(StartAfter);
+ size += ZclDataTypeUI16.zclSize(StopBefore);
+ ZclFrame zclFrame = new ZclFrame(1, size);
+ zclFrame.setCommandId(9);
+ ZclDataTypeUI8.zclSerialize(zclFrame, PowerProfileID);
+ ZclDataTypeUI16.zclSerialize(zclFrame, StartAfter);
+ ZclDataTypeUI16.zclSerialize(zclFrame, StopBefore);
+ issueExec(zclFrame, 11, context);
+ }
+
+ public GetPowerProfilePriceExtendedResponse execGetPowerProfilePriceExtended(short Options, short PowerProfileID,
+ int PowerProfileStartTime, IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ int size = 0;
+ size += ZclDataTypeBitmap8.zclSize(Options);
+ size += ZclDataTypeUI8.zclSize(PowerProfileID);
+ size += ZclDataTypeUI16.zclSize(PowerProfileStartTime);
+ ZclFrame zclFrame = new ZclFrame(1, size);
+ zclFrame.setCommandId(11);
+ ZclDataTypeBitmap8.zclSerialize(zclFrame, Options);
+ ZclDataTypeUI8.zclSerialize(zclFrame, PowerProfileID);
+ ZclDataTypeUI16.zclSerialize(zclFrame, PowerProfileStartTime);
+ IZclFrame zclResponseFrame = issueExec(zclFrame, 8, context);
+ return (ZclGetPowerProfilePriceExtendedResponse.zclParse(zclResponseFrame));
+ }
+
+ protected IZclFrame parsePowerProfileRequest(PowerProfileServer o, IZclFrame zclFrame) throws ApplianceException,
+ ServiceClusterException {
+ short PowerProfileID = ZclDataTypeUI8.zclParse(zclFrame);
+ PowerProfileResponse r = o.execPowerProfileRequest(PowerProfileID, null);
+ int size = ZclPowerProfileResponse.zclSize(r);
+ IZclFrame zclResponseFrame = zclFrame.createResponseFrame(size);
+ zclResponseFrame.setCommandId(1);
+ ZclPowerProfileResponse.zclSerialize(zclResponseFrame, r);
+ return zclResponseFrame;
+ }
+
+ protected IZclFrame parsePowerProfileStateRequest(PowerProfileServer o, IZclFrame zclFrame) throws ApplianceException,
+ ServiceClusterException {
+ PowerProfileStateResponse r = o.execPowerProfileStateRequest(null);
+ int size = ZclPowerProfileStateResponse.zclSize(r);
+ IZclFrame zclResponseFrame = zclFrame.createResponseFrame(size);
+ zclResponseFrame.setCommandId(2);
+ ZclPowerProfileStateResponse.zclSerialize(zclResponseFrame, r);
+ return zclResponseFrame;
+ }
+
+ protected IZclFrame parseEnergyPhasesScheduleNotification(PowerProfileServer o, IZclFrame zclFrame) throws ApplianceException,
+ ServiceClusterException {
+ short PowerProfileID = ZclDataTypeUI8.zclParse(zclFrame);
+ int ZclScheduledPhaseSize;
+ ZclScheduledPhaseSize = ZclDataTypeBitmap8.zclParse(zclFrame);
+ ScheduledPhase[] ScheduledPhases;
+ ScheduledPhases = new ScheduledPhase[ZclScheduledPhaseSize];
+ int i;
+ for (i = 0; (i < ZclScheduledPhaseSize); i++) {
+ ScheduledPhases[i] = ZclScheduledPhase.zclParse(zclFrame);
+ }
+ o.execEnergyPhasesScheduleNotification(PowerProfileID, ScheduledPhases, null);
+ return null;
+ }
+
+ protected IZclFrame parsePowerProfileScheduleConstraintsRequest(PowerProfileServer o, IZclFrame zclFrame)
+ throws ApplianceException, ServiceClusterException {
+ short PowerProfileID = ZclDataTypeUI8.zclParse(zclFrame);
+ PowerProfileScheduleConstraintsResponse r = o.execPowerProfileScheduleConstraintsRequest(PowerProfileID, null);
+ int size = ZclPowerProfileScheduleConstraintsResponse.zclSize(r);
+ IZclFrame zclResponseFrame = zclFrame.createResponseFrame(size);
+ zclResponseFrame.setCommandId(10);
+ ZclPowerProfileScheduleConstraintsResponse.zclSerialize(zclResponseFrame, r);
+ return zclResponseFrame;
+ }
+
+ protected IZclFrame parseEnergyPhasesScheduleStateRequest(PowerProfileServer o, IZclFrame zclFrame) throws ApplianceException,
+ ServiceClusterException {
+ short PowerProfileID = ZclDataTypeUI8.zclParse(zclFrame);
+ EnergyPhasesScheduleStateResponse r = o.execEnergyPhasesScheduleStateRequest(PowerProfileID, null);
+ int size = ZclEnergyPhasesScheduleStateResponse.zclSize(r);
+ IZclFrame zclResponseFrame = zclFrame.createResponseFrame(size);
+ zclResponseFrame.setCommandId(7);
+ ZclEnergyPhasesScheduleStateResponse.zclSerialize(zclResponseFrame, r);
+ return zclResponseFrame;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileResponse.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileResponse.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileResponse.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,46 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.eh;
+
+import it.telecomitalia.ah.cluster.zigbee.eh.PowerProfile;
+import it.telecomitalia.ah.cluster.zigbee.eh.PowerProfileResponse;
+import it.telecomitalia.ah.cluster.zigbee.eh.PowerProfileTransferredPhase;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+public class ZclPowerProfileResponse {
+
+ public static PowerProfileResponse zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ PowerProfileResponse r = new PowerProfileResponse();
+ r.TotalProfileNum = ZclDataTypeUI8.zclParse(zclFrame);
+ r.PowerProfileID = ZclDataTypeUI8.zclParse(zclFrame);
+ short NumPowerProfilesTransferredPhases = ZclDataTypeUI8.zclParse(zclFrame);
+
+ PowerProfileTransferredPhase[] PowerProfileTransferredPhases = new PowerProfileTransferredPhase[NumPowerProfilesTransferredPhases];
+
+ for (int i = 0; i < NumPowerProfilesTransferredPhases; i++) {
+ PowerProfileTransferredPhases[i] = ZclPowerProfileTransferredPhase.zclParse(zclFrame);
+ }
+
+ r.PowerProfileTransferredPhases = PowerProfileTransferredPhases;
+ return r;
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, PowerProfileResponse r) throws ZclValidationException {
+ ZclDataTypeUI8.zclSerialize(zclFrame, r.TotalProfileNum);
+ ZclDataTypeUI8.zclSerialize(zclFrame, r.PowerProfileID);
+ ZclDataTypeUI8.zclSerialize(zclFrame, (short) r.PowerProfileTransferredPhases.length);
+ for (int i = 0; i < r.PowerProfileTransferredPhases.length; i++) {
+ ZclPowerProfileTransferredPhase.zclSerialize(zclFrame, r.PowerProfileTransferredPhases[i]);
+ }
+ }
+
+ public static int zclSize(PowerProfileResponse r) throws ZclValidationException {
+ int size = 0;
+ size += ZclDataTypeUI8.zclSize(r.TotalProfileNum);
+ size += ZclDataTypeUI8.zclSize(r.PowerProfileID);
+ size += 1;
+ size += ZclPowerProfile.zclSize(null) * r.PowerProfileTransferredPhases.length;
+ return size;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileScheduleConstraintsResponse.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileScheduleConstraintsResponse.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileScheduleConstraintsResponse.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,33 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.eh;
+
+import it.telecomitalia.ah.cluster.zigbee.eh.PowerProfileScheduleConstraintsResponse;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI16;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+public class ZclPowerProfileScheduleConstraintsResponse {
+
+ public static PowerProfileScheduleConstraintsResponse zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ PowerProfileScheduleConstraintsResponse r = new PowerProfileScheduleConstraintsResponse();
+ r.PowerProfileID = ZclDataTypeUI8.zclParse(zclFrame);
+ r.StartAfter = ZclDataTypeUI16.zclParse(zclFrame);
+ r.StopBefore = ZclDataTypeUI16.zclParse(zclFrame);
+ return r;
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, PowerProfileScheduleConstraintsResponse r) throws ZclValidationException {
+ ZclDataTypeUI8.zclSerialize(zclFrame, r.PowerProfileID);
+ ZclDataTypeUI16.zclSerialize(zclFrame, r.StartAfter);
+ ZclDataTypeUI16.zclSerialize(zclFrame, r.StopBefore);
+ }
+
+ public static int zclSize(PowerProfileScheduleConstraintsResponse r) throws ZclValidationException {
+ int size = 0;
+ size += ZclDataTypeUI8.zclSize(r.PowerProfileID);
+ size += ZclDataTypeUI16.zclSize(r.StartAfter);
+ size += ZclDataTypeUI16.zclSize(r.StopBefore);
+ return size;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileServer.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileServer.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileServer.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,369 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.eh;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import it.telecomitalia.ah.cluster.zigbee.eh.EnergyPhasesScheduleResponse;
+import it.telecomitalia.ah.cluster.zigbee.eh.EnergyPhasesScheduleStateResponse;
+import it.telecomitalia.ah.cluster.zigbee.eh.GetOverallSchedulePriceResponse;
+import it.telecomitalia.ah.cluster.zigbee.eh.GetPowerProfilePriceExtendedResponse;
+import it.telecomitalia.ah.cluster.zigbee.eh.GetPowerProfilePriceResponse;
+import it.telecomitalia.ah.cluster.zigbee.eh.PowerProfile;
+import it.telecomitalia.ah.cluster.zigbee.eh.PowerProfileClient;
+import it.telecomitalia.ah.cluster.zigbee.eh.PowerProfileResponse;
+import it.telecomitalia.ah.cluster.zigbee.eh.PowerProfileScheduleConstraintsResponse;
+import it.telecomitalia.ah.cluster.zigbee.eh.PowerProfileServer;
+import it.telecomitalia.ah.cluster.zigbee.eh.PowerProfileStateResponse;
+import it.telecomitalia.ah.cluster.zigbee.eh.PowerProfileTransferredPhase;
+import it.telecomitalia.ah.cluster.zigbee.eh.ScheduledPhase;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.IEndPointRequestContext;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.internal.zigbee.ZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZCL;
+import it.telecomitalia.ah.zigbee.ZclFrame;
+import it.telecomitalia.ah.zigbee.ZigBeeDevice;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.IZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeBitmap8;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeBoolean;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI16;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+public class ZclPowerProfileServer extends ZclServiceCluster implements PowerProfileServer, ZigBeeDeviceListener {
+
+ public final static short CLUSTER_ID = 26;
+ final static HashMap attributesMapByName = new HashMap();
+ final static HashMap attributesMapById = new HashMap();
+
+ static {
+ attributesMapByName.put(ZclPowerProfileServer.ATTR_TotalProfileNum_NAME, new ZclAttributeDescriptor(0,
+ ZclPowerProfileServer.ATTR_TotalProfileNum_NAME, new ZclDataTypeUI8(), null, false, 1));
+ attributesMapByName.put(ZclPowerProfileServer.ATTR_MultipleScheduling_NAME, new ZclAttributeDescriptor(1,
+ ZclPowerProfileServer.ATTR_MultipleScheduling_NAME, new ZclDataTypeBoolean(), null, false, 1));
+ attributesMapByName.put(ZclPowerProfileServer.ATTR_EnergyFormatting_NAME, new ZclAttributeDescriptor(2,
+ ZclPowerProfileServer.ATTR_EnergyFormatting_NAME, new ZclDataTypeBitmap8(), null, false, 1));
+ attributesMapByName.put(ZclPowerProfileServer.ATTR_EnergyRemote_NAME, new ZclAttributeDescriptor(3,
+ ZclPowerProfileServer.ATTR_EnergyRemote_NAME, new ZclDataTypeBoolean(), null, true, 1));
+ attributesMapByName.put(ZclPowerProfileServer.ATTR_ScheduleMode_NAME, new ZclAttributeDescriptor(4,
+ ZclPowerProfileServer.ATTR_ScheduleMode_NAME, new ZclDataTypeBitmap8(), null, true, 0));
+ }
+
+ public ZclPowerProfileServer() throws ApplianceException {
+ super();
+ }
+
+ public boolean notifyZclFrame(short clusterId, IZclFrame zclFrame) throws Exception {
+ boolean handled;
+ handled = super.notifyZclFrame(clusterId, zclFrame);
+ if (handled) {
+ return handled;
+ }
+ int commandId = zclFrame.getCommandId();
+ if (zclFrame.isClientToServer()) {
+ throw new ZclValidationException("invalid direction field");
+ }
+ IZclFrame responseZclFrame = null;
+ ZigBeeDevice device = getZigBeeDevice();
+ int statusCode = ZCL.SUCCESS;
+ PowerProfileClient c = ((PowerProfileClient) getSinglePeerCluster((PowerProfileClient.class.getName())));
+ switch (commandId) {
+ case 0:
+ responseZclFrame = parsePowerProfileNotification(c, zclFrame);
+ break;
+ case 3:
+ responseZclFrame = parseGetPowerProfilePrice(c, zclFrame);
+ break;
+ case 4:
+ responseZclFrame = parsePowerProfilesStateNotification(c, zclFrame);
+ break;
+ case 5:
+ responseZclFrame = parseGetOverallSchedulePrice(c, zclFrame);
+ break;
+ case 6:
+ responseZclFrame = parseEnergyPhasesScheduleRequest(c, zclFrame);
+ break;
+ case 8:
+ responseZclFrame = parseEnergyPhasesScheduleStateNotification(c, zclFrame);
+ break;
+ case 9:
+ responseZclFrame = parsePowerProfileScheduleConstraintsNotification(c, zclFrame);
+ break;
+ case 11:
+ responseZclFrame = parseGetPowerProfilePriceExtended(c, zclFrame);
+ break;
+ }
+ if (responseZclFrame == null) {
+ if (!zclFrame.isDefaultResponseDisabled()) {
+ responseZclFrame = getDefaultResponse(zclFrame, statusCode);
+ }
+ }
+ if (!(responseZclFrame == null)) {
+ device.post(ZclPowerProfileServer.CLUSTER_ID, responseZclFrame);
+ return true;
+ }
+ return false;
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(String name) {
+ return ((IZclAttributeDescriptor) attributesMapByName.get(name));
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(int id) {
+ Iterator iterator = attributesMapByName.values().iterator();
+ // FIXME: generate it and optimize!!!!
+ for (; iterator.hasNext();) {
+ IZclAttributeDescriptor attributeDescriptor = (IZclAttributeDescriptor) iterator.next();
+ if (attributeDescriptor.zclGetId() == id)
+ return attributeDescriptor;
+ }
+ return null;
+ }
+
+ public PowerProfileResponse execPowerProfileRequest(short PowerProfileID, IEndPointRequestContext context)
+ throws ApplianceException, ServiceClusterException {
+ int size = 0;
+ size += ZclDataTypeUI8.zclSize(PowerProfileID);
+ ZclFrame zclFrame = new ZclFrame(1, size);
+ zclFrame.setCommandId(0);
+ ZclDataTypeUI8.zclSerialize(zclFrame, PowerProfileID);
+ IZclFrame zclResponseFrame = issueExec(zclFrame, 1, context);
+ return (ZclPowerProfileResponse.zclParse(zclResponseFrame));
+ }
+
+ public PowerProfileStateResponse execPowerProfileStateRequest(IEndPointRequestContext context) throws ApplianceException,
+ ServiceClusterException {
+ ZclFrame zclFrame = new ZclFrame(1);
+ zclFrame.setCommandId(1);
+ IZclFrame zclResponseFrame = issueExec(zclFrame, 2, context);
+ return (ZclPowerProfileStateResponse.zclParse(zclResponseFrame));
+ }
+
+ public void execEnergyPhasesScheduleNotification(short PowerProfileID, ScheduledPhase[] ScheduledPhases,
+ IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ int size = 0;
+ size += ZclDataTypeUI8.zclSize(PowerProfileID);
+ size += ZclDataTypeUI8.zclSize((short)ScheduledPhases.length);
+ size += (ScheduledPhases.length * ZclScheduledPhase.zclSize(null));
+ ZclFrame zclFrame = new ZclFrame(1, size);
+ zclFrame.setCommandId(4);
+ ZclDataTypeUI8.zclSerialize(zclFrame, PowerProfileID);
+ ZclDataTypeUI8.zclSerialize(zclFrame, (short)ScheduledPhases.length);
+ int i;
+
+ for (i = 0; (i < ScheduledPhases.length); i++) {
+ ZclScheduledPhase.zclSerialize(zclFrame, ScheduledPhases[i]);
+ }
+ issueExec(zclFrame, 11, context);
+ }
+
+ public PowerProfileScheduleConstraintsResponse execPowerProfileScheduleConstraintsRequest(short PowerProfileID,
+ IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ int size = 0;
+ size += ZclDataTypeUI8.zclSize(PowerProfileID);
+ ZclFrame zclFrame = new ZclFrame(1, size);
+ zclFrame.setCommandId(6);
+ ZclDataTypeUI8.zclSerialize(zclFrame, PowerProfileID);
+ IZclFrame zclResponseFrame = issueExec(zclFrame, 10, context);
+ return (ZclPowerProfileScheduleConstraintsResponse.zclParse(zclResponseFrame));
+ }
+
+ public EnergyPhasesScheduleStateResponse execEnergyPhasesScheduleStateRequest(short PowerProfileID,
+ IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ int size = 0;
+ size += ZclDataTypeUI8.zclSize(PowerProfileID);
+ ZclFrame zclFrame = new ZclFrame(1, size);
+ zclFrame.setCommandId(7);
+ ZclDataTypeUI8.zclSerialize(zclFrame, PowerProfileID);
+ IZclFrame zclResponseFrame = issueExec(zclFrame, 7, context);
+ return (ZclEnergyPhasesScheduleStateResponse.zclParse(zclResponseFrame));
+ }
+
+ protected IZclFrame parsePowerProfileNotification(PowerProfileClient o, IZclFrame zclFrame) throws ApplianceException,
+ ServiceClusterException {
+ short TotalProfileNum = ZclDataTypeUI8.zclParse(zclFrame);
+ short PowerProfileID = ZclDataTypeUI8.zclParse(zclFrame);
+ int ZclPowerProfileTransferredPhaseSize;
+ ZclPowerProfileTransferredPhaseSize = ZclDataTypeBitmap8.zclParse(zclFrame);
+ PowerProfileTransferredPhase[] PowerProfileTransferredPhases;
+ PowerProfileTransferredPhases = new PowerProfileTransferredPhase[ZclPowerProfileTransferredPhaseSize];
+ int i;
+ for (i = 0; (i < ZclPowerProfileTransferredPhaseSize); i++) {
+ PowerProfileTransferredPhases[i] = ZclPowerProfileTransferredPhase.zclParse(zclFrame);
+ }
+ o.execPowerProfileNotification(TotalProfileNum, PowerProfileID, PowerProfileTransferredPhases, null);
+ return null;
+ }
+
+ protected IZclFrame parseGetPowerProfilePrice(PowerProfileClient o, IZclFrame zclFrame) throws ApplianceException,
+ ServiceClusterException {
+ short PowerProfileID = ZclDataTypeUI8.zclParse(zclFrame);
+ GetPowerProfilePriceResponse r = o.execGetPowerProfilePrice(PowerProfileID, null);
+ int size = ZclGetPowerProfilePriceResponse.zclSize(r);
+ IZclFrame zclResponseFrame = zclFrame.createResponseFrame(size);
+ zclResponseFrame.setCommandId(2);
+ ZclGetPowerProfilePriceResponse.zclSerialize(zclResponseFrame, r);
+ return zclResponseFrame;
+ }
+
+ protected IZclFrame parsePowerProfilesStateNotification(PowerProfileClient o, IZclFrame zclFrame) throws ApplianceException,
+ ServiceClusterException {
+ short PowerProfileCount = ZclDataTypeUI8.zclParse(zclFrame);
+ PowerProfile[] PowerProfiles;
+ PowerProfiles = new PowerProfile[PowerProfileCount];
+ int i;
+ for (i = 0; (i < PowerProfileCount); i++) {
+ PowerProfiles[i] = ZclPowerProfile.zclParse(zclFrame);
+ }
+ o.execPowerProfilesStateNotification(PowerProfiles, null);
+ return null;
+ }
+
+ protected IZclFrame parseGetOverallSchedulePrice(PowerProfileClient o, IZclFrame zclFrame) throws ApplianceException,
+ ServiceClusterException {
+ GetOverallSchedulePriceResponse r = o.execGetOverallSchedulePrice(null);
+ int size = ZclGetOverallSchedulePriceResponse.zclSize(r);
+ IZclFrame zclResponseFrame = zclFrame.createResponseFrame(size);
+ zclResponseFrame.setCommandId(3);
+ ZclGetOverallSchedulePriceResponse.zclSerialize(zclResponseFrame, r);
+ return zclResponseFrame;
+ }
+
+ protected IZclFrame parseEnergyPhasesScheduleRequest(PowerProfileClient o, IZclFrame zclFrame) throws ApplianceException,
+ ServiceClusterException {
+ short PowerProfileID = ZclDataTypeUI8.zclParse(zclFrame);
+ EnergyPhasesScheduleResponse r = o.execEnergyPhasesScheduleRequest(PowerProfileID, null);
+ int size = ZclEnergyPhasesScheduleResponse.zclSize(r);
+ IZclFrame zclResponseFrame = zclFrame.createResponseFrame(size);
+ zclResponseFrame.setCommandId(5);
+ ZclEnergyPhasesScheduleResponse.zclSerialize(zclResponseFrame, r);
+ return zclResponseFrame;
+ }
+
+ protected IZclFrame parseEnergyPhasesScheduleStateNotification(PowerProfileClient o, IZclFrame zclFrame)
+ throws ApplianceException, ServiceClusterException {
+ short PowerProfileID = ZclDataTypeUI8.zclParse(zclFrame);
+ int ZclScheduledPhaseSize;
+ ZclScheduledPhaseSize = ZclDataTypeBitmap8.zclParse(zclFrame);
+ ScheduledPhase[] ScheduledPhases;
+ ScheduledPhases = new ScheduledPhase[ZclScheduledPhaseSize];
+ int i;
+ for (i = 0; (i < ZclScheduledPhaseSize); i++) {
+ ScheduledPhases[i] = ZclScheduledPhase.zclParse(zclFrame);
+ }
+ o.execEnergyPhasesScheduleStateNotification(PowerProfileID, ScheduledPhases, null);
+ return null;
+ }
+
+ protected IZclFrame parsePowerProfileScheduleConstraintsNotification(PowerProfileClient o, IZclFrame zclFrame)
+ throws ApplianceException, ServiceClusterException {
+ short PowerProfileID = ZclDataTypeUI8.zclParse(zclFrame);
+ int StartAfter = ZclDataTypeUI16.zclParse(zclFrame);
+ int StopBefore = ZclDataTypeUI16.zclParse(zclFrame);
+ o.execPowerProfileScheduleConstraintsNotification(PowerProfileID, StartAfter, StopBefore, null);
+ return null;
+ }
+
+ protected IZclFrame parseGetPowerProfilePriceExtended(PowerProfileClient o, IZclFrame zclFrame) throws ApplianceException,
+ ServiceClusterException {
+ short Options = ZclDataTypeBitmap8 .zclParse(zclFrame);
+ short PowerProfileID = ZclDataTypeUI8 .zclParse(zclFrame);
+ int PowerProfileStartTime = ZclDataTypeUI16 .zclParse(zclFrame);
+ GetPowerProfilePriceExtendedResponse r = o.execGetPowerProfilePriceExtended(Options, PowerProfileID, PowerProfileStartTime, null);
+ int size = ZclGetPowerProfilePriceExtendedResponse.zclSize(r);
+ IZclFrame zclResponseFrame = zclFrame.createResponseFrame(size);
+ zclResponseFrame.setCommandId(8);
+ ZclGetPowerProfilePriceExtendedResponse.zclSerialize(zclResponseFrame, r);
+ return zclResponseFrame;
+ }
+
+ public short getTotalProfileNum(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Short objectResult = null;
+ objectResult = ((Short) getValidCachedAttributeObject(0, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.shortValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(0, context);
+ short v = ZclDataTypeUI8.zclParse(zclFrame);
+ setCachedAttributeObject(0, new Short(v));
+ return v;
+ }
+
+ public boolean getMultipleScheduling(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Boolean objectResult = null;
+ objectResult = ((Boolean) getValidCachedAttributeObject(1, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.booleanValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(1, context);
+ boolean v = ZclDataTypeBoolean.zclParse(zclFrame);
+ setCachedAttributeObject(1, new Boolean(v));
+ return v;
+ }
+
+ public short getEnergyFormatting(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Short objectResult = null;
+ objectResult = ((Short) getValidCachedAttributeObject(2, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.shortValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(2, context);
+
+ short v = ZclDataTypeBitmap8.zclParse(zclFrame);
+ setCachedAttributeObject(2, new Short(v));
+ return v;
+ }
+
+ public boolean getEnergyRemote(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Boolean objectResult = null;
+ objectResult = ((Boolean) getValidCachedAttributeObject(3, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.booleanValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(3, context);
+ boolean v = ZclDataTypeBoolean.zclParse(zclFrame);
+ setCachedAttributeObject(3, new Boolean(v));
+ return v;
+ }
+
+ public void setScheduleMode(short ScheduleMode, IEndPointRequestContext context) throws ApplianceException,
+ ServiceClusterException {
+ int attrId = 4;
+ int size = 3;
+ size += ZclDataTypeBitmap8.zclSize(ScheduleMode);
+ IZclFrame zclFrame = new ZclFrame(0, size);
+ zclFrame.appendUInt16(attrId);
+ zclFrame.appendUInt8(ZclDataTypeBitmap8.ZCL_DATA_TYPE);
+ ZclDataTypeBitmap8.zclSerialize(zclFrame, ScheduleMode);
+ issueSet(ZclPowerProfileServer.CLUSTER_ID, zclFrame, attrId, context);
+ }
+
+ public short getScheduleMode(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Short objectResult = null;
+ objectResult = ((Short) getValidCachedAttributeObject(4, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.shortValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(4, context);
+ short v = ZclDataTypeBitmap8.zclParse(zclFrame);
+ setCachedAttributeObject(4, new Short(v));
+ return v;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileStateResponse.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileStateResponse.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileStateResponse.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,40 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.eh;
+
+import it.telecomitalia.ah.cluster.zigbee.eh.PowerProfile;
+import it.telecomitalia.ah.cluster.zigbee.eh.PowerProfileStateResponse;
+import it.telecomitalia.ah.cluster.zigbee.eh.PowerProfileTransferredPhase;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+public class ZclPowerProfileStateResponse {
+
+ public static PowerProfileStateResponse zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ PowerProfileStateResponse r = new PowerProfileStateResponse();
+ short PowerProfileCount = ZclDataTypeUI8.zclParse(zclFrame);
+ PowerProfile[] PowerProfiles = new PowerProfile[PowerProfileCount];
+
+ for (int i = 0; i < PowerProfileCount; i++) {
+ PowerProfiles[i] = ZclPowerProfile.zclParse(zclFrame);
+ }
+
+ r.PowerProfiles = PowerProfiles;
+
+ return r;
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, PowerProfileStateResponse r) throws ZclValidationException {
+ ZclDataTypeUI8.zclSerialize(zclFrame, (short) r.PowerProfiles.length);
+ for (int i = 0; i < r.PowerProfiles.length; i++) {
+ ZclPowerProfile.zclSerialize(zclFrame, r.PowerProfiles[i]);
+ }
+ }
+
+ public static int zclSize(PowerProfileStateResponse r) throws ZclValidationException {
+ int size = 0;
+ size += 1;
+ size += ZclPowerProfile.zclSize(null) * r.PowerProfiles.length;
+ return size;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileTransferredPhase.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileTransferredPhase.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclPowerProfileTransferredPhase.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,33 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.eh;
+
+import it.telecomitalia.ah.cluster.zigbee.eh.PowerProfileTransferredPhase;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI16;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+public class ZclPowerProfileTransferredPhase {
+ public static PowerProfileTransferredPhase zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ PowerProfileTransferredPhase p = new PowerProfileTransferredPhase();
+ p.EnergyPhaseID = ZclDataTypeUI8.zclParse(zclFrame);
+ p.MacroPhaseID = ZclDataTypeUI8.zclParse(zclFrame);
+ p.ExpectedDuration = ZclDataTypeUI16.zclParse(zclFrame);
+ p.PeakPower = ZclDataTypeUI16.zclParse(zclFrame);
+ p.Energy = ZclDataTypeUI16.zclParse(zclFrame);
+ p.MaxActivationDelay = ZclDataTypeUI16.zclParse(zclFrame);
+ return p;
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, PowerProfileTransferredPhase value) throws ZclValidationException {
+ ZclDataTypeUI8.zclSerialize(zclFrame, value.EnergyPhaseID);
+ ZclDataTypeUI8.zclSerialize(zclFrame, value.MacroPhaseID);
+ ZclDataTypeUI16.zclSerialize(zclFrame, value.ExpectedDuration);
+ ZclDataTypeUI16.zclSerialize(zclFrame, value.PeakPower);
+ ZclDataTypeUI16.zclSerialize(zclFrame, value.Energy);
+ ZclDataTypeUI16.zclSerialize(zclFrame, value.MaxActivationDelay);
+ }
+
+ public static int zclSize(PowerProfileTransferredPhase value) throws ZclValidationException {
+ return 10;
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclReadHandshakeParamResponse.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclReadHandshakeParamResponse.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclReadHandshakeParamResponse.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,34 @@
+
+package it.telecomitalia.ah.zigbee.zcl.cluster.eh;
+
+import it.telecomitalia.ah.cluster.zigbee.general.ReadHandshakeParamResponse;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI16;
+
+public class ZclReadHandshakeParamResponse {
+
+
+ public static ReadHandshakeParamResponse zclParse(IZclFrame zclFrame)
+ throws ZclValidationException
+ {
+ ReadHandshakeParamResponse r = new ReadHandshakeParamResponse();
+ r.PartitionedClusterId = ZclDataTypeUI16 .zclParse(zclFrame);
+ return r;
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, ReadHandshakeParamResponse r)
+ throws ZclValidationException
+ {
+ ZclDataTypeUI16 .zclSerialize(zclFrame, r.PartitionedClusterId);
+ }
+
+ public static int zclSize(ReadHandshakeParamResponse r)
+ throws ZclValidationException
+ {
+ int size = 0;
+ size += ZclDataTypeUI16 .zclSize(r.PartitionedClusterId);
+ return size;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclScheduledPhase.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclScheduledPhase.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclScheduledPhase.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,27 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.eh;
+
+import it.telecomitalia.ah.cluster.zigbee.eh.PowerProfile;
+import it.telecomitalia.ah.cluster.zigbee.eh.ScheduledPhase;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI16;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+public class ZclScheduledPhase {
+
+ public static ScheduledPhase zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ ScheduledPhase p = new ScheduledPhase();
+ p.EnergyPhaseID = ZclDataTypeUI8.zclParse(zclFrame);
+ p.ScheduledTime = ZclDataTypeUI16.zclParse(zclFrame);
+ return p;
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, ScheduledPhase value) throws ZclValidationException {
+ ZclDataTypeUI8.zclSerialize(zclFrame, value.EnergyPhaseID);
+ ZclDataTypeUI16.zclSerialize(zclFrame, value.ScheduledTime);
+ }
+
+ public static int zclSize(PowerProfile value) throws ZclValidationException {
+ return 3;
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclSignalStateResponse.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclSignalStateResponse.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/eh/ZclSignalStateResponse.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,47 @@
+
+package it.telecomitalia.ah.zigbee.zcl.cluster.eh;
+
+import it.telecomitalia.ah.cluster.zigbee.eh.SignalStateResponse;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeEnum8;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI24;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+public class ZclSignalStateResponse {
+
+
+ public static SignalStateResponse zclParse(IZclFrame zclFrame)
+ throws ZclValidationException
+ {
+ SignalStateResponse r = new SignalStateResponse();
+ r.ApplianceStatus = ZclDataTypeEnum8 .zclParse(zclFrame);
+ r.RemoteEnableFlags = ZclDataTypeUI8 .zclParse(zclFrame);
+
+ try {
+ r.ApplianceStatus2 = ZclDataTypeUI24 .zclParse(zclFrame);
+ } catch (Exception e) {
+ r.ApplianceStatus2 = 0;
+ }
+ return r;
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, SignalStateResponse r)
+ throws ZclValidationException
+ {
+ ZclDataTypeEnum8 .zclSerialize(zclFrame, r.ApplianceStatus);
+ ZclDataTypeUI8 .zclSerialize(zclFrame, r.RemoteEnableFlags);
+ ZclDataTypeUI24 .zclSerialize(zclFrame, r.ApplianceStatus2);
+ }
+
+ public static int zclSize(SignalStateResponse r)
+ throws ZclValidationException
+ {
+ int size = 0;
+ size += ZclDataTypeEnum8 .zclSize(r.ApplianceStatus);
+ size += ZclDataTypeUI8 .zclSize(r.RemoteEnableFlags);
+ size += ZclDataTypeUI24 .zclSize(r.ApplianceStatus2);
+ return size;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclAddGroupResponse.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclAddGroupResponse.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclAddGroupResponse.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,30 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.general;
+
+import it.telecomitalia.ah.cluster.zigbee.general.AddGroupResponse;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeEnum8;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI16;
+
+public class ZclAddGroupResponse {
+
+ public static AddGroupResponse zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ AddGroupResponse r = new AddGroupResponse();
+ r.Status = ZclDataTypeEnum8.zclParse(zclFrame);
+ r.GroupID = ZclDataTypeUI16.zclParse(zclFrame);
+ return r;
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, AddGroupResponse r) throws ZclValidationException {
+ ZclDataTypeEnum8.zclSerialize(zclFrame, r.Status);
+ ZclDataTypeUI16.zclSerialize(zclFrame, r.GroupID);
+ }
+
+ public static int zclSize(AddGroupResponse r) throws ZclValidationException {
+ int size = 0;
+ size += ZclDataTypeEnum8.zclSize(r.Status);
+ size += ZclDataTypeUI16.zclSize(r.GroupID);
+ return size;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclAlarmsClient.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclAlarmsClient.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclAlarmsClient.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,109 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.general;
+
+import it.telecomitalia.ah.cluster.zigbee.general.AlarmsClient;
+import it.telecomitalia.ah.cluster.zigbee.general.AlarmsServer;
+import it.telecomitalia.ah.cluster.zigbee.general.GetAlarmResponse;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.IEndPointRequestContext;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZCL;
+import it.telecomitalia.ah.zigbee.ZclFrame;
+import it.telecomitalia.ah.zigbee.ZigBeeDevice;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeEnum8;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI16;
+
+public class ZclAlarmsClient extends ZclServiceCluster implements AlarmsClient, ZigBeeDeviceListener {
+
+ final static short CLUSTER_ID = 9;
+
+ public ZclAlarmsClient() throws ApplianceException {
+ super();
+ }
+
+ public boolean notifyZclFrame(short clusterId, IZclFrame zclFrame) throws Exception {
+ boolean handled;
+ handled = super.notifyZclFrame(clusterId, zclFrame);
+ if (handled) {
+ return handled;
+ }
+ int commandId = zclFrame.getCommandId();
+ if (zclFrame.isServerToClient()) {
+ throw new ZclValidationException("invalid direction field");
+ }
+ IZclFrame responseZclFrame = null;
+ ZigBeeDevice device = getZigBeeDevice();
+ int statusCode = ZCL.SUCCESS;
+ AlarmsServer c = ((AlarmsServer) getSinglePeerCluster((AlarmsServer.class.getName())));
+ switch (commandId) {
+ case 0:
+ responseZclFrame = parseResetAlarm(c, zclFrame);
+ break;
+ case 1:
+ responseZclFrame = parseResetAllAlarms(c, zclFrame);
+ break;
+ case 2:
+ responseZclFrame = parseGetAlarm(c, zclFrame);
+ break;
+ case 3:
+ responseZclFrame = parseResetAlarmLog(c, zclFrame);
+ break;
+ }
+ if (responseZclFrame == null) {
+ if (!zclFrame.isDefaultResponseDisabled()) {
+ responseZclFrame = getDefaultResponse(zclFrame, statusCode);
+ }
+ }
+ if (!(responseZclFrame == null)) {
+ device.post(ZclAlarmsClient.CLUSTER_ID, responseZclFrame);
+ return true;
+ }
+ return false;
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ public void execAlarm(short AlarmCode, int ClusterIdentifier, IEndPointRequestContext context) throws ApplianceException,
+ ServiceClusterException {
+ int size = 0;
+ size += ZclDataTypeEnum8.zclSize(AlarmCode);
+ size += ZclDataTypeUI16.zclSize(ClusterIdentifier);
+ ZclFrame zclFrame = new ZclFrame(1, size);
+ zclFrame.setCommandId(0);
+ ZclDataTypeEnum8.zclSerialize(zclFrame, AlarmCode);
+ ZclDataTypeUI16.zclSerialize(zclFrame, ClusterIdentifier);
+ issueExec(zclFrame, 11, context);
+ }
+
+ protected IZclFrame parseResetAlarm(AlarmsServer o, IZclFrame zclFrame) throws ApplianceException, ServiceClusterException {
+ short AlarmCode = ZclDataTypeEnum8.zclParse(zclFrame);
+ int ClusterIdentifier = ZclDataTypeUI16.zclParse(zclFrame);
+ o.execResetAlarm(AlarmCode, ClusterIdentifier, null);
+ return null;
+ }
+
+ protected IZclFrame parseResetAllAlarms(AlarmsServer o, IZclFrame zclFrame) throws ApplianceException, ServiceClusterException {
+ o.execResetAllAlarms(null);
+ return null;
+ }
+
+ protected IZclFrame parseGetAlarm(AlarmsServer o, IZclFrame zclFrame) throws ApplianceException, ServiceClusterException {
+ GetAlarmResponse r = o.execGetAlarm(null);
+ int size = ZclGetAlarmResponse.zclSize(r);
+ IZclFrame zclResponseFrame = zclFrame.createResponseFrame(size);
+ zclResponseFrame.setCommandId(1);
+ ZclGetAlarmResponse.zclSerialize(zclResponseFrame, r);
+ return zclResponseFrame;
+ }
+
+ protected IZclFrame parseResetAlarmLog(AlarmsServer o, IZclFrame zclFrame) throws ApplianceException, ServiceClusterException {
+ o.execResetAlarmLog(null);
+ return null;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclAlarmsServer.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclAlarmsServer.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclAlarmsServer.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,140 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.general;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import it.telecomitalia.ah.cluster.zigbee.general.AlarmsClient;
+import it.telecomitalia.ah.cluster.zigbee.general.AlarmsServer;
+import it.telecomitalia.ah.cluster.zigbee.general.GetAlarmResponse;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.IEndPointRequestContext;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.internal.zigbee.ZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZCL;
+import it.telecomitalia.ah.zigbee.ZclFrame;
+import it.telecomitalia.ah.zigbee.ZigBeeDevice;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.IZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeEnum8;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI16;
+
+public class ZclAlarmsServer extends ZclServiceCluster implements AlarmsServer, ZigBeeDeviceListener {
+
+ final static short CLUSTER_ID = 9;
+ final static HashMap attributesMapByName = new HashMap();
+ final static HashMap attributesMapById = new HashMap();
+
+ static {
+ attributesMapByName.put(ZclAlarmsServer.ATTR_AlarmCount_NAME, new ZclAttributeDescriptor(0,
+ ZclAlarmsServer.ATTR_AlarmCount_NAME, new ZclDataTypeUI16(), null, true, 1));
+ }
+
+ public ZclAlarmsServer() throws ApplianceException {
+ super();
+ }
+
+ public boolean notifyZclFrame(short clusterId, IZclFrame zclFrame) throws Exception {
+ boolean handled;
+ handled = super.notifyZclFrame(clusterId, zclFrame);
+ if (handled) {
+ return handled;
+ }
+ int commandId = zclFrame.getCommandId();
+ if (zclFrame.isClientToServer()) {
+ throw new ZclValidationException("invalid direction field");
+ }
+ IZclFrame responseZclFrame = null;
+ ZigBeeDevice device = getZigBeeDevice();
+ int statusCode = ZCL.SUCCESS;
+ AlarmsClient c = ((AlarmsClient) getSinglePeerCluster((AlarmsClient.class.getName())));
+ switch (commandId) {
+ case 0:
+ responseZclFrame = parseAlarm(c, zclFrame);
+ break;
+ }
+ if (responseZclFrame == null) {
+ if (!zclFrame.isDefaultResponseDisabled()) {
+ responseZclFrame = getDefaultResponse(zclFrame, statusCode);
+ }
+ }
+ if (!(responseZclFrame == null)) {
+ device.post(ZclAlarmsServer.CLUSTER_ID, responseZclFrame);
+ return true;
+ }
+ return false;
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(String name) {
+ return ((IZclAttributeDescriptor) attributesMapByName.get(name));
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(int id) {
+ Iterator iterator = attributesMapByName.values().iterator();
+ // FIXME: generate it and optimize!!!!
+ for (; iterator.hasNext();) {
+ IZclAttributeDescriptor attributeDescriptor = (IZclAttributeDescriptor) iterator.next();
+ if (attributeDescriptor.zclGetId() == id)
+ return attributeDescriptor;
+ }
+ return null;
+ }
+
+ public void execResetAlarm(short AlarmCode, int ClusterIdentifier, IEndPointRequestContext context) throws ApplianceException,
+ ServiceClusterException {
+ int size = 0;
+ size += ZclDataTypeEnum8.zclSize(AlarmCode);
+ size += ZclDataTypeUI16.zclSize(ClusterIdentifier);
+ ZclFrame zclFrame = new ZclFrame(1, size);
+ zclFrame.setCommandId(0);
+ ZclDataTypeEnum8.zclSerialize(zclFrame, AlarmCode);
+ ZclDataTypeUI16.zclSerialize(zclFrame, ClusterIdentifier);
+ issueExec(zclFrame, 11, context);
+ }
+
+ public void execResetAllAlarms(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ ZclFrame zclFrame = new ZclFrame(1);
+ zclFrame.setCommandId(1);
+ issueExec(zclFrame, 11, context);
+ }
+
+ public GetAlarmResponse execGetAlarm(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ ZclFrame zclFrame = new ZclFrame(1);
+ zclFrame.setCommandId(2);
+ IZclFrame zclResponseFrame = issueExec(zclFrame, 1, context);
+ return (ZclGetAlarmResponse.zclParse(zclResponseFrame));
+ }
+
+ public void execResetAlarmLog(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ ZclFrame zclFrame = new ZclFrame(1);
+ zclFrame.setCommandId(3);
+ issueExec(zclFrame, 11, context);
+ }
+
+ protected IZclFrame parseAlarm(AlarmsClient o, IZclFrame zclFrame) throws ApplianceException, ServiceClusterException {
+ short AlarmCode = ZclDataTypeEnum8.zclParse(zclFrame);
+ int ClusterIdentifier = ZclDataTypeUI16.zclParse(zclFrame);
+ o.execAlarm(AlarmCode, ClusterIdentifier, null);
+ return null;
+ }
+
+ public int getAlarmCount(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(0, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(0, context);
+ int v = ZclDataTypeUI16.zclParse(zclFrame);
+ setCachedAttributeObject(0, new Integer(v));
+ return v;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclBasicClient.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclBasicClient.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclBasicClient.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,20 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.general;
+
+import it.telecomitalia.ah.cluster.zigbee.general.BasicClient;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+
+public class ZclBasicClient extends ZclServiceCluster implements BasicClient, ZigBeeDeviceListener {
+
+ public final static short CLUSTER_ID = 0;
+
+ public ZclBasicClient() throws ApplianceException {
+ super();
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclBasicServer.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclBasicServer.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclBasicServer.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,320 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.general;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import it.telecomitalia.ah.cluster.zigbee.general.BasicServer;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.IEndPointRequestContext;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.internal.zigbee.ZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZclFrame;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.IZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeBitmap8;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeBoolean;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeEnum8;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeString;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+public class ZclBasicServer extends ZclServiceCluster implements BasicServer, ZigBeeDeviceListener {
+
+ public final static short CLUSTER_ID = 0;
+ final static HashMap attributesMapByName = new HashMap();
+ final static HashMap attributesMapById = new HashMap();
+
+ static {
+ attributesMapByName.put(ZclBasicServer.ATTR_ZCLVersion_NAME, new ZclAttributeDescriptor(0,
+ ZclBasicServer.ATTR_ZCLVersion_NAME, new ZclDataTypeUI8(), null, true, 1));
+ attributesMapByName.put(ZclBasicServer.ATTR_ApplicationVersion_NAME, new ZclAttributeDescriptor(1,
+ ZclBasicServer.ATTR_ApplicationVersion_NAME, new ZclDataTypeUI8(), null, true, 1));
+ attributesMapByName.put(ZclBasicServer.ATTR_StackVersion_NAME, new ZclAttributeDescriptor(2,
+ ZclBasicServer.ATTR_StackVersion_NAME, new ZclDataTypeUI8(), null, true, 1));
+ attributesMapByName.put(ZclBasicServer.ATTR_HWVersion_NAME, new ZclAttributeDescriptor(3,
+ ZclBasicServer.ATTR_HWVersion_NAME, new ZclDataTypeUI8(), null, true, 1));
+ attributesMapByName.put(ZclBasicServer.ATTR_ManufacturerName_NAME, new ZclAttributeDescriptor(4,
+ ZclBasicServer.ATTR_ManufacturerName_NAME, new ZclDataTypeString(32), null, true, 1));
+ attributesMapByName.put(ZclBasicServer.ATTR_ModelIdentifier_NAME, new ZclAttributeDescriptor(5,
+ ZclBasicServer.ATTR_ModelIdentifier_NAME, new ZclDataTypeString(32), null, true, 1));
+ attributesMapByName.put(ZclBasicServer.ATTR_DateCode_NAME, new ZclAttributeDescriptor(6, ZclBasicServer.ATTR_DateCode_NAME,
+ new ZclDataTypeString(32), null, true, 1));
+ attributesMapByName.put(ZclBasicServer.ATTR_PowerSource_NAME, new ZclAttributeDescriptor(7,
+ ZclBasicServer.ATTR_PowerSource_NAME, new ZclDataTypeEnum8(), null, true, 1));
+ attributesMapByName.put(ZclBasicServer.ATTR_LocationDescription_NAME, new ZclAttributeDescriptor(16,
+ ZclBasicServer.ATTR_LocationDescription_NAME, new ZclDataTypeString(16), null, true, 0));
+ attributesMapByName.put(ZclBasicServer.ATTR_PhysicalEnvironment_NAME, new ZclAttributeDescriptor(17,
+ ZclBasicServer.ATTR_PhysicalEnvironment_NAME, new ZclDataTypeEnum8(), null, true, 0));
+ attributesMapByName.put(ZclBasicServer.ATTR_DeviceEnabled_NAME, new ZclAttributeDescriptor(18,
+ ZclBasicServer.ATTR_DeviceEnabled_NAME, new ZclDataTypeBoolean(), null, true, 0));
+ attributesMapByName.put(ZclBasicServer.ATTR_AlarmMask_NAME, new ZclAttributeDescriptor(19,
+ ZclBasicServer.ATTR_AlarmMask_NAME, new ZclDataTypeBitmap8(), null, true, 0));
+ attributesMapByName.put(ZclBasicServer.ATTR_DisableLocalConfig_NAME, new ZclAttributeDescriptor(20,
+ ZclBasicServer.ATTR_DisableLocalConfig_NAME, new ZclDataTypeBitmap8(), null, true, 0));
+ }
+
+ public ZclBasicServer() throws ApplianceException {
+ super();
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(String name) {
+ return ((IZclAttributeDescriptor) attributesMapByName.get(name));
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(int id) {
+ Iterator iterator = attributesMapByName.values().iterator();
+ // FIXME: generate it and optimize!!!!
+ for (; iterator.hasNext();) {
+ IZclAttributeDescriptor attributeDescriptor = (IZclAttributeDescriptor) iterator.next();
+ if (attributeDescriptor.zclGetId() == id)
+ return attributeDescriptor;
+ }
+ return null;
+ }
+
+ public short getZCLVersion(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Short objectResult = null;
+ objectResult = ((Short) getValidCachedAttributeObject(0, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.shortValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(0, context);
+ short v = ZclDataTypeUI8.zclParse(zclFrame);
+ setCachedAttributeObject(0, new Short(v));
+ return v;
+ }
+
+ public short getApplicationVersion(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Short objectResult = null;
+ objectResult = ((Short) getValidCachedAttributeObject(1, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.shortValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(1, context);
+ short v = ZclDataTypeUI8.zclParse(zclFrame);
+ setCachedAttributeObject(1, new Short(v));
+ return v;
+ }
+
+ public short getStackVersion(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Short objectResult = null;
+ objectResult = ((Short) getValidCachedAttributeObject(2, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.shortValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(2, context);
+ short v = ZclDataTypeUI8.zclParse(zclFrame);
+ setCachedAttributeObject(2, new Short(v));
+ return v;
+ }
+
+ public short getHWVersion(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Short objectResult = null;
+ objectResult = ((Short) getValidCachedAttributeObject(3, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.shortValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(3, context);
+ short v = ZclDataTypeUI8.zclParse(zclFrame);
+ setCachedAttributeObject(3, new Short(v));
+ return v;
+ }
+
+ public String getManufacturerName(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ String objectResult = null;
+ objectResult = ((String) getValidCachedAttributeObject(4, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult;
+ }
+ }
+ IZclFrame zclFrame = readAttribute(4, context);
+ String v = ZclDataTypeString.zclParse(zclFrame);
+ setCachedAttributeObject(4, v);
+ return v;
+ }
+
+ public String getModelIdentifier(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ String objectResult = null;
+ objectResult = ((String) getValidCachedAttributeObject(5, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult;
+ }
+ }
+ IZclFrame zclFrame = readAttribute(5, context);
+ String v = ZclDataTypeString.zclParse(zclFrame);
+ setCachedAttributeObject(5, v);
+ return v;
+ }
+
+ public String getDateCode(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ String objectResult = null;
+ objectResult = ((String) getValidCachedAttributeObject(6, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult;
+ }
+ }
+ IZclFrame zclFrame = readAttribute(6, context);
+ String v = ZclDataTypeString.zclParse(zclFrame);
+ setCachedAttributeObject(6, v);
+ return v;
+ }
+
+ public short getPowerSource(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Short objectResult = null;
+ objectResult = ((Short) getValidCachedAttributeObject(7, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.shortValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(7, context);
+ short v = ZclDataTypeEnum8.zclParse(zclFrame);
+ setCachedAttributeObject(7, new Short(v));
+ return v;
+ }
+
+ public void setLocationDescription(String LocationDescription, IEndPointRequestContext context) throws ApplianceException,
+ ServiceClusterException {
+ int attrId = 16;
+ int size = 3;
+ size += ZclDataTypeString.zclSize(LocationDescription);
+ IZclFrame zclFrame = new ZclFrame(0, size);
+ zclFrame.appendUInt16(attrId);
+ zclFrame.appendUInt8(ZclDataTypeString.ZCL_DATA_TYPE);
+ ZclDataTypeString.zclSerialize(zclFrame, LocationDescription);
+ issueSet(ZclBasicServer.CLUSTER_ID, zclFrame, attrId, context);
+ }
+
+ public String getLocationDescription(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ String objectResult = null;
+ objectResult = ((String) getValidCachedAttributeObject(16, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult;
+ }
+ }
+ IZclFrame zclFrame = readAttribute(16, context);
+ String v = ZclDataTypeString.zclParse(zclFrame);
+ setCachedAttributeObject(16, v);
+ return v;
+ }
+
+ public void setPhysicalEnvironment(short PhysicalEnvironment, IEndPointRequestContext context) throws ApplianceException,
+ ServiceClusterException {
+ int attrId = 17;
+ int size = 3;
+ size += ZclDataTypeEnum8.zclSize(PhysicalEnvironment);
+ IZclFrame zclFrame = new ZclFrame(0, size);
+ zclFrame.appendUInt16(attrId);
+ zclFrame.appendUInt8(ZclDataTypeEnum8.ZCL_DATA_TYPE);
+ ZclDataTypeEnum8.zclSerialize(zclFrame, PhysicalEnvironment);
+ issueSet(ZclBasicServer.CLUSTER_ID, zclFrame, attrId, context);
+ }
+
+ public short getPhysicalEnvironment(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Short objectResult = null;
+ objectResult = ((Short) getValidCachedAttributeObject(17, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.shortValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(17, context);
+ short v = ZclDataTypeEnum8.zclParse(zclFrame);
+ setCachedAttributeObject(17, new Short(v));
+ return v;
+ }
+
+ public void setDeviceEnabled(boolean DeviceEnabled, IEndPointRequestContext context) throws ApplianceException,
+ ServiceClusterException {
+ int attrId = 18;
+ int size = 3;
+ size += ZclDataTypeBoolean.zclSize(DeviceEnabled);
+ IZclFrame zclFrame = new ZclFrame(0, size);
+ zclFrame.appendUInt16(attrId);
+ zclFrame.appendUInt8(ZclDataTypeBoolean.ZCL_DATA_TYPE);
+ ZclDataTypeBoolean.zclSerialize(zclFrame, DeviceEnabled);
+ issueSet(ZclBasicServer.CLUSTER_ID, zclFrame, attrId, context);
+ }
+
+ public boolean getDeviceEnabled(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Boolean objectResult = null;
+ objectResult = ((Boolean) getValidCachedAttributeObject(18, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.booleanValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(18, context);
+ boolean v = ZclDataTypeBoolean.zclParse(zclFrame);
+ setCachedAttributeObject(18, new Boolean(v));
+ return v;
+ }
+
+ public void setAlarmMask(short AlarmMask, IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ int attrId = 19;
+ int size = 3;
+ size += ZclDataTypeBitmap8.zclSize(AlarmMask);
+ IZclFrame zclFrame = new ZclFrame(0, size);
+ zclFrame.appendUInt16(attrId);
+ zclFrame.appendUInt8(ZclDataTypeBitmap8.ZCL_DATA_TYPE);
+ ZclDataTypeBitmap8.zclSerialize(zclFrame, AlarmMask);
+ issueSet(ZclBasicServer.CLUSTER_ID, zclFrame, attrId, context);
+ }
+
+ public short getAlarmMask(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Short objectResult = null;
+ objectResult = ((Short) getValidCachedAttributeObject(19, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.shortValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(19, context);
+ short v = ZclDataTypeBitmap8.zclParse(zclFrame);
+ setCachedAttributeObject(19, new Short(v));
+ return v;
+ }
+
+ public void setDisableLocalConfig(short DisableLocalConfig, IEndPointRequestContext context) throws ApplianceException,
+ ServiceClusterException {
+ int attrId = 20;
+ int size = 3;
+ size += ZclDataTypeBitmap8.zclSize(DisableLocalConfig);
+ IZclFrame zclFrame = new ZclFrame(0, size);
+ zclFrame.appendUInt16(attrId);
+ zclFrame.appendUInt8(ZclDataTypeBitmap8.ZCL_DATA_TYPE);
+ ZclDataTypeBitmap8.zclSerialize(zclFrame, DisableLocalConfig);
+ issueSet(ZclBasicServer.CLUSTER_ID, zclFrame, attrId, context);
+ }
+
+ public short getDisableLocalConfig(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Short objectResult = null;
+ objectResult = ((Short) getValidCachedAttributeObject(20, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.shortValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(20, context);
+ short v = ZclDataTypeBitmap8.zclParse(zclFrame);
+ setCachedAttributeObject(20, new Short(v));
+ return v;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclDeviceTemperatureConfigurationClient.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclDeviceTemperatureConfigurationClient.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclDeviceTemperatureConfigurationClient.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,21 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.general;
+
+import it.telecomitalia.ah.cluster.zigbee.general.DeviceTemperatureConfigurationClient;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+
+public class ZclDeviceTemperatureConfigurationClient extends ZclServiceCluster implements DeviceTemperatureConfigurationClient,
+ ZigBeeDeviceListener {
+
+ final static short CLUSTER_ID = 2;
+
+ public ZclDeviceTemperatureConfigurationClient() throws ApplianceException {
+ super();
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclDeviceTemperatureConfigurationServer.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclDeviceTemperatureConfigurationServer.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclDeviceTemperatureConfigurationServer.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,261 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.general;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import it.telecomitalia.ah.cluster.zigbee.general.DeviceTemperatureConfigurationServer;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.IEndPointRequestContext;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.internal.zigbee.ZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZclFrame;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.IZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeBitmap8;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeI16;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI16;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI24;
+
+public class ZclDeviceTemperatureConfigurationServer extends ZclServiceCluster implements DeviceTemperatureConfigurationServer,
+ ZigBeeDeviceListener {
+
+ final static short CLUSTER_ID = 2;
+ final static HashMap attributesMapByName = new HashMap();
+ final static HashMap attributesMapById = new HashMap();
+
+ static {
+ attributesMapByName.put(ZclDeviceTemperatureConfigurationServer.ATTR_CurrentTemperature_NAME, new ZclAttributeDescriptor(0,
+ ZclDeviceTemperatureConfigurationServer.ATTR_CurrentTemperature_NAME, new ZclDataTypeI16(), null, true, 1));
+ attributesMapByName.put(ZclDeviceTemperatureConfigurationServer.ATTR_MinTempExperienced_NAME, new ZclAttributeDescriptor(1,
+ ZclDeviceTemperatureConfigurationServer.ATTR_MinTempExperienced_NAME, new ZclDataTypeI16(), null, true, 1));
+ attributesMapByName.put(ZclDeviceTemperatureConfigurationServer.ATTR_MaxTempExperienced_NAME, new ZclAttributeDescriptor(3,
+ ZclDeviceTemperatureConfigurationServer.ATTR_MaxTempExperienced_NAME, new ZclDataTypeI16(), null, true, 1));
+ attributesMapByName.put(ZclDeviceTemperatureConfigurationServer.ATTR_OverTempTotalDwell_NAME, new ZclAttributeDescriptor(4,
+ ZclDeviceTemperatureConfigurationServer.ATTR_OverTempTotalDwell_NAME, new ZclDataTypeUI16(), null, true, 1));
+ attributesMapByName
+ .put(ZclDeviceTemperatureConfigurationServer.ATTR_DeviceTempAlarmMask_NAME, new ZclAttributeDescriptor(16,
+ ZclDeviceTemperatureConfigurationServer.ATTR_DeviceTempAlarmMask_NAME, new ZclDataTypeBitmap8(), null,
+ true, 0));
+ attributesMapByName.put(ZclDeviceTemperatureConfigurationServer.ATTR_LowTempThreshold_NAME, new ZclAttributeDescriptor(17,
+ ZclDeviceTemperatureConfigurationServer.ATTR_LowTempThreshold_NAME, new ZclDataTypeI16(), null, true, 0));
+ attributesMapByName.put(ZclDeviceTemperatureConfigurationServer.ATTR_HighTempThreshold_NAME, new ZclAttributeDescriptor(17,
+ ZclDeviceTemperatureConfigurationServer.ATTR_HighTempThreshold_NAME, new ZclDataTypeI16(), null, true, 0));
+ attributesMapByName.put(ZclDeviceTemperatureConfigurationServer.ATTR_LowTempDwellTripPoint_NAME,
+ new ZclAttributeDescriptor(17, ZclDeviceTemperatureConfigurationServer.ATTR_LowTempDwellTripPoint_NAME,
+ new ZclDataTypeUI24(), null, true, 0));
+ attributesMapByName.put(ZclDeviceTemperatureConfigurationServer.ATTR_HighTempDwellTripPoint_NAME,
+ new ZclAttributeDescriptor(17, ZclDeviceTemperatureConfigurationServer.ATTR_HighTempDwellTripPoint_NAME,
+ new ZclDataTypeUI24(), null, true, 0));
+ }
+
+ public ZclDeviceTemperatureConfigurationServer() throws ApplianceException {
+ super();
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(String name) {
+ return ((IZclAttributeDescriptor) attributesMapByName.get(name));
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(int id) {
+ Iterator iterator = attributesMapByName.values().iterator();
+ // FIXME: generate it and optimize!!!!
+ for (; iterator.hasNext();) {
+ IZclAttributeDescriptor attributeDescriptor = (IZclAttributeDescriptor) iterator.next();
+ if (attributeDescriptor.zclGetId() == id)
+ return attributeDescriptor;
+ }
+ return null;
+ }
+
+ public int getCurrentTemperature(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(0, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(0, context);
+ int v = ZclDataTypeI16.zclParse(zclFrame);
+ setCachedAttributeObject(0, new Integer(v));
+ return v;
+ }
+
+ public int getMinTempExperienced(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(1, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(1, context);
+ int v = ZclDataTypeI16.zclParse(zclFrame);
+ setCachedAttributeObject(1, new Integer(v));
+ return v;
+ }
+
+ public int getMaxTempExperienced(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(3, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(3, context);
+ int v = ZclDataTypeI16.zclParse(zclFrame);
+ setCachedAttributeObject(3, new Integer(v));
+ return v;
+ }
+
+ public int getOverTempTotalDwell(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(4, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(4, context);
+ int v = ZclDataTypeUI16.zclParse(zclFrame);
+ setCachedAttributeObject(4, new Integer(v));
+ return v;
+ }
+
+ public void setDeviceTempAlarmMask(short DeviceTempAlarmMask, IEndPointRequestContext context) throws ApplianceException,
+ ServiceClusterException {
+ int attrId = 16;
+ int size = 3;
+ size += ZclDataTypeBitmap8.zclSize(DeviceTempAlarmMask);
+ IZclFrame zclFrame = new ZclFrame(0, size);
+ zclFrame.appendUInt16(attrId);
+ zclFrame.appendUInt8(ZclDataTypeBitmap8.ZCL_DATA_TYPE);
+ ZclDataTypeBitmap8.zclSerialize(zclFrame, DeviceTempAlarmMask);
+ issueSet(ZclDeviceTemperatureConfigurationServer.CLUSTER_ID, zclFrame, attrId, context);
+ }
+
+ public short getDeviceTempAlarmMask(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Short objectResult = null;
+ objectResult = ((Short) getValidCachedAttributeObject(16, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.shortValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(16, context);
+ short v = ZclDataTypeBitmap8.zclParse(zclFrame);
+ setCachedAttributeObject(16, new Short(v));
+ return v;
+ }
+
+ public void setLowTempThreshold(int LowTempThreshold, IEndPointRequestContext context) throws ApplianceException,
+ ServiceClusterException {
+ int attrId = 17;
+ int size = 3;
+ size += ZclDataTypeI16.zclSize(LowTempThreshold);
+ IZclFrame zclFrame = new ZclFrame(0, size);
+ zclFrame.appendUInt16(attrId);
+ zclFrame.appendUInt8(ZclDataTypeI16.ZCL_DATA_TYPE);
+ ZclDataTypeI16.zclSerialize(zclFrame, LowTempThreshold);
+ issueSet(ZclDeviceTemperatureConfigurationServer.CLUSTER_ID, zclFrame, attrId, context);
+ }
+
+ public int getLowTempThreshold(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(17, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(17, context);
+ int v = ZclDataTypeI16.zclParse(zclFrame);
+ setCachedAttributeObject(17, new Integer(v));
+ return v;
+ }
+
+ public void setHighTempThreshold(int HighTempThreshold, IEndPointRequestContext context) throws ApplianceException,
+ ServiceClusterException {
+ int attrId = 17;
+ int size = 3;
+ size += ZclDataTypeI16.zclSize(HighTempThreshold);
+ IZclFrame zclFrame = new ZclFrame(0, size);
+ zclFrame.appendUInt16(attrId);
+ zclFrame.appendUInt8(ZclDataTypeI16.ZCL_DATA_TYPE);
+ ZclDataTypeI16.zclSerialize(zclFrame, HighTempThreshold);
+ issueSet(ZclDeviceTemperatureConfigurationServer.CLUSTER_ID, zclFrame, attrId, context);
+ }
+
+ public int getHighTempThreshold(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(17, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(17, context);
+ int v = ZclDataTypeI16.zclParse(zclFrame);
+ setCachedAttributeObject(17, new Integer(v));
+ return v;
+ }
+
+ public void setLowTempDwellTripPoint(int LowTempDwellTripPoint, IEndPointRequestContext context) throws ApplianceException,
+ ServiceClusterException {
+ int attrId = 17;
+ int size = 3;
+ size += ZclDataTypeUI24.zclSize(LowTempDwellTripPoint);
+ IZclFrame zclFrame = new ZclFrame(0, size);
+ zclFrame.appendUInt16(attrId);
+ zclFrame.appendUInt8(ZclDataTypeUI24.ZCL_DATA_TYPE);
+ ZclDataTypeUI24.zclSerialize(zclFrame, LowTempDwellTripPoint);
+ issueSet(ZclDeviceTemperatureConfigurationServer.CLUSTER_ID, zclFrame, attrId, context);
+ }
+
+ public int getLowTempDwellTripPoint(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(17, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(17, context);
+ int v = ZclDataTypeUI24.zclParse(zclFrame);
+ setCachedAttributeObject(17, new Integer(v));
+ return v;
+ }
+
+ public void setHighTempDwellTripPoint(int HighTempDwellTripPoint, IEndPointRequestContext context) throws ApplianceException,
+ ServiceClusterException {
+ int attrId = 17;
+ int size = 3;
+ size += ZclDataTypeUI24.zclSize(HighTempDwellTripPoint);
+ IZclFrame zclFrame = new ZclFrame(0, size);
+ zclFrame.appendUInt16(attrId);
+ zclFrame.appendUInt8(ZclDataTypeUI24.ZCL_DATA_TYPE);
+ ZclDataTypeUI24.zclSerialize(zclFrame, HighTempDwellTripPoint);
+ issueSet(ZclDeviceTemperatureConfigurationServer.CLUSTER_ID, zclFrame, attrId, context);
+ }
+
+ public int getHighTempDwellTripPoint(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(17, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(17, context);
+ int v = ZclDataTypeUI24.zclParse(zclFrame);
+ setCachedAttributeObject(17, new Integer(v));
+ return v;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclGetAlarmResponse.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclGetAlarmResponse.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclGetAlarmResponse.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,37 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.general;
+
+import it.telecomitalia.ah.cluster.zigbee.general.GetAlarmResponse;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeEnum8;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI16;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI32;
+
+public class ZclGetAlarmResponse {
+
+ public static GetAlarmResponse zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ GetAlarmResponse r = new GetAlarmResponse();
+ r.Status = ZclDataTypeEnum8.zclParse(zclFrame);
+ r.AlarmCode = ZclDataTypeEnum8.zclParse(zclFrame);
+ r.ClusterIdentifier = ZclDataTypeUI16.zclParse(zclFrame);
+ r.Timestamp = ZclDataTypeUI32.zclParse(zclFrame);
+ return r;
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, GetAlarmResponse r) throws ZclValidationException {
+ ZclDataTypeEnum8.zclSerialize(zclFrame, r.Status);
+ ZclDataTypeEnum8.zclSerialize(zclFrame, r.AlarmCode);
+ ZclDataTypeUI16.zclSerialize(zclFrame, r.ClusterIdentifier);
+ ZclDataTypeUI32.zclSerialize(zclFrame, r.Timestamp);
+ }
+
+ public static int zclSize(GetAlarmResponse r) throws ZclValidationException {
+ int size = 0;
+ size += ZclDataTypeEnum8.zclSize(r.Status);
+ size += ZclDataTypeEnum8.zclSize(r.AlarmCode);
+ size += ZclDataTypeUI16.zclSize(r.ClusterIdentifier);
+ size += ZclDataTypeUI32.zclSize(r.Timestamp);
+ return size;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclGetGroupMembershipResponse.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclGetGroupMembershipResponse.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclGetGroupMembershipResponse.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,30 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.general;
+
+import it.telecomitalia.ah.cluster.zigbee.general.GetGroupMembershipResponse;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+public class ZclGetGroupMembershipResponse {
+
+ public static GetGroupMembershipResponse zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ GetGroupMembershipResponse r = new GetGroupMembershipResponse();
+ r.Capacity = ZclDataTypeUI8.zclParse(zclFrame);
+ r.GroupCount = ZclDataTypeUI8.zclParse(zclFrame);
+ // FIXME: unable handle parameter 'GroupList' of type 'array of uint16'
+ return r;
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, GetGroupMembershipResponse r) throws ZclValidationException {
+ ZclDataTypeUI8.zclSerialize(zclFrame, r.Capacity);
+ ZclDataTypeUI8.zclSerialize(zclFrame, r.GroupCount);
+ }
+
+ public static int zclSize(GetGroupMembershipResponse r) throws ZclValidationException {
+ int size = 0;
+ size += ZclDataTypeUI8.zclSize(r.Capacity);
+ size += ZclDataTypeUI8.zclSize(r.GroupCount);
+ return size;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclGroupsClient.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclGroupsClient.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclGroupsClient.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,146 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.general;
+
+import java.util.HashMap;
+import it.telecomitalia.ah.cluster.zigbee.general.AddGroupResponse;
+import it.telecomitalia.ah.cluster.zigbee.general.GetGroupMembershipResponse;
+import it.telecomitalia.ah.cluster.zigbee.general.GroupsClient;
+import it.telecomitalia.ah.cluster.zigbee.general.GroupsServer;
+import it.telecomitalia.ah.cluster.zigbee.general.RemoveGroupResponse;
+import it.telecomitalia.ah.cluster.zigbee.general.ViewGroupResponse;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZCL;
+import it.telecomitalia.ah.zigbee.ZigBeeDevice;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.IZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeString;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI16;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+public class ZclGroupsClient extends ZclServiceCluster implements GroupsClient, ZigBeeDeviceListener {
+
+ final static short CLUSTER_ID = 4;
+ final static HashMap attributesMap = new HashMap();
+
+ static {
+ }
+
+ public ZclGroupsClient() throws ApplianceException {
+ super();
+ }
+
+ public boolean notifyZclFrame(short clusterId, IZclFrame zclFrame) throws Exception {
+ boolean handled;
+ handled = super.notifyZclFrame(clusterId, zclFrame);
+ if (handled) {
+ return handled;
+ }
+ int commandId = zclFrame.getCommandId();
+ if (zclFrame.isServerToClient()) {
+ throw new ZclValidationException("invalid direction field");
+ }
+ IZclFrame responseZclFrame = null;
+ ZigBeeDevice device = getZigBeeDevice();
+ int statusCode = ZCL.SUCCESS;
+ GroupsServer c = ((GroupsServer) getSinglePeerCluster((GroupsServer.class.getName())));
+ switch (commandId) {
+ case 0:
+ responseZclFrame = parseAddGroup(c, zclFrame);
+ break;
+ case 1:
+ responseZclFrame = parseViewGroup(c, zclFrame);
+ break;
+ case 2:
+ responseZclFrame = parseGetGroupMembership(c, zclFrame);
+ break;
+ case 3:
+ responseZclFrame = parseRemoveGroup(c, zclFrame);
+ break;
+ case 4:
+ responseZclFrame = parseRemoveAllGroups(c, zclFrame);
+ break;
+ case 5:
+ responseZclFrame = parseAddGroupIfIdentifying(c, zclFrame);
+ break;
+ }
+ if (responseZclFrame == null) {
+ if (!zclFrame.isDefaultResponseDisabled()) {
+ responseZclFrame = getDefaultResponse(zclFrame, statusCode);
+ }
+ }
+ if (!(responseZclFrame == null)) {
+ device.post(ZclGroupsClient.CLUSTER_ID, responseZclFrame);
+ return true;
+ }
+ return false;
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(String name) {
+ return ((IZclAttributeDescriptor) attributesMap.get(name));
+ }
+
+ protected IZclFrame parseAddGroup(GroupsServer o, IZclFrame zclFrame) throws ApplianceException, ServiceClusterException {
+ int GroupID = ZclDataTypeUI16.zclParse(zclFrame);
+ String GroupName = ZclDataTypeString.zclParse(zclFrame);
+ AddGroupResponse r = o.execAddGroup(GroupID, GroupName, null);
+ int size = ZclAddGroupResponse.zclSize(r);
+ IZclFrame zclResponseFrame = zclFrame.createResponseFrame(size);
+ zclResponseFrame.setCommandId(0);
+ ZclAddGroupResponse.zclSerialize(zclResponseFrame, r);
+ return zclResponseFrame;
+ }
+
+ protected IZclFrame parseViewGroup(GroupsServer o, IZclFrame zclFrame) throws ApplianceException, ServiceClusterException {
+ int GroupID = ZclDataTypeUI16.zclParse(zclFrame);
+ ViewGroupResponse r = o.execViewGroup(GroupID, null);
+ int size = ZclViewGroupResponse.zclSize(r);
+ IZclFrame zclResponseFrame = zclFrame.createResponseFrame(size);
+ zclResponseFrame.setCommandId(1);
+ ZclViewGroupResponse.zclSerialize(zclResponseFrame, r);
+ return zclResponseFrame;
+ }
+
+ protected IZclFrame parseGetGroupMembership(GroupsServer o, IZclFrame zclFrame) throws ApplianceException,
+ ServiceClusterException {
+ short GroupCount = ZclDataTypeUI8.zclParse(zclFrame);
+ // FIXME: unable handle parameter 'GroupList' of type 'array of uint16'
+ GetGroupMembershipResponse r = null;
+ // o.execGetGroupMembership(GroupCount, null);
+ int size = ZclGetGroupMembershipResponse.zclSize(r);
+ IZclFrame zclResponseFrame = zclFrame.createResponseFrame(size);
+ zclResponseFrame.setCommandId(2);
+ ZclGetGroupMembershipResponse.zclSerialize(zclResponseFrame, r);
+ return zclResponseFrame;
+ }
+
+ protected IZclFrame parseRemoveGroup(GroupsServer o, IZclFrame zclFrame) throws ApplianceException, ServiceClusterException {
+ int GroupID = ZclDataTypeUI16.zclParse(zclFrame);
+ RemoveGroupResponse r = o.execRemoveGroup(GroupID, null);
+ int size = ZclRemoveGroupResponse.zclSize(r);
+ IZclFrame zclResponseFrame = zclFrame.createResponseFrame(size);
+ zclResponseFrame.setCommandId(3);
+ ZclRemoveGroupResponse.zclSerialize(zclResponseFrame, r);
+ return zclResponseFrame;
+ }
+
+ protected IZclFrame parseRemoveAllGroups(GroupsServer o, IZclFrame zclFrame) throws ApplianceException, ServiceClusterException {
+ o.execRemoveAllGroups(null);
+ return null;
+ }
+
+ protected IZclFrame parseAddGroupIfIdentifying(GroupsServer o, IZclFrame zclFrame) throws ApplianceException,
+ ServiceClusterException {
+ int GroupID = ZclDataTypeUI16.zclParse(zclFrame);
+ String GroupName = ZclDataTypeString.zclParse(zclFrame);
+ o.execAddGroupIfIdentifying(GroupID, GroupName, null);
+ return null;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclGroupsServer.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclGroupsServer.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclGroupsServer.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,138 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.general;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import it.telecomitalia.ah.cluster.zigbee.general.AddGroupResponse;
+import it.telecomitalia.ah.cluster.zigbee.general.GetGroupMembershipResponse;
+import it.telecomitalia.ah.cluster.zigbee.general.GroupsServer;
+import it.telecomitalia.ah.cluster.zigbee.general.RemoveGroupResponse;
+import it.telecomitalia.ah.cluster.zigbee.general.ViewGroupResponse;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.IEndPointRequestContext;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.internal.zigbee.ZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZclFrame;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.IZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeBitmap8;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeString;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI16;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+public class ZclGroupsServer extends ZclServiceCluster implements GroupsServer, ZigBeeDeviceListener {
+
+ final static short CLUSTER_ID = 4;
+ final static HashMap attributesMapByName = new HashMap();
+ final static HashMap attributesMapById = new HashMap();
+
+ static {
+ attributesMapByName.put(ZclGroupsServer.ATTR_NameSupport_NAME, new ZclAttributeDescriptor(0,
+ ZclGroupsServer.ATTR_NameSupport_NAME, new ZclDataTypeBitmap8(), null, true, 1));
+ }
+
+ public ZclGroupsServer() throws ApplianceException {
+ super();
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(String name) {
+ return ((IZclAttributeDescriptor) attributesMapByName.get(name));
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(int id) {
+ Iterator iterator = attributesMapByName.values().iterator();
+ // FIXME: generate it and optimize!!!!
+ for (; iterator.hasNext();) {
+ IZclAttributeDescriptor attributeDescriptor = (IZclAttributeDescriptor) iterator.next();
+ if (attributeDescriptor.zclGetId() == id)
+ return attributeDescriptor;
+ }
+ return null;
+ }
+
+ public AddGroupResponse execAddGroup(int GroupID, String GroupName, IEndPointRequestContext context) throws ApplianceException,
+ ServiceClusterException {
+ int size = 0;
+ size += ZclDataTypeUI16.zclSize(GroupID);
+ size += ZclDataTypeString.zclSize(GroupName);
+ ZclFrame zclFrame = new ZclFrame(1, size);
+ zclFrame.setCommandId(0);
+ ZclDataTypeUI16.zclSerialize(zclFrame, GroupID);
+ ZclDataTypeString.zclSerialize(zclFrame, GroupName);
+ IZclFrame zclResponseFrame = issueExec(zclFrame, 0, context);
+ return (ZclAddGroupResponse.zclParse(zclResponseFrame));
+ }
+
+ public ViewGroupResponse execViewGroup(int GroupID, IEndPointRequestContext context) throws ApplianceException,
+ ServiceClusterException {
+ int size = 0;
+ size += ZclDataTypeUI16.zclSize(GroupID);
+ ZclFrame zclFrame = new ZclFrame(1, size);
+ zclFrame.setCommandId(1);
+ ZclDataTypeUI16.zclSerialize(zclFrame, GroupID);
+ IZclFrame zclResponseFrame = issueExec(zclFrame, 1, context);
+ return (ZclViewGroupResponse.zclParse(zclResponseFrame));
+ }
+
+ public GetGroupMembershipResponse execGetGroupMembership(short GroupCount, int GroupList, IEndPointRequestContext context)
+ throws ApplianceException, ServiceClusterException {
+ int size = 0;
+ size += ZclDataTypeUI8.zclSize(GroupCount);
+ // FIXME: unable handle parameter 'GroupList' of type 'array of uint16'
+ ZclFrame zclFrame = new ZclFrame(1, size);
+ zclFrame.setCommandId(2);
+ ZclDataTypeUI8.zclSerialize(zclFrame, GroupCount);
+ // FIXME: unable handle parameter 'GroupList' of type 'array of uint16'
+ IZclFrame zclResponseFrame = issueExec(zclFrame, 2, context);
+ return (ZclGetGroupMembershipResponse.zclParse(zclResponseFrame));
+ }
+
+ public RemoveGroupResponse execRemoveGroup(int GroupID, IEndPointRequestContext context) throws ApplianceException,
+ ServiceClusterException {
+ int size = 0;
+ size += ZclDataTypeUI16.zclSize(GroupID);
+ ZclFrame zclFrame = new ZclFrame(1, size);
+ zclFrame.setCommandId(3);
+ ZclDataTypeUI16.zclSerialize(zclFrame, GroupID);
+ IZclFrame zclResponseFrame = issueExec(zclFrame, 3, context);
+ return (ZclRemoveGroupResponse.zclParse(zclResponseFrame));
+ }
+
+ public void execRemoveAllGroups(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ ZclFrame zclFrame = new ZclFrame(1);
+ zclFrame.setCommandId(4);
+ issueExec(zclFrame, 11, context);
+ }
+
+ public void execAddGroupIfIdentifying(int GroupID, String GroupName, IEndPointRequestContext context)
+ throws ApplianceException, ServiceClusterException {
+ int size = 0;
+ size += ZclDataTypeUI16.zclSize(GroupID);
+ size += ZclDataTypeString.zclSize(GroupName);
+ ZclFrame zclFrame = new ZclFrame(1, size);
+ zclFrame.setCommandId(5);
+ ZclDataTypeUI16.zclSerialize(zclFrame, GroupID);
+ ZclDataTypeString.zclSerialize(zclFrame, GroupName);
+ issueExec(zclFrame, 11, context);
+ }
+
+ public short getNameSupport(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Short objectResult = null;
+ objectResult = ((Short) getValidCachedAttributeObject(0, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.shortValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(0, context);
+ short v = ZclDataTypeBitmap8.zclParse(zclFrame);
+ setCachedAttributeObject(0, new Short(v));
+ return v;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclIdentifyClient.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclIdentifyClient.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclIdentifyClient.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,75 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.general;
+
+import it.telecomitalia.ah.cluster.zigbee.general.IdentifyClient;
+import it.telecomitalia.ah.cluster.zigbee.general.IdentifyQueryResponse;
+import it.telecomitalia.ah.cluster.zigbee.general.IdentifyServer;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZCL;
+import it.telecomitalia.ah.zigbee.ZigBeeDevice;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+
+public class ZclIdentifyClient extends ZclServiceCluster implements IdentifyClient, ZigBeeDeviceListener {
+
+ public final static short CLUSTER_ID = 3;
+
+ public ZclIdentifyClient() throws ApplianceException {
+ super();
+ }
+
+ public boolean notifyZclFrame(short clusterId, IZclFrame zclFrame) throws Exception {
+ boolean handled;
+ handled = super.notifyZclFrame(clusterId, zclFrame);
+ if (handled) {
+ return handled;
+ }
+ int commandId = zclFrame.getCommandId();
+ if (zclFrame.isServerToClient()) {
+ throw new ZclValidationException("invalid direction field");
+ }
+ IZclFrame responseZclFrame = null;
+ ZigBeeDevice device = getZigBeeDevice();
+ int statusCode = ZCL.SUCCESS;
+ IdentifyServer c = ((IdentifyServer) getSinglePeerCluster((IdentifyServer.class.getName())));
+ switch (commandId) {
+ case 0:
+ responseZclFrame = parseIdentify(c, zclFrame);
+ break;
+ case 1:
+ responseZclFrame = parseIdentifyQuery(c, zclFrame);
+ break;
+ }
+ if (responseZclFrame == null) {
+ if (!zclFrame.isDefaultResponseDisabled()) {
+ responseZclFrame = getDefaultResponse(zclFrame, statusCode);
+ }
+ }
+ if (!(responseZclFrame == null)) {
+ device.post(ZclIdentifyClient.CLUSTER_ID, responseZclFrame);
+ return true;
+ }
+ return false;
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ protected IZclFrame parseIdentify(IdentifyServer o, IZclFrame zclFrame) throws ApplianceException, ServiceClusterException {
+ o.execIdentify(null);
+ return null;
+ }
+
+ protected IZclFrame parseIdentifyQuery(IdentifyServer o, IZclFrame zclFrame) throws ApplianceException, ServiceClusterException {
+ IdentifyQueryResponse r = o.execIdentifyQuery(null);
+ int size = ZclIdentifyQueryResponse.zclSize(r);
+ IZclFrame zclResponseFrame = zclFrame.createResponseFrame(size);
+ zclResponseFrame.setCommandId(0);
+ ZclIdentifyQueryResponse.zclSerialize(zclResponseFrame, r);
+ return zclResponseFrame;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclIdentifyQueryResponse.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclIdentifyQueryResponse.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclIdentifyQueryResponse.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,26 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.general;
+
+import it.telecomitalia.ah.cluster.zigbee.general.IdentifyQueryResponse;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI16;
+
+public class ZclIdentifyQueryResponse {
+
+ public static IdentifyQueryResponse zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ IdentifyQueryResponse r = new IdentifyQueryResponse();
+ r.Timeout = ZclDataTypeUI16.zclParse(zclFrame);
+ return r;
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, IdentifyQueryResponse r) throws ZclValidationException {
+ ZclDataTypeUI16.zclSerialize(zclFrame, r.Timeout);
+ }
+
+ public static int zclSize(IdentifyQueryResponse r) throws ZclValidationException {
+ int size = 0;
+ size += ZclDataTypeUI16.zclSize(r.Timeout);
+ return size;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclIdentifyServer.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclIdentifyServer.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclIdentifyServer.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,92 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.general;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import it.telecomitalia.ah.cluster.zigbee.general.IdentifyQueryResponse;
+import it.telecomitalia.ah.cluster.zigbee.general.IdentifyServer;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.IEndPointRequestContext;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.internal.zigbee.ZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZclFrame;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.IZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI16;
+
+public class ZclIdentifyServer extends ZclServiceCluster implements IdentifyServer, ZigBeeDeviceListener {
+
+ public final static short CLUSTER_ID = 3;
+ final static HashMap attributesMapByName = new HashMap();
+ final static HashMap attributesMapById = new HashMap();
+
+ static {
+ attributesMapByName.put(ZclIdentifyServer.ATTR_IdentifyTime_NAME, new ZclAttributeDescriptor(0,
+ ZclIdentifyServer.ATTR_IdentifyTime_NAME, new ZclDataTypeUI16(), null, true, 0));
+ }
+
+ public ZclIdentifyServer() throws ApplianceException {
+ super();
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(String name) {
+ return ((IZclAttributeDescriptor) attributesMapByName.get(name));
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(int id) {
+ Iterator iterator = attributesMapByName.values().iterator();
+ // FIXME: generate it and optimize!!!!
+ for (; iterator.hasNext();) {
+ IZclAttributeDescriptor attributeDescriptor = (IZclAttributeDescriptor) iterator.next();
+ if (attributeDescriptor.zclGetId() == id)
+ return attributeDescriptor;
+ }
+ return null;
+ }
+
+ public void execIdentify(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ ZclFrame zclFrame = new ZclFrame(1);
+ zclFrame.setCommandId(0);
+ issueExec(zclFrame, 11, context);
+ }
+
+ public IdentifyQueryResponse execIdentifyQuery(IEndPointRequestContext context) throws ApplianceException,
+ ServiceClusterException {
+ ZclFrame zclFrame = new ZclFrame(1);
+ zclFrame.setCommandId(1);
+ IZclFrame zclResponseFrame = issueExec(zclFrame, 0, context);
+ return (ZclIdentifyQueryResponse.zclParse(zclResponseFrame));
+ }
+
+ public void setIdentifyTime(int IdentifyTime, IEndPointRequestContext context) throws ApplianceException,
+ ServiceClusterException {
+ int attrId = 0;
+ int size = 3;
+ size += ZclDataTypeUI16.zclSize(IdentifyTime);
+ IZclFrame zclFrame = new ZclFrame(0, size);
+ zclFrame.appendUInt16(attrId);
+ zclFrame.appendUInt8(ZclDataTypeUI16.ZCL_DATA_TYPE);
+ ZclDataTypeUI16.zclSerialize(zclFrame, IdentifyTime);
+ issueSet(ZclIdentifyServer.CLUSTER_ID, zclFrame, attrId, context);
+ }
+
+ public int getIdentifyTime(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(0, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(0, context);
+ int v = ZclDataTypeUI16.zclParse(zclFrame);
+ setCachedAttributeObject(0, new Integer(v));
+ return v;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclLevelControlClient.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclLevelControlClient.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclLevelControlClient.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,140 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.general;
+
+import it.telecomitalia.ah.cluster.zigbee.general.LevelControlClient;
+import it.telecomitalia.ah.cluster.zigbee.general.LevelControlServer;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZCL;
+import it.telecomitalia.ah.zigbee.ZigBeeDevice;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeEnum8;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI16;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+public class ZclLevelControlClient extends ZclServiceCluster implements LevelControlClient, ZigBeeDeviceListener {
+
+ final static short CLUSTER_ID = 8;
+
+ public ZclLevelControlClient() throws ApplianceException {
+ super();
+ }
+
+ public boolean notifyZclFrame(short clusterId, IZclFrame zclFrame) throws Exception {
+ boolean handled;
+ handled = super.notifyZclFrame(clusterId, zclFrame);
+ if (handled) {
+ return handled;
+ }
+ int commandId = zclFrame.getCommandId();
+ if (zclFrame.isServerToClient()) {
+ throw new ZclValidationException("invalid direction field");
+ }
+ IZclFrame responseZclFrame = null;
+ ZigBeeDevice device = getZigBeeDevice();
+ int statusCode = ZCL.SUCCESS;
+ LevelControlServer c = ((LevelControlServer) getSinglePeerCluster((LevelControlServer.class.getName())));
+ switch (commandId) {
+ case 0:
+ responseZclFrame = parseMoveToLevel(c, zclFrame);
+ break;
+ case 1:
+ responseZclFrame = parseMove(c, zclFrame);
+ break;
+ case 2:
+ responseZclFrame = parseStep(c, zclFrame);
+ break;
+ case 3:
+ responseZclFrame = parseStop(c, zclFrame);
+ break;
+ case 4:
+ responseZclFrame = parseMoveToLevelWithOnOff(c, zclFrame);
+ break;
+ case 5:
+ responseZclFrame = parseMoveWithOnOff(c, zclFrame);
+ break;
+ case 6:
+ responseZclFrame = parseStepWithOnOff(c, zclFrame);
+ break;
+ case 7:
+ responseZclFrame = parseStopWithOnOff(c, zclFrame);
+ break;
+ }
+ if (responseZclFrame == null) {
+ if (!zclFrame.isDefaultResponseDisabled()) {
+ responseZclFrame = getDefaultResponse(zclFrame, statusCode);
+ }
+ }
+ if (!(responseZclFrame == null)) {
+ device.post(ZclLevelControlClient.CLUSTER_ID, responseZclFrame);
+ return true;
+ }
+ return false;
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ protected IZclFrame parseMoveToLevel(LevelControlServer o, IZclFrame zclFrame) throws ApplianceException,
+ ServiceClusterException {
+ short Level = ZclDataTypeUI8.zclParse(zclFrame);
+ int TransitionTime = ZclDataTypeUI16.zclParse(zclFrame);
+ o.execMoveToLevel(Level, TransitionTime, null);
+ return null;
+ }
+
+ protected IZclFrame parseMove(LevelControlServer o, IZclFrame zclFrame) throws ApplianceException, ServiceClusterException {
+ short MoveMode = ZclDataTypeEnum8.zclParse(zclFrame);
+ short Rate = ZclDataTypeUI8.zclParse(zclFrame);
+ o.execMove(MoveMode, Rate, null);
+ return null;
+ }
+
+ protected IZclFrame parseStep(LevelControlServer o, IZclFrame zclFrame) throws ApplianceException, ServiceClusterException {
+ short StepMode = ZclDataTypeEnum8.zclParse(zclFrame);
+ short StepSize = ZclDataTypeUI8.zclParse(zclFrame);
+ int TransitionTime = ZclDataTypeUI16.zclParse(zclFrame);
+ o.execStep(StepMode, StepSize, TransitionTime, null);
+ return null;
+ }
+
+ protected IZclFrame parseStop(LevelControlServer o, IZclFrame zclFrame) throws ApplianceException, ServiceClusterException {
+ o.execStop(null);
+ return null;
+ }
+
+ protected IZclFrame parseMoveToLevelWithOnOff(LevelControlServer o, IZclFrame zclFrame) throws ApplianceException,
+ ServiceClusterException {
+ short Level = ZclDataTypeUI8.zclParse(zclFrame);
+ int TransitionTime = ZclDataTypeUI16.zclParse(zclFrame);
+ o.execMoveToLevelWithOnOff(Level, TransitionTime, null);
+ return null;
+ }
+
+ protected IZclFrame parseMoveWithOnOff(LevelControlServer o, IZclFrame zclFrame) throws ApplianceException,
+ ServiceClusterException {
+ short MoveMode = ZclDataTypeEnum8.zclParse(zclFrame);
+ short Rate = ZclDataTypeUI8.zclParse(zclFrame);
+ o.execMoveWithOnOff(MoveMode, Rate, null);
+ return null;
+ }
+
+ protected IZclFrame parseStepWithOnOff(LevelControlServer o, IZclFrame zclFrame) throws ApplianceException,
+ ServiceClusterException {
+ short StepMode = ZclDataTypeEnum8.zclParse(zclFrame);
+ short StepSize = ZclDataTypeUI8.zclParse(zclFrame);
+ int TransitionTime = ZclDataTypeUI16.zclParse(zclFrame);
+ o.execStepWithOnOff(StepMode, StepSize, TransitionTime, null);
+ return null;
+ }
+
+ protected IZclFrame parseStopWithOnOff(LevelControlServer o, IZclFrame zclFrame) throws ApplianceException,
+ ServiceClusterException {
+ o.execStopWithOnOff(null);
+ return null;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclLevelControlServer.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclLevelControlServer.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclLevelControlServer.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,203 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.general;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import it.telecomitalia.ah.cluster.zigbee.general.LevelControlServer;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.IEndPointRequestContext;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.internal.zigbee.ZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZclFrame;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.IZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeEnum8;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI16;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+public class ZclLevelControlServer extends ZclServiceCluster implements LevelControlServer, ZigBeeDeviceListener {
+
+ final static short CLUSTER_ID = 8;
+ final static HashMap attributesMapByName = new HashMap();
+ final static HashMap attributesMapById = new HashMap();
+
+ static {
+ attributesMapByName.put(ZclLevelControlServer.ATTR_CurrentLevel_NAME, new ZclAttributeDescriptor(0,
+ ZclLevelControlServer.ATTR_CurrentLevel_NAME, new ZclDataTypeUI8(), null, true, 1));
+ attributesMapByName.put(ZclLevelControlServer.ATTR_RemainingTime_NAME, new ZclAttributeDescriptor(1,
+ ZclLevelControlServer.ATTR_RemainingTime_NAME, new ZclDataTypeUI16(), null, true, 1));
+ attributesMapByName.put(ZclLevelControlServer.ATTR_OnOffTransitionTime_NAME, new ZclAttributeDescriptor(16,
+ ZclLevelControlServer.ATTR_OnOffTransitionTime_NAME, new ZclDataTypeUI16(), null, true, 1));
+ attributesMapByName.put(ZclLevelControlServer.ATTR_OnLevel_NAME, new ZclAttributeDescriptor(17,
+ ZclLevelControlServer.ATTR_OnLevel_NAME, new ZclDataTypeUI8(), null, true, 1));
+ }
+
+ public ZclLevelControlServer() throws ApplianceException {
+ super();
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(String name) {
+ return ((IZclAttributeDescriptor) attributesMapByName.get(name));
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(int id) {
+ Iterator iterator = attributesMapByName.values().iterator();
+ // FIXME: generate it and optimize!!!!
+ for (; iterator.hasNext();) {
+ IZclAttributeDescriptor attributeDescriptor = (IZclAttributeDescriptor) iterator.next();
+ if (attributeDescriptor.zclGetId() == id)
+ return attributeDescriptor;
+ }
+ return null;
+ }
+
+ public void execMoveToLevel(short Level, int TransitionTime, IEndPointRequestContext context) throws ApplianceException,
+ ServiceClusterException {
+ int size = 0;
+ size += ZclDataTypeUI8.zclSize(Level);
+ size += ZclDataTypeUI16.zclSize(TransitionTime);
+ ZclFrame zclFrame = new ZclFrame(1, size);
+ zclFrame.setCommandId(0);
+ ZclDataTypeUI8.zclSerialize(zclFrame, Level);
+ ZclDataTypeUI16.zclSerialize(zclFrame, TransitionTime);
+ issueExec(zclFrame, 11, context);
+ }
+
+ public void execMove(short MoveMode, short Rate, IEndPointRequestContext context) throws ApplianceException,
+ ServiceClusterException {
+ int size = 0;
+ size += ZclDataTypeEnum8.zclSize(MoveMode);
+ size += ZclDataTypeUI8.zclSize(Rate);
+ ZclFrame zclFrame = new ZclFrame(1, size);
+ zclFrame.setCommandId(1);
+ ZclDataTypeEnum8.zclSerialize(zclFrame, MoveMode);
+ ZclDataTypeUI8.zclSerialize(zclFrame, Rate);
+ issueExec(zclFrame, 11, context);
+ }
+
+ public void execStep(short StepMode, short StepSize, int TransitionTime, IEndPointRequestContext context)
+ throws ApplianceException, ServiceClusterException {
+ int size = 0;
+ size += ZclDataTypeEnum8.zclSize(StepMode);
+ size += ZclDataTypeUI8.zclSize(StepSize);
+ size += ZclDataTypeUI16.zclSize(TransitionTime);
+ ZclFrame zclFrame = new ZclFrame(1, size);
+ zclFrame.setCommandId(2);
+ ZclDataTypeEnum8.zclSerialize(zclFrame, StepMode);
+ ZclDataTypeUI8.zclSerialize(zclFrame, StepSize);
+ ZclDataTypeUI16.zclSerialize(zclFrame, TransitionTime);
+ issueExec(zclFrame, 11, context);
+ }
+
+ public void execStop(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ ZclFrame zclFrame = new ZclFrame(1);
+ zclFrame.setCommandId(3);
+ issueExec(zclFrame, 11, context);
+ }
+
+ public void execMoveToLevelWithOnOff(short Level, int TransitionTime, IEndPointRequestContext context)
+ throws ApplianceException, ServiceClusterException {
+ int size = 0;
+ size += ZclDataTypeUI8.zclSize(Level);
+ size += ZclDataTypeUI16.zclSize(TransitionTime);
+ ZclFrame zclFrame = new ZclFrame(1, size);
+ zclFrame.setCommandId(4);
+ ZclDataTypeUI8.zclSerialize(zclFrame, Level);
+ ZclDataTypeUI16.zclSerialize(zclFrame, TransitionTime);
+ issueExec(zclFrame, 11, context);
+ }
+
+ public void execMoveWithOnOff(short MoveMode, short Rate, IEndPointRequestContext context) throws ApplianceException,
+ ServiceClusterException {
+ int size = 0;
+ size += ZclDataTypeEnum8.zclSize(MoveMode);
+ size += ZclDataTypeUI8.zclSize(Rate);
+ ZclFrame zclFrame = new ZclFrame(1, size);
+ zclFrame.setCommandId(5);
+ ZclDataTypeEnum8.zclSerialize(zclFrame, MoveMode);
+ ZclDataTypeUI8.zclSerialize(zclFrame, Rate);
+ issueExec(zclFrame, 11, context);
+ }
+
+ public void execStepWithOnOff(short StepMode, short StepSize, int TransitionTime, IEndPointRequestContext context)
+ throws ApplianceException, ServiceClusterException {
+ int size = 0;
+ size += ZclDataTypeEnum8.zclSize(StepMode);
+ size += ZclDataTypeUI8.zclSize(StepSize);
+ size += ZclDataTypeUI16.zclSize(TransitionTime);
+ ZclFrame zclFrame = new ZclFrame(1, size);
+ zclFrame.setCommandId(6);
+ ZclDataTypeEnum8.zclSerialize(zclFrame, StepMode);
+ ZclDataTypeUI8.zclSerialize(zclFrame, StepSize);
+ ZclDataTypeUI16.zclSerialize(zclFrame, TransitionTime);
+ issueExec(zclFrame, 11, context);
+ }
+
+ public void execStopWithOnOff(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ ZclFrame zclFrame = new ZclFrame(1);
+ zclFrame.setCommandId(7);
+ issueExec(zclFrame, 11, context);
+ }
+
+ public short getCurrentLevel(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Short objectResult = null;
+ objectResult = ((Short) getValidCachedAttributeObject(0, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.shortValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(0, context);
+ short v = ZclDataTypeUI8.zclParse(zclFrame);
+ setCachedAttributeObject(0, new Short(v));
+ return v;
+ }
+
+ public int getRemainingTime(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(1, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(1, context);
+ int v = ZclDataTypeUI16.zclParse(zclFrame);
+ setCachedAttributeObject(1, new Integer(v));
+ return v;
+ }
+
+ public int getOnOffTransitionTime(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(16, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(16, context);
+ int v = ZclDataTypeUI16.zclParse(zclFrame);
+ setCachedAttributeObject(16, new Integer(v));
+ return v;
+ }
+
+ public short getOnLevel(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Short objectResult = null;
+ objectResult = ((Short) getValidCachedAttributeObject(17, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.shortValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(17, context);
+ short v = ZclDataTypeUI8.zclParse(zclFrame);
+ setCachedAttributeObject(17, new Short(v));
+ return v;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclOnOffClient.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclOnOffClient.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclOnOffClient.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,78 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.general;
+
+import it.telecomitalia.ah.cluster.zigbee.general.OnOffClient;
+import it.telecomitalia.ah.cluster.zigbee.general.OnOffServer;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZCL;
+import it.telecomitalia.ah.zigbee.ZigBeeDevice;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+
+public class ZclOnOffClient extends ZclServiceCluster implements OnOffClient, ZigBeeDeviceListener {
+
+ public final static short CLUSTER_ID = 6;
+
+ public ZclOnOffClient() throws ApplianceException {
+ super();
+ }
+
+ public boolean notifyZclFrame(short clusterId, IZclFrame zclFrame) throws Exception {
+ boolean handled;
+ handled = super.notifyZclFrame(clusterId, zclFrame);
+ if (handled) {
+ return handled;
+ }
+ int commandId = zclFrame.getCommandId();
+ if (zclFrame.isServerToClient()) {
+ throw new ZclValidationException("invalid direction field");
+ }
+ IZclFrame responseZclFrame = null;
+ ZigBeeDevice device = getZigBeeDevice();
+ int statusCode = ZCL.SUCCESS;
+ OnOffServer c = ((OnOffServer) getSinglePeerCluster((OnOffServer.class.getName())));
+ switch (commandId) {
+ case 0:
+ responseZclFrame = parseOff(c, zclFrame);
+ break;
+ case 1:
+ responseZclFrame = parseOn(c, zclFrame);
+ break;
+ case 2:
+ responseZclFrame = parseToggle(c, zclFrame);
+ break;
+ }
+ if (responseZclFrame == null) {
+ if (!zclFrame.isDefaultResponseDisabled()) {
+ responseZclFrame = getDefaultResponse(zclFrame, statusCode);
+ }
+ }
+ if (!(responseZclFrame == null)) {
+ device.post(ZclOnOffClient.CLUSTER_ID, responseZclFrame);
+ return true;
+ }
+ return false;
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ protected IZclFrame parseOff(OnOffServer o, IZclFrame zclFrame) throws ApplianceException, ServiceClusterException {
+ o.execOff(null);
+ return null;
+ }
+
+ protected IZclFrame parseOn(OnOffServer o, IZclFrame zclFrame) throws ApplianceException, ServiceClusterException {
+ o.execOn(null);
+ return null;
+ }
+
+ protected IZclFrame parseToggle(OnOffServer o, IZclFrame zclFrame) throws ApplianceException, ServiceClusterException {
+ o.execToggle(null);
+ return null;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclOnOffServer.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclOnOffServer.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclOnOffServer.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,83 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.general;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import it.telecomitalia.ah.cluster.zigbee.general.OnOffServer;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.IEndPointRequestContext;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.internal.zigbee.ZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZclFrame;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.IZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeBoolean;
+
+public class ZclOnOffServer extends ZclServiceCluster implements OnOffServer, ZigBeeDeviceListener {
+
+ public final static short CLUSTER_ID = 6;
+ final static HashMap attributesMapByName = new HashMap();
+ final static HashMap attributesMapById = new HashMap();
+
+ static {
+ attributesMapByName.put(ZclOnOffServer.ATTR_OnOff_NAME, new ZclAttributeDescriptor(0, ZclOnOffServer.ATTR_OnOff_NAME,
+ new ZclDataTypeBoolean(), null, true, 1));
+ }
+
+ public ZclOnOffServer() throws ApplianceException {
+ super();
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(String name) {
+ return ((IZclAttributeDescriptor) attributesMapByName.get(name));
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(int id) {
+ Iterator iterator = attributesMapByName.values().iterator();
+ // FIXME: generate it and optimize!!!!
+ for (; iterator.hasNext();) {
+ IZclAttributeDescriptor attributeDescriptor = (IZclAttributeDescriptor) iterator.next();
+ if (attributeDescriptor.zclGetId() == id)
+ return attributeDescriptor;
+ }
+ return null;
+ }
+
+ public void execOff(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ ZclFrame zclFrame = new ZclFrame(1);
+ zclFrame.setCommandId(0);
+ issueExec(zclFrame, 11, context);
+ }
+
+ public void execOn(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ ZclFrame zclFrame = new ZclFrame(1);
+ zclFrame.setCommandId(1);
+ issueExec(zclFrame, 11, context);
+ }
+
+ public void execToggle(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ ZclFrame zclFrame = new ZclFrame(1);
+ zclFrame.setCommandId(2);
+ issueExec(zclFrame, 11, context);
+ }
+
+ public boolean getOnOff(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Boolean objectResult = null;
+ objectResult = ((Boolean) getValidCachedAttributeObject(0, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.booleanValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(0, context);
+ boolean v = ZclDataTypeBoolean.zclParse(zclFrame);
+ setCachedAttributeObject(0, new Boolean(v));
+ return v;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclOnOffSwitchConfigurationClient.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclOnOffSwitchConfigurationClient.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclOnOffSwitchConfigurationClient.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,21 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.general;
+
+import it.telecomitalia.ah.cluster.zigbee.general.OnOffSwitchConfigurationClient;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+
+public class ZclOnOffSwitchConfigurationClient extends ZclServiceCluster implements OnOffSwitchConfigurationClient,
+ ZigBeeDeviceListener {
+
+ final static short CLUSTER_ID = 7;
+
+ public ZclOnOffSwitchConfigurationClient() throws ApplianceException {
+ super();
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclOnOffSwitchConfigurationServer.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclOnOffSwitchConfigurationServer.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclOnOffSwitchConfigurationServer.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,94 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.general;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import it.telecomitalia.ah.cluster.zigbee.general.OnOffSwitchConfigurationServer;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.IEndPointRequestContext;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.internal.zigbee.ZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZclFrame;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.IZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeEnum8;
+
+public class ZclOnOffSwitchConfigurationServer extends ZclServiceCluster implements OnOffSwitchConfigurationServer,
+ ZigBeeDeviceListener {
+
+ final static short CLUSTER_ID = 7;
+ final static HashMap attributesMapByName = new HashMap();
+ final static HashMap attributesMapById = new HashMap();
+
+ static {
+ attributesMapByName.put(ZclOnOffSwitchConfigurationServer.ATTR_SwitchType_NAME, new ZclAttributeDescriptor(0,
+ ZclOnOffSwitchConfigurationServer.ATTR_SwitchType_NAME, new ZclDataTypeEnum8(), null, true, 1));
+ attributesMapByName.put(ZclOnOffSwitchConfigurationServer.ATTR_SwitchActions_NAME, new ZclAttributeDescriptor(16,
+ ZclOnOffSwitchConfigurationServer.ATTR_SwitchActions_NAME, new ZclDataTypeEnum8(), null, true, 0));
+ }
+
+ public ZclOnOffSwitchConfigurationServer() throws ApplianceException {
+ super();
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(String name) {
+ return ((IZclAttributeDescriptor) attributesMapByName.get(name));
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(int id) {
+ Iterator iterator = attributesMapByName.values().iterator();
+ // FIXME: generate it and optimize!!!!
+ for (; iterator.hasNext();) {
+ IZclAttributeDescriptor attributeDescriptor = (IZclAttributeDescriptor) iterator.next();
+ if (attributeDescriptor.zclGetId() == id)
+ return attributeDescriptor;
+ }
+ return null;
+ }
+
+ public short getSwitchType(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Short objectResult = null;
+ objectResult = ((Short) getValidCachedAttributeObject(0, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.shortValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(0, context);
+ short v = ZclDataTypeEnum8.zclParse(zclFrame);
+ setCachedAttributeObject(0, new Short(v));
+ return v;
+ }
+
+ public void setSwitchActions(short SwitchActions, IEndPointRequestContext context) throws ApplianceException,
+ ServiceClusterException {
+ int attrId = 16;
+ int size = 3;
+ size += ZclDataTypeEnum8.zclSize(SwitchActions);
+ IZclFrame zclFrame = new ZclFrame(0, size);
+ zclFrame.appendUInt16(attrId);
+ zclFrame.appendUInt8(ZclDataTypeEnum8.ZCL_DATA_TYPE);
+ ZclDataTypeEnum8.zclSerialize(zclFrame, SwitchActions);
+ issueSet(ZclOnOffSwitchConfigurationServer.CLUSTER_ID, zclFrame, attrId, context);
+ }
+
+ public short getSwitchActions(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Short objectResult = null;
+ objectResult = ((Short) getValidCachedAttributeObject(16, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.shortValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(16, context);
+ short v = ZclDataTypeEnum8.zclParse(zclFrame);
+ setCachedAttributeObject(16, new Short(v));
+ return v;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclPartitionServer.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclPartitionServer.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclPartitionServer.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,717 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.general;
+
+import it.telecomitalia.ah.cluster.zigbee.general.PartitionServer;
+import it.telecomitalia.ah.cluster.zigbee.general.ReadHandshakeParamResponse;
+import it.telecomitalia.ah.cluster.zigbee.general.TransferPartitionedFrameCommand;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.internal.zigbee.ZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZCL;
+import it.telecomitalia.ah.zigbee.ZclFrame;
+import it.telecomitalia.ah.zigbee.ZigBeeDevice;
+import it.telecomitalia.ah.zigbee.zcl.IZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.zcl.ZclException;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.cluster.eh.ZclReadHandshakeParamResponse;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeBitmap8;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeClusterID;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI16;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Timer;
+import java.util.TimerTask;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+class PartitionClusterAttributes {
+ public static int PartitionedFrameSize = 0x40;
+ public static int LargeFrameSize = 0x0500;
+ public static int NumberOfACKFrame = 0x04;
+ public static int NACKTimeout = 0x4000;
+ public static int InterframeDelay = 0x10;
+ public static int NumberOfSendRetries = 0x03;
+ public static int SenderTimeout = 0xffff;
+ public static int ReceiverTimeout = 0xffff;
+};
+
+class PartitionedFrame {
+ private boolean _ack = false;
+ private int _from;
+ private int _length;
+ private byte[] _data;
+
+ PartitionedFrame(int from, int length) {
+ _from = from;
+ _length = length;
+ _data = null;
+ }
+
+ public PartitionedFrame(int from, byte[] data) {
+ _from = from;
+ _data = data;
+ _length = data.length;
+ }
+
+ public boolean isACKd() {
+ return (_ack);
+ }
+
+ public void setACKd(boolean acked) {
+ _ack = acked;
+ }
+
+ public int getFrom() {
+ return (_from);
+ }
+
+ public int getLength() {
+ return (_length);
+ }
+
+ public byte[] getData() {
+ return (_data);
+ }
+}
+
+public class ZclPartitionServer extends ZclServiceCluster implements Runnable, PartitionServer {
+ public final static short CLUSTER_ID = 22;
+
+ final static HashMap attributesMapByName = new HashMap();
+ final static HashMap attributesMapById = new HashMap();
+
+ static {
+ attributesMapByName.put(ZclPartitionServer.ATTR_MaximumIncomingTransferSize_NAME, new ZclAttributeDescriptor(0,
+ ZclPartitionServer.ATTR_MaximumIncomingTransferSize_NAME, new ZclDataTypeUI16(), null, true, 1));
+ attributesMapByName.put(ZclPartitionServer.ATTR_MaximumOutgoingTransferSize_NAME, new ZclAttributeDescriptor(1,
+ ZclPartitionServer.ATTR_MaximumOutgoingTransferSize_NAME, new ZclDataTypeUI16(), null, true, 1));
+ attributesMapByName.put(ZclPartitionServer.ATTR_PartitionedFrameSize_NAME, new ZclAttributeDescriptor(2,
+ ZclPartitionServer.ATTR_PartitionedFrameSize_NAME, new ZclDataTypeUI8(), null, true, 0));
+ attributesMapByName.put(ZclPartitionServer.ATTR_LargeFrameSize_NAME, new ZclAttributeDescriptor(3,
+ ZclPartitionServer.ATTR_LargeFrameSize_NAME, new ZclDataTypeUI16(), null, true, 0));
+ attributesMapByName.put(ZclPartitionServer.ATTR_NumberOfACKFrame_NAME, new ZclAttributeDescriptor(4,
+ ZclPartitionServer.ATTR_NumberOfACKFrame_NAME, new ZclDataTypeUI8(), null, true, 0));
+ attributesMapByName.put(ZclPartitionServer.ATTR_NACKTimeout_NAME, new ZclAttributeDescriptor(5,
+ ZclPartitionServer.ATTR_NACKTimeout_NAME, new ZclDataTypeUI16(), null, true, 1));
+ attributesMapByName.put(ZclPartitionServer.ATTR_InterframeDelay_NAME, new ZclAttributeDescriptor(6,
+ ZclPartitionServer.ATTR_InterframeDelay_NAME, new ZclDataTypeUI8(), null, true, 0));
+ attributesMapByName.put(ZclPartitionServer.ATTR_NumberOfSendRetries_NAME, new ZclAttributeDescriptor(7,
+ ZclPartitionServer.ATTR_NumberOfSendRetries_NAME, new ZclDataTypeUI8(), null, true, 1));
+ attributesMapByName.put(ZclPartitionServer.ATTR_SenderTimeout_NAME, new ZclAttributeDescriptor(8,
+ ZclPartitionServer.ATTR_SenderTimeout_NAME, new ZclDataTypeUI16(), null, true, 1));
+ attributesMapByName.put(ZclPartitionServer.ATTR_ReceiverTimeout_NAME, new ZclAttributeDescriptor(9,
+ ZclPartitionServer.ATTR_ReceiverTimeout_NAME, new ZclDataTypeUI16(), null, true, 1));
+ }
+
+ private static final int ZCL_FRAME = 0x01;
+ private static final int RECEIVER_TIMEOUT = 0x03;
+ private static final int NACK_TIMEOUT = 0x04;
+
+ private Hashtable states = new Hashtable();
+ private Hashtable statesBySequenceNumber = new Hashtable();
+
+ private class State {
+ public State(int clusterId, short sequenceNumber) {
+ this.clusterId = clusterId;
+ this.calculateDependentAttributes();
+ }
+
+ static final int IDLE = 1;
+ static final int RECEIVING = 2;
+
+ static final int apsAckWaitDuration = 1600;
+
+ private int clusterId;
+ public int currentState = IDLE;
+ public int firstPartitionedFrameInSet = 0;
+ public int remainingPartitionedFramesToReceive = 0;
+ public int remainingPartitionedFramesToReceiveInSet = 0;
+ public PartitionedFrame[] partitionedFrames;
+ public int sequenceNumber = 0;
+
+ private PartitionTimerTask _timeoutTimerReceiverTask = null;
+ private PartitionTimerTask _timeoutTimerNACKTask = null;
+ private Timer _receiverTimerThread = new Timer();
+
+ // Attributes
+ public int MaximumIncomingTransferSize = 0x0500;
+ public int MaximumOutgoingTransferSize = 0x0500;
+ public short PartitionedFrameSize = 0x50;
+ public int LargeFrameSize = 0x0500;
+ public short NumberOfACKFrame = 0x64;
+ public short InterframeDelay = 0x0032; // 50 ms
+ public short NumberOfSendRetries = 0x03;
+
+ // The following attributes depends on aps constants and other Partition Cluster attributes
+ public int SenderTimeout;
+ public int NACKTimeout;
+ public int ReceiverTimeout;
+
+ public void calculateDependentAttributes() {
+ SenderTimeout = 2 * apsAckWaitDuration + InterframeDelay * NumberOfACKFrame;
+ NACKTimeout = apsAckWaitDuration + InterframeDelay * NumberOfACKFrame;
+ ReceiverTimeout = apsAckWaitDuration + InterframeDelay + NumberOfSendRetries * NACKTimeout;
+ }
+ }
+
+ private class PartitionTimerTask extends TimerTask {
+ private State state;
+ private int eventType;
+
+ public PartitionTimerTask(int eventType, State state) {
+ this.state = state;
+ this.eventType = eventType;
+ }
+
+ public void run() {
+ try {
+ handleEvent(eventType, state.clusterId, state);
+ } catch (Exception e) {
+ log.error("Exception returned by handleEvent", e);
+ }
+ }
+ }
+
+ private Thread thread;
+
+ public ZclPartitionServer(ZigBeeDevice device) throws ApplianceException {
+ super();
+
+ // FIXME: a che serve il thread?
+
+ thread = new Thread();
+ thread.setName("ZclReceiverPartition");
+ thread.start();
+ this.device = device;
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(int id) {
+ Iterator iterator = attributesMapByName.values().iterator();
+ // FIXME: generate it and optimize!!!!
+ for (; iterator.hasNext();) {
+ IZclAttributeDescriptor attributeDescriptor = (IZclAttributeDescriptor) iterator.next();
+ if (attributeDescriptor.zclGetId() == id)
+ return attributeDescriptor;
+ }
+ return null;
+ }
+
+ public boolean notifyZclFrame(short clusterId, IZclFrame zclFrame) throws ZclException {
+ handleEvent(ZCL_FRAME, clusterId, zclFrame);
+ return true;
+ }
+
+ public void run() {
+ }
+
+ /**
+ * Concatenate the received frames and return back a ZclFrame that will be
+ * notified to the upper cluster.
+ *
+ * @param partitionedFrames
+ * @return
+ */
+ private IZclFrame createAssembledZclFrame(State state) {
+ // Determina la lunghezza del buffer che ospitera' l'intero frame.
+ // Nota che in partitionedFrame c'e' sempre almeno un frame per cui
+ // partitionedFrame.length > 0.
+
+ PartitionedFrame[] pFrame = state.partitionedFrames;
+
+ int frameLength = ((pFrame.length - 1) * PartitionClusterAttributes.PartitionedFrameSize)
+ + pFrame[state.partitionedFrames.length - 1].getLength();
+
+ byte[] frame = new byte[frameLength];
+
+ // Assembla tutte le partizioni in un solo grande frame
+ for (int i = 0; i < pFrame.length; i++) {
+ System.arraycopy(pFrame[i].getData(), 0, frame, (i * PartitionClusterAttributes.PartitionedFrameSize),
+ pFrame[i].getLength());
+ }
+
+ // FIXME: build correct frame!!!!!
+ IZclFrame zclFrame = new ZclFrame(frame);
+ zclFrame.setSequence(state.sequenceNumber);
+ return zclFrame;
+ }
+
+ protected void execMultipleNACK(State state, short ACKOptions, int FirstFrameID, int[] ackList) throws ApplianceException,
+ ServiceClusterException {
+ boolean NACKIDLength16 = false;
+ int size = 0;
+
+ size += ZclDataTypeBitmap8.zclSize(ACKOptions);
+ if ((ACKOptions & 0x01) > 0) {
+ NACKIDLength16 = true;
+ }
+
+ if (NACKIDLength16) {
+ size += ZclDataTypeUI16.zclSize(FirstFrameID);
+ size += 2 * ackList.length;
+ } else {
+ size += ZclDataTypeUI8.zclSize((short) FirstFrameID);
+ size += ackList.length;
+ }
+
+ ZclFrame zclFrame = new ZclFrame(1, size);
+ zclFrame.setCommandId(0);
+ zclFrame.setSequence(state.sequenceNumber);
+
+ ZclDataTypeBitmap8.zclSerialize(zclFrame, ACKOptions);
+
+ if (NACKIDLength16) {
+ ZclDataTypeUI16.zclSerialize(zclFrame, FirstFrameID);
+ for (int i = 0; i < ackList.length; i++)
+ ZclDataTypeUI16.zclSerialize(zclFrame, ackList[i]);
+ } else {
+ ZclDataTypeUI8.zclSerialize(zclFrame, (short) FirstFrameID);
+ for (int i = 0; i < ackList.length; i++)
+ ZclDataTypeUI8.zclSerialize(zclFrame, (short) ackList[i]);
+ }
+
+ ZigBeeDevice device = getZigBeeDevice();
+ if (device == null)
+ throw new ApplianceException("Not attached");
+
+ zclFrame.setDirection(IZclFrame.SERVER_TO_CLIENT_DIRECTION);
+
+ boolean res = false;
+ try {
+ res = device.post((short) getClusterId(), zclFrame);
+ } catch (Exception e) {
+ log.error(e);
+ }
+ if (!res) {
+ throw new ApplianceException(POST_FAILED_MESSAGE);
+ }
+ }
+
+ private void sendMultipleNACK(State state) {
+ int FirstFrameID = state.firstPartitionedFrameInSet;
+ PartitionedFrame[] partitionedFrames = state.partitionedFrames;
+
+ // Crea la lista dei NACKids in funzione dei partitioned frame non
+ // ricevuti
+ List nACKIdsList = new LinkedList();
+
+ if (partitionedFrames != null) {
+ for (int pfIdx = FirstFrameID; (pfIdx < (FirstFrameID + PartitionClusterAttributes.NumberOfACKFrame))
+ && (pfIdx < partitionedFrames.length); pfIdx++) {
+ // Se non e' stato ricevuto allora la relativa posizione
+ // nell'array e' null
+ if (partitionedFrames[pfIdx] == null)
+ nACKIdsList.add(new Integer(pfIdx));
+ }
+ }
+
+ // TODO: che succede se partitionedFrames e' null?
+
+ // TODO generate the array instead of the List
+ int[] nackList = new int[nACKIdsList.size()];
+ for (int i = 0; i < nACKIdsList.size(); i++) {
+ nackList[i] = ((Integer) nACKIdsList.get(i)).intValue();
+ }
+
+ // Aggiunge le ACKOptions con b0=1 (due byte per FirstFrameID e i
+ // NACKIds)
+ short ACKOptions = 0x00;
+
+ try {
+ log.debug(">>> (" + System.currentTimeMillis() / 1000 + ") Sending MultipleACK for set = " + FirstFrameID);
+ execMultipleNACK(state, ACKOptions, FirstFrameID, nackList);
+ log.debug(">>> (" + System.currentTimeMillis() / 1000 + ") MultipleACK sent");
+ } catch (Exception e) {
+ log.error("Exception returned by execMultipleACK", e);
+ }
+ }
+
+ private boolean handleEvent(int eventType, int clusterId, Object data) throws ZclException {
+ State state;
+
+
+ synchronized (lock) {
+ switch (eventType) {
+ case ZCL_FRAME:
+ // A zcl frame is arrived!
+ IZclFrame zclFrame = (IZclFrame) data;
+ IZclFrame responseZclFrame = null;
+
+ int commandId = zclFrame.getCommandId();
+ if (zclFrame.isServerToClient()) {
+ throw new ZclException("Invalid direction field", ZCL.INVALID_FIELD);
+ }
+
+ switch (commandId) {
+ case 0:
+ return handleTransferPartitionedFrame(clusterId, zclFrame);
+
+ case 1:
+ try {
+ responseZclFrame = handleReadHandshakeParam(clusterId, zclFrame);
+ } catch (ZclValidationException e) {
+ throw new ZclException(ZCL.MALFORMED_COMMAND);
+ }
+ break;
+
+ case 2:
+ try {
+ responseZclFrame = handleWriteHandshakeParam(clusterId, zclFrame);
+ } catch (ZclValidationException e) {
+ throw new ZclException(ZCL.MALFORMED_COMMAND);
+ }
+ break;
+ }
+
+ if (responseZclFrame == null) {
+ if (!zclFrame.isDefaultResponseDisabled()) {
+ responseZclFrame = getDefaultResponse(zclFrame, ZCL.SUCCESS);
+ }
+ }
+ if (!(responseZclFrame == null)) {
+ device.post(CLUSTER_ID, responseZclFrame);
+ return true;
+ }
+
+ break;
+
+ case NACK_TIMEOUT:
+ log.error(">>> (" + System.currentTimeMillis() / 1000 + ") NACK Timeout");
+ state = (State) data;
+ sendMultipleNACK(state);
+ break;
+
+ case RECEIVER_TIMEOUT:
+ log.error(">>> (" + System.currentTimeMillis() / 1000 + ") Receiver Timeout");
+ state = (State) data;
+ // TODO: uscire dalla ricezione. Come notificare
+ // all'applicazione
+ // l'errore?
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ return false;
+ }
+
+ private Log log = LogFactory.getLog(ZclPartitionServer.class);
+
+ private Object lock = new Object();
+
+ protected boolean handleTransferPartitionedFrame(int clusterId, IZclFrame zclFrame) throws ZclException {
+
+ synchronized (lock) {
+ State rcvrState = this.getState(zclFrame.getSequenceNumber());
+
+ if (rcvrState == null) {
+ throw new ZclException("Unexpected PartitionedFrame received", ZCL.FAILURE);
+ }
+
+ TransferPartitionedFrameCommand zclTPFCommand;
+ try {
+ zclTPFCommand = ZclTransferPartitionedFrameCommand.zclParse(zclFrame);
+ } catch (Exception e) {
+ log.error("Error parsing TransferPartitionedFrame", e);
+ return false;
+ }
+
+ log.debug(">>> (" + System.currentTimeMillis() / 1000 + ") PARTITION CLUSTER FRAME RECEIVED");
+ log.debug(">>> (" + System.currentTimeMillis() / 1000 + ") PartitionIndicator: " + zclTPFCommand.PartitionIndicator);
+
+ // log.debug("ClusterID: " + rcvrState.clusterId +
+ // ", FragmentationOptions: " + zclTPFCommand.FragmentationOptions
+ // + " PartitionIndicator: " + zclTPFCommand.PartitionIndicator);
+
+ if (zclTPFCommand.isFirstBlock()) {
+ log.debug(">>> (" + System.currentTimeMillis() / 1000 + ") isFirstBlock");
+
+ // we are waiting for the first frame && this is the first
+ // frame!
+ // let start!
+
+ if (rcvrState.currentState == State.IDLE) {
+ rcvrState.currentState = State.RECEIVING;
+ // Nel primo frame il campo PartitionIndicator indica il
+ // numero totale di frame che dovranno
+ // essere ricevuti (compreso il primo frame che ha
+ // firstBlock = true).
+ rcvrState.partitionedFrames = new PartitionedFrame[zclTPFCommand.PartitionIndicator];
+ // saves the total number of frames expected
+ rcvrState.remainingPartitionedFramesToReceive = zclTPFCommand.PartitionIndicator;
+ rcvrState.remainingPartitionedFramesToReceiveInSet = rcvrState.NumberOfACKFrame;
+ startReceiverNACKTimer(rcvrState);
+ }
+
+ // Forza il primo frame ad avere PartitionIndicator = 0
+ // (anziche' il numero di frame totali)
+ zclTPFCommand.PartitionIndicator = 0;
+
+ log.debug(">>> (" + System.currentTimeMillis() / 1000 + ") firstPartitionedFrameInSet: " + rcvrState.firstPartitionedFrameInSet);
+ //log.debug(">>> (" + System.currentTimeMillis() / 1000 + ") remainingPartitionedFramesToReceiveInSet = " + rcvrState.remainingPartitionedFramesToReceiveInSet);
+ //log.debug(">>> (" + System.currentTimeMillis() / 1000 + ") remainingPartitionedFramesToReceive = " + rcvrState.remainingPartitionedFramesToReceive);
+
+ } else if (rcvrState.currentState != State.RECEIVING) {
+ log.debug(">>> (" + System.currentTimeMillis() / 1000 + ") Frame discarded because state != RECEIVING");
+ return false;
+ }
+
+ // checks if the frame have to be discarded
+
+ if ((zclTPFCommand.PartitionIndicator >= rcvrState.partitionedFrames.length)
+ || (zclTPFCommand.PartitionIndicator > (rcvrState.firstPartitionedFrameInSet + rcvrState.NumberOfACKFrame))) {
+ log.debug(">>> (" + System.currentTimeMillis() / 1000 + ") Frame discarded because out of set");
+ return false;
+ }
+
+ if (rcvrState.partitionedFrames == null) {
+ log.debug(">>> (" + System.currentTimeMillis() / 1000 + ") Frame discarded because partitionedFrames is null");
+ return false;
+ }
+
+ if (rcvrState.partitionedFrames[zclTPFCommand.PartitionIndicator] != null) {
+ log.debug(">>> (" + System.currentTimeMillis() / 1000 + ") Frame discarded because already received");
+ return false;
+ }
+
+ // Inserisce il partitioned frame nell'array di quelli ricevuti
+ rcvrState.partitionedFrames[zclTPFCommand.PartitionIndicator] = new PartitionedFrame(0, zclTPFCommand.PartitionedFrame);
+
+ if ((rcvrState.remainingPartitionedFramesToReceiveInSet % PartitionClusterAttributes.NumberOfACKFrame) == 0) {
+ startReceiverNACKTimer(rcvrState);
+ }
+
+ // Decrementa il numero di partitioned frame che ci si aspetta di
+ // ricevere
+ rcvrState.remainingPartitionedFramesToReceiveInSet--;
+ rcvrState.remainingPartitionedFramesToReceive--;
+
+ log.debug(">>> (" + System.currentTimeMillis() / 1000 + ") Frame accepted");
+ log.debug(">>> (" + System.currentTimeMillis() / 1000 + ") Now remainingPartitionedFramesToReceiveInSet = " + rcvrState.remainingPartitionedFramesToReceiveInSet);
+ log.debug(">>> (" + System.currentTimeMillis() / 1000 + ") Now remainingPartitionedFramesToReceive = " + rcvrState.remainingPartitionedFramesToReceive);
+
+ if ((rcvrState.remainingPartitionedFramesToReceiveInSet == 0) || (rcvrState.remainingPartitionedFramesToReceive == 0)) {
+ // TODO: ottimizzare. Qui si manda sempre un MultipleNACK
+ // vuoto!!!
+ sendMultipleNACK(rcvrState);
+ rcvrState.firstPartitionedFrameInSet += PartitionClusterAttributes.NumberOfACKFrame;
+ rcvrState.remainingPartitionedFramesToReceiveInSet = PartitionClusterAttributes.NumberOfACKFrame;
+ stopReceiverNACKTimer(rcvrState);
+
+ if (rcvrState.remainingPartitionedFramesToReceive == 0) {
+ log.debug(">> (" + System.currentTimeMillis() / 1000 + ") ALL THE FRAMES WERE RECEIVED");
+ stopReceiverTimeoutTimer(rcvrState);
+
+ IZclFrame assembledZclFrame = createAssembledZclFrame(rcvrState);
+ log.debug(">>> (" + System.currentTimeMillis() / 1000 + ") THE MESSAGE IS: " + assembledZclFrame.toString());
+ this.device.injectZclFrame((short) rcvrState.clusterId, assembledZclFrame);
+
+ // Soluzione bug
+ deleteState(rcvrState);
+
+ return true;
+ }
+ }
+
+ // Riavvia il ReceiverTimeout
+ restartReceiverTimeoutTimer(rcvrState);
+ return true;
+ }
+ }
+
+ private long calculateTxRxHash(int clusterId, IZclFrame zclFrame) {
+ long hash = clusterId;
+ hash = hash << 8;
+ return zclFrame.getSequenceNumber() & 0xFF | hash;
+ }
+
+ private State getState(int clusterId, IZclFrame zclFrame) {
+ long hash = calculateTxRxHash(clusterId, zclFrame);
+ return (State) this.states.get(new Long(hash));
+ }
+
+ private State getState(byte sequenceNumber) {
+ return (State) this.statesBySequenceNumber.get(new Integer(sequenceNumber & 0xFF));
+ }
+
+ private State createState(int clusterId, IZclFrame zclFrame) {
+ long hash = calculateTxRxHash(clusterId, zclFrame);
+ Long h = new Long(hash);
+ State state = new State(clusterId, zclFrame.getSequenceNumber());
+ this.states.put(h, state);
+ state.sequenceNumber = zclFrame.getSequenceNumber() & 0xFF;
+ this.statesBySequenceNumber.put(new Integer(state.sequenceNumber), state);
+ return state;
+ }
+
+ private void deleteState(State state) {
+ this.statesBySequenceNumber.remove(state.sequenceNumber);
+ }
+
+ protected IZclFrame handleReadHandshakeParam(int ClusterID, IZclFrame zclFrame) throws ZclValidationException {
+ ReadHandshakeParamResponse r = new ReadHandshakeParamResponse();
+
+ int size = ZclReadHandshakeParamResponse.zclSize(r);
+ IZclFrame zclResponseFrame = zclFrame.createResponseFrame(size);
+ zclResponseFrame.setCommandId(1);
+ ZclReadHandshakeParamResponse.zclSerialize(zclResponseFrame, r);
+ return zclResponseFrame;
+ }
+
+ protected IZclFrame handleWriteHandshakeParam(int clusterId, IZclFrame zclFrame) throws ZclValidationException {
+ int ClusterID = ZclDataTypeClusterID.zclParse(zclFrame);
+
+ State rcvState = getState(ClusterID, zclFrame);
+ if (rcvState == null) {
+ rcvState = createState(ClusterID, zclFrame);
+ }
+
+ log.debug(">>> (" + System.currentTimeMillis() / 1000 + ") WRITE HANDASHAKE PARAMETERS RECEIVED");
+ while (true) {
+ int attrId;
+ try {
+ attrId = ZclDataTypeUI16.zclParse(zclFrame);
+ } catch (Throwable e) {
+ log.debug(">>> (" + System.currentTimeMillis() / 1000 + ") No more attributes");
+ break;
+ }
+
+ try {
+ IZclAttributeDescriptor descriptor = this.getAttributeDescriptor(attrId);
+ short zclDataType = ZclDataTypeUI8.zclParse(zclFrame);
+ if (descriptor != null && descriptor.zclGetDataType().zclGetDataType() == zclDataType) {
+ switch (attrId) {
+ case 0x0000:
+ rcvState.MaximumIncomingTransferSize = ZclDataTypeUI16.zclParse(zclFrame);
+ log.debug(">>> (" + System.currentTimeMillis() / 1000 + ") MaximumIncomingTransferSize = " + rcvState.MaximumIncomingTransferSize);
+ break;
+
+ case 0x0001:
+ rcvState.MaximumOutgoingTransferSize = ZclDataTypeUI16.zclParse(zclFrame);
+ log.debug(">>> (" + System.currentTimeMillis() / 1000 + ") MaximumOutgoingTransferSize = " + rcvState.MaximumOutgoingTransferSize);
+ break;
+
+ case 0x0002:
+ rcvState.PartitionedFrameSize = ZclDataTypeUI8.zclParse(zclFrame);
+ log.debug(">>> (" + System.currentTimeMillis() / 1000 + ") PartitionedFrameSize = " + rcvState.PartitionedFrameSize);
+ break;
+
+ case 0x0003:
+ rcvState.LargeFrameSize = ZclDataTypeUI16.zclParse(zclFrame);
+ log.debug(">>> (" + System.currentTimeMillis() / 1000 + ") LargeFrameSize = " + rcvState.LargeFrameSize);
+ break;
+
+ case 0x0004:
+ rcvState.NumberOfACKFrame = ZclDataTypeUI8.zclParse(zclFrame);
+ log.debug(">>> (" + System.currentTimeMillis() / 1000 + ") NumberOfACKFrame = " + rcvState.NumberOfACKFrame);
+ break;
+
+ case 0x0005:
+ rcvState.NACKTimeout = ZclDataTypeUI16.zclParse(zclFrame);
+ log.warn(">>> (" + System.currentTimeMillis() / 1000 + ") WriteHanshakeParameter requested to change the dependent attribute NACKTimeout to " + rcvState.NACKTimeout);
+ break;
+
+ case 0x0006:
+ rcvState.InterframeDelay = ZclDataTypeUI8.zclParse(zclFrame);
+ log.warn(">>> (" + System.currentTimeMillis() / 1000 + ") WriteHanshakeParameter requested to change the dependent attribute InterframeDelay to " + rcvState.InterframeDelay);
+ break;
+
+ case 0x0007:
+ rcvState.NumberOfSendRetries = ZclDataTypeUI8.zclParse(zclFrame);
+ log.warn(">>> (" + System.currentTimeMillis() / 1000 + ") WriteHanshakeParameter requested to change the dependent attribute NumberOfSendRetries to " + rcvState.NumberOfSendRetries);
+ break;
+
+ case 0x0008:
+ rcvState.SenderTimeout = ZclDataTypeUI16.zclParse(zclFrame);
+ log.warn(">>> (" + System.currentTimeMillis() / 1000 + ") WriteHanshakeParameter requested to change the dependent attribute SenderTimeout to " + rcvState.SenderTimeout);
+ break;
+
+ case 0x0009:
+ rcvState.ReceiverTimeout = ZclDataTypeUI16.zclParse(zclFrame);
+ log.warn(">>> (" + System.currentTimeMillis() / 1000 + ") WriteHanshakeParameter requested to change the dependent attribute ReceiverTimeout to " + rcvState.ReceiverTimeout);
+ break;
+
+ default:
+ log.error(">>> (" + System.currentTimeMillis() / 1000 + ") Unknown attribute ID " + attrId);
+ break;
+ }
+ }
+ } catch (ZclValidationException e) {
+ continue;
+ } catch (Throwable e) {
+ log.error(">>> (" + System.currentTimeMillis() / 1000 + ") Error parsing WriteHanshakeParameters", e);
+ return null;
+ }
+ }
+
+ log.error(">>> ReceiverTimeout: " + rcvState.ReceiverTimeout + ", NACKTimeout: " + rcvState.NACKTimeout);
+
+ // recalculate dependent attributes because they might have changed.
+ rcvState.calculateDependentAttributes();
+ return null;
+ }
+
+ private void startReceiverTimeoutTimer(State state) {
+ log.debug(">>> (" + System.currentTimeMillis() / 1000 + ") Starting Receiver Timeout Timer");
+ state._timeoutTimerReceiverTask = new PartitionTimerTask(RECEIVER_TIMEOUT, state);
+ state._receiverTimerThread.schedule(state._timeoutTimerReceiverTask, PartitionClusterAttributes.ReceiverTimeout * 1000);
+ }
+
+ private void stopReceiverTimeoutTimer(State state) {
+ log.debug(">>> (" + System.currentTimeMillis() / 1000 + ") Stopping Receiver Timeout Timer");
+ if (state._timeoutTimerReceiverTask != null)
+ state._timeoutTimerReceiverTask.cancel();
+ }
+
+ private void startReceiverNACKTimer(State state) {
+ log.debug(">>> (" + System.currentTimeMillis() / 1000 + ") Starting Receiver NACK Timer");
+ state._timeoutTimerNACKTask = new PartitionTimerTask(NACK_TIMEOUT, state);
+ state._receiverTimerThread.schedule(state._timeoutTimerNACKTask, state.NACKTimeout * 1000);
+ }
+
+ private void stopReceiverNACKTimer(State state) {
+ log.debug(">>> (" + System.currentTimeMillis() / 1000 + ") Stopping Receiver NACK Timer");
+ if (state._timeoutTimerNACKTask != null)
+ state._timeoutTimerNACKTask.cancel();
+ }
+
+ private void restartReceiverTimeoutTimer(State state) {
+ stopReceiverTimeoutTimer(state);
+ startReceiverTimeoutTimer(state);
+ }
+
+ public boolean handleCluster(short clusterId, short commandId) {
+ return false;
+ }
+
+ public boolean enablePartitioning(short clusterId, short commandId) {
+ // TODO: implement it!!!
+ return true;
+ }
+
+ public boolean disablePartitioning(short clusterId, short commandId) {
+ // TODO implement it!!
+ return true;
+ }
+
+ public boolean isPartitioningEnabled(short clusterId, short commandId) {
+ // TODO: implement it!!
+ return true;
+ }
+
+ protected ZigBeeDevice getZigBeeDevice() throws ApplianceException {
+ return device;
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclPowerConfigurationClient.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclPowerConfigurationClient.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclPowerConfigurationClient.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,26 @@
+
+package it.telecomitalia.ah.zigbee.zcl.cluster.general;
+
+import it.telecomitalia.ah.cluster.zigbee.general.PowerConfigurationClient;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+
+public class ZclPowerConfigurationClient
+ extends ZclServiceCluster
+ implements PowerConfigurationClient, ZigBeeDeviceListener
+{
+
+ public final static short CLUSTER_ID = 1;
+
+ public ZclPowerConfigurationClient()
+ throws ApplianceException
+ {
+ super();
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclPowerConfigurationServer.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclPowerConfigurationServer.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclPowerConfigurationServer.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,115 @@
+
+package it.telecomitalia.ah.zigbee.zcl.cluster.general;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import it.telecomitalia.ah.cluster.zigbee.general.PowerConfigurationServer;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.IEndPointRequestContext;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.internal.zigbee.ZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZclFrame;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.IZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+public class ZclPowerConfigurationServer
+ extends ZclServiceCluster
+ implements PowerConfigurationServer, ZigBeeDeviceListener
+{
+
+ public final static short CLUSTER_ID = 1;
+ final static HashMap attributesMapByName = new HashMap();
+ final static HashMap attributesMapById = new HashMap();
+
+ static {
+ attributesMapByName.put(ZclPowerConfigurationServer.ATTR_BatteryAlarmMask_NAME, new ZclAttributeDescriptor(53, ZclPowerConfigurationServer.ATTR_BatteryAlarmMask_NAME, new ZclDataTypeUI8(), null, true, 0));
+ attributesMapByName.put(ZclPowerConfigurationServer.ATTR_BatteryVoltageMinThreshold_NAME, new ZclAttributeDescriptor(54, ZclPowerConfigurationServer.ATTR_BatteryVoltageMinThreshold_NAME, new ZclDataTypeUI8(), null, true, 0));
+ }
+
+ public ZclPowerConfigurationServer()
+ throws ApplianceException
+ {
+ super();
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(String name) {
+ return ((IZclAttributeDescriptor) attributesMapByName.get(name));
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(int id) {
+ Iterator iterator = attributesMapByName.values().iterator();
+ // FIXME: generate it and optimize!!!!
+ for (; iterator.hasNext();) {
+ IZclAttributeDescriptor attributeDescriptor = (IZclAttributeDescriptor) iterator.next();
+ if (attributeDescriptor.zclGetId() == id)
+ return attributeDescriptor;
+ }
+ return null;
+ }
+
+ public void setBatteryAlarmMask(short BatteryAlarmMask, IEndPointRequestContext context)
+ throws ApplianceException, ServiceClusterException
+ {
+ int attrId = 53;
+ int size = 3;
+ size += ZclDataTypeUI8 .zclSize(BatteryAlarmMask);
+ IZclFrame zclFrame = new ZclFrame(0, size);
+ zclFrame.appendUInt16(attrId);
+ zclFrame.appendUInt8(ZclDataTypeUI8 .ZCL_DATA_TYPE);
+ ZclDataTypeUI8 .zclSerialize(zclFrame, BatteryAlarmMask);
+ issueSet(ZclPowerConfigurationServer.CLUSTER_ID, zclFrame, attrId, context);
+ }
+
+ public short getBatteryAlarmMask(IEndPointRequestContext context)
+ throws ApplianceException, ServiceClusterException
+ {
+ if (context!= null) {
+ Short objectResult = null;
+ objectResult = ((Short) getValidCachedAttributeObject(53, context.getMaxAgeForAttributeValues()));
+ if (objectResult!= null) {
+ return objectResult.shortValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(53, context);
+ short v = ZclDataTypeUI8 .zclParse(zclFrame);
+ setCachedAttributeObject(53, new Short(v));
+ return v;
+ }
+
+ public void setBatteryVoltageMinThreshold(short BatteryVoltageMinThreshold, IEndPointRequestContext context)
+ throws ApplianceException, ServiceClusterException
+ {
+ int attrId = 54;
+ int size = 3;
+ size += ZclDataTypeUI8 .zclSize(BatteryVoltageMinThreshold);
+ IZclFrame zclFrame = new ZclFrame(0, size);
+ zclFrame.appendUInt16(attrId);
+ zclFrame.appendUInt8(ZclDataTypeUI8 .ZCL_DATA_TYPE);
+ ZclDataTypeUI8 .zclSerialize(zclFrame, BatteryVoltageMinThreshold);
+ issueSet(ZclPowerConfigurationServer.CLUSTER_ID, zclFrame, attrId, context);
+ }
+
+ public short getBatteryVoltageMinThreshold(IEndPointRequestContext context)
+ throws ApplianceException, ServiceClusterException
+ {
+ if (context!= null) {
+ Short objectResult = null;
+ objectResult = ((Short) getValidCachedAttributeObject(54, context.getMaxAgeForAttributeValues()));
+ if (objectResult!= null) {
+ return objectResult.shortValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(54, context);
+ short v = ZclDataTypeUI8 .zclParse(zclFrame);
+ setCachedAttributeObject(54, new Short(v));
+ return v;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclRemoveGroupResponse.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclRemoveGroupResponse.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclRemoveGroupResponse.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,30 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.general;
+
+import it.telecomitalia.ah.cluster.zigbee.general.RemoveGroupResponse;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeEnum8;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI16;
+
+public class ZclRemoveGroupResponse {
+
+ public static RemoveGroupResponse zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ RemoveGroupResponse r = new RemoveGroupResponse();
+ r.Status = ZclDataTypeEnum8.zclParse(zclFrame);
+ r.GroupID = ZclDataTypeUI16.zclParse(zclFrame);
+ return r;
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, RemoveGroupResponse r) throws ZclValidationException {
+ ZclDataTypeEnum8.zclSerialize(zclFrame, r.Status);
+ ZclDataTypeUI16.zclSerialize(zclFrame, r.GroupID);
+ }
+
+ public static int zclSize(RemoveGroupResponse r) throws ZclValidationException {
+ int size = 0;
+ size += ZclDataTypeEnum8.zclSize(r.Status);
+ size += ZclDataTypeUI16.zclSize(r.GroupID);
+ return size;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclTimeClient.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclTimeClient.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclTimeClient.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,161 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.general;
+
+import it.telecomitalia.ah.cluster.zigbee.general.TimeClient;
+import it.telecomitalia.ah.cluster.zigbee.general.TimeServer;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.hac.UnsupportedClusterOperationException;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZCL;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeBitmap8;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeI32;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI32;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUTCTime;
+
+public class ZclTimeClient extends ZclServiceCluster implements TimeClient, ZigBeeDeviceListener {
+
+ final static short CLUSTER_ID = 10;
+
+ public ZclTimeClient() throws ApplianceException {
+ super();
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ protected int readAttributeResponseGetSize(int attrId) throws ServiceClusterException, ZclValidationException {
+ switch (attrId) {
+ case 0x00:
+ return ZclDataTypeUTCTime.zclSize(0);
+
+ case 0x01:
+ return ZclDataTypeBitmap8.zclSize((byte) 0);
+
+ case 0x02:
+ return ZclDataTypeI32.zclSize(0);
+
+ case 0x03:
+ return ZclDataTypeUI32.zclSize(0);
+
+ case 0x04:
+ return ZclDataTypeUI32.zclSize(0);
+
+ case 0x05:
+ return ZclDataTypeI32.zclSize(0);
+
+
+ case 0x06:
+ return ZclDataTypeUI32.zclSize(0);
+
+ case 0x07:
+ return ZclDataTypeUI32.zclSize(0);
+
+ case 0x08:
+ return ZclDataTypeUTCTime.zclSize(0);
+
+ case 0x09:
+ return ZclDataTypeUTCTime.zclSize(0);
+
+ default:
+ throw new UnsupportedClusterOperationException();
+ }
+ }
+
+ protected boolean fillAttributeRecord(IZclFrame zclResponseFrame, int attrId) throws ServiceClusterException,
+ ApplianceException {
+ TimeServer c = ((TimeServer) getSinglePeerCluster((TimeServer.class.getName())));
+
+ switch (attrId) {
+ case 0x00: {
+ long v = c.getTime(null);
+ ZclDataTypeUI8.zclSerialize(zclResponseFrame, ZCL.SUCCESS);
+ zclResponseFrame.appendUInt8(ZclDataTypeUTCTime.ZCL_DATA_TYPE);
+ ZclDataTypeUTCTime.zclSerialize(zclResponseFrame, v);
+ break;
+ }
+
+ case 0x01: {
+ short v = c.getTimeStatus(null);
+ ZclDataTypeUI8.zclSerialize(zclResponseFrame, ZCL.SUCCESS);
+ zclResponseFrame.appendUInt8(ZclDataTypeBitmap8.ZCL_DATA_TYPE);
+ ZclDataTypeBitmap8.zclSerialize(zclResponseFrame, v);
+ break;
+ }
+
+ case 0x02: {
+ long v = c.getTimeZone(null);
+ ZclDataTypeUI8.zclSerialize(zclResponseFrame, ZCL.SUCCESS);
+ zclResponseFrame.appendUInt8(ZclDataTypeI32.ZCL_DATA_TYPE);
+ ZclDataTypeI32.zclSerialize(zclResponseFrame, v);
+ break;
+ }
+
+ case 0x03: {
+ long v = c.getDstStart(null);
+ ZclDataTypeUI8.zclSerialize(zclResponseFrame, ZCL.SUCCESS);
+ zclResponseFrame.appendUInt8(ZclDataTypeUI32.ZCL_DATA_TYPE);
+ ZclDataTypeUI32.zclSerialize(zclResponseFrame, v);
+ break;
+ }
+
+ case 0x04: {
+ long v = c.getDstEnd(null);
+ ZclDataTypeUI8.zclSerialize(zclResponseFrame, ZCL.SUCCESS);
+ zclResponseFrame.appendUInt8(ZclDataTypeUI32.ZCL_DATA_TYPE);
+ ZclDataTypeUI32.zclSerialize(zclResponseFrame, v);
+ break;
+ }
+
+ case 0x05: {
+ long v = c.getDstShift(null);
+ ZclDataTypeUI8.zclSerialize(zclResponseFrame, ZCL.SUCCESS);
+ zclResponseFrame.appendUInt8(ZclDataTypeI32.ZCL_DATA_TYPE);
+ ZclDataTypeI32.zclSerialize(zclResponseFrame, v);
+ break;
+ }
+
+ case 0x06: {
+ long v = c.getStandardTime(null);
+ ZclDataTypeUI8.zclSerialize(zclResponseFrame, ZCL.SUCCESS);
+ zclResponseFrame.appendUInt8(ZclDataTypeUI32.ZCL_DATA_TYPE);
+ ZclDataTypeUI32.zclSerialize(zclResponseFrame, v);
+ break;
+ }
+
+ case 0x07: {
+ long v = c.getLocalTime(null);
+ ZclDataTypeUI8.zclSerialize(zclResponseFrame, ZCL.SUCCESS);
+ zclResponseFrame.appendUInt8(ZclDataTypeUI32.ZCL_DATA_TYPE);
+ ZclDataTypeUI32.zclSerialize(zclResponseFrame, v);
+ break;
+ }
+
+ case 0x08: {
+ long v = c.getLastSetTime(null);
+ ZclDataTypeUI8.zclSerialize(zclResponseFrame, ZCL.SUCCESS);
+ zclResponseFrame.appendUInt8(ZclDataTypeUTCTime.ZCL_DATA_TYPE);
+ ZclDataTypeUTCTime.zclSerialize(zclResponseFrame, v);
+ break;
+ }
+
+ case 0x09: {
+ long v = c.getValidUntilTime(null);
+ ZclDataTypeUI8.zclSerialize(zclResponseFrame, ZCL.SUCCESS);
+ zclResponseFrame.appendUInt8(ZclDataTypeUTCTime.ZCL_DATA_TYPE);
+ ZclDataTypeUTCTime.zclSerialize(zclResponseFrame, v);
+ break;
+ }
+
+ default:
+ return false;
+ }
+
+
+ return true;
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclTimeServer.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclTimeServer.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclTimeServer.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,210 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.general;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import it.telecomitalia.ah.cluster.zigbee.general.TimeServer;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.IEndPointRequestContext;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.internal.zigbee.ZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.IZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeBitmap8;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeI32;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI32;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUTCTime;
+
+public class ZclTimeServer extends ZclServiceCluster implements TimeServer, ZigBeeDeviceListener {
+
+ public final static short CLUSTER_ID = 10;
+ final static HashMap attributesMapByName = new HashMap();
+ final static HashMap attributesMapById = new HashMap();
+
+ static {
+ attributesMapByName.put(ZclTimeServer.ATTR_Time_NAME, new ZclAttributeDescriptor(0, ZclTimeServer.ATTR_Time_NAME,
+ new ZclDataTypeUTCTime(), null, true, 1));
+ attributesMapByName.put(ZclTimeServer.ATTR_TimeStatus_NAME, new ZclAttributeDescriptor(1,
+ ZclTimeServer.ATTR_TimeStatus_NAME, new ZclDataTypeBitmap8(), null, true, 1));
+ attributesMapByName.put(ZclTimeServer.ATTR_TimeZone_NAME, new ZclAttributeDescriptor(2, ZclTimeServer.ATTR_TimeZone_NAME,
+ new ZclDataTypeI32(), null, true, 1));
+ attributesMapByName.put(ZclTimeServer.ATTR_DstStart_NAME, new ZclAttributeDescriptor(3, ZclTimeServer.ATTR_DstStart_NAME,
+ new ZclDataTypeUI32(), null, true, 1));
+ attributesMapByName.put(ZclTimeServer.ATTR_DstEnd_NAME, new ZclAttributeDescriptor(4, ZclTimeServer.ATTR_DstEnd_NAME,
+ new ZclDataTypeUI32(), null, true, 1));
+ attributesMapByName.put(ZclTimeServer.ATTR_DstShift_NAME, new ZclAttributeDescriptor(5, ZclTimeServer.ATTR_DstShift_NAME,
+ new ZclDataTypeI32(), null, true, 1));
+ attributesMapByName.put(ZclTimeServer.ATTR_StandardTime_NAME, new ZclAttributeDescriptor(6,
+ ZclTimeServer.ATTR_StandardTime_NAME, new ZclDataTypeUI32(), null, true, 1));
+ attributesMapByName.put(ZclTimeServer.ATTR_LocalTime_NAME, new ZclAttributeDescriptor(7, ZclTimeServer.ATTR_LocalTime_NAME,
+ new ZclDataTypeUI32(), null, true, 1));
+ attributesMapByName.put(ZclTimeServer.ATTR_LastSetTime_NAME, new ZclAttributeDescriptor(8,
+ ZclTimeServer.ATTR_LastSetTime_NAME, new ZclDataTypeUTCTime(), null, true, 1));
+ attributesMapByName.put(ZclTimeServer.ATTR_ValidUntilTime_NAME, new ZclAttributeDescriptor(9,
+ ZclTimeServer.ATTR_ValidUntilTime_NAME, new ZclDataTypeUTCTime(), null, true, 1));
+ }
+
+ public ZclTimeServer() throws ApplianceException {
+ super();
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(String name) {
+ return ((IZclAttributeDescriptor) attributesMapByName.get(name));
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(int id) {
+ Iterator iterator = attributesMapByName.values().iterator();
+ // FIXME: generate it and optimize!!!!
+ for (; iterator.hasNext();) {
+ IZclAttributeDescriptor attributeDescriptor = (IZclAttributeDescriptor) iterator.next();
+ if (attributeDescriptor.zclGetId() == id)
+ return attributeDescriptor;
+ }
+ return null;
+ }
+
+ public long getTime(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Long objectResult = null;
+ objectResult = ((Long) getValidCachedAttributeObject(0, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.longValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(0, context);
+ long v = ZclDataTypeUTCTime.zclParse(zclFrame);
+ setCachedAttributeObject(0, new Long(v));
+ return v;
+ }
+
+ public short getTimeStatus(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Short objectResult = null;
+ objectResult = ((Short) getValidCachedAttributeObject(1, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.shortValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(1, context);
+ short v = ZclDataTypeBitmap8.zclParse(zclFrame);
+ setCachedAttributeObject(1, new Short(v));
+ return v;
+ }
+
+ public long getTimeZone(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Long objectResult = null;
+ objectResult = ((Long) getValidCachedAttributeObject(2, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.longValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(2, context);
+ long v = ZclDataTypeI32.zclParse(zclFrame);
+ setCachedAttributeObject(2, new Long(v));
+ return v;
+ }
+
+ public long getDstStart(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Long objectResult = null;
+ objectResult = ((Long) getValidCachedAttributeObject(3, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.longValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(3, context);
+ long v = ZclDataTypeUI32.zclParse(zclFrame);
+ setCachedAttributeObject(3, new Long(v));
+ return v;
+ }
+
+ public long getDstEnd(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Long objectResult = null;
+ objectResult = ((Long) getValidCachedAttributeObject(4, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.longValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(4, context);
+ long v = ZclDataTypeUI32.zclParse(zclFrame);
+ setCachedAttributeObject(4, new Long(v));
+ return v;
+ }
+
+ public long getDstShift(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Long objectResult = null;
+ objectResult = ((Long) getValidCachedAttributeObject(5, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.longValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(5, context);
+ long v = ZclDataTypeI32.zclParse(zclFrame);
+ setCachedAttributeObject(5, new Long(v));
+ return v;
+ }
+
+ public long getStandardTime(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Long objectResult = null;
+ objectResult = ((Long) getValidCachedAttributeObject(6, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.longValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(6, context);
+ long v = ZclDataTypeUI32.zclParse(zclFrame);
+ setCachedAttributeObject(6, new Long(v));
+ return v;
+ }
+
+ public long getLocalTime(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Long objectResult = null;
+ objectResult = ((Long) getValidCachedAttributeObject(7, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.longValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(7, context);
+ long v = ZclDataTypeUI32.zclParse(zclFrame);
+ setCachedAttributeObject(7, new Long(v));
+ return v;
+ }
+
+ public long getLastSetTime(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Long objectResult = null;
+ objectResult = ((Long) getValidCachedAttributeObject(8, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.longValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(8, context);
+ long v = ZclDataTypeUTCTime.zclParse(zclFrame);
+ setCachedAttributeObject(8, new Long(v));
+ return v;
+ }
+
+ public long getValidUntilTime(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Long objectResult = null;
+ objectResult = ((Long) getValidCachedAttributeObject(9, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.longValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(9, context);
+ long v = ZclDataTypeUTCTime.zclParse(zclFrame);
+ setCachedAttributeObject(9, new Long(v));
+ return v;
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclTransferPartitionedFrameCommand.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclTransferPartitionedFrameCommand.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclTransferPartitionedFrameCommand.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,36 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.general;
+
+import it.telecomitalia.ah.cluster.zigbee.general.TransferPartitionedFrameCommand;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeEnum8;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeOctets;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI16;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+public class ZclTransferPartitionedFrameCommand {
+ public static TransferPartitionedFrameCommand zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ TransferPartitionedFrameCommand r = new TransferPartitionedFrameCommand();
+ r.FragmentationOptions = ZclDataTypeEnum8.zclParse(zclFrame);
+ // Ottiene il campo PartitionIndicator in funzione della lunghezza
+ // definita dal bit IndicatorLength all'interno del campo
+ // FragmentationOptions
+ r.PartitionIndicator = ((r.FragmentationOptions & 0x02) > 0) ? zclFrame.parseUInt16() : zclFrame.parseUInt8();
+ r.PartitionedFrame = ZclDataTypeOctets.zclParse(zclFrame);
+ return r;
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, TransferPartitionedFrameCommand r) throws ZclValidationException {
+ ZclDataTypeUI8.zclSerialize(zclFrame, r.FragmentationOptions);
+ if (r.PartitionIndicator > 0xFF)
+ ZclDataTypeUI16.zclSerialize(zclFrame, r.PartitionIndicator);
+ else
+ ZclDataTypeUI8.zclSerialize(zclFrame, (short) r.PartitionIndicator);
+ ZclDataTypeOctets.zclSerialize(zclFrame, r.PartitionedFrame);
+ }
+
+ public static int zclSize(TransferPartitionedFrameCommand r) throws ZclValidationException {
+ int size = 1 + ((r.PartitionIndicator > 0xFF) ? 2 : 1) + 1 + r.PartitionedFrame.length;
+ return size;
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclViewGroupResponse.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclViewGroupResponse.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/general/ZclViewGroupResponse.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,34 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.general;
+
+import it.telecomitalia.ah.cluster.zigbee.general.ViewGroupResponse;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeEnum8;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeString;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI16;
+
+public class ZclViewGroupResponse {
+
+ public static ViewGroupResponse zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ ViewGroupResponse r = new ViewGroupResponse();
+ r.Status = ZclDataTypeEnum8.zclParse(zclFrame);
+ r.GroupID = ZclDataTypeUI16.zclParse(zclFrame);
+ r.GroupName = ZclDataTypeString.zclParse(zclFrame);
+ return r;
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, ViewGroupResponse r) throws ZclValidationException {
+ ZclDataTypeEnum8.zclSerialize(zclFrame, r.Status);
+ ZclDataTypeUI16.zclSerialize(zclFrame, r.GroupID);
+ ZclDataTypeString.zclSerialize(zclFrame, r.GroupName);
+ }
+
+ public static int zclSize(ViewGroupResponse r) throws ZclValidationException {
+ int size = 0;
+ size += ZclDataTypeEnum8.zclSize(r.Status);
+ size += ZclDataTypeUI16.zclSize(r.GroupID);
+ size += ZclDataTypeString.zclSize(r.GroupName);
+ return size;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/hvac/ZclThermostatClient.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/hvac/ZclThermostatClient.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/hvac/ZclThermostatClient.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,20 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.hvac;
+
+import it.telecomitalia.ah.cluster.zigbee.hvac.ThermostatClient;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+
+public class ZclThermostatClient extends ZclServiceCluster implements ThermostatClient, ZigBeeDeviceListener {
+
+ final static short CLUSTER_ID = 513;
+
+ public ZclThermostatClient() throws ApplianceException {
+ super();
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/hvac/ZclThermostatServer.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/hvac/ZclThermostatServer.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/hvac/ZclThermostatServer.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,80 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.hvac;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import it.telecomitalia.ah.cluster.zigbee.hvac.ThermostatServer;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.IEndPointRequestContext;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.internal.zigbee.ZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.IZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeI16;
+
+public class ZclThermostatServer extends ZclServiceCluster implements ThermostatServer, ZigBeeDeviceListener {
+
+ final static short CLUSTER_ID = 513;
+ final static HashMap attributesMapByName = new HashMap();
+ final static HashMap attributesMapById = new HashMap();
+
+ static {
+ attributesMapByName.put(ZclThermostatServer.ATTR_LocalTemperature_NAME, new ZclAttributeDescriptor(0,
+ ZclThermostatServer.ATTR_LocalTemperature_NAME, new ZclDataTypeI16(), null, true, 1));
+ attributesMapByName.put(ZclThermostatServer.ATTR_MinCoolSetpointLimit_NAME, new ZclAttributeDescriptor(23,
+ ZclThermostatServer.ATTR_MinCoolSetpointLimit_NAME, new ZclDataTypeI16(), null, true, 1));
+ }
+
+ public ZclThermostatServer() throws ApplianceException {
+ super();
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(String name) {
+ return ((IZclAttributeDescriptor) attributesMapByName.get(name));
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(int id) {
+ Iterator iterator = attributesMapByName.values().iterator();
+ // FIXME: generate it and optimize!!!!
+ for (; iterator.hasNext();) {
+ IZclAttributeDescriptor attributeDescriptor = (IZclAttributeDescriptor) iterator.next();
+ if (attributeDescriptor.zclGetId() == id)
+ return attributeDescriptor;
+ }
+ return null;
+ }
+
+ public int getLocalTemperature(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(0, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(0, context);
+ int v = ZclDataTypeI16.zclParse(zclFrame);
+ setCachedAttributeObject(0, new Integer(v));
+ return v;
+ }
+
+ public int getMinCoolSetpointLimit(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(23, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(23, context);
+ int v = ZclDataTypeI16.zclParse(zclFrame);
+ setCachedAttributeObject(23, new Integer(v));
+ return v;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclIlluminanceMeasurementClient.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclIlluminanceMeasurementClient.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclIlluminanceMeasurementClient.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,21 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.measurement;
+
+import it.telecomitalia.ah.cluster.zigbee.measurement.IlluminanceMeasurementClient;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+
+public class ZclIlluminanceMeasurementClient extends ZclServiceCluster implements IlluminanceMeasurementClient,
+ ZigBeeDeviceListener {
+
+ public final static short CLUSTER_ID = 1024;
+
+ public ZclIlluminanceMeasurementClient() throws ApplianceException {
+ super();
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclIlluminanceMeasurementServer.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclIlluminanceMeasurementServer.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclIlluminanceMeasurementServer.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,130 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.measurement;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import it.telecomitalia.ah.cluster.zigbee.measurement.IlluminanceMeasurementServer;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.IEndPointRequestContext;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.internal.zigbee.ZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.IZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeEnum8;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeI16;
+
+public class ZclIlluminanceMeasurementServer extends ZclServiceCluster implements IlluminanceMeasurementServer,
+ ZigBeeDeviceListener {
+
+ final static short CLUSTER_ID = 1024;
+ final static HashMap attributesMapByName = new HashMap();
+ final static HashMap attributesMapById = new HashMap();
+
+ static {
+ attributesMapByName.put(ZclIlluminanceMeasurementServer.ATTR_MeasuredValue_NAME, new ZclAttributeDescriptor(0,
+ ZclIlluminanceMeasurementServer.ATTR_MeasuredValue_NAME, new ZclDataTypeI16(), null, true, 1));
+ attributesMapByName.put(ZclIlluminanceMeasurementServer.ATTR_MinMeasuredValue_NAME, new ZclAttributeDescriptor(1,
+ ZclIlluminanceMeasurementServer.ATTR_MinMeasuredValue_NAME, new ZclDataTypeI16(), null, true, 1));
+ attributesMapByName.put(ZclIlluminanceMeasurementServer.ATTR_MaxMeasuredValue_NAME, new ZclAttributeDescriptor(2,
+ ZclIlluminanceMeasurementServer.ATTR_MaxMeasuredValue_NAME, new ZclDataTypeI16(), null, true, 1));
+ attributesMapByName.put(ZclIlluminanceMeasurementServer.ATTR_Tolerance_NAME, new ZclAttributeDescriptor(3,
+ ZclIlluminanceMeasurementServer.ATTR_Tolerance_NAME, new ZclDataTypeI16(), null, true, 1));
+ attributesMapByName.put(ZclIlluminanceMeasurementServer.ATTR_LightSensorType_NAME, new ZclAttributeDescriptor(4,
+ ZclIlluminanceMeasurementServer.ATTR_LightSensorType_NAME, new ZclDataTypeEnum8(), null, true, 1));
+ }
+
+ public ZclIlluminanceMeasurementServer() throws ApplianceException {
+ super();
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(String name) {
+ return ((IZclAttributeDescriptor) attributesMapByName.get(name));
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(int id) {
+ Iterator iterator = attributesMapByName.values().iterator();
+ // FIXME: generate it and optimize!!!!
+ for (; iterator.hasNext();) {
+ IZclAttributeDescriptor attributeDescriptor = (IZclAttributeDescriptor) iterator.next();
+ if (attributeDescriptor.zclGetId() == id)
+ return attributeDescriptor;
+ }
+ return null;
+ }
+
+ public int getMeasuredValue(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(0, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(0, context);
+ int v = ZclDataTypeI16.zclParse(zclFrame);
+ setCachedAttributeObject(0, new Integer(v));
+ return v;
+ }
+
+ public int getMinMeasuredValue(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(1, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(1, context);
+ int v = ZclDataTypeI16.zclParse(zclFrame);
+ setCachedAttributeObject(1, new Integer(v));
+ return v;
+ }
+
+ public int getMaxMeasuredValue(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(2, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(2, context);
+ int v = ZclDataTypeI16.zclParse(zclFrame);
+ setCachedAttributeObject(2, new Integer(v));
+ return v;
+ }
+
+ public int getTolerance(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(3, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(3, context);
+ int v = ZclDataTypeI16.zclParse(zclFrame);
+ setCachedAttributeObject(3, new Integer(v));
+ return v;
+ }
+
+ public short getLightSensorType(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Short objectResult = null;
+ objectResult = ((Short) getValidCachedAttributeObject(4, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.shortValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(4, context);
+ short v = ZclDataTypeEnum8.zclParse(zclFrame);
+ setCachedAttributeObject(4, new Short(v));
+ return v;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclOccupancySensingClient.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclOccupancySensingClient.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclOccupancySensingClient.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,26 @@
+
+package it.telecomitalia.ah.zigbee.zcl.cluster.measurement;
+
+import it.telecomitalia.ah.cluster.zigbee.measurement.OccupancySensingClient;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+
+public class ZclOccupancySensingClient
+ extends ZclServiceCluster
+ implements OccupancySensingClient, ZigBeeDeviceListener
+{
+
+ public final static short CLUSTER_ID = 1030;
+
+ public ZclOccupancySensingClient()
+ throws ApplianceException
+ {
+ super();
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclOccupancySensingServer.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclOccupancySensingServer.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclOccupancySensingServer.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,150 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.measurement;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import it.telecomitalia.ah.cluster.zigbee.measurement.OccupancySensingServer;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.IEndPointRequestContext;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.internal.zigbee.ZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.IZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeBitmap8;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeEnum8;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+public class ZclOccupancySensingServer extends ZclServiceCluster implements OccupancySensingServer, ZigBeeDeviceListener {
+
+ public final static short CLUSTER_ID = 1030;
+ final static HashMap attributesMapByName = new HashMap();
+ final static HashMap attributesMapById = new HashMap();
+
+ static {
+ attributesMapByName.put(ZclOccupancySensingServer.ATTR_Occupancy_NAME, new ZclAttributeDescriptor(0,
+ ZclOccupancySensingServer.ATTR_Occupancy_NAME, new ZclDataTypeBitmap8(), null, true, 1));
+ attributesMapByName.put(ZclOccupancySensingServer.ATTR_OccupancySensorType_NAME, new ZclAttributeDescriptor(1,
+ ZclOccupancySensingServer.ATTR_OccupancySensorType_NAME, new ZclDataTypeEnum8(), null, true, 1));
+ attributesMapByName.put(ZclOccupancySensingServer.ATTR_PIROccupiedToUnoccupiedDelay_NAME, new ZclAttributeDescriptor(16,
+ ZclOccupancySensingServer.ATTR_PIROccupiedToUnoccupiedDelay_NAME, new ZclDataTypeUI8(), null, true, 1));
+ attributesMapByName.put(ZclOccupancySensingServer.ATTR_PIRUnccupiedToOccupiedDelay_NAME, new ZclAttributeDescriptor(17,
+ ZclOccupancySensingServer.ATTR_PIRUnccupiedToOccupiedDelay_NAME, new ZclDataTypeUI8(), null, true, 1));
+ attributesMapByName.put(ZclOccupancySensingServer.ATTR_UltraSonicOccupiedToUnoccupiedDelay_NAME,
+ new ZclAttributeDescriptor(32, ZclOccupancySensingServer.ATTR_UltraSonicOccupiedToUnoccupiedDelay_NAME,
+ new ZclDataTypeUI8(), null, true, 1));
+ attributesMapByName.put(ZclOccupancySensingServer.ATTR_UltraSonicPIRUnccupiedToOccupiedDelay_NAME,
+ new ZclAttributeDescriptor(33, ZclOccupancySensingServer.ATTR_UltraSonicPIRUnccupiedToOccupiedDelay_NAME,
+ new ZclDataTypeUI8(), null, true, 1));
+ }
+
+ public ZclOccupancySensingServer() throws ApplianceException {
+ super();
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(String name) {
+ return ((IZclAttributeDescriptor) attributesMapByName.get(name));
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(int id) {
+ Iterator iterator = attributesMapByName.values().iterator();
+ // FIXME: generate it and optimize!!!!
+ for (; iterator.hasNext();) {
+ IZclAttributeDescriptor attributeDescriptor = (IZclAttributeDescriptor) iterator.next();
+ if (attributeDescriptor.zclGetId() == id)
+ return attributeDescriptor;
+ }
+ return null;
+ }
+
+ public short getOccupancy(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Short objectResult = null;
+ objectResult = ((Short) getValidCachedAttributeObject(0, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.shortValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(0, context);
+ short v = ZclDataTypeBitmap8.zclParse(zclFrame);
+ setCachedAttributeObject(0, new Short(v));
+ return v;
+ }
+
+ public short getOccupancySensorType(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Short objectResult = null;
+ objectResult = ((Short) getValidCachedAttributeObject(1, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.shortValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(1, context);
+ short v = ZclDataTypeEnum8.zclParse(zclFrame);
+ setCachedAttributeObject(1, new Short(v));
+ return v;
+ }
+
+ public short getPIROccupiedToUnoccupiedDelay(IEndPointRequestContext context) throws ApplianceException,
+ ServiceClusterException {
+ if (context != null) {
+ Short objectResult = null;
+ objectResult = ((Short) getValidCachedAttributeObject(16, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.shortValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(16, context);
+ short v = ZclDataTypeUI8.zclParse(zclFrame);
+ setCachedAttributeObject(16, new Short(v));
+ return v;
+ }
+
+ public short getPIRUnccupiedToOccupiedDelay(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Short objectResult = null;
+ objectResult = ((Short) getValidCachedAttributeObject(17, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.shortValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(17, context);
+ short v = ZclDataTypeUI8.zclParse(zclFrame);
+ setCachedAttributeObject(17, new Short(v));
+ return v;
+ }
+
+ public short getUltraSonicOccupiedToUnoccupiedDelay(IEndPointRequestContext context) throws ApplianceException,
+ ServiceClusterException {
+ if (context != null) {
+ Short objectResult = null;
+ objectResult = ((Short) getValidCachedAttributeObject(32, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.shortValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(32, context);
+ short v = ZclDataTypeUI8.zclParse(zclFrame);
+ setCachedAttributeObject(32, new Short(v));
+ return v;
+ }
+
+ public short getUltraSonicPIRUnccupiedToOccupiedDelay(IEndPointRequestContext context) throws ApplianceException,
+ ServiceClusterException {
+ if (context != null) {
+ Short objectResult = null;
+ objectResult = ((Short) getValidCachedAttributeObject(33, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.shortValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(33, context);
+ short v = ZclDataTypeUI8.zclParse(zclFrame);
+ setCachedAttributeObject(33, new Short(v));
+ return v;
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclRelativeHumidityMeasurementClient.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclRelativeHumidityMeasurementClient.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclRelativeHumidityMeasurementClient.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,21 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.measurement;
+
+import it.telecomitalia.ah.cluster.zigbee.measurement.RelativeHumidityMeasurementClient;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+
+public class ZclRelativeHumidityMeasurementClient extends ZclServiceCluster implements RelativeHumidityMeasurementClient,
+ ZigBeeDeviceListener {
+
+ final static short CLUSTER_ID = 1029;
+
+ public ZclRelativeHumidityMeasurementClient() throws ApplianceException {
+ super();
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclRelativeHumidityMeasurementServer.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclRelativeHumidityMeasurementServer.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclRelativeHumidityMeasurementServer.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,113 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.measurement;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import it.telecomitalia.ah.cluster.zigbee.measurement.RelativeHumidityMeasurementServer;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.IEndPointRequestContext;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.internal.zigbee.ZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.IZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI16;
+
+public class ZclRelativeHumidityMeasurementServer extends ZclServiceCluster implements RelativeHumidityMeasurementServer,
+ ZigBeeDeviceListener {
+
+ final static short CLUSTER_ID = 1029;
+ final static HashMap attributesMapByName = new HashMap();
+ final static HashMap attributesMapById = new HashMap();
+
+ static {
+ attributesMapByName.put(ZclRelativeHumidityMeasurementServer.ATTR_MeasuredValue_NAME, new ZclAttributeDescriptor(0,
+ ZclRelativeHumidityMeasurementServer.ATTR_MeasuredValue_NAME, new ZclDataTypeUI16(), null, true, 1));
+ attributesMapByName.put(ZclRelativeHumidityMeasurementServer.ATTR_MinMeasuredValue_NAME, new ZclAttributeDescriptor(1,
+ ZclRelativeHumidityMeasurementServer.ATTR_MinMeasuredValue_NAME, new ZclDataTypeUI16(), null, true, 1));
+ attributesMapByName.put(ZclRelativeHumidityMeasurementServer.ATTR_MaxMeasuredValue_NAME, new ZclAttributeDescriptor(2,
+ ZclRelativeHumidityMeasurementServer.ATTR_MaxMeasuredValue_NAME, new ZclDataTypeUI16(), null, true, 1));
+ attributesMapByName.put(ZclRelativeHumidityMeasurementServer.ATTR_Tolerance_NAME, new ZclAttributeDescriptor(3,
+ ZclRelativeHumidityMeasurementServer.ATTR_Tolerance_NAME, new ZclDataTypeUI16(), null, true, 1));
+ }
+
+ public ZclRelativeHumidityMeasurementServer() throws ApplianceException {
+ super();
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(String name) {
+ return ((IZclAttributeDescriptor) attributesMapByName.get(name));
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(int id) {
+ Iterator iterator = attributesMapByName.values().iterator();
+ // FIXME: generate it and optimize!!!!
+ for (; iterator.hasNext();) {
+ IZclAttributeDescriptor attributeDescriptor = (IZclAttributeDescriptor) iterator.next();
+ if (attributeDescriptor.zclGetId() == id)
+ return attributeDescriptor;
+ }
+ return null;
+ }
+
+ public int getMeasuredValue(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(0, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(0, context);
+ int v = ZclDataTypeUI16.zclParse(zclFrame);
+ setCachedAttributeObject(0, new Integer(v));
+ return v;
+ }
+
+ public int getMinMeasuredValue(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(1, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(1, context);
+ int v = ZclDataTypeUI16.zclParse(zclFrame);
+ setCachedAttributeObject(1, new Integer(v));
+ return v;
+ }
+
+ public int getMaxMeasuredValue(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(2, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(2, context);
+ int v = ZclDataTypeUI16.zclParse(zclFrame);
+ setCachedAttributeObject(2, new Integer(v));
+ return v;
+ }
+
+ public int getTolerance(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(3, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(3, context);
+ int v = ZclDataTypeUI16.zclParse(zclFrame);
+ setCachedAttributeObject(3, new Integer(v));
+ return v;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclTemperatureMeasurementClient.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclTemperatureMeasurementClient.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclTemperatureMeasurementClient.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,21 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.measurement;
+
+import it.telecomitalia.ah.cluster.zigbee.measurement.TemperatureMeasurementClient;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+
+public class ZclTemperatureMeasurementClient extends ZclServiceCluster implements TemperatureMeasurementClient,
+ ZigBeeDeviceListener {
+
+ public final static short CLUSTER_ID = 1026;
+
+ public ZclTemperatureMeasurementClient() throws ApplianceException {
+ super();
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclTemperatureMeasurementServer.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclTemperatureMeasurementServer.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/measurement/ZclTemperatureMeasurementServer.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,114 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.measurement;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import it.telecomitalia.ah.cluster.zigbee.measurement.TemperatureMeasurementServer;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.IEndPointRequestContext;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.internal.zigbee.ZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.IZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeI16;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI16;
+
+public class ZclTemperatureMeasurementServer extends ZclServiceCluster implements TemperatureMeasurementServer,
+ ZigBeeDeviceListener {
+
+ final static short CLUSTER_ID = 1026;
+ final static HashMap attributesMapByName = new HashMap();
+ final static HashMap attributesMapById = new HashMap();
+
+ static {
+ attributesMapByName.put(ZclTemperatureMeasurementServer.ATTR_MeasuredValue_NAME, new ZclAttributeDescriptor(0,
+ ZclTemperatureMeasurementServer.ATTR_MeasuredValue_NAME, new ZclDataTypeI16(), null, true, 1));
+ attributesMapByName.put(ZclTemperatureMeasurementServer.ATTR_MinMeasuredValue_NAME, new ZclAttributeDescriptor(1,
+ ZclTemperatureMeasurementServer.ATTR_MinMeasuredValue_NAME, new ZclDataTypeI16(), null, true, 1));
+ attributesMapByName.put(ZclTemperatureMeasurementServer.ATTR_MaxMeasuredValue_NAME, new ZclAttributeDescriptor(2,
+ ZclTemperatureMeasurementServer.ATTR_MaxMeasuredValue_NAME, new ZclDataTypeI16(), null, true, 1));
+ attributesMapByName.put(ZclTemperatureMeasurementServer.ATTR_Tolerance_NAME, new ZclAttributeDescriptor(3,
+ ZclTemperatureMeasurementServer.ATTR_Tolerance_NAME, new ZclDataTypeUI16(), null, true, 1));
+ }
+
+ public ZclTemperatureMeasurementServer() throws ApplianceException {
+ super();
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(String name) {
+ return ((IZclAttributeDescriptor) attributesMapByName.get(name));
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(int id) {
+ Iterator iterator = attributesMapByName.values().iterator();
+ // FIXME: generate it and optimize!!!!
+ for (; iterator.hasNext();) {
+ IZclAttributeDescriptor attributeDescriptor = (IZclAttributeDescriptor) iterator.next();
+ if (attributeDescriptor.zclGetId() == id)
+ return attributeDescriptor;
+ }
+ return null;
+ }
+
+ public int getMeasuredValue(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(0, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(0, context);
+ int v = ZclDataTypeI16.zclParse(zclFrame);
+ setCachedAttributeObject(0, new Integer(v));
+ return v;
+ }
+
+ public int getMinMeasuredValue(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(1, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(1, context);
+ int v = ZclDataTypeI16.zclParse(zclFrame);
+ setCachedAttributeObject(1, new Integer(v));
+ return v;
+ }
+
+ public int getMaxMeasuredValue(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(2, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(2, context);
+ int v = ZclDataTypeI16.zclParse(zclFrame);
+ setCachedAttributeObject(2, new Integer(v));
+ return v;
+ }
+
+ public int getTolerance(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(3, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(3, context);
+ int v = ZclDataTypeUI16.zclParse(zclFrame);
+ setCachedAttributeObject(3, new Integer(v));
+ return v;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/metering/ZclSimpleMeteringClient.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/metering/ZclSimpleMeteringClient.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/metering/ZclSimpleMeteringClient.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,69 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.metering;
+
+import it.telecomitalia.ah.cluster.zigbee.metering.SimpleMeteringClient;
+import it.telecomitalia.ah.cluster.zigbee.metering.SimpleMeteringServer;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.hac.UnsupportedClusterOperationException;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZCL;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeBitmap8;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeI24;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+public class ZclSimpleMeteringClient extends ZclServiceCluster implements SimpleMeteringClient, ZigBeeDeviceListener {
+
+ public final static short CLUSTER_ID = 1794;
+
+ public ZclSimpleMeteringClient() throws ApplianceException {
+ super();
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ protected int readAttributeResponseGetSize(int attrId) throws ServiceClusterException, ZclValidationException {
+ switch (attrId) {
+
+ case 0x0304:
+ return ZclDataTypeBitmap8.zclSize((short) 0);
+
+ case 0x0400:
+ return ZclDataTypeI24.zclSize(0);
+
+ default:
+ throw new UnsupportedClusterOperationException();
+ }
+ }
+
+ protected boolean fillAttributeRecord(IZclFrame zclResponseFrame, int attrId) throws ServiceClusterException,
+ ApplianceException {
+ SimpleMeteringServer c = ((SimpleMeteringServer) getSinglePeerCluster((SimpleMeteringServer.class.getName())));
+
+ switch (attrId) {
+ case 0x0304: {
+ short v = c.getDemandFormatting(null);
+ ZclDataTypeUI8.zclSerialize(zclResponseFrame, ZCL.SUCCESS);
+ zclResponseFrame.appendUInt8(ZclDataTypeBitmap8.ZCL_DATA_TYPE);
+ ZclDataTypeBitmap8.zclSerialize(zclResponseFrame, v);
+ break;
+ }
+ case 0x0400: {
+ int v = c.getIstantaneousDemand(null);
+ ZclDataTypeUI8.zclSerialize(zclResponseFrame, ZCL.SUCCESS);
+ zclResponseFrame.appendUInt8(ZclDataTypeI24.ZCL_DATA_TYPE);
+ ZclDataTypeI24.zclSerialize(zclResponseFrame, v);
+ break;
+ }
+
+ default:
+ return false;
+ }
+
+ return true;
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/metering/ZclSimpleMeteringServer.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/metering/ZclSimpleMeteringServer.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/metering/ZclSimpleMeteringServer.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,180 @@
+package it.telecomitalia.ah.zigbee.zcl.cluster.metering;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import it.telecomitalia.ah.cluster.zigbee.metering.SimpleMeteringServer;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.IEndPointRequestContext;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.internal.zigbee.ZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.IZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeBitmap8;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeEnum8;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeI24;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeI8;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI48;
+
+public class ZclSimpleMeteringServer extends ZclServiceCluster implements SimpleMeteringServer, ZigBeeDeviceListener {
+
+ public final static short CLUSTER_ID = 1794;
+ final static HashMap attributesMapByName = new HashMap();
+ final static HashMap attributesMapById = new HashMap();
+
+ static {
+ attributesMapByName.put(ZclSimpleMeteringServer.ATTR_CurrentSummationDelivered_NAME, new ZclAttributeDescriptor(0,
+ ZclSimpleMeteringServer.ATTR_CurrentSummationDelivered_NAME, new ZclDataTypeUI48(), null, true, 1));
+ attributesMapByName.put(ZclSimpleMeteringServer.ATTR_PowerFactor_NAME, new ZclAttributeDescriptor(6,
+ ZclSimpleMeteringServer.ATTR_PowerFactor_NAME, new ZclDataTypeI8(), null, true, 1));
+ attributesMapByName.put(ZclSimpleMeteringServer.ATTR_Status_NAME, new ZclAttributeDescriptor(512,
+ ZclSimpleMeteringServer.ATTR_Status_NAME, new ZclDataTypeBitmap8(), null, true, 1));
+ attributesMapByName.put(ZclSimpleMeteringServer.ATTR_UnitOfMeasure_NAME, new ZclAttributeDescriptor(768,
+ ZclSimpleMeteringServer.ATTR_UnitOfMeasure_NAME, new ZclDataTypeEnum8(), null, true, 1));
+ attributesMapByName.put(ZclSimpleMeteringServer.ATTR_SummationFormatting_NAME, new ZclAttributeDescriptor(771,
+ ZclSimpleMeteringServer.ATTR_SummationFormatting_NAME, new ZclDataTypeBitmap8(), null, true, 1));
+ attributesMapByName.put(ZclSimpleMeteringServer.ATTR_DemandFormatting_NAME, new ZclAttributeDescriptor(772,
+ ZclSimpleMeteringServer.ATTR_DemandFormatting_NAME, new ZclDataTypeBitmap8(), null, true, 1));
+ attributesMapByName.put(ZclSimpleMeteringServer.ATTR_MeteringDeviceType_NAME, new ZclAttributeDescriptor(774,
+ ZclSimpleMeteringServer.ATTR_MeteringDeviceType_NAME, new ZclDataTypeBitmap8(), null, true, 1));
+ attributesMapByName.put(ZclSimpleMeteringServer.ATTR_IstantaneousDemand_NAME, new ZclAttributeDescriptor(1024,
+ ZclSimpleMeteringServer.ATTR_IstantaneousDemand_NAME, new ZclDataTypeI24(), null, true, 1));
+ }
+
+ public ZclSimpleMeteringServer() throws ApplianceException {
+ super();
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(String name) {
+ return ((IZclAttributeDescriptor) attributesMapByName.get(name));
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(int id) {
+ Iterator iterator = attributesMapByName.values().iterator();
+ // FIXME: generate it and optimize!!!!
+ for (; iterator.hasNext();) {
+ IZclAttributeDescriptor attributeDescriptor = (IZclAttributeDescriptor) iterator.next();
+ if (attributeDescriptor.zclGetId() == id)
+ return attributeDescriptor;
+ }
+ return null;
+ }
+
+ public long getCurrentSummationDelivered(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Long objectResult = null;
+ objectResult = ((Long) getValidCachedAttributeObject(0, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.longValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(0, context);
+ long v = ZclDataTypeUI48.zclParse(zclFrame);
+ setCachedAttributeObject(0, new Long(v));
+ return v;
+ }
+
+ public short getPowerFactor(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Short objectResult = null;
+ objectResult = ((Short) getValidCachedAttributeObject(6, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.shortValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(6, context);
+ short v = ZclDataTypeI8.zclParse(zclFrame);
+ setCachedAttributeObject(6, new Short(v));
+ return v;
+ }
+
+ public short getStatus(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Short objectResult = null;
+ objectResult = ((Short) getValidCachedAttributeObject(512, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.shortValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(512, context);
+ short v = ZclDataTypeBitmap8.zclParse(zclFrame);
+ setCachedAttributeObject(512, new Short(v));
+ return v;
+ }
+
+ public short getUnitOfMeasure(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Short objectResult = null;
+ objectResult = ((Short) getValidCachedAttributeObject(768, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.shortValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(768, context);
+ short v = ZclDataTypeEnum8.zclParse(zclFrame);
+ setCachedAttributeObject(768, new Short(v));
+ return v;
+ }
+
+ public short getSummationFormatting(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Short objectResult = null;
+ objectResult = ((Short) getValidCachedAttributeObject(771, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.shortValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(771, context);
+ short v = ZclDataTypeBitmap8.zclParse(zclFrame);
+ setCachedAttributeObject(771, new Short(v));
+ return v;
+ }
+
+ public short getDemandFormatting(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Short objectResult = null;
+ objectResult = ((Short) getValidCachedAttributeObject(772, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.shortValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(772, context);
+ short v = ZclDataTypeBitmap8.zclParse(zclFrame);
+ setCachedAttributeObject(772, new Short(v));
+ return v;
+ }
+
+ public short getMeteringDeviceType(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Short objectResult = null;
+ objectResult = ((Short) getValidCachedAttributeObject(774, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.shortValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(774, context);
+ short v = ZclDataTypeBitmap8.zclParse(zclFrame);
+ setCachedAttributeObject(774, new Short(v));
+ return v;
+ }
+
+ public int getIstantaneousDemand(IEndPointRequestContext context) throws ApplianceException, ServiceClusterException {
+ if (context != null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(1024, context.getMaxAgeForAttributeValues()));
+ if (objectResult != null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(1024, context);
+ int v = ZclDataTypeI24.zclParse(zclFrame);
+ setCachedAttributeObject(1024, new Integer(v));
+ return v;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/security/ZclIASZoneClient.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/security/ZclIASZoneClient.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/security/ZclIASZoneClient.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,61 @@
+
+package it.telecomitalia.ah.zigbee.zcl.cluster.security;
+
+import it.telecomitalia.ah.cluster.zigbee.security.IASZoneClient;
+import it.telecomitalia.ah.cluster.zigbee.security.ZoneEnrollResponse;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.IEndPointRequestContext;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZclFrame;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeEnum16;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeEnum8;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI16;
+
+public class ZclIASZoneClient
+ extends ZclServiceCluster
+ implements IASZoneClient, ZigBeeDeviceListener
+{
+
+ public final static short CLUSTER_ID = 1280;
+
+ public ZclIASZoneClient()
+ throws ApplianceException
+ {
+ super();
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ public void execZoneStatusChangeNotification(int ZoneStatus, short ExtendedStatus, IEndPointRequestContext context)
+ throws ApplianceException, ServiceClusterException
+ {
+ int size = 0;
+ size += ZclDataTypeEnum16 .zclSize(ZoneStatus);
+ size += ZclDataTypeEnum8 .zclSize(ExtendedStatus);
+ ZclFrame zclFrame = new ZclFrame(1, size);
+ zclFrame.setCommandId(0);
+ ZclDataTypeEnum16 .zclSerialize(zclFrame, ZoneStatus);
+ ZclDataTypeEnum8 .zclSerialize(zclFrame, ExtendedStatus);
+ issueExec(zclFrame, 11, context);
+ }
+
+ public ZoneEnrollResponse execZoneEnrollRequest(int ZoneType, int ManufacturerCode, IEndPointRequestContext context)
+ throws ApplianceException, ServiceClusterException
+ {
+ int size = 0;
+ size += ZclDataTypeEnum16 .zclSize(ZoneType);
+ size += ZclDataTypeUI16 .zclSize(ManufacturerCode);
+ ZclFrame zclFrame = new ZclFrame(1, size);
+ zclFrame.setCommandId(1);
+ ZclDataTypeEnum16 .zclSerialize(zclFrame, ZoneType);
+ ZclDataTypeUI16 .zclSerialize(zclFrame, ManufacturerCode);
+ IZclFrame zclResponseFrame = issueExec(zclFrame, 0, context);
+ return (ZclZoneEnrollResponse.zclParse(zclResponseFrame));
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/security/ZclIASZoneServer.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/security/ZclIASZoneServer.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/security/ZclIASZoneServer.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,171 @@
+
+package it.telecomitalia.ah.zigbee.zcl.cluster.security;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import it.telecomitalia.ah.cluster.zigbee.security.IASZoneClient;
+import it.telecomitalia.ah.cluster.zigbee.security.IASZoneServer;
+import it.telecomitalia.ah.cluster.zigbee.security.ZoneEnrollResponse;
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.IEndPointRequestContext;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.internal.zigbee.ZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZCL;
+import it.telecomitalia.ah.zigbee.ZigBeeDevice;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.IZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.ZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeBitmap16;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeEnum16;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeEnum8;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI16;
+
+public class ZclIASZoneServer
+ extends ZclServiceCluster
+ implements IASZoneServer, ZigBeeDeviceListener
+{
+
+ public final static short CLUSTER_ID = 1280;
+ final static HashMap attributesMapByName = new HashMap();
+ final static HashMap attributesMapById = new HashMap();
+
+ static {
+ attributesMapByName.put(ZclIASZoneServer.ATTR_ZoneState_NAME, new ZclAttributeDescriptor(0, ZclIASZoneServer.ATTR_ZoneState_NAME, new ZclDataTypeEnum8(), null, true, 1));
+ attributesMapByName.put(ZclIASZoneServer.ATTR_ZoneType_NAME, new ZclAttributeDescriptor(1, ZclIASZoneServer.ATTR_ZoneType_NAME, new ZclDataTypeEnum16(), null, true, 1));
+ attributesMapByName.put(ZclIASZoneServer.ATTR_ZoneStatus_NAME, new ZclAttributeDescriptor(2, ZclIASZoneServer.ATTR_ZoneStatus_NAME, new ZclDataTypeBitmap16(), null, true, 1));
+ }
+
+ public ZclIASZoneServer()
+ throws ApplianceException
+ {
+ super();
+ }
+
+ public boolean notifyZclFrame(short clusterId, IZclFrame zclFrame)
+ throws Exception
+ {
+ boolean handled;
+ handled = super.notifyZclFrame(clusterId, zclFrame);
+ if (handled) {
+ return handled;
+ }
+ int commandId = zclFrame.getCommandId();
+ if (zclFrame.isClientToServer()) {
+ throw new ZclValidationException("invalid direction field");
+ }
+ IZclFrame responseZclFrame = null;
+ ZigBeeDevice device = getZigBeeDevice();
+ int statusCode = ZCL.SUCCESS;
+ IASZoneClient c = ((IASZoneClient) getSinglePeerCluster((IASZoneClient.class.getName())));
+ switch (commandId) {
+ case 0 :
+ responseZclFrame = parseZoneStatusChangeNotification(c, zclFrame);
+ break;
+ case 1 :
+ responseZclFrame = parseZoneEnrollRequest(c, zclFrame);
+ break;
+ }
+ if (responseZclFrame == null) {
+ if (!zclFrame.isDefaultResponseDisabled()) {
+ responseZclFrame = getDefaultResponse(zclFrame, statusCode);
+ }
+ }
+ if (!(responseZclFrame == null)) {
+ device.post(ZclIASZoneServer.CLUSTER_ID, responseZclFrame);
+ return true;
+ }
+ return false;
+ }
+
+ protected int getClusterId() {
+ return CLUSTER_ID;
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(String name) {
+ return ((IZclAttributeDescriptor) attributesMapByName.get(name));
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(int id) {
+ Iterator iterator = attributesMapByName.values().iterator();
+ // FIXME: generate it and optimize!!!!
+ for (; iterator.hasNext();) {
+ IZclAttributeDescriptor attributeDescriptor = (IZclAttributeDescriptor) iterator.next();
+ if (attributeDescriptor.zclGetId() == id)
+ return attributeDescriptor;
+ }
+ return null;
+ }
+
+ protected IZclFrame parseZoneStatusChangeNotification(IASZoneClient o, IZclFrame zclFrame)
+ throws ApplianceException, ServiceClusterException
+ {
+ int ZoneStatus = ZclDataTypeEnum16 .zclParse(zclFrame);
+ short ExtendedStatus = ZclDataTypeEnum8 .zclParse(zclFrame);
+ o.execZoneStatusChangeNotification(ZoneStatus, ExtendedStatus, null);
+ return null;
+ }
+
+ protected IZclFrame parseZoneEnrollRequest(IASZoneClient o, IZclFrame zclFrame)
+ throws ApplianceException, ServiceClusterException
+ {
+ int ZoneType = ZclDataTypeEnum16 .zclParse(zclFrame);
+ int ManufacturerCode = ZclDataTypeUI16 .zclParse(zclFrame);
+ ZoneEnrollResponse r = o.execZoneEnrollRequest(ZoneType, ManufacturerCode, null);
+ int size = ZclZoneEnrollResponse.zclSize(r);
+ IZclFrame zclResponseFrame = zclFrame.createResponseFrame(size);
+ zclResponseFrame.setCommandId(0);
+ ZclZoneEnrollResponse.zclSerialize(zclResponseFrame, r);
+ return zclResponseFrame;
+ }
+
+ public short getZoneState(IEndPointRequestContext context)
+ throws ApplianceException, ServiceClusterException
+ {
+ if (context!= null) {
+ Short objectResult = null;
+ objectResult = ((Short) getValidCachedAttributeObject(0, context.getMaxAgeForAttributeValues()));
+ if (objectResult!= null) {
+ return objectResult.shortValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(0, context);
+ short v = ZclDataTypeEnum8 .zclParse(zclFrame);
+ setCachedAttributeObject(0, new Short(v));
+ return v;
+ }
+
+ public int getZoneType(IEndPointRequestContext context)
+ throws ApplianceException, ServiceClusterException
+ {
+ if (context!= null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(1, context.getMaxAgeForAttributeValues()));
+ if (objectResult!= null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(1, context);
+ int v = ZclDataTypeEnum16 .zclParse(zclFrame);
+ setCachedAttributeObject(1, new Integer(v));
+ return v;
+ }
+
+ public int getZoneStatus(IEndPointRequestContext context)
+ throws ApplianceException, ServiceClusterException
+ {
+ if (context!= null) {
+ Integer objectResult = null;
+ objectResult = ((Integer) getValidCachedAttributeObject(2, context.getMaxAgeForAttributeValues()));
+ if (objectResult!= null) {
+ return objectResult.intValue();
+ }
+ }
+ IZclFrame zclFrame = readAttribute(2, context);
+ int v = ZclDataTypeBitmap16 .zclParse(zclFrame);
+ setCachedAttributeObject(2, new Integer(v));
+ return v;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/security/ZclZoneEnrollResponse.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/security/ZclZoneEnrollResponse.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/cluster/security/ZclZoneEnrollResponse.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,38 @@
+
+package it.telecomitalia.ah.zigbee.zcl.cluster.security;
+
+import it.telecomitalia.ah.cluster.zigbee.security.ZoneEnrollResponse;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeEnum8;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+public class ZclZoneEnrollResponse {
+
+
+ public static ZoneEnrollResponse zclParse(IZclFrame zclFrame)
+ throws ZclValidationException
+ {
+ ZoneEnrollResponse r = new ZoneEnrollResponse();
+ r.EnrollResponseCode = ZclDataTypeEnum8 .zclParse(zclFrame);
+ r.ZoneID = ZclDataTypeUI8 .zclParse(zclFrame);
+ return r;
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, ZoneEnrollResponse r)
+ throws ZclValidationException
+ {
+ ZclDataTypeEnum8 .zclSerialize(zclFrame, r.EnrollResponseCode);
+ ZclDataTypeUI8 .zclSerialize(zclFrame, r.ZoneID);
+ }
+
+ public static int zclSize(ZoneEnrollResponse r)
+ throws ZclValidationException
+ {
+ int size = 0;
+ size += ZclDataTypeEnum8 .zclSize(r.EnrollResponseCode);
+ size += ZclDataTypeUI8 .zclSize(r.ZoneID);
+ return size;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/ZclAppliance.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/ZclAppliance.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/ZclAppliance.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,199 @@
+package it.telecomitalia.ah.zigbee.zcl.lib;
+
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.IEndPoint;
+import it.telecomitalia.ah.hac.IHacDevice;
+import it.telecomitalia.ah.hac.IServiceCluster;
+import it.telecomitalia.ah.hac.lib.DriverAppliance;
+import it.telecomitalia.ah.internal.zigbee.ZigBeeManagerImpl;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZigBeeDevice;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.zcl.IZclAppliance;
+import it.telecomitalia.ah.zigbee.zcl.IZclServiceCluster;
+import it.telecomitalia.zgd.jaxb.ServiceDescriptor;
+
+import java.util.Dictionary;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+public abstract class ZclAppliance extends DriverAppliance implements IZclAppliance, ZigBeeDeviceListener {
+
+ private static final Log log = LogFactory.getLog(ZclAppliance.class);
+
+ private String nodeMacAddress = null;
+ private int attachedDevices = 0;
+
+ public ZclAppliance(String pid, Dictionary config) throws ApplianceException {
+ super(pid, config);
+ this.setAvailability(false);
+ }
+
+ public String zclGetNodeMacAddress() {
+ return nodeMacAddress;
+ }
+
+ public synchronized void attach(IHacDevice device) {
+ ZigBeeDevice zclDevice = (ZigBeeDevice) device;
+ ServiceDescriptor service = zclDevice.getServiceDescriptor();
+ int deviceId = service.getSimpleDescriptor().getApplicationDeviceIdentifier().intValue();
+ int profileId = service.getSimpleDescriptor().getApplicationProfileIdentifier().intValue();
+ int endPointId = service.getEndPoint();
+ if (nodeMacAddress == null)
+ nodeMacAddress = ZigBeeManagerImpl.getIeeeAddressHex(zclDevice.getNodeServices().getAddress());
+
+ // FIXME: read manufacturer code somewhere
+ ZclEndPoint serviceEndPoint = null;
+ try {
+ serviceEndPoint = this.zclGetEndPoint(profileId, deviceId, endPointId, 0);
+ } catch (ApplianceException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ if (serviceEndPoint == null) {
+ log.error("attaching device but no valid end point found");
+ return;
+ }
+ serviceEndPoint.zclSetZigBeeDevice(zclDevice);
+ String[] clusterEndPoints = serviceEndPoint.getServiceClusterNames();
+ for (int j = 0; j < clusterEndPoints.length; j++) {
+ IServiceCluster serviceCluster = serviceEndPoint.getServiceCluster(clusterEndPoints[j]);
+
+ try {
+ if (serviceCluster instanceof IZclServiceCluster)
+ ((IZclServiceCluster) serviceCluster).zclAttach(zclDevice);
+ } catch (Exception e) {
+ log.error("attaching clusterEndPoint to device in ZclAppliance ");
+ continue;
+ }
+ }
+ attachedDevices++;
+ if (attachedDevices == zclDevice.getNodeServices().getActiveEndpoints().size()) {
+ attached();
+ this.setAvailability(true);
+ }
+ zclDevice.setListener(this);
+ }
+
+ public synchronized void detach(IHacDevice device) throws ApplianceException {
+ ZigBeeDevice zclDevice = (ZigBeeDevice) device;
+ if (this.isAvailable()) {
+ this.setAvailability(false);
+ }
+ attachedDevices--;
+
+ IEndPoint[] serviceEndPoints = this.getEndPoints();
+ IEndPoint serviceEndPoint = null;
+ ZigBeeDevice attachedDevice = null;
+ for (int i = 0; i < serviceEndPoints.length; i++) {
+ serviceEndPoint = serviceEndPoints[i];
+ if (serviceEndPoint instanceof ZclEndPoint &&
+ (attachedDevice = ((ZclEndPoint)serviceEndPoint).zclGetZigBeeDevice()) != null &&
+ attachedDevice.getServiceDescriptor().getEndPoint() == zclDevice.getServiceDescriptor().getEndPoint()) {
+ ((ZclEndPoint)serviceEndPoint).zclSetZigBeeDevice(null);
+ String[] clusterEndPoints = serviceEndPoint.getServiceClusterNames();
+ for (int j = 0; j < clusterEndPoints.length; j++) {
+ IServiceCluster serviceCluster = serviceEndPoint.getServiceCluster(clusterEndPoints[j]);
+ try {
+ if (serviceCluster instanceof IZclServiceCluster)
+ ((IZclServiceCluster) serviceCluster).zclDetach(zclDevice);
+ } catch (Exception e) {
+ log.error("detaching clusterEndPoint to device in ZclAppliance ");
+ continue;
+ }
+ }
+ break;
+ }
+ }
+ zclDevice.removeListener(this);
+ detached();
+ }
+
+ public ZclEndPoint zclAddEndPoint(String endPointType) throws ApplianceException {
+ return (ZclEndPoint) this.addEndPoint(new ZclEndPoint(endPointType));
+ }
+
+ public ZclEndPoint zclAddEndPoint(String endPointType, int endPointId) throws ApplianceException {
+ return (ZclEndPoint) this.addEndPoint(new ZclEndPoint(endPointType), endPointId);
+ }
+
+ // protected synchronized void detach(Device d) {
+ // if (this.zclDevice == d) {
+ // this.setAvailability(false);
+ // IEndPoint[] serviceEndPoints = this.getEndPoints();
+ // for (int i = 0; i < serviceEndPoints.length; i++) {
+ // IEndPoint serviceEndPoint = serviceEndPoints[i];
+ //
+ // String[] clusterEndPoints = serviceEndPoint.getServiceClusterNames();
+ // for (int j = 0; j < clusterEndPoints.length; j++) {
+ //
+ // IServiceCluster serviceCluster =
+ // serviceEndPoint.getServiceCluster(clusterEndPoints[j]);
+ // if (serviceCluster instanceof IZclServiceCluster)
+ // ((IZclServiceCluster) serviceCluster).zclDetach(this.zclDevice);
+ // }
+ // }
+ //
+ // this.zclDevice.removeListener(this);
+ //
+ // detached();
+ //
+ // this.setAvailability(false);
+ // this.statusUpdated();
+ // }
+ // }
+
+// protected synchronized final void removeAttachedDevices() {
+// IEndPoint[] zclEndPoints = getEndPoints();
+// ZigBeeDevice device = null;
+// for (int i = 1; i < zclEndPoints.length; i++) {
+// device = ((ZclEndPoint)zclEndPoints[i]).zclGetZigBeeDevice();
+// if (device != null)
+// device.remove();
+// }
+// }
+
+
+
+ protected void attached() {
+ log.debug("attached");
+ }
+
+ protected void detached() {
+ log.debug("detached");
+ }
+
+ protected ZclEndPoint zclGetEndPoint(int profile_id, int device_id, int end_point_id, int manufacturer_code) throws ApplianceException {
+ ZclEndPoint endPoint = (ZclEndPoint) getEndPoint(end_point_id);
+ if (endPoint == null)
+ // TODO: !!!Pino controlla dove viene usato default end point id 1 nella logica applicativa
+ endPoint = (ZclEndPoint)getEndPoint(IEndPoint.DEFAULT_END_POINT_ID);
+ return endPoint;
+ }
+
+ public void notifyEvent(int event) {
+ if (event == ZigBeeDeviceListener.ANNOUNCEMENT) {
+ log.debug("ZclAppliance " + this.getPid() + " received an announcement");
+ // if the availability is already true don't update it!
+ if (this.isAvailable()) {
+ return;
+ }
+
+ this.setAvailability(true);
+ } else if (event == ZigBeeDeviceListener.LEAVE) {
+ log.debug("ZclAppliance " + this.getPid() + " left the network");
+ // if the availability is already false don't update it!
+ if (!this.isAvailable()) {
+ return;
+ }
+
+ this.setAvailability(false);
+ }
+ }
+
+ public boolean notifyZclFrame(short clusterId, IZclFrame zclFrame) throws Exception {
+ // TODO Auto-generated method stub
+ return false;
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/ZclByteUtils.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/ZclByteUtils.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/ZclByteUtils.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,191 @@
+package it.telecomitalia.ah.zigbee.zcl.lib;
+
+public class ZclByteUtils {
+
+ public static final byte[] invert(byte abyte0[]) {
+ if (abyte0 == null || abyte0.length == 0)
+ return abyte0;
+ byte abyte1[] = new byte[abyte0.length];
+ for (int i = 0; i < abyte0.length; i++)
+ abyte1[i] = abyte0[abyte0.length - i - 1];
+
+ return abyte1;
+ }
+
+ public static final void invert(byte abyte0[], int i, byte abyte1[], int j, int k) {
+ if (abyte0 == null || abyte0.length == 0 || k == 0)
+ return;
+ int l = Math.min(abyte0.length - 1, (i + k) - 1);
+ for (int i1 = l; i1 >= i; i1--) {
+ if (j >= abyte1.length)
+ throw new ArrayIndexOutOfBoundsException("Destination array has insuffiecient length. Destination offset reached "
+ + j + " while dest length is " + abyte1.length);
+ abyte1[j] = abyte0[i1];
+ j++;
+ }
+
+ }
+
+ public static final void _16BitsToLittleEndian(int i, byte abyte0[], int j) {
+ abyte0[j] = (byte) (0xff & i >>> 0);
+ abyte0[j + 1] = (byte) (0xff & i >>> 8);
+ }
+
+ public static final int _16BitLittleEndianToInt(byte abyte0[], int i) {
+ int j = 0xffff & abyte0[i + 1] << 8;
+ j += 0xff & abyte0[i];
+ return j;
+ }
+
+ public static final void _24BitsToLittleEndian(int i, byte abyte0[], int j) {
+ abyte0[j] = (byte) (0xff & i);
+ abyte0[j + 1] = (byte) (0xff & i >>> 8);
+ abyte0[j + 2] = (byte) (0xff & i >>> 16);
+ }
+
+ public static final int _24BitLittleEndianToInt(byte abyte0[], int i) {
+ int j = 0xffffff & abyte0[i + 2] << 16;
+ j += 0xffff & abyte0[i + 1] << 8;
+ j += 0xff & abyte0[i];
+ return j;
+ }
+
+ public static final void _32BitsToLittleEndian(int i, byte abyte0[], int j) {
+ abyte0[j] = (byte) (0xff & i);
+ abyte0[j + 1] = (byte) (0xff & i >>> 8);
+ abyte0[j + 2] = (byte) (0xff & i >>> 16);
+ abyte0[j + 3] = (byte) (0xff & i >>> 24);
+ }
+
+ public static final void _64BitsToLittleEndian(long l, byte abyte0[], int i) {
+ abyte0[i] = (byte) (int) (255L & l);
+ abyte0[i + 1] = (byte) (int) (255L & l >>> 8);
+ abyte0[i + 2] = (byte) (int) (255L & l >>> 16);
+ abyte0[i + 3] = (byte) (int) (255L & l >>> 24);
+ abyte0[i + 4] = (byte) (int) (255L & l >>> 32);
+ abyte0[i + 5] = (byte) (int) (255L & l >>> 40);
+ abyte0[i + 6] = (byte) (int) (255L & l >>> 48);
+ abyte0[i + 7] = (byte) (int) (255L & l >>> 56);
+ }
+
+ public static final int _32BitLittleEndianToInt(byte abyte0[], int i) {
+ int j = abyte0[i + 3] << 24;
+ j += 0xffffff & abyte0[i + 2] << 16;
+ j += 0xffff & abyte0[i + 1] << 8;
+ j += 0xff & abyte0[i];
+ return j;
+ }
+
+ public static final long _64BitLittleEndianToLong(byte abyte0[], int i) {
+ long l = 0L;
+ l = ((long) abyte0[i + 7] << 56) + ((long) (abyte0[i + 6] & 0xff) << 48) + ((long) (abyte0[i + 5] & 0xff) << 40)
+ + ((long) (abyte0[i + 4] & 0xff) << 32) + ((long) (abyte0[i + 3] & 0xff) << 24)
+ + ((long) (abyte0[i + 2] & 0xff) << 16) + ((long) (abyte0[i + 1] & 0xff) << 8)
+ + ((long) (abyte0[i + 0] & 0xff) << 0);
+ return l;
+ }
+
+ public static final void floatToSemiPrecision(float f, byte abyte0[], int i) {
+ int j = Float.floatToIntBits(f);
+ int k = j >> 23;
+ k &= 0xff;
+ int l = j << 9;
+ l >>>= 9;
+ int i1 = l >> 13;
+ int j1 = (j >>> 31) << 15;
+ int k1;
+ if (k == 255) {
+ k1 = 31744;
+ k1 |= j1;
+ } else if (k == 0) {
+ k1 = j1 | i1;
+ } else {
+ int l1 = k - 112;
+ l1 <<= 10;
+ k1 = j1 | l1 | i1;
+ }
+ _16BitsToLittleEndian(k1, abyte0, i);
+ }
+
+ public static final float semiPrecisionToFloat(byte abyte0[], int i) {
+ int j = _16BitLittleEndianToInt(abyte0, i);
+ int k = (j >>> 15) << 31;
+ int l = (j << 22) >>> 9;
+ int i1 = (j << 17) >>> 27;
+ int j1 = 0;
+ if (i1 == 31)
+ j1 = 255;
+ else if (i1 == 0)
+ j1 = 0;
+ else
+ j1 = i1 + 112;
+ j1 <<= 23;
+ int k1 = k | l | j1;
+ float f = Float.intBitsToFloat(k1);
+ return f;
+ }
+
+ public static final boolean match(byte abyte0[], byte abyte1[]) {
+ if (abyte0 == abyte1)
+ return true;
+ if (abyte0 == null && abyte1 != null || abyte0 != null && abyte1 == null)
+ return false;
+ if (abyte0.length != abyte1.length)
+ return false;
+ for (int i = 0; i < abyte0.length; i++)
+ if (abyte0[i] != abyte1[i])
+ return false;
+
+ return true;
+ }
+
+ public static void main(String args[]) throws Throwable {
+ float f = (float) Math.pow(2D, -14D);
+ System.out.println("input float: " + f);
+ byte abyte0[] = new byte[2];
+ int i = 0;
+ floatToSemiPrecision(f, abyte0, i);
+ float f1 = semiPrecisionToFloat(abyte0, 0);
+ System.out.println("result float:" + f1);
+ if (f1 == f)
+ System.out.println("We have a match!");
+ byte byte0 = -5;
+ int j = (byte0 >>> 31) << 15;
+ System.out.println(j);
+ }
+
+ public static String bytesToHexString(byte abyte0[], int i, int j) {
+ StringBuffer stringbuffer = new StringBuffer("[");
+ int k = Math.min(i + j, abyte0.length);
+ for (int l = i; l < k; l++) {
+ stringbuffer.append("0x");
+ stringbuffer.append(toHexString(0xff & abyte0[l]));
+ if (l < k - 1)
+ stringbuffer.append(", ");
+ }
+
+ stringbuffer.append("]");
+ return stringbuffer.toString();
+ }
+
+ public static String bytesToHexString(byte abyte0[]) {
+ if (abyte0 == null)
+ return "null";
+ else
+ return bytesToHexString(abyte0, 0, abyte0.length);
+ }
+
+ public static String toHexString(int i) {
+ char ac[] = new char[32];
+ int j = 32;
+ byte byte0 = 16;
+ int k = byte0 - 1;
+ do {
+ ac[--j] = HEX_DIGITS[i & k];
+ i >>>= 4;
+ } while (i != 0);
+ return new String(ac, j, 32 - j);
+ }
+
+ static final char HEX_DIGITS[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/ZclEndPoint.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/ZclEndPoint.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/ZclEndPoint.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,23 @@
+package it.telecomitalia.ah.zigbee.zcl.lib;
+
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.lib.EndPoint;
+import it.telecomitalia.ah.zigbee.ZigBeeDevice;
+import it.telecomitalia.ah.zigbee.zcl.IZclServiceEndPoint;
+
+public class ZclEndPoint extends EndPoint implements IZclServiceEndPoint {
+ private ZigBeeDevice device = null;
+
+ public ZclEndPoint(String type) throws ApplianceException {
+ super(type);
+ }
+
+ public ZigBeeDevice zclGetZigBeeDevice() {
+ return device;
+ }
+
+ public void zclSetZigBeeDevice(ZigBeeDevice device) {
+ this.device = device;
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/ZclServiceCluster.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/ZclServiceCluster.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/ZclServiceCluster.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,1065 @@
+package it.telecomitalia.ah.zigbee.zcl.lib;
+
+import it.telecomitalia.ah.hac.ApplianceException;
+import it.telecomitalia.ah.hac.IAttributeValue;
+import it.telecomitalia.ah.hac.IEndPoint;
+import it.telecomitalia.ah.hac.IEndPointRequestContext;
+import it.telecomitalia.ah.hac.IServiceCluster;
+import it.telecomitalia.ah.hac.ISubscriptionParameters;
+import it.telecomitalia.ah.hac.InvalidAttributeValueException;
+import it.telecomitalia.ah.hac.MalformedMessageException;
+import it.telecomitalia.ah.hac.NotAuthorized;
+import it.telecomitalia.ah.hac.ReadOnlyAttributeException;
+import it.telecomitalia.ah.hac.ServiceClusterException;
+import it.telecomitalia.ah.hac.UnsupportedClusterAttributeException;
+import it.telecomitalia.ah.hac.UnsupportedClusterOperationException;
+import it.telecomitalia.ah.hac.lib.AttributeValue;
+import it.telecomitalia.ah.hac.lib.EndPoint;
+import it.telecomitalia.ah.hac.lib.ServiceCluster;
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.ZCL;
+import it.telecomitalia.ah.zigbee.ZclFrame;
+import it.telecomitalia.ah.zigbee.ZigBeeDevice;
+import it.telecomitalia.ah.zigbee.ZigBeeDeviceListener;
+import it.telecomitalia.ah.zigbee.ZigBeeException;
+import it.telecomitalia.ah.zigbee.zcl.IZclAttributeDescriptor;
+import it.telecomitalia.ah.zigbee.zcl.IZclServiceCluster;
+import it.telecomitalia.ah.zigbee.zcl.IZclServiceEndPoint;
+import it.telecomitalia.ah.zigbee.zcl.ZclException;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclAbstractDataType;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI16;
+import it.telecomitalia.ah.zigbee.zcl.lib.types.ZclDataTypeUI8;
+
+import java.util.HashMap;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+// TODO consider also the differences between general and cluster specific commands
+
+public class ZclServiceCluster extends ServiceCluster implements IZclServiceCluster, ZigBeeDeviceListener {
+ protected static final String BAD_DIRECTION_MESSAGE = "bad direction field";
+ protected static final String BAD_RESPONSE_COMMAND_ID_MESSAGE = "bad command id in response";
+ protected static final String INVOKE_ERROR_MESSAGE = "error in invoke";
+ protected static final String POST_FAILED_MESSAGE = "error in post";
+ protected static final String ERROR_PARSING_MESSAGE = "Error parsing ZigBee message";
+
+ protected ZigBeeDevice device;
+
+ protected int sequence = 30; // Zcl Frame sequence number
+ private final static Log log = LogFactory.getLog(ZclServiceCluster.class);
+
+ private boolean checkDirection = false;
+
+ public ZclServiceCluster() throws ApplianceException {
+ super();
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(String name) {
+ // Override in childs
+ return null;
+ }
+
+ protected IZclAttributeDescriptor getAttributeDescriptor(int attrId) {
+ // Override in childs
+ return null;
+ }
+
+ /**
+ * Getter for the checkDirection field
+ *
+ * @return true if the direction is checked on incoming Zcl messages, false
+ * otherwise
+ */
+
+ protected boolean getCheckDirection() {
+ return this.checkDirection;
+ }
+
+ /**
+ * Permits to enable/disable the direction field check on incoming Zcl
+ * messages. The default behaviour is: not check the direction.
+ *
+ * @param checkDirection
+ * true enables check on the direction field of the incoming Zcl
+ * messages. false disables this check. By default the direction
+ * field check is disabled.
+ */
+
+ protected void setCheckDirection(boolean checkDirection) {
+ this.checkDirection = checkDirection;
+ }
+
+ protected IZclFrame readAttributes(short clusterId, int[] attrIds) {
+ int sequence = 0;
+ IZclFrame zclFrame = new ZclFrame((byte) 0x00, attrIds.length * 2);
+ zclFrame.setSequence(sequence);
+
+ zclFrame.appendUInt8(ZCL.ZclReadAttrs);
+
+ for (int i = 0; i < attrIds.length; i++) {
+ zclFrame.appendUInt16(attrIds[i]);
+ }
+
+ return zclFrame;
+ }
+
+ protected IServiceCluster getSinglePeerCluster(String name) throws ServiceClusterException {
+ IServiceCluster[] serviceClusters = ((EndPoint) endPoint).getPeerServiceClusters(name);
+
+ if (serviceClusters == null) {
+ throw new ServiceClusterException("No appliances connected");
+ } else if (serviceClusters.length > 1) {
+ // FIXME: we can relax this by checking if the command don't need
+ // any response.
+ // throw new
+ // ServiceClusterException("More than one appliance connected.");
+ } else if (serviceClusters.length == 0) {
+ throw new ServiceClusterException("Service Clusters List is empty!!!");
+ }
+ return serviceClusters[0];
+ }
+
+ /**
+ * Given a commandId and a size, it creates a ZclFrame object of the correct
+ * size, direction. The direction is set according to the cluster type. If
+ * it is a client cluster, the direction is set C to S. The method sets also
+ * the sequence number accordingly
+ *
+ * @param commandId
+ * The commandId of the newly created frame
+ * @param size
+ * The total size.
+ * @return The newly created ZclFrame.
+ */
+
+ protected IZclFrame createOutgoingZclFrame(int commandId, int size) {
+ IZclFrame zclFrame = new ZclFrame((byte) 0x00, size);
+
+ if (this.getSide() == IZclServiceCluster.CLIENT_SIDE)
+ zclFrame.setDirection(IZclFrame.SERVER_TO_CLIENT_DIRECTION);
+ else
+ zclFrame.setDirection(IZclFrame.CLIENT_TO_SERVER_DIRECTION);
+
+ zclFrame.setSequence(sequence++);
+ zclFrame.setCommandId(commandId);
+ return zclFrame;
+ }
+
+ protected ISubscriptionParameters[] configureReportings(int clusterId, String[] attrNames,
+ ISubscriptionParameters[] parameters, IEndPointRequestContext context) throws ApplianceException,
+ ServiceClusterException, ZclValidationException {
+
+ boolean sync = true;
+
+ ZigBeeDevice device = getZigBeeDevice();
+ if (device == null)
+ throw new ApplianceException("Not attached");
+
+ // The size is set to 255 since we don't know in advance the actual
+ // packet size
+ IZclFrame zclFrame = this.createOutgoingZclFrame(ZCL.ZclConfigRep, 255);
+
+ for (int i = 0; i < attrNames.length; i++) {
+ String attrName = attrNames[i];
+ IZclAttributeDescriptor zclAttributeDescriptor = getAttributeDescriptor(attrName);
+ if (!zclAttributeDescriptor.isReportable())
+ throw new ServiceClusterException("Attribute '" + attrName + "' is not reportable");
+
+ ISubscriptionParameters parameter = parameters[i];
+
+ int direction = 0x00;
+ int timeout = 0;
+
+ zclFrame.appendUInt8(direction);
+ zclFrame.appendUInt16(zclAttributeDescriptor.zclGetId());
+
+ ZclAbstractDataType zclDataType = zclAttributeDescriptor.zclGetDataType();
+
+ if (direction == 0x00) {
+ zclFrame.appendUInt8(zclDataType.zclGetDataType());
+ if (parameter != null) {
+ zclFrame.appendUInt16((int) parameter.getMinReportingInterval());
+ zclFrame.appendUInt16((int) parameter.getMaxReportingInterval());
+ } else {
+ // disable attribute reporting on this attribute
+ zclFrame.appendUInt16(0x0000);
+ zclFrame.appendUInt16(0xffff); // disable!
+ }
+
+ } else if (direction == 0x01) {
+ zclFrame.appendUInt16(timeout);
+ }
+
+ if (zclDataType.isAnalog()) {
+ // FIXME there are some issue here...
+ if (parameter != null) {
+ zclDataType.zclObjectSerialize(zclFrame, new Integer((int) parameter.getReportableChange()));
+ } else {
+ zclDataType.zclObjectSerialize(zclFrame, new Integer(1));
+ }
+ }
+
+ zclFrame.shrink();
+
+ int profileId = getProfileId();
+
+ if ((context != null) && (!context.isConfirmationRequired())) {
+ zclFrame.disableDefaultResponse(true);
+ sync = false;
+ }
+
+ if (sync) {
+ IZclFrame zclResponseFrame;
+ if (profileId == -1)
+ zclResponseFrame = device.invoke((short) clusterId, zclFrame);
+ else
+ zclResponseFrame = device.invoke((short) profileId, (short) clusterId, zclFrame);
+
+ if (zclResponseFrame == null)
+ throw new ApplianceException("Timeout");
+
+ // TODO: check if the response frame is correct
+ if (zclResponseFrame.getCommandId() == ZCL.ZclConfigRepRsp) {
+ short status = ZclDataTypeUI8.zclParse(zclResponseFrame);
+ if (status != ZCL.SUCCESS)
+ this.raiseServiceClusterException(status);
+ } else if (zclResponseFrame.getCommandId() == ZCL.ZclDefaultRsp) {
+ short status = ZclDataTypeUI8.zclParse(zclResponseFrame);
+ if (status != ZCL.SUCCESS) {
+ this.raiseServiceClusterException(status);
+ }
+ } else
+ throw new ServiceClusterException("Response command doesn't match the request command");
+
+ } else {
+ if (profileId == -1)
+ device.post((short) clusterId, zclFrame);
+ else
+ device.post((short) profileId, (short) clusterId, zclFrame);
+ return null;
+ }
+ }
+
+ return parameters;
+ }
+
+ /**
+ * Given a Zcl status code, this method convert it in the corresponding
+ * specific ServiceClusterException that represents this status code. No
+ * specific exception is found a generic ServiceClusterException exception
+ * is raised, where the status code is set to the Zcl status code.
+ *
+ * @param status
+ * @throws ServiceClusterException
+ */
+
+ protected void raiseServiceClusterException(short status) throws ServiceClusterException {
+ // TODO: cover all the Zcl status codes
+
+ switch (status) {
+ case ZCL.UNSUPPORTED_ATTRIBUTE:
+ throw new UnsupportedClusterAttributeException("Zcl unsupported attribute: " + status);
+
+ case ZCL.UNREPORTABLE_ATTRIBUTE:
+ throw new UnsupportedClusterOperationException("Zcl unreportable attribute: " + status);
+
+ case ZCL.INVALID_VALUE:
+ throw new InvalidAttributeValueException();
+
+ case ZCL.READ_ONLY:
+ throw new ReadOnlyAttributeException();
+
+ case ZCL.NOT_AUTHORIZED:
+ throw new NotAuthorized();
+
+ case ZCL.MALFORMED_COMMAND:
+ throw new MalformedMessageException();
+
+ default:
+ }
+
+ throw new ServiceClusterException("Got Zcl Status Code: " + status);
+ }
+
+ protected ZigBeeDevice getZigBeeDevice() throws ApplianceException {
+ return device;
+ // IZclServiceEndPoint zclEndPoint = null;
+ // IEndPoint endPoint = getEndPoint();
+ // if (endPoint instanceof IZclServiceEndPoint) {
+ // zclEndPoint = (IZclServiceEndPoint) endPoint;
+ // } else {
+ // throw new
+ // ApplianceException("at this point the appliance MUST be a ZclAppliance");
+ // }
+ //
+ // return zclEndPoint.zclGetZigBeeDevice();
+ }
+
+ // FIXME: qui passare anche l'attr Type!!!!
+ // in questo modo e' possible fare il check se la risposta e' del tipo
+ // corretto!!!!
+
+ protected IZclFrame readAttribute(short clusterId, int attrId, boolean sync) throws Exception {
+
+ ZigBeeDevice device = getZigBeeDevice();
+
+ if (device == null)
+ throw new ApplianceException("Not attached");
+
+ IZclFrame zclFrame = this.createOutgoingZclFrame(ZCL.ZclReadAttrs, 2);
+ zclFrame.appendUInt16(attrId);
+
+ if (sync) {
+ IZclFrame zclResponseFrame = device.invoke(clusterId, zclFrame);
+
+ if (zclResponseFrame == null)
+ throw new ApplianceException("Timeout");
+
+ // TODO: check if the response frame is correct
+ if (zclResponseFrame.getCommandId() != ZCL.ZclReadAttrsRsp)
+ throw new ApplianceException("Response command doesn't match the request command");
+
+ int responseAttrId = ZclDataTypeUI16.zclParse(zclResponseFrame);
+ if (responseAttrId != attrId)
+ throw new ApplianceException("Response attrId doesn't match requeted one");
+
+ short status = ZclDataTypeUI8.zclParse(zclResponseFrame);
+ if (status != ZCL.SUCCESS)
+ this.raiseServiceClusterException(status);
+
+ short responseDataType = ZclDataTypeUI8.zclParse(zclResponseFrame);
+
+ short dataType = responseDataType;
+ if (responseDataType != dataType)
+ throw new ZclException("response data type doesn't match request data type", ZCL.INVALID_DATA_TYPE);
+
+ return zclResponseFrame;
+ } else {
+ device.post(clusterId, zclFrame);
+ return null;
+ }
+ }
+
+ protected IZclFrame readAttribute(int attrId, IEndPointRequestContext context) throws ServiceClusterException,
+ ApplianceException {
+
+ boolean sync = true;
+
+ ZigBeeDevice device = getZigBeeDevice();
+
+ if (device == null)
+ throw new ApplianceException("Not attached");
+
+ IZclFrame zclFrame = this.createOutgoingZclFrame(ZCL.ZclReadAttrs, 2);
+ zclFrame.appendUInt16(attrId);
+
+ if ((context != null) && (!context.isConfirmationRequired())) {
+ zclFrame.disableDefaultResponse(true);
+ // sync = false;
+ }
+
+ if (sync) {
+ IZclFrame zclResponseFrame = device.invoke((short) getClusterId(), zclFrame);
+ if (zclResponseFrame == null)
+ throw new ApplianceException("Timeout");
+
+ // TODO: check if the response frame is correct
+ int responseCommandId = zclResponseFrame.getCommandId();
+
+ if (responseCommandId == ZCL.ZclReadAttrsRsp) {
+
+ try {
+ int responseAttrId = ZclDataTypeUI16.zclParse(zclResponseFrame);
+ if (responseAttrId != attrId)
+ throw new ApplianceException("Response attrId doesn't match requeted one");
+
+ short status = ZclDataTypeUI8.zclParse(zclResponseFrame);
+ if (status != ZCL.SUCCESS)
+ throw new ApplianceException("Error: zigbee status " + status);
+
+ short responseDataType = ZclDataTypeUI8.zclParse(zclResponseFrame);
+
+ short dataType = responseDataType;
+ if (responseDataType != dataType)
+ this.raiseServiceClusterException(ZCL.INVALID_DATA_TYPE);
+
+ if (this.checkDirection && (zclFrame.getDirection() == zclResponseFrame.getDirection())) {
+ // this is an error, since the direction of the outgoing
+ // frame cannot be identical to dir of the received
+ // frame.
+ log.error(BAD_DIRECTION_MESSAGE);
+ throw new ServiceClusterException("bad direction field in incoming packet");
+ }
+ } catch (ZclValidationException e) {
+ this.raiseServiceClusterException(ZCL.MALFORMED_COMMAND);
+ }
+ } else if (responseCommandId == ZCL.ZclDefaultRsp) {
+
+ short commandId = 0;
+ try {
+ commandId = ZclDataTypeUI8.zclParse(zclResponseFrame);
+ } catch (ZclValidationException e1) {
+ this.raiseServiceClusterException(ZCL.MALFORMED_COMMAND);
+ }
+
+ if (commandId != ZCL.ZclReadAttrs)
+ throw new ServiceClusterException("Expected default response for ReadAttributes, received " + commandId);
+
+ short status = 0;
+ try {
+ status = ZclDataTypeUI8.zclParse(zclResponseFrame);
+ } catch (ZclValidationException e) {
+ this.raiseServiceClusterException(ZCL.MALFORMED_COMMAND);
+ }
+
+ if (status != ZCL.SUCCESS) {
+ this.raiseServiceClusterException(status);
+ }
+
+ } else {
+ throw new ApplianceException("Response command doesn't match the request command");
+ }
+ return zclResponseFrame;
+ } else {
+ device.post((short) getClusterId(), zclFrame);
+ return null;
+ }
+ }
+
+ public void writeAttribute(int myattribute) throws ApplianceException, ServiceClusterException {
+
+ if (device == null)
+ throw new ApplianceException("Not attached");
+
+ boolean sync = true;
+ short clusterId = 0x0001;
+
+ IZclFrame zclFrame = this.createOutgoingZclFrame(ZCL.ZclWriteAttrs, 5);
+
+ zclFrame.appendUInt16(0x0100); // attributeId
+ zclFrame.appendUInt8(0x01); // attributeType
+ zclFrame.appendUInt16(myattribute);
+
+ if (sync) {
+ try {
+ IZclFrame zclResponseFrame = device.invoke(clusterId, zclFrame);
+ if (zclResponseFrame.isClientToServer())
+ throw new ServiceClusterException("bad direction");
+ if (zclResponseFrame.getCommandId() != ZCL.ZclWriteAttrsRsp)
+ throw new ServiceClusterException("bad response command id '" + zclResponseFrame.getCommandId() + "'");
+ } catch (ZigBeeException e) {
+ throw new ApplianceException("Exception in Invoke on ZigBee device");
+ }
+ // TODO: check if the response frame is correct
+ return;
+ } else {
+ boolean res = device.post(clusterId, zclFrame);
+ if (!res) {
+ throw new ServiceClusterException("post to ZigBee failed");
+ }
+ }
+ }
+
+ protected IZclFrame getDefaultResponse(IZclFrame zclFrame, int statusCode) {
+ IZclFrame responseZclFrame = zclFrame.createResponseFrame(2);
+ responseZclFrame.setCommandId(ZCL.ZclDefaultRsp);
+ responseZclFrame.appendUInt8(zclFrame.getCommandId());
+ responseZclFrame.setFrameType(IZclFrame.GENERAL_COMMAND);
+ responseZclFrame.appendUInt8(statusCode);
+ return responseZclFrame;
+ }
+
+ public void zclAttach(ZigBeeDevice device) {
+ device.setListener((short) this.getClusterId(), this.getSide(), this);
+ this.device = device;
+ }
+
+ public void zclDetach(ZigBeeDevice device) {
+ device.removeListener((short) this.getClusterId(), this.getSide(), this);
+ this.device = null;
+ }
+
+ public boolean notifyZclFrame(short clusterId, IZclFrame zclFrame) throws Exception {
+
+ this.checkIncomingFrameDirection(zclFrame);
+
+ if (zclFrame.getFrameType() == IZclFrame.GENERAL_COMMAND) {
+ handleGeneralCommands(clusterId, zclFrame);
+ return true;
+ }
+
+ // Pino: added to manage automatic announcement in case a subscription
+ // is already active
+ if (!this.getEndPoint().isAvailable())
+ ((ZclAppliance) this.getEndPoint().getAppliance()).notifyEvent(ZigBeeDeviceListener.ANNOUNCEMENT);
+
+ return false;
+ }
+
+ protected int getClusterId() {
+ return -1;
+ }
+
+ protected int getProfileId() {
+ return -1;
+ }
+
+ public ISubscriptionParameters setAttributeSubscription(String attributeName, ISubscriptionParameters parameters,
+ IEndPointRequestContext endPointRequestContext) throws ApplianceException, ServiceClusterException {
+ // FIXME: currently sleeping end device is supposed to later receive the
+ // subscription (no error managed)
+ // TODO: add configure reporting read operation
+ super.setAttributeSubscription(attributeName, parameters, endPointRequestContext);
+ ISubscriptionParameters[] sps = null;
+ try {
+ sps = configureReportings(getClusterId(), new String[] { attributeName }, new ISubscriptionParameters[] { parameters },
+ endPointRequestContext);
+ } catch (Exception e) {
+ log.error("Error while subscribing attribute " + attributeName + " for driver appliance "
+ + this.getEndPoint().getAppliance().getPid() + ". Maybe this is a sleeping end device!");
+ sps = new ISubscriptionParameters[] { parameters };
+ }
+ updateAllSubscriptionMap(attributeName, sps[0], endPointRequestContext);
+ return sps[0];
+ }
+
+ protected int readAttributeResponseGetSize(int attrId) throws ServiceClusterException, ZclValidationException {
+ throw new UnsupportedClusterOperationException();
+ }
+
+ /**
+ * This method must be redefined by the children classes. It should read
+ * from the peer appliances the requested attribute and, if found it should
+ * marshal this attribute in the passed frame object.
+ *
+ * @param zclResponseFrame
+ * @param attrId
+ * @return true if the attribute has been handled, false, otherwise
+ * @throws ZclValidationException
+ *
+ * TODO: allineare documentazione
+ */
+
+ protected boolean fillAttributeRecord(IZclFrame zclResponseFrame, int attrId) throws ServiceClusterException,
+ ApplianceException {
+ return false;
+ }
+
+ /**
+ * Handles incoming General Command Frames
+ *
+ * @param clusterId
+ * The Cluster identifier of the received general command
+ * @param zclFrame
+ * The received zclFrame
+ * @throws ServiceClusterException
+ * This exeption is raised in case of error
+ */
+ protected void handleGeneralCommands(short clusterId, IZclFrame zclFrame) throws ZclException {
+ int commandId = zclFrame.getCommandId();
+
+ switch (commandId) {
+ case ZCL.ZclReadAttrs: {
+ // Handles an incoming Read Attributes ZCL Command
+ int attributesIdsNumber = (zclFrame.getPayloadSize() / 2);
+
+ int[] attrIds = new int[attributesIdsNumber];
+
+ int size = 4 * attrIds.length;
+ for (int i = 0; i < attributesIdsNumber; i++) {
+ try {
+ attrIds[i] = ZclDataTypeUI16.zclParse(zclFrame);
+ } catch (ZclValidationException e) {
+
+ }
+ try {
+ // initially supposes that all the attributes are returned
+ size += readAttributeResponseGetSize(attrIds[i]);
+ } catch (ServiceClusterException e) {
+ continue;
+ }
+ }
+
+ IZclFrame zclResponseFrame = zclFrame.createResponseFrame(size + 3 * attributesIdsNumber);
+ zclResponseFrame.setCommandId(ZCL.ZclReadAttrsRsp);
+
+ for (int i = 0; i < attributesIdsNumber; i++) {
+ try {
+ ZclDataTypeUI16.zclSerialize(zclResponseFrame, attrIds[i]);
+ } catch (Exception e1) {
+ log.fatal(e1);
+ }
+
+ boolean handled = true;
+ try {
+ handled = fillAttributeRecord(zclResponseFrame, attrIds[i]);
+ if (!handled)
+ ZclDataTypeUI8.zclSerialize(zclResponseFrame, (byte) ZCL.UNSUPPORTED_ATTRIBUTE);
+ } catch (ApplianceException e) {
+ try {
+ ZclDataTypeUI8.zclSerialize(zclResponseFrame, (byte) ZCL.FAILURE);
+ } catch (ZclValidationException e1) {
+ log.fatal("Opps... unable to serialize ZclReadAttrs Response ", e1);
+ return;
+ }
+ } catch (ServiceClusterException e) {
+ if (e instanceof UnsupportedClusterOperationException)
+ try {
+ ZclDataTypeUI8.zclSerialize(zclResponseFrame, (byte) ZCL.UNSUPPORTED_ATTRIBUTE);
+ } catch (ZclValidationException e1) {
+ log.fatal("Opps... unable to serialize ZclReadAttrs Response ", e1);
+ return;
+ }
+ else {
+ try {
+ ZclDataTypeUI8.zclSerialize(zclResponseFrame, (byte) ZCL.FAILURE);
+ } catch (ZclValidationException e1) {
+ log.fatal("Opps... unable to serialize ZclReadAttrs Response ", e1);
+ return;
+ }
+ }
+ } catch (Throwable e) {
+ log.error(e);
+ try {
+ ZclDataTypeUI8.zclSerialize(zclResponseFrame, (byte) ZCL.FAILURE);
+ } catch (ZclValidationException e1) {
+ log.fatal("Opps... unable to serialize ZclReadAttrs Response ", e1);
+ return;
+ }
+ }
+ }
+
+ try {
+ ZigBeeDevice device = getZigBeeDevice();
+ zclResponseFrame.shrink();
+ device.post(clusterId, zclResponseFrame);
+ } catch (ApplianceException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ break;
+ }
+
+ case ZCL.ZclReportAttrs: {
+ // Handles an incoming Report Attributes ZCL Command
+ short statusCode = ZCL.SUCCESS;
+ while (true) {
+
+ try {
+ int attrId = ZclDataTypeUI16.zclParse(zclFrame);
+ short attrDataType = ZclDataTypeUI8.zclParse(zclFrame);
+ IZclAttributeDescriptor zclAttributeDescriptor = getAttributeDescriptor(attrId);
+ if (zclAttributeDescriptor == null)
+ continue;
+
+ ZclAbstractDataType zclDataTypeObject = zclAttributeDescriptor.zclGetDataType();
+ if (zclDataTypeObject.zclGetDataType() == attrDataType) {
+ Object objectValue = zclDataTypeObject.zclParseToObject(zclFrame);
+ try {
+ AttributeValue attrValue = new AttributeValue(objectValue, System.currentTimeMillis());
+ setCachedAttributeValue(attrId, attrValue);
+ notifyAttributeValue(zclAttributeDescriptor.getName(), attrValue);
+ } catch (Exception e) {
+ continue;
+ }
+ } else {
+ statusCode = ZCL.INVALID_DATA_TYPE;
+ }
+ } catch (Throwable e) {
+ // probably an array out of band.
+ break;
+ }
+ }
+
+ // generates the default response, if required
+ if (!zclFrame.isDefaultResponseDisabled()) {
+ statusCode = ZCL.SUCCESS;
+ IZclFrame zclResponseFrame = this.getDefaultResponse(zclFrame, statusCode);
+ // try {
+ // device = getZigBeeDevice();
+ // } catch (ApplianceException e) {
+ // log.fatal("getZigBeeDevice() returned exception. Unable to send default response",
+ // e);
+ // }
+
+ device.post(clusterId, zclResponseFrame);
+ }
+ break;
+ }
+
+ case ZCL.ZclReadAttrsRsp:
+ case ZCL.ZclWriteAttrs:
+ case ZCL.ZclWriteAttrsUndivided:
+ case ZCL.ZclWriteAttrsRsp:
+ case ZCL.ZclWriteAttrsNoRsp:
+ case ZCL.ZclConfigRep:
+ case ZCL.ZclConfigRepRsp:
+ case ZCL.ZclRepConf:
+ case ZCL.ZclRepConfRsp:
+ case ZCL.ZclDefaultRsp:
+ case ZCL.ZclDiscoverAttrs:
+ case ZCL.ZclReadAttrsStructured:
+ case ZCL.ZclWriteAttrsStructured:
+ case ZCL.ZclWriteAttrsStructuredRsp:
+ throw new ZclException(ZCL.UNSUP_GENERAL_COMMAND);
+
+ default:
+ throw new ZclException(ZCL.UNSUP_GENERAL_COMMAND);
+ }
+ }
+
+ /**
+ * Issues a WriteAttributesRequest to retrieve a ZigBee attribute from the
+ * peer cluster
+ *
+ * @param clusterId
+ * The Cluster Identifier
+ * @param zclFrame
+ * The ZclFrame that contains the
+ * @param context
+ * @throws Exception
+ */
+
+ protected void issueSet(short clusterId, IZclFrame zclFrame, IEndPointRequestContext context) throws Exception {
+ boolean sync = true;
+ IZclFrame zclResponseFrame;
+
+ ZigBeeDevice device = getZigBeeDevice();
+ if (device == null) {
+ throw new ApplianceException("Not attached");
+ }
+
+ zclFrame.setCommandId(ZCL.ZclWriteAttrs);
+
+ if (sync) {
+ try {
+ zclResponseFrame = device.invoke(clusterId, zclFrame);
+ } catch (ZigBeeException _x) {
+ throw new ApplianceException((INVOKE_ERROR_MESSAGE));
+ }
+
+ this.checkResponseFrameDirection(zclResponseFrame);
+
+ if (zclResponseFrame.getCommandId() != ZCL.ZclWriteAttrsRsp) {
+ throw new ApplianceException(BAD_RESPONSE_COMMAND_ID_MESSAGE + " '" + zclResponseFrame.getCommandId()
+ + "', expected WriteAttributeResponse");
+ }
+
+ short status = ZclDataTypeUI8.zclParse(zclResponseFrame);
+ if (status != ZCL.SUCCESS)
+ this.raiseServiceClusterException(status);
+
+ return;
+ } else {
+ boolean res = device.post(clusterId, zclFrame);
+ if (!res) {
+ throw new ApplianceException(POST_FAILED_MESSAGE);
+ }
+ }
+ }
+
+ protected void issueSet(short clusterId, IZclFrame zclFrame, int attrId, IEndPointRequestContext context)
+ throws ApplianceException, ServiceClusterException {
+ boolean sync = true;
+ IZclFrame zclResponseFrame;
+
+ ZigBeeDevice device = getZigBeeDevice();
+ if (device == null) {
+ throw new ApplianceException("Not attached");
+ }
+
+ zclFrame.setSequence(sequence++);
+ zclFrame.setCommandId(ZCL.ZclWriteAttrs);
+
+ if (sync) {
+ zclResponseFrame = device.invoke(clusterId, zclFrame);
+
+ this.checkResponseFrameDirection(zclResponseFrame);
+
+ // FIXME: handle the ZclWriteAttrsRsp or the default Response
+ if (zclResponseFrame.getCommandId() != ZCL.ZclWriteAttrsRsp) {
+ throw new ApplianceException(BAD_RESPONSE_COMMAND_ID_MESSAGE + " " + zclResponseFrame.getCommandId() + "'");
+ }
+
+ short status = ZCL.SUCCESS;
+
+ try {
+ status = ZclDataTypeUI8.zclParse(zclResponseFrame);
+ } catch (ZclValidationException e) {
+ this.raiseServiceClusterException(ZCL.MALFORMED_COMMAND);
+ }
+
+ if (status != ZCL.SUCCESS) {
+ int responseAttrId = 0;
+ try {
+ responseAttrId = ZclDataTypeUI16.zclParse(zclResponseFrame);
+ } catch (ZclValidationException e) {
+ this.raiseServiceClusterException(ZCL.MALFORMED_COMMAND);
+ }
+
+ if (responseAttrId != attrId)
+ throw new ApplianceException("Response attrId doesn't match requeted one");
+ else
+ this.raiseServiceClusterException(ZCL.MALFORMED_COMMAND);
+ } else {
+ // success, we need to check that no more bytes follows
+ // TODO: performs this check!!
+ }
+ return;
+ } else {
+ boolean res = device.post(clusterId, zclFrame);
+ if (!res) {
+ throw new ApplianceException(POST_FAILED_MESSAGE);
+ }
+ }
+ }
+
+ protected IZclFrame issueExec(IZclFrame zclFrame, int expectedResponseId, IEndPointRequestContext context)
+ throws ApplianceException, ServiceClusterException {
+ boolean sync = true;
+
+ IZclFrame zclResponseFrame = null;
+
+ ZigBeeDevice device = getZigBeeDevice();
+ if (device == null)
+ throw new ApplianceException("Not attached");
+
+ zclFrame.setSequence(sequence++);
+
+ if ((context != null) && (!context.isConfirmationRequired())) {
+ zclFrame.disableDefaultResponse(true);
+ if (expectedResponseId == ZCL.ZclDefaultRsp) {
+ sync = false;
+ }
+ }
+
+ if (sync) {
+ try {
+ zclResponseFrame = device.invoke((short) getClusterId(), zclFrame);
+ } catch (ZigBeeException _x) {
+ throw new ApplianceException((INVOKE_ERROR_MESSAGE));
+ }
+
+ this.checkResponseFrameDirection(zclResponseFrame);
+ this.handleResponseFrame(zclFrame, zclResponseFrame, expectedResponseId);
+
+ } else {
+ boolean res = device.post((short) getClusterId(), zclFrame);
+ if (!res) {
+ throw new ApplianceException(POST_FAILED_MESSAGE);
+ }
+ }
+ return zclResponseFrame;
+ }
+
+ /**
+ * @deprecated Use the other issueExec
+ * @param clusterId
+ * @param zclFrame
+ * @param expectedResponseId
+ * @param context
+ * @return
+ * @throws ApplianceException
+ */
+ protected IZclFrame issueExec(short clusterId, IZclFrame zclFrame, int expectedResponseId, IEndPointRequestContext context)
+ throws ApplianceException, ServiceClusterException {
+ boolean sync = true;
+
+ IZclFrame zclResponseFrame = null;
+
+ ZigBeeDevice device = getZigBeeDevice();
+ if (device == null)
+ throw new ApplianceException("Not attached");
+
+ zclFrame.setSequence(sequence++);
+
+ if ((context != null) && (!context.isConfirmationRequired())) {
+ zclFrame.disableDefaultResponse(true);
+ sync = false;
+ }
+
+ if (sync) {
+ try {
+ zclResponseFrame = device.invoke(clusterId, zclFrame);
+ } catch (ZigBeeException _x) {
+ throw new ApplianceException((INVOKE_ERROR_MESSAGE));
+ }
+
+ this.checkResponseFrameDirection(zclResponseFrame);
+
+ if (zclResponseFrame.getCommandId() != expectedResponseId) {
+ throw new ApplianceException(BAD_RESPONSE_COMMAND_ID_MESSAGE + ": '" + zclResponseFrame.getCommandId()
+ + "', expected " + expectedResponseId);
+ }
+ } else {
+ boolean res = device.post(clusterId, zclFrame);
+ if (!res) {
+ throw new ApplianceException(POST_FAILED_MESSAGE);
+ }
+ }
+ return zclResponseFrame;
+ }
+
+ /**
+ * Check if the direction of the incoming Zcl Frame is compatible with the
+ * type of cluster that the current instance of service cluster represents:
+ * client or server
+ *
+ * @param incomingZclFrame
+ * The incoming IZclFrame
+ * @throws ServiceClusterException
+ * In case of error it throws a ServiceCluster Exception
+ */
+ private void checkIncomingFrameDirection(IZclFrame incomingZclFrame) throws ZclException {
+ if (checkDirection) {
+ if (incomingZclFrame.isClientToServer() && (this.getSide() != IServiceCluster.CLIENT_SIDE))
+ throw new ZclException(BAD_DIRECTION_MESSAGE + " Expected C to S", ZCL.MALFORMED_COMMAND);
+
+ if (!incomingZclFrame.isClientToServer() && (this.getSide() != IServiceCluster.SERVER_SIDE))
+ throw new ZclException(BAD_DIRECTION_MESSAGE + " Expected S to C", ZCL.MALFORMED_COMMAND);
+
+ }
+ }
+
+ /**
+ * Check if the direction of a response Zcl Frame is compatible with the
+ * type of cluster that the current instance of service cluster represents:
+ * client or server
+ *
+ * @param responseZclFrame
+ * The response IZclFrame
+ * @throws ServiceClusterException
+ * In case of error it throws a ZclException exception
+ */
+ private void checkResponseFrameDirection(IZclFrame responseZclFrame) throws ServiceClusterException {
+ if (checkDirection) {
+ if (responseZclFrame.isClientToServer() && (this.getSide() != IServiceCluster.SERVER_SIDE))
+ throw new MalformedMessageException(BAD_DIRECTION_MESSAGE + " Expected C to S");
+
+ if (!responseZclFrame.isClientToServer() && (this.getSide() != IServiceCluster.CLIENT_SIDE))
+ throw new MalformedMessageException(BAD_DIRECTION_MESSAGE + " Expected S to C");
+
+ }
+ }
+
+ public void notifyEvent(int event) {
+ // TODO Auto-generated method stub
+ }
+
+ /**
+ * Method to access the Cache of the current cluster
+ *
+ * @param clusterId
+ * @param attrId
+ * @param context
+ * @return
+ */
+
+ protected IAttributeValue checkCache(short clusterId, int attrId, IEndPointRequestContext context) {
+
+ if ((context != null) && (context.getMaxAgeForAttributeValues() > 0)) {
+ IAttributeValue attributeValue = (IAttributeValue) this.cachedAttributeValues.get(new Integer(attrId));
+ if (attributeValue != null
+ && attributeValue.getTimestamp() + context.getMaxAgeForAttributeValues() >= System.currentTimeMillis()) {
+ return attributeValue;
+ }
+ return null;
+ } else
+ return null;
+
+ }
+
+ protected void updateCachedValue(int attrId, Boolean v) {
+ IAttributeValue av = new AttributeValue(v);
+ this.cachedAttributeValues.put(new Integer(attrId), av);
+ }
+
+ private HashMap cachedAttributeValues = new HashMap();
+
+ protected void setCachedAttributeObject(int attributeId, Object attributeObjectValue) {
+ this.cachedAttributeValues.put(new Integer(attributeId), new AttributeValue(attributeObjectValue));
+ }
+
+ protected void setCachedAttributeValue(int attributeId, AttributeValue attributeValue) {
+ this.cachedAttributeValues.put(new Integer(attributeId), attributeValue);
+ }
+
+ protected Object getValidCachedAttributeObject(int attributeId, long maxAge) {
+ AttributeValue attributeValue = (AttributeValue) this.cachedAttributeValues.get(new Integer(attributeId));
+ if (attributeValue != null && attributeValue.getTimestamp() + maxAge >= System.currentTimeMillis())
+ return attributeValue.getValue();
+ return null;
+ }
+
+ /**
+ * Raise an exception if the response frame doesn't contain the expected
+ * command
+ *
+ * @param zclFrame
+ * The outgoing Zcl Frame.
+ * @param zclResponseFrame
+ * The response Zcl Frame
+ * @param expectedResponseId
+ * The expected response command Id
+ * @throws ServiceClusterException
+ */
+
+ private void handleResponseFrame(IZclFrame zclFrame, IZclFrame zclResponseFrame, int expectedResponseId)
+ throws ServiceClusterException {
+
+ int responseCommandId = zclResponseFrame.getCommandId();
+
+ if (responseCommandId != expectedResponseId) {
+ if (responseCommandId == ZCL.ZclDefaultRsp) {
+ raiseDefaultResponse(zclResponseFrame, zclFrame.getCommandId(), true);
+ } else {
+ // This is a completed different message (wrong sequence
+ // number?)
+ throw new ServiceClusterException("Completely unexpected response: expecting " + expectedResponseId
+ + " or defaultResponse");
+ }
+ }
+
+ if (expectedResponseId == ZCL.ZclDefaultRsp) {
+ raiseDefaultResponse(zclResponseFrame, zclFrame.getCommandId(), false);
+ }
+ }
+
+ /**
+ *
+ * @param zclFrame
+ * The passed zclFrame must contain a default response command
+ * @param sentCommandId
+ * The commandId it must be contained in the DefaultResponse
+ * @param expectError
+ * true if the defaultResponse is expected to contain an error.
+ * If it doesn't contain and error, it an error if it doesn't
+ * contain an error.
+ * @throws ServiceClusterException
+ */
+
+ private void raiseDefaultResponse(IZclFrame zclFrame, int sentCommandId, boolean expectError) throws ServiceClusterException {
+ int commandId;
+ try {
+ commandId = ZclDataTypeUI8.zclParse(zclFrame);
+ } catch (ZclValidationException e) {
+ throw new ServiceClusterException("Sent cmdId " + sentCommandId + ", received a wrong message");
+ }
+
+ if (commandId != sentCommandId)
+ throw new ServiceClusterException("Sent cmdId " + commandId + ", received default response with wrong cmdId: "
+ + zclFrame.getCommandId());
+
+ short status = ZclDataTypeUI8.zclParse(zclFrame);
+
+ if (status != ZCL.SUCCESS) {
+ this.raiseServiceClusterException(status);
+ } else if (expectError) {
+ // the status is ZCL.SUCCESS but we expect that the DefaultResponse
+ // contain an error.
+ throw new ServiceClusterException("Unexpected Success status code in DefaultResponse");
+ }
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclAbstractDataType.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclAbstractDataType.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclAbstractDataType.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,12 @@
+package it.telecomitalia.ah.zigbee.zcl.lib.types;
+
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+
+public abstract class ZclAbstractDataType {
+ public abstract Object zclParseToObject(IZclFrame zclFrame) throws ZclValidationException;
+ public abstract void zclObjectSerialize(IZclFrame zclFrame, Object value) throws ZclValidationException;
+ public abstract int zclObjectSize (Object value) throws ZclValidationException;
+ public abstract short zclGetDataType();
+ public abstract boolean isAnalog();
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeBitmap16.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeBitmap16.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeBitmap16.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,42 @@
+package it.telecomitalia.ah.zigbee.zcl.lib.types;
+
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+
+public class ZclDataTypeBitmap16 extends ZclAbstractDataType {
+ public static final int ZCL_DATA_TYPE = ZclTypes.ZclBitmap16Type;
+ private static final int BYTE_ARRAY_LENGTH = 2;
+ static final boolean IS_ANALOG = false;
+
+ public static int zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ return zclFrame.parseUInt16();
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, int uint16) throws ZclValidationException {
+ zclFrame.appendUInt16(uint16);
+ }
+
+ public static int zclSize(int uint16) {
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public boolean isAnalog() {
+ return IS_ANALOG;
+ }
+
+ public short zclGetDataType() {
+ return ZCL_DATA_TYPE;
+ }
+
+ public void zclObjectSerialize(IZclFrame zclFrame, Object value) throws ZclValidationException {
+ ZclDataTypeBitmap16.zclSerialize(zclFrame, (int) ((Number) value).intValue());
+ }
+
+ public int zclObjectSize(Object value) throws ZclValidationException {
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public Object zclParseToObject(IZclFrame zclFrame) throws ZclValidationException {
+ return new Integer(ZclDataTypeBitmap16.zclParse(zclFrame));
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeBitmap24.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeBitmap24.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeBitmap24.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,22 @@
+package it.telecomitalia.ah.zigbee.zcl.lib.types;
+
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+
+public class ZclDataTypeBitmap24 {
+ public static final int ZCL_DATA_TYPE = ZclTypes.ZclBitmap24Type;
+ private static final int BYTE_ARRAY_LENGTH = 3;
+ static final boolean IS_ANALOG = false;
+
+ public static int zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ return zclFrame.parseUInt24();
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, int uint) throws ZclValidationException {
+ zclFrame.appendUInt24(uint);
+ }
+
+ public static int zclSize(int value) {
+ return BYTE_ARRAY_LENGTH;
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeBitmap32.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeBitmap32.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeBitmap32.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,75 @@
+package it.telecomitalia.ah.zigbee.zcl.lib.types;
+
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+
+public class ZclDataTypeBitmap32 {
+ public static final int ZCL_DATA_TYPE = ZclTypes.ZclBitmap32Type;
+ private static final int BYTE_ARRAY_LENGTH = 4;
+ static final boolean IS_ANALOG = false;
+
+ /*private static final Integer MAX_VALUE = new Integer(0xffff);
+ private static final Integer MIN_VALUE = new Integer(0x0000);
+ private static final Integer STEP_VALUE = null;
+
+ private static ZclDataTypeUI32 instance = null;
+
+ static synchronized public ZclDataTypeUI32 get() {
+ try {
+ if (instance == null)
+ instance = new ZclDataTypeUI32(null);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return instance;
+ }
+
+ static public ZclDataTypeUI32 get(Object defaultValue) {
+ try {
+ return new ZclDataTypeUI32(defaultValue);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ protected ZclDataTypeUI32(Object defaultValue) throws ApplianceValidationException {
+ super(Integer.class.getCanonicalName(), defaultValue, null, MIN_VALUE, MAX_VALUE, STEP_VALUE);
+ }
+
+ public int zclGetDataType() {
+ return ZCL_TYPE_UNSIGNED_8_BIT_INT;
+ }
+
+ public boolean zclIsDescreteDataType() {
+ return false;
+ }
+
+ public int zclGetByteLength(Object value) throws ZclValidationException{
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public int zclParse(byte[] msg, int msgIndex, Object[] values, int valuesIndex) throws ZclValidationException {
+ int i1 = ZclByteUtils._16BitLittleEndianToInt(msg, msgIndex);
+ values[valuesIndex] = new Integer(i1);
+ return msgIndex + 2;
+ }
+
+ public int zclSerialize(Object value, byte[] msg, int msgIndex) throws ZclValidationException{
+ int l = ((Integer) value).intValue();
+ ZclByteUtils._16BitsToLittleEndian(l, msg, msgIndex);
+ return msgIndex + 2;
+ }*/
+
+ public static long zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ return zclFrame.parseUInt32();
+ }
+
+ public static int zclSize (long value) throws ZclValidationException {
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, long uint) throws ZclValidationException {
+ zclFrame.appendUInt32(uint);
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeBitmap8.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeBitmap8.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeBitmap8.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,95 @@
+package it.telecomitalia.ah.zigbee.zcl.lib.types;
+
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+
+public class ZclDataTypeBitmap8 extends ZclAbstractDataType {
+ public static final int ZCL_DATA_TYPE = ZclTypes.ZclBitmap8Type;
+ static final int BYTE_ARRAY_LENGTH = 1;
+ static final boolean IS_ANALOG = false;
+
+/* static final Short MAX_VALUE = new Short((short) 0xff);
+ static final Short MIN_VALUE = new Short((short) 0x00);
+ static final Short STEP_VALUE = null;
+
+ private static ZclDataTypeUI8 instance = null;
+
+ static synchronized public ZclDataTypeUI8 get() {
+ try {
+ if (instance == null)
+ instance = new ZclDataTypeUI8(null);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return instance;
+ }
+
+ static public ZclDataTypeUI8 get(Object defaultValue) {
+ try {
+ return new ZclDataTypeUI8(defaultValue);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ protected ZclDataTypeUI8(Object defaultValue) throws ApplianceValidationException {
+ super(Short.class.getCanonicalName(), defaultValue, null, MIN_VALUE, MAX_VALUE, STEP_VALUE);
+ }
+
+ public int zclGetDataType() {
+ return ZCL_TYPE_UNSIGNED_8_BIT_INT;
+ }
+
+ public boolean zclIsDescreteDataType() {
+ return false;
+ }
+
+ public int zclGetByteLength(Object value) {
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public int zclParse(byte[] msg, int msgIndex, Object[] values, int valuesIndex) throws ZclValidationException {
+ int l = 0xff & msg[msgIndex];
+ values[valuesIndex] = new Integer(l);
+ return msgIndex + 1;
+ }
+
+ public int zclSerialize(Object value, byte[] msg, int msgIndex) throws ZclValidationException {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+ */
+
+ public static short zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ return zclFrame.parseUInt8();
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, short uint8) throws ZclValidationException {
+ zclFrame.appendUInt8(uint8);
+ }
+
+ public static int zclSize (short uint8) throws ZclValidationException {
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public boolean isAnalog() {
+ return IS_ANALOG;
+ }
+
+ public short zclGetDataType() {
+ return ZCL_DATA_TYPE;
+ }
+
+ public void zclObjectSerialize(IZclFrame zclFrame, Object value) throws ZclValidationException {
+ ZclDataTypeBitmap8.zclSerialize(zclFrame, (short) ((Number) value).intValue());
+ }
+
+ public int zclObjectSize(Object value) throws ZclValidationException {
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public Object zclParseToObject(IZclFrame zclFrame) throws ZclValidationException {
+ return new Short(ZclDataTypeBitmap8.zclParse(zclFrame));
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeBoolean.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeBoolean.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeBoolean.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,42 @@
+package it.telecomitalia.ah.zigbee.zcl.lib.types;
+
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+
+public class ZclDataTypeBoolean extends ZclAbstractDataType {
+ private static final int BYTE_ARRAY_LENGTH = 1;
+ public static final int ZCL_DATA_TYPE = ZclTypes.ZclBooleanType;
+ static final boolean IS_ANALOG = false;
+
+ public static boolean zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ return zclFrame.parseBoolean();
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, boolean value) throws ZclValidationException {
+ zclFrame.appendBoolean(value);
+ }
+
+ public static int zclSize (boolean bool) throws ZclValidationException {
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public boolean isAnalog() {
+ return IS_ANALOG;
+ }
+
+ public short zclGetDataType() {
+ return ZCL_DATA_TYPE;
+ }
+
+ public void zclObjectSerialize(IZclFrame zclFrame, Object value) throws ZclValidationException {
+ ZclDataTypeBoolean.zclSerialize(zclFrame, ((Boolean) value).booleanValue());
+ }
+
+ public int zclObjectSize(Object value) throws ZclValidationException {
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public Object zclParseToObject(IZclFrame zclFrame) throws ZclValidationException {
+ return new Boolean(ZclDataTypeBoolean.zclParse(zclFrame));
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeClusterID.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeClusterID.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeClusterID.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,96 @@
+package it.telecomitalia.ah.zigbee.zcl.lib.types;
+
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+
+public class ZclDataTypeClusterID extends ZclAbstractDataType {
+ public static final int ZCL_DATA_TYPE = ZclTypes.ZclClusterIDType;
+ private static final int BYTE_ARRAY_LENGTH = 2;
+ static final boolean IS_ANALOG = true;
+
+/* private static final Integer MAX_VALUE = new Integer(0xffff);
+ private static final Integer MIN_VALUE = new Integer(0x0000);
+ private static final Integer STEP_VALUE = null;
+
+
+ private static ZclDataTypeUI16 instance = null;
+
+ static synchronized public ZclDataTypeUI16 get() {
+ try {
+ if (instance == null)
+ instance = new ZclDataTypeUI16(null);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return instance;
+ }
+
+ static public ZclDataTypeUI16 get(Object defaultValue) {
+ try {
+ return new ZclDataTypeUI16(defaultValue);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ protected ZclDataTypeUI16(Object defaultValue) throws ApplianceValidationException {
+ super(Integer.class.getCanonicalName(), defaultValue, null, MIN_VALUE, MAX_VALUE, STEP_VALUE);
+ }
+
+ public int zclGetDataType() {
+ return ZCL_TYPE_UNSIGNED_8_BIT_INT;
+ }
+
+ public boolean zclIsDescreteDataType() {
+ return false;
+ }
+
+ public int zclGetByteLength(Object value) throws ZclValidationException{
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public int zclParse(byte[] msg, int msgIndex, Object[] values, int valuesIndex) throws ZclValidationException {
+ int i1 = ZclByteUtils._16BitLittleEndianToInt(msg, msgIndex);
+ values[valuesIndex] = new Integer(i1);
+ return msgIndex + 2;
+ }
+
+ public int zclSerialize(Object value, byte[] msg, int msgIndex) throws ZclValidationException{
+ int l = ((Integer) value).intValue();
+ ZclByteUtils._16BitsToLittleEndian(l, msg, msgIndex);
+ return msgIndex + 2;
+ }*/
+
+ public static int zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ return zclFrame.parseUInt16();
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, int uint16) throws ZclValidationException {
+ zclFrame.appendUInt16(uint16);
+ }
+
+ public static int zclSize(int uint16) {
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public boolean isAnalog() {
+ return IS_ANALOG;
+ }
+
+ public short zclGetDataType() {
+ return ZCL_DATA_TYPE;
+ }
+
+ public void zclObjectSerialize(IZclFrame zclFrame, Object value) throws ZclValidationException {
+ ZclDataTypeClusterID.zclSerialize(zclFrame, (int) ((Number) value).intValue());
+ }
+
+ public int zclObjectSize(Object value) throws ZclValidationException {
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public Object zclParseToObject(IZclFrame zclFrame) throws ZclValidationException {
+ return new Integer(ZclDataTypeClusterID.zclParse(zclFrame));
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeEnum16.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeEnum16.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeEnum16.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,42 @@
+package it.telecomitalia.ah.zigbee.zcl.lib.types;
+
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+
+public class ZclDataTypeEnum16 extends ZclAbstractDataType {
+ public static final int ZCL_DATA_TYPE = ZclTypes.ZclEnum16Type;
+ static final int BYTE_ARRAY_LENGTH = 2;
+ static final boolean IS_ANALOG = false;
+
+ public static short zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ return zclFrame.parseUInt8();
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, int enum16) throws ZclValidationException {
+ zclFrame.appendUInt8(enum16);
+ }
+
+ public static int zclSize (int enum16) throws ZclValidationException {
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public void zclObjectSerialize(IZclFrame zclFrame, Object value) throws ZclValidationException {
+ ZclDataTypeEnum16.zclSerialize(zclFrame, (int) ((Number) value).intValue());
+ }
+
+ public int zclObjectSize(Object value) throws ZclValidationException {
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public Object zclParseToObject(IZclFrame zclFrame) throws ZclValidationException {
+ return new Short(ZclDataTypeEnum16.zclParse(zclFrame));
+ }
+
+ public short zclGetDataType() {
+ return ZCL_DATA_TYPE;
+ }
+
+ public boolean isAnalog() {
+ return IS_ANALOG;
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeEnum8.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeEnum8.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeEnum8.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,42 @@
+package it.telecomitalia.ah.zigbee.zcl.lib.types;
+
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+
+public class ZclDataTypeEnum8 extends ZclAbstractDataType {
+ public static final int ZCL_DATA_TYPE = ZclTypes.ZclEnum8Type;
+ static final int BYTE_ARRAY_LENGTH = 1;
+ static final boolean IS_ANALOG = false;
+
+ public static short zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ return zclFrame.parseUInt8();
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, short uint8) throws ZclValidationException {
+ zclFrame.appendUInt8(uint8);
+ }
+
+ public static int zclSize (short uint8) throws ZclValidationException {
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public void zclObjectSerialize(IZclFrame zclFrame, Object value) throws ZclValidationException {
+ ZclDataTypeEnum8.zclSerialize(zclFrame, (short) ((Number) value).intValue());
+ }
+
+ public int zclObjectSize(Object value) throws ZclValidationException {
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public Object zclParseToObject(IZclFrame zclFrame) throws ZclValidationException {
+ return new Short(ZclDataTypeEnum8.zclParse(zclFrame));
+ }
+
+ public short zclGetDataType() {
+ return ZCL_DATA_TYPE;
+ }
+
+ public boolean isAnalog() {
+ return IS_ANALOG;
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeI16.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeI16.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeI16.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,96 @@
+package it.telecomitalia.ah.zigbee.zcl.lib.types;
+
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+
+public class ZclDataTypeI16 extends ZclAbstractDataType {
+ public static final int ZCL_DATA_TYPE = ZclTypes.ZclInt16Type;
+ private static final int BYTE_ARRAY_LENGTH = 2;
+ static final boolean IS_ANALOG = true;
+
+/* private static final Integer MAX_VALUE = new Integer(0xffff);
+ private static final Integer MIN_VALUE = new Integer(0x0000);
+ private static final Integer STEP_VALUE = null;
+
+
+ private static ZclDataTypeUI16 instance = null;
+
+ static synchronized public ZclDataTypeUI16 get() {
+ try {
+ if (instance == null)
+ instance = new ZclDataTypeUI16(null);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return instance;
+ }
+
+ static public ZclDataTypeUI16 get(Object defaultValue) {
+ try {
+ return new ZclDataTypeUI16(defaultValue);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ protected ZclDataTypeUI16(Object defaultValue) throws ApplianceValidationException {
+ super(Integer.class.getCanonicalName(), defaultValue, null, MIN_VALUE, MAX_VALUE, STEP_VALUE);
+ }
+
+ public int zclGetDataType() {
+ return ZCL_TYPE_UNSIGNED_8_BIT_INT;
+ }
+
+ public boolean zclIsDescreteDataType() {
+ return false;
+ }
+
+ public int zclGetByteLength(Object value) throws ZclValidationException{
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public int zclParse(byte[] msg, int msgIndex, Object[] values, int valuesIndex) throws ZclValidationException {
+ int i1 = ZclByteUtils._16BitLittleEndianToInt(msg, msgIndex);
+ values[valuesIndex] = new Integer(i1);
+ return msgIndex + 2;
+ }
+
+ public int zclSerialize(Object value, byte[] msg, int msgIndex) throws ZclValidationException{
+ int l = ((Integer) value).intValue();
+ ZclByteUtils._16BitsToLittleEndian(l, msg, msgIndex);
+ return msgIndex + 2;
+ }*/
+
+ public static int zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ return zclFrame.parseUInt16();
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, int uint16) throws ZclValidationException {
+ zclFrame.appendUInt16(uint16);
+ }
+
+ public static int zclSize(int uint16) {
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public boolean isAnalog() {
+ return IS_ANALOG;
+ }
+
+ public short zclGetDataType() {
+ return ZCL_DATA_TYPE;
+ }
+
+ public void zclObjectSerialize(IZclFrame zclFrame, Object value) throws ZclValidationException {
+ ZclDataTypeI16.zclSerialize(zclFrame, (int) ((Number) value).intValue());
+ }
+
+ public int zclObjectSize(Object value) throws ZclValidationException {
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public Object zclParseToObject(IZclFrame zclFrame) throws ZclValidationException {
+ return new Integer(ZclDataTypeI16.zclParse(zclFrame));
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeI24.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeI24.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeI24.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,42 @@
+package it.telecomitalia.ah.zigbee.zcl.lib.types;
+
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+
+public class ZclDataTypeI24 extends ZclAbstractDataType {
+ public static final int ZCL_DATA_TYPE = ZclTypes.ZclInt24Type;
+ private static final int BYTE_ARRAY_LENGTH = 3;
+ static final boolean IS_ANALOG = true;
+
+ public static int zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ return zclFrame.parseUInt24();
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, int uint) throws ZclValidationException {
+ zclFrame.appendUInt24(uint);
+ }
+
+ public static int zclSize(int value) {
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public boolean isAnalog() {
+ return IS_ANALOG;
+ }
+
+ public short zclGetDataType() {
+ return ZCL_DATA_TYPE;
+ }
+
+ public void zclObjectSerialize(IZclFrame zclFrame, Object value) throws ZclValidationException {
+ ZclDataTypeI24.zclSerialize(zclFrame, (int) ((Number) value).intValue());
+ }
+
+ public int zclObjectSize(Object value) throws ZclValidationException {
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public Object zclParseToObject(IZclFrame zclFrame) throws ZclValidationException {
+ return new Integer(ZclDataTypeI24.zclParse(zclFrame));
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeI32.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeI32.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeI32.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,95 @@
+package it.telecomitalia.ah.zigbee.zcl.lib.types;
+
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+
+public class ZclDataTypeI32 extends ZclAbstractDataType {
+ public static final int ZCL_DATA_TYPE = ZclTypes.ZclInt32Type;
+ private static final int BYTE_ARRAY_LENGTH = 4;
+ static final boolean IS_ANALOG = true;
+
+ /*private static final Integer MAX_VALUE = new Integer(0xffff);
+ private static final Integer MIN_VALUE = new Integer(0x0000);
+ private static final Integer STEP_VALUE = null;
+
+ private static ZclDataTypeUI32 instance = null;
+
+ static synchronized public ZclDataTypeUI32 get() {
+ try {
+ if (instance == null)
+ instance = new ZclDataTypeUI32(null);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return instance;
+ }
+
+ static public ZclDataTypeUI32 get(Object defaultValue) {
+ try {
+ return new ZclDataTypeUI32(defaultValue);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ protected ZclDataTypeUI32(Object defaultValue) throws ApplianceValidationException {
+ super(Integer.class.getCanonicalName(), defaultValue, null, MIN_VALUE, MAX_VALUE, STEP_VALUE);
+ }
+
+ public int zclGetDataType() {
+ return ZCL_TYPE_UNSIGNED_8_BIT_INT;
+ }
+
+ public boolean zclIsDescreteDataType() {
+ return false;
+ }
+
+ public int zclGetByteLength(Object value) throws ZclValidationException{
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public int zclParse(byte[] msg, int msgIndex, Object[] values, int valuesIndex) throws ZclValidationException {
+ int i1 = ZclByteUtils._16BitLittleEndianToInt(msg, msgIndex);
+ values[valuesIndex] = new Integer(i1);
+ return msgIndex + 2;
+ }
+
+ public int zclSerialize(Object value, byte[] msg, int msgIndex) throws ZclValidationException{
+ int l = ((Integer) value).intValue();
+ ZclByteUtils._16BitsToLittleEndian(l, msg, msgIndex);
+ return msgIndex + 2;
+ }*/
+
+ public static long zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ return zclFrame.parseUInt32();
+ }
+
+ public static int zclSize (long value) throws ZclValidationException {
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, long uint) throws ZclValidationException {
+ zclFrame.appendUInt32(uint);
+ }
+
+ public boolean isAnalog() {
+ return IS_ANALOG;
+ }
+
+ public short zclGetDataType() {
+ return ZCL_DATA_TYPE;
+ }
+
+ public void zclObjectSerialize(IZclFrame zclFrame, Object value) throws ZclValidationException {
+ ZclDataTypeI32.zclSerialize(zclFrame, (long) ((Number) value).longValue());
+ }
+
+ public int zclObjectSize(Object value) throws ZclValidationException {
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public Object zclParseToObject(IZclFrame zclFrame) throws ZclValidationException {
+ return new Long(ZclDataTypeI32.zclParse(zclFrame));
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeI8.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeI8.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeI8.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,95 @@
+package it.telecomitalia.ah.zigbee.zcl.lib.types;
+
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+
+public class ZclDataTypeI8 extends ZclAbstractDataType {
+ public static final int ZCL_DATA_TYPE = ZclTypes.ZclInt8Type;
+ static final int BYTE_ARRAY_LENGTH = 1;
+ static final boolean IS_ANALOG = true;
+
+/* static final Short MAX_VALUE = new Short((short) 0xff);
+ static final Short MIN_VALUE = new Short((short) 0x00);
+ static final Short STEP_VALUE = null;
+
+ private static ZclDataTypeUI8 instance = null;
+
+ static synchronized public ZclDataTypeUI8 get() {
+ try {
+ if (instance == null)
+ instance = new ZclDataTypeUI8(null);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return instance;
+ }
+
+ static public ZclDataTypeUI8 get(Object defaultValue) {
+ try {
+ return new ZclDataTypeUI8(defaultValue);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ protected ZclDataTypeUI8(Object defaultValue) throws ApplianceValidationException {
+ super(Short.class.getCanonicalName(), defaultValue, null, MIN_VALUE, MAX_VALUE, STEP_VALUE);
+ }
+
+ public int zclGetDataType() {
+ return ZCL_TYPE_UNSIGNED_8_BIT_INT;
+ }
+
+ public boolean zclIsDescreteDataType() {
+ return false;
+ }
+
+ public int zclGetByteLength(Object value) {
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public int zclParse(byte[] msg, int msgIndex, Object[] values, int valuesIndex) throws ZclValidationException {
+ int l = 0xff & msg[msgIndex];
+ values[valuesIndex] = new Integer(l);
+ return msgIndex + 1;
+ }
+
+ public int zclSerialize(Object value, byte[] msg, int msgIndex) throws ZclValidationException {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+ */
+
+ public static short zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ return zclFrame.parseUInt8();
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, short uint8) throws ZclValidationException {
+ zclFrame.appendUInt8(uint8);
+ }
+
+ public static int zclSize (short uint8) throws ZclValidationException {
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public void zclObjectSerialize(IZclFrame zclFrame, Object value) throws ZclValidationException {
+ ZclDataTypeI8.zclSerialize(zclFrame, (short) ((Number) value).intValue());
+ }
+
+ public int zclObjectSize(Object value) throws ZclValidationException {
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public Object zclParseToObject(IZclFrame zclFrame) throws ZclValidationException {
+ return new Short(ZclDataTypeI8.zclParse(zclFrame));
+ }
+
+ public short zclGetDataType() {
+ return ZCL_DATA_TYPE;
+ }
+
+ public boolean isAnalog() {
+ return IS_ANALOG;
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeOctets.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeOctets.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeOctets.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,104 @@
+package it.telecomitalia.ah.zigbee.zcl.lib.types;
+
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+
+public class ZclDataTypeOctets extends ZclAbstractDataType {
+ private static final int BYTE_ARRAY_LENGTH = 3;
+ public static final int ZCL_DATA_TYPE = ZclTypes.ZclOctetsType;
+ static final boolean IS_ANALOG = false;
+ private int maxSize;
+/*
+ private static final Integer MAX_VALUE = new Integer(0xffff);
+ private static final Integer MIN_VALUE = new Integer(0x0000);
+ private static final Integer STEP_VALUE = null;
+
+
+ private static ZclDataTypeOctets instance = null;
+
+ static synchronized public ZclDataTypeOctets get() {
+ try {
+ if (instance == null)
+ instance = new ZclDataTypeOctets(null);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return instance;
+ }
+
+ static public ZclDataTypeOctets get(Object defaultValue) {
+ try {
+ return new ZclDataTypeOctets(defaultValue);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ protected ZclDataTypeOctets(Object defaultValue) throws ApplianceValidationException {
+ super(Integer.class.getCanonicalName(), defaultValue, null, MIN_VALUE, MAX_VALUE, STEP_VALUE);
+ }
+
+ public int zclGetDataType() {
+ return ZCL_TYPE_UNSIGNED_8_BIT_INT;
+ }
+
+ public boolean zclIsDescreteDataType() {
+ return false;
+ }
+
+ public int zclGetByteLength(Object value) throws ZclValidationException{
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public int zclParse(byte[] msg, int msgIndex, Object[] values, int valuesIndex) throws ZclValidationException {
+ int i1 = ZclByteUtils._16BitLittleEndianToInt(msg, msgIndex);
+ values[valuesIndex] = new Integer(i1);
+ return msgIndex + 2;
+ }
+
+ public int zclSerialize(Object value, byte[] msg, int msgIndex) throws ZclValidationException{
+ int l = ((Integer) value).intValue();
+ ZclByteUtils._16BitsToLittleEndian(l, msg, msgIndex);
+ return msgIndex + 2;
+ }*/
+
+ public ZclDataTypeOctets(int maxSize) {
+ this.maxSize = maxSize;
+ }
+
+ public static byte[] zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ return zclFrame.parseOctets();
+ }
+
+ public static int zclSize (byte[] value) throws ZclValidationException {
+ if (value == null) {
+ return 1;
+ }
+ return value.length + 1; // first byte is reserved for length
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, byte[] value) throws ZclValidationException {
+ zclFrame.appendOctets(value);
+ }
+
+ public boolean isAnalog() {
+ return IS_ANALOG;
+ }
+
+ public short zclGetDataType() {
+ return ZCL_DATA_TYPE;
+ }
+
+ public void zclObjectSerialize(IZclFrame zclFrame, Object value) throws ZclValidationException {
+ ZclDataTypeOctets.zclSerialize(zclFrame, (byte[]) value);
+ }
+
+ public int zclObjectSize(Object value) throws ZclValidationException {
+ return ((byte[]) value).length;
+ }
+
+ public Object zclParseToObject(IZclFrame zclFrame) throws ZclValidationException {
+ return zclFrame.parseOctets();
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeString.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeString.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeString.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,102 @@
+package it.telecomitalia.ah.zigbee.zcl.lib.types;
+
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+
+public class ZclDataTypeString extends ZclAbstractDataType {
+
+ public static final int ZCL_DATA_TYPE = ZclTypes.ZclStringType;
+ private static final int BYTE_ARRAY_LENGTH = 1;
+ static final boolean IS_ANALOG = false;
+ int maxSize = 0;
+/*
+ static final Short MAX_VALUE = new Short((short) 0xff);
+ static final Short MIN_VALUE = new Short((short) 0x00);
+ static final Short STEP_VALUE = null;
+
+
+ private static ZclDataTypeString instance = null;
+
+ static synchronized public ZclDataTypeString get() {
+ try {
+ if (instance == null)
+ instance = new ZclDataTypeString(null);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return instance;
+ }
+
+ static public ZclDataTypeString get(Object defaultValue) {
+ try {
+ return new ZclDataTypeString(defaultValue);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ protected ZclDataTypeString(Object defaultValue) throws ApplianceValidationException {
+ super(Short.class.getCanonicalName(), defaultValue, null, MIN_VALUE, MAX_VALUE, STEP_VALUE);
+ }
+
+ public int zclGetDataType() {
+ return ZCL_TYPE_UNSIGNED_8_BIT_INT;
+ }
+
+ public boolean zclIsDescreteDataType() {
+ return false;
+ }
+
+ public int zclGetByteLength(Object value) {
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public int zclParse(byte[] msg, int msgIndex, Object[] values, int valuesIndex) throws ZclValidationException {
+ int l = 0xff & msg[msgIndex];
+ values[valuesIndex] = new Integer(l);
+ return msgIndex + 1;
+ }
+
+ public int zclSerialize(Object value, byte[] msg, int msgIndex) throws ZclValidationException {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+ */
+
+ public ZclDataTypeString(int maxSize) {
+ this.maxSize = maxSize;
+ }
+
+ public static String zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ return zclFrame.parseString();
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, String value) throws ZclValidationException {
+ zclFrame.appendString(value);
+ }
+
+ public static int zclSize (String value) throws ZclValidationException {
+ return value.length();
+ }
+
+ public boolean isAnalog() {
+ return IS_ANALOG;
+ }
+
+ public short zclGetDataType() {
+ return ZCL_DATA_TYPE;
+ }
+
+ public void zclObjectSerialize(IZclFrame zclFrame, Object value) throws ZclValidationException {
+ ZclDataTypeString.zclSerialize(zclFrame, (String) value);
+ }
+
+ public int zclObjectSize(Object value) throws ZclValidationException {
+ return ((String) value).length();
+ }
+
+ public Object zclParseToObject(IZclFrame zclFrame) throws ZclValidationException {
+ return zclFrame.parseString();
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUI16.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUI16.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUI16.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,96 @@
+package it.telecomitalia.ah.zigbee.zcl.lib.types;
+
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+
+public class ZclDataTypeUI16 extends ZclAbstractDataType {
+ public static final int ZCL_DATA_TYPE = ZclTypes.ZclUInt16Type;
+ private static final int BYTE_ARRAY_LENGTH = 2;
+ static final boolean IS_ANALOG = true;
+
+/* private static final Integer MAX_VALUE = new Integer(0xffff);
+ private static final Integer MIN_VALUE = new Integer(0x0000);
+ private static final Integer STEP_VALUE = null;
+
+
+ private static ZclDataTypeUI16 instance = null;
+
+ static synchronized public ZclDataTypeUI16 get() {
+ try {
+ if (instance == null)
+ instance = new ZclDataTypeUI16(null);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return instance;
+ }
+
+ static public ZclDataTypeUI16 get(Object defaultValue) {
+ try {
+ return new ZclDataTypeUI16(defaultValue);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ protected ZclDataTypeUI16(Object defaultValue) throws ApplianceValidationException {
+ super(Integer.class.getCanonicalName(), defaultValue, null, MIN_VALUE, MAX_VALUE, STEP_VALUE);
+ }
+
+ public int zclGetDataType() {
+ return ZCL_TYPE_UNSIGNED_8_BIT_INT;
+ }
+
+ public boolean zclIsDescreteDataType() {
+ return false;
+ }
+
+ public int zclGetByteLength(Object value) throws ZclValidationException{
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public int zclParse(byte[] msg, int msgIndex, Object[] values, int valuesIndex) throws ZclValidationException {
+ int i1 = ZclByteUtils._16BitLittleEndianToInt(msg, msgIndex);
+ values[valuesIndex] = new Integer(i1);
+ return msgIndex + 2;
+ }
+
+ public int zclSerialize(Object value, byte[] msg, int msgIndex) throws ZclValidationException{
+ int l = ((Integer) value).intValue();
+ ZclByteUtils._16BitsToLittleEndian(l, msg, msgIndex);
+ return msgIndex + 2;
+ }*/
+
+ public static int zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ return zclFrame.parseUInt16();
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, int uint16) throws ZclValidationException {
+ zclFrame.appendUInt16(uint16);
+ }
+
+ public static int zclSize(int uint16) {
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public boolean isAnalog() {
+ return IS_ANALOG;
+ }
+
+ public short zclGetDataType() {
+ return ZCL_DATA_TYPE;
+ }
+
+ public void zclObjectSerialize(IZclFrame zclFrame, Object value) throws ZclValidationException {
+ ZclDataTypeUI16.zclSerialize(zclFrame, (int) ((Number) value).intValue());
+ }
+
+ public int zclObjectSize(Object value) throws ZclValidationException {
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public Object zclParseToObject(IZclFrame zclFrame) throws ZclValidationException {
+ return new Integer(ZclDataTypeUI16.zclParse(zclFrame));
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUI24.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUI24.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUI24.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,97 @@
+package it.telecomitalia.ah.zigbee.zcl.lib.types;
+
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+
+public class ZclDataTypeUI24 extends ZclAbstractDataType {
+ public static final int ZCL_DATA_TYPE = ZclTypes.ZclUInt24Type;
+ private static final int BYTE_ARRAY_LENGTH = 3;
+ static final boolean IS_ANALOG = true;
+
+/*
+ private static final Integer MAX_VALUE = new Integer(0xffff);
+ private static final Integer MIN_VALUE = new Integer(0x0000);
+ private static final Integer STEP_VALUE = null;
+
+
+ private static ZclDataTypeUI24 instance = null;
+
+ static synchronized public ZclDataTypeUI24 get() {
+ try {
+ if (instance == null)
+ instance = new ZclDataTypeUI24(null);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return instance;
+ }
+
+ static public ZclDataTypeUI24 get(Object defaultValue) {
+ try {
+ return new ZclDataTypeUI24(defaultValue);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ protected ZclDataTypeUI24(Object defaultValue) throws ApplianceValidationException {
+ super(Integer.class.getCanonicalName(), defaultValue, null, MIN_VALUE, MAX_VALUE, STEP_VALUE);
+ }
+
+ public int zclGetDataType() {
+ return ZCL_TYPE_UNSIGNED_8_BIT_INT;
+ }
+
+ public boolean zclIsDescreteDataType() {
+ return false;
+ }
+
+ public int zclGetByteLength(Object value) throws ZclValidationException{
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public int zclParse(byte[] msg, int msgIndex, Object[] values, int valuesIndex) throws ZclValidationException {
+ int i1 = ZclByteUtils._16BitLittleEndianToInt(msg, msgIndex);
+ values[valuesIndex] = new Integer(i1);
+ return msgIndex + 2;
+ }
+
+ public int zclSerialize(Object value, byte[] msg, int msgIndex) throws ZclValidationException{
+ int l = ((Integer) value).intValue();
+ ZclByteUtils._16BitsToLittleEndian(l, msg, msgIndex);
+ return msgIndex + 2;
+ }*/
+
+ public static int zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ return zclFrame.parseUInt24();
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, int uint) throws ZclValidationException {
+ zclFrame.appendUInt24(uint);
+ }
+
+ public static int zclSize(int value) {
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public boolean isAnalog() {
+ return IS_ANALOG;
+ }
+
+ public short zclGetDataType() {
+ return ZCL_DATA_TYPE;
+ }
+
+ public void zclObjectSerialize(IZclFrame zclFrame, Object value) throws ZclValidationException {
+ ZclDataTypeUI24.zclSerialize(zclFrame, (int) ((Number) value).intValue());
+ }
+
+ public int zclObjectSize(Object value) throws ZclValidationException {
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public Object zclParseToObject(IZclFrame zclFrame) throws ZclValidationException {
+ return new Integer(ZclDataTypeUI24.zclParse(zclFrame));
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUI32.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUI32.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUI32.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,95 @@
+package it.telecomitalia.ah.zigbee.zcl.lib.types;
+
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+
+public class ZclDataTypeUI32 extends ZclAbstractDataType {
+ public static final int ZCL_DATA_TYPE = ZclTypes.ZclUInt32Type;
+ private static final int BYTE_ARRAY_LENGTH = 4;
+ static final boolean IS_ANALOG = true;
+
+ /*private static final Integer MAX_VALUE = new Integer(0xffff);
+ private static final Integer MIN_VALUE = new Integer(0x0000);
+ private static final Integer STEP_VALUE = null;
+
+ private static ZclDataTypeUI32 instance = null;
+
+ static synchronized public ZclDataTypeUI32 get() {
+ try {
+ if (instance == null)
+ instance = new ZclDataTypeUI32(null);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return instance;
+ }
+
+ static public ZclDataTypeUI32 get(Object defaultValue) {
+ try {
+ return new ZclDataTypeUI32(defaultValue);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ protected ZclDataTypeUI32(Object defaultValue) throws ApplianceValidationException {
+ super(Integer.class.getCanonicalName(), defaultValue, null, MIN_VALUE, MAX_VALUE, STEP_VALUE);
+ }
+
+ public int zclGetDataType() {
+ return ZCL_TYPE_UNSIGNED_8_BIT_INT;
+ }
+
+ public boolean zclIsDescreteDataType() {
+ return false;
+ }
+
+ public int zclGetByteLength(Object value) throws ZclValidationException{
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public int zclParse(byte[] msg, int msgIndex, Object[] values, int valuesIndex) throws ZclValidationException {
+ int i1 = ZclByteUtils._16BitLittleEndianToInt(msg, msgIndex);
+ values[valuesIndex] = new Integer(i1);
+ return msgIndex + 2;
+ }
+
+ public int zclSerialize(Object value, byte[] msg, int msgIndex) throws ZclValidationException{
+ int l = ((Integer) value).intValue();
+ ZclByteUtils._16BitsToLittleEndian(l, msg, msgIndex);
+ return msgIndex + 2;
+ }*/
+
+ public static long zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ return zclFrame.parseUInt32();
+ }
+
+ public static int zclSize (long value) throws ZclValidationException {
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, long uint) throws ZclValidationException {
+ zclFrame.appendUInt32(uint);
+ }
+
+ public boolean isAnalog() {
+ return IS_ANALOG;
+ }
+
+ public short zclGetDataType() {
+ return ZCL_DATA_TYPE;
+ }
+
+ public void zclObjectSerialize(IZclFrame zclFrame, Object value) throws ZclValidationException {
+ ZclDataTypeUI32.zclSerialize(zclFrame, (long) ((Number) value).longValue());
+ }
+
+ public int zclObjectSize(Object value) throws ZclValidationException {
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public Object zclParseToObject(IZclFrame zclFrame) throws ZclValidationException {
+ return new Long(ZclDataTypeUI32.zclParse(zclFrame));
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUI48.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUI48.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUI48.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,42 @@
+package it.telecomitalia.ah.zigbee.zcl.lib.types;
+
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+
+public class ZclDataTypeUI48 extends ZclAbstractDataType {
+ public static final int ZCL_DATA_TYPE = ZclTypes.ZclUInt48Type;
+ private static final int BYTE_ARRAY_LENGTH = 6;
+ static final boolean IS_ANALOG = true;
+
+ public static long zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ return zclFrame.parseUInt48();
+ }
+
+ public static int zclSize (long value) throws ZclValidationException {
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, long value) throws ZclValidationException {
+ zclFrame.appendUInt48(value);
+ }
+
+ public boolean isAnalog() {
+ return IS_ANALOG;
+ }
+
+ public short zclGetDataType() {
+ return ZCL_DATA_TYPE;
+ }
+
+ public void zclObjectSerialize(IZclFrame zclFrame, Object value) throws ZclValidationException {
+ ZclDataTypeUI48.zclSerialize(zclFrame, (long) ((Number) value).longValue());
+ }
+
+ public int zclObjectSize(Object value) throws ZclValidationException {
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public Object zclParseToObject(IZclFrame zclFrame) throws ZclValidationException {
+ return new Long(ZclDataTypeUI48.zclParse(zclFrame));
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUI8.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUI8.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUI8.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,95 @@
+package it.telecomitalia.ah.zigbee.zcl.lib.types;
+
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+
+public class ZclDataTypeUI8 extends ZclAbstractDataType {
+ public static final int ZCL_DATA_TYPE = ZclTypes.ZclUInt8Type;
+ static final int BYTE_ARRAY_LENGTH = 1;
+ static final boolean IS_ANALOG = true;
+
+/* static final Short MAX_VALUE = new Short((short) 0xff);
+ static final Short MIN_VALUE = new Short((short) 0x00);
+ static final Short STEP_VALUE = null;
+
+ private static ZclDataTypeUI8 instance = null;
+
+ static synchronized public ZclDataTypeUI8 get() {
+ try {
+ if (instance == null)
+ instance = new ZclDataTypeUI8(null);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return instance;
+ }
+
+ static public ZclDataTypeUI8 get(Object defaultValue) {
+ try {
+ return new ZclDataTypeUI8(defaultValue);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ protected ZclDataTypeUI8(Object defaultValue) throws ApplianceValidationException {
+ super(Short.class.getCanonicalName(), defaultValue, null, MIN_VALUE, MAX_VALUE, STEP_VALUE);
+ }
+
+ public int zclGetDataType() {
+ return ZCL_TYPE_UNSIGNED_8_BIT_INT;
+ }
+
+ public boolean zclIsDescreteDataType() {
+ return false;
+ }
+
+ public int zclGetByteLength(Object value) {
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public int zclParse(byte[] msg, int msgIndex, Object[] values, int valuesIndex) throws ZclValidationException {
+ int l = 0xff & msg[msgIndex];
+ values[valuesIndex] = new Integer(l);
+ return msgIndex + 1;
+ }
+
+ public int zclSerialize(Object value, byte[] msg, int msgIndex) throws ZclValidationException {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+ */
+
+ public static short zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ return zclFrame.parseUInt8();
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, short uint8) throws ZclValidationException {
+ zclFrame.appendUInt8(uint8);
+ }
+
+ public static int zclSize (short uint8) throws ZclValidationException {
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public void zclObjectSerialize(IZclFrame zclFrame, Object value) throws ZclValidationException {
+ ZclDataTypeUI8.zclSerialize(zclFrame, (short) ((Number) value).intValue());
+ }
+
+ public int zclObjectSize(Object value) throws ZclValidationException {
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public Object zclParseToObject(IZclFrame zclFrame) throws ZclValidationException {
+ return new Short(ZclDataTypeUI8.zclParse(zclFrame));
+ }
+
+ public short zclGetDataType() {
+ return ZCL_DATA_TYPE;
+ }
+
+ public boolean isAnalog() {
+ return IS_ANALOG;
+ }
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUTCTime.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUTCTime.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclDataTypeUTCTime.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,96 @@
+package it.telecomitalia.ah.zigbee.zcl.lib.types;
+
+import it.telecomitalia.ah.zigbee.IZclFrame;
+import it.telecomitalia.ah.zigbee.zcl.ZclValidationException;
+
+public class ZclDataTypeUTCTime extends ZclAbstractDataType {
+ public static final int ZCL_DATA_TYPE = ZclTypes.ZclUTCTime;
+ private static final int BYTE_ARRAY_LENGTH = 4;
+ static final boolean IS_ANALOG = false;
+
+/*
+ static final Short MAX_VALUE = new Short((short) 0xff);
+ static final Short MIN_VALUE = new Short((short) 0x00);
+ static final Short STEP_VALUE = null;
+
+ private static ZclDataTypeUTCTime instance = null;
+
+ static synchronized public ZclDataTypeUTCTime get() {
+ try {
+ if (instance == null)
+ instance = new ZclDataTypeUTCTime(null);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return instance;
+ }
+
+ static public ZclDataTypeUTCTime get(Object defaultValue) {
+ try {
+ return new ZclDataTypeUTCTime(defaultValue);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ protected ZclDataTypeUTCTime(Object defaultValue) throws ApplianceValidationException {
+ super(Short.class.getCanonicalName(), defaultValue, null, MIN_VALUE, MAX_VALUE, STEP_VALUE);
+ }
+
+ public int zclGetDataType() {
+ return ZCL_TYPE_UNSIGNED_8_BIT_INT;
+ }
+
+ public boolean zclIsDescreteDataType() {
+ return false;
+ }
+
+ public int zclGetByteLength(Object value) {
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public int zclParse(byte[] msg, int msgIndex, Object[] values, int valuesIndex) throws ZclValidationException {
+ int l = 0xff & msg[msgIndex];
+ values[valuesIndex] = new Integer(l);
+ return msgIndex + 1;
+ }
+
+ public int zclSerialize(Object value, byte[] msg, int msgIndex) throws ZclValidationException {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+ */
+
+ public static long zclParse(IZclFrame zclFrame) throws ZclValidationException {
+ return zclFrame.parseUTCTime();
+ }
+
+ public static void zclSerialize(IZclFrame zclFrame, long value) throws ZclValidationException {
+ zclFrame.appendUTCTime(value);
+ }
+
+ public static int zclSize (long value) throws ZclValidationException {
+ return BYTE_ARRAY_LENGTH;
+ }
+ public boolean isAnalog() {
+ return IS_ANALOG;
+ }
+
+ public short zclGetDataType() {
+ return ZCL_DATA_TYPE;
+ }
+
+ public void zclObjectSerialize(IZclFrame zclFrame, Object value) throws ZclValidationException {
+ ZclDataTypeUI32.zclSerialize(zclFrame, (long) ((Number) value).longValue());
+ }
+
+ public int zclObjectSize(Object value) throws ZclValidationException {
+ return BYTE_ARRAY_LENGTH;
+ }
+
+ public Object zclParseToObject(IZclFrame zclFrame) throws ZclValidationException {
+ return new Long(ZclDataTypeUI32.zclParse(zclFrame));
+ }
+
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclTypes.java
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclTypes.java (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/src/it/telecomitalia/ah/zigbee/zcl/lib/types/ZclTypes.java Mon Oct 22 13:55:46 2012
@@ -1,0 +1,47 @@
+package it.telecomitalia.ah.zigbee.zcl.lib.types;
+
+
+
+/**
+ * ZigBee type constants
+ *
+ * TODO: implementare tutti i tipi di ZigBee (in particolare quelli utilizzati da Indesit!
+ */
+
+public class ZclTypes {
+
+ public static final short ZclData8Type = 0x08;
+ public static final short ZclData16Type = 0x09;
+ public static final short ZclData24Type = 0x0a;
+ public static final short ZclData32Type = 0x0b;
+ public static final short ZclBooleanType = 0x10;
+ public static final short ZclBitmap8Type = 0x18;
+ public static final short ZclBitmap16Type = 0x19;
+ public static final short ZclBitmap24Type = 0x1a;
+ public static final short ZclBitmap32Type = 0x1b;
+
+ public static final short ZclUInt8Type = 0x20;
+ public static final short ZclUInt16Type = 0x21;
+ public static final short ZclUInt24Type = 0x22;
+ public static final short ZclUInt32Type = 0x23;
+
+ public static final short ZclUInt40Type = 0x24; // From Smart Energy Profile
+ public static final short ZclUInt48Type = 0x25; // From Smart Energy Profile
+
+ public static final short ZclInt8Type = 0x28;
+ public static final short ZclInt16Type = 0x29;
+ public static final short ZclInt24Type = 0x2a;
+ public static final short ZclInt32Type = 0x2b;
+
+ public static final short ZclEnum8Type = 0x30;
+ public static final short ZclEnum16Type = 0x31;
+
+ public static final short ZclOctetsType = 0x41;
+ public static final short ZclStringType = 0x42;
+
+ public static final short ZclClusterIDType = 0xe8;
+
+ public static final short ZclFloatType = 0x99; // FIXME: put the right value
+ // from specs!!!
+ public static final short ZclUTCTime = 0xe2; // From Smart Energy Profile
+}
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/xml/zigbee/README.TXT
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/xml/zigbee/README.TXT (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/xml/zigbee/README.TXT Mon Oct 22 13:55:46 2012
@@ -1,0 +1,11 @@
+
+Defaults:
+
+access="r"
+mandatory="true"
+
+
+generate="true"
+
+generate is used to enable/disable code generation.
+By default code generation is enabled
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/xml/zigbee/ha.xml
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/xml/zigbee/ha.xml (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/xml/zigbee/ha.xml Mon Oct 22 13:55:46 2012
@@ -1,0 +1,339 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<profiles xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="ha.xsd">
+ <profile id="0x0104" name="Home Automation Profile">
+
+ <!--
+ Imports ZigBee Cluster Library to get cluster definitions used below
+ -->
+
+ <xi:include href="/xml/zigbee/zcl.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+
+ <device id="0x0000" name="On/Off Switch">
+ <server>
+ <clusterRef name="Basic" />
+ <clusterRef name="Identify" />
+ <clusterRef name="On/Off Switch Configuration" />
+ </server>
+ <client>
+ <clusterRef name="On/Off" />
+ </client>
+ </device>
+
+ <device id="0x0001" name="Level Control Switch">
+ <server>
+ <clusterRef name="On/Off Switch Configuration" />
+ </server>
+ <client>
+ <clusterRef name="On/Off" />
+ <clusterRef name="Level Control" />
+ </client>
+ </device>
+
+ <device id="0x0002" name="On/Off Output">
+ <server>
+ <clusterRef name="On/Off" />
+ <clusterRef name="Scenes" />
+ <clusterRef name="Groups" />
+ </server>
+ </device>
+
+ <device id="0x0009" name="Mains Power Outlet">
+ <server>
+ <clusterRef name="On/Off" />
+ <clusterRef name="Scenes" />
+ <clusterRef name="Groups" />
+ </server>
+ </device>
+
+ <device id="0x0006" name="Remote Control" />
+ <device id="0x0100" name="On/Off Light" />
+ <device id="0x0103" name="On/Off light Switch" />
+ <device id="0x0200" name="Shade">
+ <server>
+ <clusterRef name="Shade Configuration" />
+ <clusterRef name="On/Off" />
+ <clusterRef name="Level Control" />
+ <clusterRef name="Scenes" />
+ <clusterRef name="Groups" />
+ </server>
+ </device>
+ <device id="0x0201" name="Shade Controller">
+ <client>
+ <clusterRef name="On/Off" />
+ <clusterRef name="Level Control" />
+ <clusterRef name="Shade Configuration" />
+ <clusterRef name="Scenes" />
+ <clusterRef name="Identify" />
+ </client>
+ </device>
+ <device id="0x0300" name="Heating/Cooling Unit" />
+ <device id="0x0302" name="Temperature Sensor">
+ <server>
+ <clusterRef name="Temperature Measurement" />
+ </server>
+ </device>
+
+ <!-- Indesit CECED applicances -->
+
+ <device id="0x0A00" name="White Goods">
+ <server>
+ <clusterRef name="Basic" />
+ <clusterRef name="Identify" />
+ <clusterRef name="Groups" />
+ <clusterRef name="On/Off" />
+ <clusterRef name="Appliance Identification" />
+ <clusterRef name="Appliance Control" />
+ <clusterRef name="Appliance Events and Alerts" />
+ <clusterRef name="Indesit Bridge" />
+ <clusterRef name="Simple Metering" mandatory="false" />
+ <clusterRef name="Applicance Statistics" mandatory="false" />
+ <clusterRef name="Alarms" mandatory="false" />
+ <clusterRef name="Temperature Measurement" mandatory="false" />
+ </server>
+ <client>
+ <clusterRef name="Power Levelling" mandatory="false" />
+ </client>
+ </device>
+
+ <device id="0x0A01" name="Dishwasher">
+ <server>
+ <clusterRef name="Basic" />
+ <clusterRef name="Identify" />
+ <clusterRef name="Groups" />
+ <clusterRef name="On/Off" />
+ <clusterRef name="Appliance Identification" />
+ <clusterRef name="Appliance Control" />
+ <clusterRef name="Appliance Events and Alerts" />
+ <clusterRef name="Indesit Bridge" />
+ <clusterRef name="Simple Metering" mandatory="false" />
+ <clusterRef name="Applicance Statistics" mandatory="false" />
+ <clusterRef name="Alarms" mandatory="false" />
+ <clusterRef name="Temperature Measurement" mandatory="false" />
+ </server>
+ <client>
+ <clusterRef name="Power Levelling" mandatory="false" />
+ </client>
+ </device>
+
+ <device id="0x0A02" name="Tumble Dryer">
+ <server>
+ <clusterRef name="Basic" />
+ <clusterRef name="Identify" />
+ <clusterRef name="Groups" />
+ <clusterRef name="On/Off" />
+ <clusterRef name="Appliance Identification" />
+ <clusterRef name="Appliance Control" />
+ <clusterRef name="Appliance Events and Alerts" />
+ <clusterRef name="Indesit Bridge" />
+ <clusterRef name="Simple Metering" mandatory="false" />
+ <clusterRef name="Applicance Statistics" mandatory="false" />
+ <clusterRef name="Alarms" mandatory="false" />
+ <clusterRef name="Temperature Measurement" mandatory="false" />
+ </server>
+ <client>
+ <clusterRef name="Power Levelling" mandatory="false" />
+ </client>
+ </device>
+
+ <device id="0x0A03" name="Washer Dryer">
+ <server>
+ <clusterRef name="Basic" />
+ <clusterRef name="Identify" />
+ <clusterRef name="Groups" />
+ <clusterRef name="On/Off" />
+ <clusterRef name="Appliance Identification" />
+ <clusterRef name="Appliance Control" />
+ <clusterRef name="Appliance Events and Alerts" />
+ <clusterRef name="Indesit Bridge" />
+ <clusterRef name="Simple Metering" mandatory="false" />
+ <clusterRef name="Applicance Statistics" mandatory="false" />
+ <clusterRef name="Alarms" mandatory="false" />
+ <clusterRef name="Temperature Measurement" mandatory="false" />
+ </server>
+ <client>
+ <clusterRef name="Power Levelling" mandatory="false" />
+ </client>
+ </device>
+
+ <device id="0x0A04" name="Washing Machine">
+ <server>
+ <clusterRef name="Basic" />
+ <clusterRef name="Identify" />
+ <clusterRef name="Groups" />
+ <clusterRef name="On/Off" />
+ <clusterRef name="Appliance Identification" />
+ <clusterRef name="Appliance Control" />
+ <clusterRef name="Appliance Events and Alerts" />
+ <clusterRef name="Indesit Bridge" />
+ <clusterRef name="Simple Metering" mandatory="false" />
+ <clusterRef name="Applicance Statistics" mandatory="false" />
+ <clusterRef name="Alarms" mandatory="false" />
+ <clusterRef name="Temperature Measurement" mandatory="false" />
+ </server>
+ <client>
+ <clusterRef name="Power Levelling" mandatory="false" />
+ </client>
+ </device>
+
+ <device id="0x0A05" name="Hobs">
+ <server>
+ <clusterRef name="Basic" />
+ <clusterRef name="Identify" />
+ <clusterRef name="Groups" />
+ <clusterRef name="On/Off" />
+ <clusterRef name="Appliance Identification" />
+ <clusterRef name="Appliance Control" />
+ <clusterRef name="Appliance Events and Alerts" />
+ <clusterRef name="Indesit Bridge" />
+ <clusterRef name="Simple Metering" mandatory="false" />
+ <clusterRef name="Applicance Statistics" mandatory="false" />
+ <clusterRef name="Alarms" mandatory="false" />
+ <clusterRef name="Temperature Measurement" mandatory="false" />
+ </server>
+ <client>
+ <clusterRef name="Power Levelling" mandatory="false" />
+ </client>
+ </device>
+
+ <device id="0x0A06" name="Induction Hobs">
+ <server>
+ <clusterRef name="Basic" />
+ <clusterRef name="Identify" />
+ <clusterRef name="Groups" />
+ <clusterRef name="On/Off" />
+ <clusterRef name="Appliance Identification" />
+ <clusterRef name="Appliance Control" />
+ <clusterRef name="Appliance Events and Alerts" />
+ <clusterRef name="Indesit Bridge" />
+ <clusterRef name="Simple Metering" mandatory="false" />
+ <clusterRef name="Applicance Statistics" mandatory="false" />
+ <clusterRef name="Alarms" mandatory="false" />
+ <clusterRef name="Temperature Measurement" mandatory="false" />
+ </server>
+ <client>
+ <clusterRef name="Power Levelling" mandatory="false" />
+ </client>
+ </device>
+
+ <device id="0x0A07" name="Oven">
+ <server>
+ <clusterRef name="Basic" />
+ <clusterRef name="Identify" />
+ <clusterRef name="Groups" />
+ <clusterRef name="On/Off" />
+ <clusterRef name="Appliance Identification" />
+ <clusterRef name="Appliance Control" />
+ <clusterRef name="Appliance Events and Alerts" />
+ <clusterRef name="Indesit Bridge" />
+ <clusterRef name="Simple Metering" mandatory="false" />
+ <clusterRef name="Applicance Statistics" mandatory="false" />
+ <clusterRef name="Alarms" mandatory="false" />
+ <clusterRef name="Temperature Measurement" mandatory="false" />
+ </server>
+ <client>
+ <clusterRef name="Power Levelling" mandatory="false" />
+ </client>
+ </device>
+ <device id="0x0A08" name="Electrical Oven">
+ <server>
+ <clusterRef name="Basic" />
+ <clusterRef name="Identify" />
+ <clusterRef name="Groups" />
+ <clusterRef name="On/Off" />
+ <clusterRef name="Appliance Identification" />
+ <clusterRef name="Appliance Control" />
+ <clusterRef name="Appliance Events and Alerts" />
+ <clusterRef name="Indesit Bridge" />
+ <clusterRef name="Simple Metering" mandatory="false" />
+ <clusterRef name="Applicance Statistics" mandatory="false" />
+ <clusterRef name="Alarms" mandatory="false" />
+ <clusterRef name="Temperature Measurement" mandatory="false" />
+ </server>
+ <client>
+ <clusterRef name="Power Levelling" mandatory="false" />
+ </client>
+ </device>
+
+ <device id="0x0A09" name="Refrigerator Freezer">
+ <server>
+ <clusterRef name="Basic" />
+ <clusterRef name="Identify" />
+ <clusterRef name="Groups" />
+ <clusterRef name="On/Off" />
+ <clusterRef name="Appliance Identification" />
+ <clusterRef name="Appliance Control" />
+ <clusterRef name="Appliance Events and Alerts" />
+ <clusterRef name="Indesit Bridge" />
+ <clusterRef name="Simple Metering" mandatory="false" />
+ <clusterRef name="Applicance Statistics" mandatory="false" />
+ <clusterRef name="Alarms" mandatory="false" />
+ <clusterRef name="Temperature Measurement" mandatory="false" />
+ </server>
+ <client>
+ <clusterRef name="Power Levelling" mandatory="false" />
+ </client>
+ </device>
+ </profile>
+
+ <profile id="0xC044" name="4Noks Profile">
+
+ <!--
+ Imports ZigBee Cluster Library to get cluster definitions used below
+ -->
+ <xi:include href="/xml/zigbee/zcl.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+
+ <device id="0x000C" name="On/Off Push Button">
+ <server>
+ <clusterRef name="On/Off Switch Configuration" />
+ </server>
+ <client>
+ <clusterRef name="On/Off" />
+ </client>
+ </device>
+
+
+ <device id="0x0501" name="SmartPlug">
+ <server>
+ <clusterRef name="On/Off Switch Configuration" />
+ <clusterRef name="Simple Metering 4Noks" />
+ <clusterRef name="On/Off" />
+ </server>
+ </device>
+ </profile>
+ <profile id="0xC045" name="Telecom Italia">
+
+ <!--
+ Imports ZigBee Cluster Library to get cluster definitions used below
+ -->
+ <xi:include href="/xml/zigbee/zcl.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+
+ <device id="0x0000" name="Overload Manager">
+ <server>
+ <clusterRef name="On/Off Switch Configuration" />
+ <clusterRef name="Simple Metering" />
+ </server>
+ <client>
+ <clusterRef name="On/Off" />
+ </client>
+ </device>
+
+ <device id="0x0000" name="Toggle">
+ <server>
+ <clusterRef name="On/Off" />
+ </server>
+ <client>
+ <clusterRef name="Simple Metering" />
+ </client>
+ </device>
+ <device id="0x0000" name="Standby Manager">
+ <server>
+ <clusterRef name="On/Off" />
+ </server>
+ <client>
+ <clusterRef name="Simple Metering" />
+ </client>
+ </device>
+ </profile>
+</profiles>
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/xml/zigbee/ha.xsd
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/xml/zigbee/ha.xsd (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/xml/zigbee/ha.xsd Mon Oct 22 13:55:46 2012
@@ -1,0 +1,101 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+ <xs:complexType name="clusterType">
+ <xs:sequence>
+ <xs:element name="attribute" type="attributeType"
+ maxOccurs="30" minOccurs="0" />
+ <xs:element name="command" type="commandType" maxOccurs="30" minOccurs="0" />
+ </xs:sequence>
+
+ <xs:attribute name="id" type="xs:string" />
+ <xs:attribute name="name" type="xs:string" />
+ </xs:complexType>
+
+ <xs:complexType name="clientType">
+ <xs:sequence>
+ <xs:element name="clusterRef" type="clusterRefType"
+ maxOccurs="30" minOccurs="0" />
+ </xs:sequence>
+ <xs:attribute name="id" type="xs:string" />
+ <xs:attribute name="name" type="xs:string" />
+ </xs:complexType>
+
+ <xs:complexType name="serverType">
+ <xs:sequence>
+ <xs:element name="clusterRef" type="clusterRefType"
+ maxOccurs="30" minOccurs="0" />
+ </xs:sequence>
+ <xs:attribute name="id" type="xs:string" />
+ <xs:attribute name="name" type="xs:string" />
+ </xs:complexType>
+
+ <xs:complexType name="deviceType">
+ <xs:sequence>
+ <xs:element name="server" type="serverType" maxOccurs="30"
+ minOccurs="0" />
+ <xs:element name="client" type="clientType" maxOccurs="30"
+ minOccurs="0" />
+ </xs:sequence>
+ <xs:attribute name="id" type="xs:string" />
+ <xs:attribute name="name" type="xs:string" />
+ </xs:complexType>
+
+
+
+ <xs:complexType name="clusterRefType">
+ <xs:attribute name="name" type="xs:string" />
+ <xs:attribute name="mandatory" type="xs:string" />
+ </xs:complexType>
+
+ <xs:complexType name="rangeType">
+ <xs:attribute name="from" type="xs:string" />
+ <xs:attribute name="to" type="xs:string" />
+ </xs:complexType>
+
+ <xs:complexType name="attributeType">
+ <xs:sequence>
+ <xs:element name="Range" maxOccurs="30" minOccurs="0" />
+ </xs:sequence>
+ <xs:attribute name="id" type="xs:string" />
+ <xs:attribute name="name" type="xs:string" />
+ <xs:attribute name="type" type="xs:string" />
+ <xs:attribute name="access" type="xs:string" />
+ <xs:attribute name="default" type="xs:string" />
+ <xs:attribute name="mandatory" type="xs:string" />
+ </xs:complexType>
+
+ <xs:complexType name="commandType">
+ <xs:attribute name="id" type="xs:string" />
+ <xs:attribute name="name" type="xs:string" />
+ <xs:attribute name="mandatory" type="xs:string" />
+ <xs:attribute name="payload" type="xs:string" />
+ </xs:complexType>
+
+ <xs:complexType name="profileType">
+ <xs:sequence>
+ <xs:element name="clusters" maxOccurs="1" minOccurs="1">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="cluster" type="clusterType"
+ maxOccurs="30" minOccurs="0" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element >
+
+ <xs:element name="device" type="deviceType" maxOccurs="30" minOccurs="0" />
+ </xs:sequence>
+ <xs:attribute name="id" type="xs:string" />
+ <xs:attribute name="name" type="xs:string" />
+
+ </xs:complexType>
+
+ <xs:element name="profiles">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="profile" type="profileType" maxOccurs="30"
+ minOccurs="0" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+</xs:schema>
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/xml/zigbee/ha_rel.xml
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/xml/zigbee/ha_rel.xml (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/xml/zigbee/ha_rel.xml Mon Oct 22 13:55:46 2012
@@ -1,0 +1,351 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<profiles xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="ha.xsd">
+ <profile id="0x0104" name="Home Automation Profile">
+
+ <!--
+ Imports ZigBee Cluster Library to get cluster definitions used below
+ -->
+
+ <xi:include href="xml/zigbee/zcl_v2.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+
+ <device id="0x0000" name="On/Off Switch">
+ <server>
+ <clusterRef name="Basic" />
+ <clusterRef name="Identify" />
+ <clusterRef name="On/Off Switch Configuration" />
+ </server>
+ <client>
+ <clusterRef name="On/Off" />
+ </client>
+ </device>
+
+ <device id="0x0001" name="Level Control Switch">
+ <server>
+ <clusterRef name="On/Off Switch Configuration" />
+ </server>
+ <client>
+ <clusterRef name="On/Off" />
+ <clusterRef name="Level Control" />
+ </client>
+ </device>
+
+ <device id="0x0002" name="On/Off Output">
+ <server>
+ <clusterRef name="On/Off" />
+ <clusterRef name="Scenes" />
+ <clusterRef name="Groups" />
+ </server>
+ </device>
+
+ <device id="0x0009" name="Mains Power Outlet">
+ <server>
+ <clusterRef name="On/Off" />
+ <clusterRef name="Scenes" />
+ <clusterRef name="Groups" />
+ </server>
+ </device>
+
+ <device id="0x0006" name="Remote Control" />
+ <device id="0x0100" name="On/Off Light" />
+ <device id="0x0103" name="On/Off light Switch" />
+ <device id="0x0200" name="Shade">
+ <server>
+ <clusterRef name="Shade Configuration" />
+ <clusterRef name="On/Off" />
+ <clusterRef name="Level Control" />
+ <clusterRef name="Scenes" />
+ <clusterRef name="Groups" />
+ </server>
+ </device>
+ <device id="0x0201" name="Shade Controller">
+ <client>
+ <clusterRef name="On/Off" />
+ <clusterRef name="Level Control" />
+ <clusterRef name="Shade Configuration" />
+ <clusterRef name="Scenes" />
+ <clusterRef name="Identify" />
+ </client>
+ </device>
+ <device id="0x0300" name="Heating/Cooling Unit" />
+ <device id="0x0302" name="Temperature Sensor">
+ <server>
+ <clusterRef name="Temperature Measurement" />
+ </server>
+ </device>
+
+ <!-- Indesit CECED applicances -->
+
+ <device id="0x0A00" name="White Goods">
+ <server>
+ <clusterRef name="Basic" />
+ <clusterRef name="Identify" />
+ <clusterRef name="Groups" />
+ <clusterRef name="On/Off" />
+ <clusterRef name="Appliance Identification" />
+ <clusterRef name="Appliance Control" />
+ <clusterRef name="Appliance Events and Alerts" />
+ <clusterRef name="Indesit Bridge" />
+ <clusterRef name="Simple Metering" mandatory="false" />
+ <clusterRef name="Applicance Statistics" mandatory="false" />
+ <clusterRef name="Alarms" mandatory="false" />
+ <clusterRef name="Temperature Measurement" mandatory="false" />
+ </server>
+ </device>
+
+ <device id="0x0A01" name="Dishwasher">
+ <server>
+ <clusterRef name="Basic" />
+ <clusterRef name="Identify" />
+ <clusterRef name="Groups" />
+ <clusterRef name="On/Off" />
+ <clusterRef name="Appliance Identification" />
+ <clusterRef name="Appliance Control" />
+ <clusterRef name="Appliance Events and Alerts" />
+ <clusterRef name="Indesit Bridge" />
+ <clusterRef name="Simple Metering" mandatory="false" />
+ <clusterRef name="Applicance Statistics" mandatory="false" />
+ <clusterRef name="Alarms" mandatory="false" />
+ <clusterRef name="Temperature Measurement" mandatory="false" />
+ </server>
+ </device>
+
+ <device id="0x0A02" name="Tumble Dryer">
+ <server>
+ <clusterRef name="Basic" />
+ <clusterRef name="Identify" />
+ <clusterRef name="Groups" />
+ <clusterRef name="On/Off" />
+ <clusterRef name="Appliance Identification" />
+ <clusterRef name="Appliance Control" />
+ <clusterRef name="Appliance Events and Alerts" />
+ <clusterRef name="Indesit Bridge" />
+ <clusterRef name="Simple Metering" mandatory="false" />
+ <clusterRef name="Applicance Statistics" mandatory="false" />
+ <clusterRef name="Alarms" mandatory="false" />
+ <clusterRef name="Temperature Measurement" mandatory="false" />
+ </server>
+ </device>
+
+ <device id="0x0A03" name="Washer Dryer">
+ <server>
+ <clusterRef name="Basic" />
+ <clusterRef name="Identify" />
+ <clusterRef name="Groups" />
+ <clusterRef name="On/Off" />
+ <clusterRef name="Appliance Identification" />
+ <clusterRef name="Appliance Control" />
+ <clusterRef name="Appliance Events and Alerts" />
+ <clusterRef name="Indesit Bridge" />
+ <clusterRef name="Simple Metering" mandatory="false" />
+ <clusterRef name="Applicance Statistics" mandatory="false" />
+ <clusterRef name="Alarms" mandatory="false" />
+ <clusterRef name="Temperature Measurement" mandatory="false" />
+ </server>
+ </device>
+
+ <device id="0x0A04" name="Washing Machine">
+ <server>
+ <clusterRef name="Basic" />
+ <clusterRef name="Identify" />
+ <clusterRef name="Groups" />
+ <clusterRef name="On/Off" />
+ <clusterRef name="Appliance Identification" />
+ <clusterRef name="Appliance Control" />
+ <clusterRef name="Appliance Events and Alerts" />
+ <clusterRef name="Indesit Bridge" />
+ <clusterRef name="Simple Metering" mandatory="false" />
+ <clusterRef name="Applicance Statistics" mandatory="false" />
+ <clusterRef name="Alarms" mandatory="false" />
+ <clusterRef name="Temperature Measurement" mandatory="false" />
+ </server>
+ </device>
+
+ <device id="0x0A05" name="Hobs">
+ <server>
+ <clusterRef name="Basic" />
+ <clusterRef name="Identify" />
+ <clusterRef name="Groups" />
+ <clusterRef name="On/Off" />
+ <clusterRef name="Appliance Identification" />
+ <clusterRef name="Appliance Control" />
+ <clusterRef name="Appliance Events and Alerts" />
+ <clusterRef name="Indesit Bridge" />
+ <clusterRef name="Simple Metering" mandatory="false" />
+ <clusterRef name="Applicance Statistics" mandatory="false" />
+ <clusterRef name="Alarms" mandatory="false" />
+ <clusterRef name="Temperature Measurement" mandatory="false" />
+ </server>
+ </device>
+
+ <device id="0x0A06" name="Induction Hobs">
+ <server>
+ <clusterRef name="Basic" />
+ <clusterRef name="Identify" />
+ <clusterRef name="Groups" />
+ <clusterRef name="On/Off" />
+ <clusterRef name="Appliance Identification" />
+ <clusterRef name="Appliance Control" />
+ <clusterRef name="Appliance Events and Alerts" />
+ <clusterRef name="Indesit Bridge" />
+ <clusterRef name="Simple Metering" mandatory="false" />
+ <clusterRef name="Applicance Statistics" mandatory="false" />
+ <clusterRef name="Alarms" mandatory="false" />
+ <clusterRef name="Temperature Measurement" mandatory="false" />
+ </server>
+ </device>
+
+ <device id="0x0A07" name="Oven">
+ <server>
+ <clusterRef name="Basic" />
+ <clusterRef name="Identify" />
+ <clusterRef name="Groups" />
+ <clusterRef name="On/Off" />
+ <clusterRef name="Appliance Identification" />
+ <clusterRef name="Appliance Control" />
+ <clusterRef name="Appliance Events and Alerts" />
+ <clusterRef name="Indesit Bridge" />
+ <clusterRef name="Simple Metering" mandatory="false" />
+ <clusterRef name="Applicance Statistics" mandatory="false" />
+ <clusterRef name="Alarms" mandatory="false" />
+ <clusterRef name="Temperature Measurement" mandatory="false" />
+ </server>
+ </device>
+ <device id="0x0A08" name="Electrical Oven">
+ <server>
+ <clusterRef name="Basic" />
+ <clusterRef name="Identify" />
+ <clusterRef name="Groups" />
+ <clusterRef name="On/Off" />
+ <clusterRef name="Appliance Identification" />
+ <clusterRef name="Appliance Control" />
+ <clusterRef name="Appliance Events and Alerts" />
+ <clusterRef name="Indesit Bridge" />
+ <clusterRef name="Simple Metering" mandatory="false" />
+ <clusterRef name="Applicance Statistics" mandatory="false" />
+ <clusterRef name="Alarms" mandatory="false" />
+ <clusterRef name="Temperature Measurement" mandatory="false" />
+ </server>
+ </device>
+
+ <device id="0x0A09" name="Refrigerator Freezer">
+ <server>
+ <clusterRef name="Basic" />
+ <clusterRef name="Identify" />
+ <clusterRef name="Groups" />
+ <clusterRef name="On/Off" />
+ <clusterRef name="Appliance Identification" />
+ <clusterRef name="Appliance Control" />
+ <clusterRef name="Appliance Events and Alerts" />
+ <clusterRef name="Indesit Bridge" />
+ <clusterRef name="Simple Metering" mandatory="false" />
+ <clusterRef name="Applicance Statistics" mandatory="false" />
+ <clusterRef name="Alarms" mandatory="false" />
+ <clusterRef name="Temperature Measurement" mandatory="false" />
+ </server>
+ </device>
+ </profile>
+
+ <profile id="0xC044" name="4Noks Profile">
+
+ <!--
+ Imports ZigBee Cluster Library to get cluster definitions used below
+ -->
+ <xi:include href="xml/zigbee/zcl_v2.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+
+ <device id="0x000C" name="On/Off Push Button">
+ <server>
+ <clusterRef name="On/Off Switch Configuration" />
+ </server>
+ <client>
+ <clusterRef name="On/Off" />
+ </client>
+ </device>
+
+
+ <device id="0x0501" name="SmartPlug">
+ <server>
+ <clusterRef name="On/Off Switch Configuration" />
+ <clusterRef name="Simple Metering 4Noks" />
+ <clusterRef name="On/Off" />
+ </server>
+ </device>
+ </profile>
+ <profile id="0xC045" name="Telecom Italia">
+
+ <!--
+ Imports ZigBee Cluster Library to get cluster definitions used below
+ -->
+ <xi:include href="xml/zigbee/zcl_v2.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+
+ <device id="0x0000" name="Overload Manager">
+ <server>
+ <clusterRef name="On/Off Switch Configuration" />
+ <clusterRef name="Simple Metering" />
+ </server>
+ <client>
+ <clusterRef name="On/Off" />
+ </client>
+ </device>
+
+ <device id="0x0000" name="Toggle">
+ <server>
+ <clusterRef name="On/Off" />
+ </server>
+ <client>
+ <clusterRef name="Simple Metering" />
+ </client>
+ </device>
+ <device id="0x0000" name="Standby Manager">
+ <server>
+ <clusterRef name="On/Off" />
+ </server>
+ <client>
+ <clusterRef name="Simple Metering" />
+ </client>
+ </device>
+ </profile>
+ <profile id="0xC23C" name="Energy at Home">
+ <!--
+ Imports ZigBee Cluster Library to get cluster definitions used below
+ -->
+ <xi:include href="xml/zigbee/zcl_v2.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+
+ <device id="0x0501" name="SmartInfo">
+ <server>
+ <clusterRef name="Basic" />
+ <clusterRef name="Identify" />
+ <clusterRef name="Groups" />
+ <clusterRef name="Simple Metering" />
+ <clusterRef name="SmartInfo Identification" />
+ <clusterRef name="Price" />
+ </server>
+ <client>
+ <clusterRef name="Time" mandatory="false" />
+ <clusterRef name="Prepayment" mandatory="false" />
+ <clusterRef name="Price" mandatory="false" />
+ <clusterRef name="Message" mandatory="false" />
+ </client>
+ </device>
+
+ <device id="0x0A04" name="Washing Machine">
+ <server>
+ <clusterRef name="Basic" />
+ <clusterRef name="Identify" />
+ <clusterRef name="Groups" />
+ <clusterRef name="Appliance Identification" mandatory="false" />
+ <clusterRef name="Appliance Control" mandatory="false" />
+ <clusterRef name="Appliance Events and Alerts" mandatory="false" />
+ <clusterRef name="Simple Metering" mandatory="false" />
+ <clusterRef name="Applicance Statistics" mandatory="false" />
+ <clusterRef name="Alarms" mandatory="false" />
+ </server>
+ <client>
+ <clusterRef name="Time" mandatory="false" />
+ <clusterRef name="Price" mandatory="false" />
+ <clusterRef name="Power Profile" mandatory="false" />
+ </client>
+ </device>
+ </profile>
+</profiles>
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/xml/zigbee/prova.xml
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/xml/zigbee/prova.xml (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/xml/zigbee/prova.xml Mon Oct 22 13:55:46 2012
@@ -1,0 +1,135 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<profiles xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="ha.xsd">
+ <profile id="0x0104" name="Home Automation Profile">
+
+ <!--
+ Imports ZigBee Cluster Library to get cluster definitions used below
+ -->
+
+
+ <device id="0x0000" name="On/Off Switch">
+ <server>
+ <clusterRef name="Basic" />
+ <clusterRef name="Identify" />
+ <clusterRef name="On/Off Switch Configuration" />
+ </server>
+ <client>
+ <clusterRef name="On/Off" />
+ </client>
+ </device>
+
+ <device id="0x0001" name="Level Control Switch">
+ <server>
+ <clusterRef name="On/Off Switch Configuration" />
+ </server>
+ <client>
+ <clusterRef name="On/Off" />
+ <clusterRef name="Level Control" />
+ </client>
+ </device>
+
+ <device id="0x0002" name="On/Off Output">
+ <server>
+ <clusterRef name="On/Off" />
+ <clusterRef name="Scenes" />
+ <clusterRef name="Groups" />
+ </server>
+ </device>
+
+ <device id="0x0006" name="Remote Control" />
+ <device id="0x0100" name="On/Off Light" />
+ <device id="0x0103" name="On/Off light Switch" />
+ <device id="0x0300" name="Heating/Cooling Unit" />
+ <device id="0x0302" name="Temperature Sensor">
+ <server>
+ <clusterRef name="Temperature Measurement" />
+ </server>
+ </device>
+
+ <!-- Indesit CECED applicances -->
+
+ <device id="0x0A04" name="Washing Machine">
+ <server>
+ <clusterRef name="Basic" />
+ <clusterRef name="Identify" />
+ <clusterRef name="Groups" />
+ <clusterRef name="On/Off" />
+ <clusterRef name="Appliance Identification" />
+ <clusterRef name="Appliance Control" />
+ <clusterRef name="Appliance Events and Alerts" />
+ <clusterRef name="Indesit Bridge" />
+ <clusterRef name="Simple Metering" mandatory="false" />
+ <clusterRef name="Applicance Statistics" mandatory="false" />
+ <clusterRef name="Alarms" mandatory="false" />
+ <clusterRef name="Temperature Measurement" mandatory="false" />
+ </server>
+ <client>
+ <clusterRef name="Power Levelling" mandatory="false" />
+ </client>
+
+ </device>
+ </profile>
+
+ <profile id="0xC044" name="4Noks Profile">
+
+ <!--
+ Imports ZigBee Cluster Library to get cluster definitions used below
+ -->
+
+
+ <device id="0x000C" name="On/Off Push Button">
+ <server>
+ <clusterRef name="On/Off Switch Configuration" />
+ </server>
+ <client>
+ <clusterRef name="On/Off" />
+ </client>
+ </device>
+
+
+ <device id="0x0501" name="On/Off SmartPlug">
+ <server>
+ <clusterRef name="On/Off Switch Configuration" />
+ <clusterRef name="Simple Metering 4Noks" />
+ <clusterRef name="On/Off" />
+ </server>
+ </device>
+ </profile>
+ <profile id="0xC045" name="Telecom Italia">
+
+ <!--
+ Imports ZigBee Cluster Library to get cluster definitions used below
+ -->
+
+
+ <device id="0x0000" name="Overload Manager">
+ <server>
+ <clusterRef name="On/Off Switch Configuration" />
+ <clusterRef name="Simple Metering" />
+
+ </server>
+ <client>
+ <clusterRef name="On/Off" />
+ </client>
+ </device>
+
+ <device id="0x0000" name="Toggle">
+ <server>
+ <clusterRef name="On/Off" />
+ </server>
+ <client>
+ <clusterRef name="Simple Metering" />
+ </client>
+ </device>
+ <device id="0x0000" name="Standby Manager">
+ <server>
+ <clusterRef name="On/Off" />
+ </server>
+ <client>
+ <clusterRef name="Simple Metering" />
+ </client>
+ </device>
+ </profile>
+</profiles>
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/xml/zigbee/zcl.xml
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/xml/zigbee/zcl.xml (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/xml/zigbee/zcl.xml Mon Oct 22 13:55:46 2012
@@ -1,0 +1,367 @@
+<?xml version="1.0" encoding="utf-8"?>
+<clusters>
+ <!-- General functional domain -->
+ <cluster id="0x0000" name="Basic">
+ <!-- General Attribute Set -->
+ <attribute id="0x0000" name="ZCLVersion" type="uint8" default="0x00">
+ <Range from="0x00" to="0xFF"/>
+ </attribute>
+ <attribute id="0x0001" name="ApplicationVersion" type="uint8" default="0x00" mandatory="false">
+ <Range from="0x00" to="0xFF"/>
+ </attribute>
+ <attribute id="0x0002" name="StackVersion" type="uint8" default="0x00" mandatory="false">
+ <Range from="0x00" to="0xFF"/>
+ </attribute>
+ <attribute id="0x0003" name="HWVersion" type="uint8" access="r" default="0x00" mandatory="false">
+ <Range from="0x00" to="0xFF"/>
+ </attribute>
+ <attribute id="0x0004" name="ManifacturerName" type="string" default="0x00" mandatory="false">
+ <Range from="0" to="32"/>
+ </attribute>
+ <attribute id="0x0005" name="ModelIdentifier" type="string" mandatory="false">
+ <Range from="0" to="32"/>
+ </attribute>
+ <attribute id="0x0006" name="DateCode" type="string" mandatory="false">
+ <Range from="0" to="32"/>
+ </attribute>
+ <attribute id="0x0007" name="PowerSource" type="enum8" mandatory="false">
+ <Range from="0x00" to="0xFF"/>
+ </attribute>
+
+ <!-- Basic Device Settings -->
+ <!-- <attribute id="0x0010" name="LocationDescription" type="string" access="rw" mandatory="false">
+ <Range from="0" to="16"/>
+ </attribute> -->
+ <attribute id="0x0011" name="PhysicalEnvironment" type="enum8" access="rw" default="0x00" mandatory="false">
+ <Range from="0x00" to="0xFF"/>
+ </attribute>
+ <attribute id="0x0012" name="DeviceEnabled" type="boolean" access="rw" default="true" mandatory="false">
+ <Range from="0x00" to="0xFF"/>
+ </attribute>
+ <attribute id="0x0013" name="AlarmMask" type="bitmap8" access="rw" default="0x00" mandatory="false">
+ <Range from="0x00" to="0x03"/>
+ </attribute>
+ </cluster>
+
+ <!-- End Basic Cluster -->
+
+ <cluster id="0x0001" name="Power Configuration"/>
+
+ <cluster id="0x0002" name="Device Temperature Configuration">
+ <!-- Device Temperature Information Attribute Set -->
+ <attribute id="0x0000" name="CurrentTemperature" type="int16" >
+ <Range from="-200" to="200"/>
+ </attribute>
+ <attribute id="0x0001" name="MinTempExperienced" type="int16" mandatory="false">
+ <Range from="-200" to="200"/>
+ </attribute>
+ <attribute id="0x0003" name="MaxTempExperienced" type="int16" mandatory="false">
+ <Range from="-200" to="200"/>
+ </attribute>
+ <attribute id="0x0004" name="OverTempTotalDwell" type="uint16" default="0" mandatory="false">
+ <Range from="0x0000" to="0xFFFF"/>
+ </attribute>
+
+ <!-- Device Temperature Settings Attribute Set -->
+ <attribute id="0x0010" name="DeviceTempAlarmMask" type="bitmap8" access="rw" default="0" mandatory="false">
+ <Range from="0x00" to="0x03"/>
+ </attribute>
+ <attribute id="0x0011" name="LowTempThreshold" type="int16" access="rw" mandatory="false">
+ <Range from="-200" to="200"/>
+ </attribute>
+ <attribute id="0x0011" name="HighTempThreshold" type="int16" access="rw" mandatory="false">
+ <Range from="-200" to="200"/>
+ </attribute>
+ <attribute id="0x0011" name="LowTempDwellTripPoint" type="uint24" access="rw" mandatory="false">
+ <Range from="0x000000" to="0xFFFFFF"/>
+ </attribute>
+ <attribute id="0x0011" name="HighTempDwellTripPoint" type="uint24" access="rw" mandatory="false">
+ <Range from="0x000000" to="0xFFFFFF"/>
+ </attribute>
+ </cluster>
+
+ <cluster id="0x0003" name="Identify"/>
+
+ <cluster id="0x0004" name="Groups"/>
+ <cluster id="0x0005" name="Scenes"/>
+
+ <cluster id="0x0006" name="On/Off">
+ <attribute id="0x0000" name="OnOff" type="boolean" default="0x00">
+ <Range from="0x00" to="0x01"/>
+ </attribute>
+
+ <command id="0x00" name="Off"/>
+ <command id="0x01" name="On"/>
+ <command id="0x02" name="Toggle"/>
+ </cluster>
+
+ <cluster id="0x0007" name="On/Off Switch Configuration">
+ <attribute id="0x0000" name="SwitchType" type="enum">
+ <Range from="0x00" to="0x01"/>
+ </attribute>
+ <attribute id="0x0010" name="SwitchActions" type="enum8" access="rw" default="0x00">
+ <Range from="0x00" to="0x02"/>
+ </attribute>
+ </cluster>
+
+ <!-- Cluster fully Specified -->
+ <cluster id="0x0008" name="Level Control">
+ <attribute id="0x0000" name="CurrentLevel" type="uint8" default="0x00" >
+ <Range from="0x00" to="0xff"/>
+ </attribute>
+ <attribute id="0x0001" name="RemainingTime" type="uint16" default="0x0000" mandatory="false">
+ <Range from="0x0000" to="0xffff"/>
+ </attribute>
+
+ <attribute id="0x0010" name="OnOffTransitionTime" type="uint16" default="0x0000" mandatory="false">
+ <Range from="0x0000" to="0xffff"/>
+ </attribute>
+
+ <attribute id="0x0011" name="OnLevel" type="uint8" default="0x00" mandatory="false">
+ <Range from="0x00" to="0xff"/>
+ </attribute>
+
+ <command id="0x00" name="Move to Level">
+ <param name="Level" type="uint8"/>
+ <param name="TransitionTime" type="uint16"/>
+ </command>
+ <command id="0x01" name="Move">
+ <param name="MoveMode" type="enum8">
+ <value id="0x00" name="Up"/>
+ <value id="0x01" name="Down"/>
+ </param>
+ <param name="Rate" type="uint8"/>
+ </command>
+ <command id="0x02" name="Step">
+ <param name="StepMode" type="enum8">
+ <value id="0x00" name="Up"/>
+ <value id="0x01" name="Down"/>
+ </param>
+ <param name="StepSize" type="uint8"/>
+ <param name="TransitionTime" type="uint16"/>
+ </command>
+ <command id="0x03" name="Stop"/>
+
+ <command id="0x00" name="Move to Level (with On/Off)">
+ <param name="Level" type="uint8"/>
+ <param name="TransitionTime" type="uint16"/>
+ </command>
+ <command id="0x01" name="Move (with On/Off)">
+ <param name="MoveMode" type="enum8">
+ <value id="0x00" name="Up"/>
+ <value id="0x01" name="Down"/>
+ </param>
+ <param name="Rate" type="uint8"/>
+ </command>
+ <command id="0x02" name="Step (with On/Off)">
+ <param name="StepMode" type="enum8">
+ <value id="0x00" name="Up"/>
+ <value id="0x01" name="Down"/>
+ </param>
+ <param name="StepSize" type="uint8"/>
+ <param name="TransitionTime" type="uint16"/>
+ </command>
+ <command id="0x03" name="Stop (with On/Off)"/>
+ </cluster>
+
+
+ <cluster id="0x0009" name="Alarms"/>
+ <cluster id="0x000A" name="Time"/>
+ <cluster id="0x000B" name="RSSI Location"/>
+
+ <cluster id="0x0702" name="Simple Metering">
+
+ <!-- Reading Information Attribute Set -->
+ <attribute id="0x0000" name="CurrentSummationDelivered" type="uint48" >
+ <Range from="0x000000000000" to="0xffffffffffff"/>
+ </attribute>
+ <attribute id="0x0006" name="PowerFactor" type="int8" default="0x00" mandatory="false">
+ <Range from="-100" to="100"/>
+ </attribute>
+
+ <!-- Meter Status Attribute Set -->
+ <attribute id="0x0200" name="Status" type="bitmap8" default="0x00">
+ <Range from="0x00" to="0xff"/>
+ </attribute>
+
+ <!-- Formatting Attribute Set -->
+ <attribute id="0x0300" name="UnitOfMeasure" type="enum8" default="0x00">
+ <Range from="0x00" to="0xff"/>
+ </attribute>
+
+ <attribute id="0x0303" name="SummationFormatting" type="bitmap8" >
+ <Range from="0x00" to="0xff"/>
+ </attribute>
+
+ <attribute id="0x0304" name="DemandFormatting" type="bitmap8" mandatory="false" >
+ <Range from="0x00" to="0xff"/>
+ </attribute>
+
+ <attribute id="0x0306" name="MeteringDeviceType" type="bitmap8" >
+ <Range from="0x00" to="0xff"/>
+ </attribute>
+
+ <!-- Simple Metering Cluster - ESP Historical Consumption Attribute Set -->
+ <attribute id="0x0400" name="IstantaneousDemand" type="int24" default="0x000000" >
+ <Range from="0x000000" to="0xffffff"/>
+ </attribute>
+
+ </cluster>
+
+ <cluster id="0x000C" name="Simple Metering 4Noks">
+ <attribute id="0x0000" name="Power" type="int32" access="r" uom="W">
+ <Range from="0x00" to="0x01"/>
+ </attribute>
+ <attribute id="0x0001" name="Energy" type="int32" factor="10" uom="Wh">
+ <Range from="0x00" to="0x01"/>
+ </attribute>
+ <attribute id="0x0002" name="TimeValue" type="int32" uom="s">
+ <Range from="0x00" to="0x01"/>
+ </attribute>
+ </cluster>
+
+ <!-- Closures functional domain -->
+ <cluster id="0100" name="Shade Configuration"/>
+
+ <!-- HVAC functional domain -->
+ <cluster id="0x0200" name="Pump Configuration and Control"/>
+ <cluster id="0x0201" name="Thermostat"/>
+ <cluster id="0x0202" name="Fan Control"/>
+ <cluster id="0x0203" name="Dehumidification Control"/>
+ <cluster id="0x0204" name="Thermostat User Interface Configuration"/>
+
+ <!-- Lighting functional domain -->
+ <cluster id="0x0300" name="Color control"/>
+
+ <cluster id="0x0301" name="Ballast Configuration"/>
+
+ <!-- Measurement and Sensing functional domain -->
+ <cluster id="0x0400" name="Illuminance measurement"/>
+
+ <cluster id="0x0401" name="Illuminance level sensing"/>
+
+ <cluster id="0x0402" name="Temperature Measurement">
+ <!-- Temperature Measurement Information Attribute Set -->
+ <attribute id="0x0000" name="MeasuredValue" type="int16" default="0" factor="0.01" uom="^C">
+ </attribute>
+ <attribute id="0x0001" name="MinMeasuredValue" type="int16" factor="0.1" uom="^C">
+ <Range from="0x954d" to="0x7ffe"/>
+ </attribute>
+ <attribute id="0x0003" name="MaxMeasuredValue" type="int16" factor="0.1" uom="^C">
+ <Range from="0x954e" to="0x7fff"/>
+ </attribute>
+ <attribute id="0x0004" name="Tolerance" type="uint16" mandatory="false">
+ <Range from="0x0000" to="0x0800"/>
+ </attribute>
+ </cluster>
+
+ <cluster id="0x0403" name="Pressure measurement"/>
+ <cluster id="0x0404" name="Flow measurement"/>
+ <cluster id="0x0405" name="Relative humidity measurement"/>
+ <cluster id="0x0406" name="Occupancy sensing"/>
+
+ <!-- Security and Sefety functional domain -->
+ <cluster id="0x0500" name="IAS Zone"/>
+ <cluster id="0x0501" name="IAS ACE"/>
+ <cluster id="0x0502" name="IAS WD"/>
+ <cluster id="0x0503" name="IAS WD"/>
+
+ <cluster id="0x0A01" name="Appliance Control">
+ <!-- Appliance Status Attribute Set -->
+ <attribute id="0x0000" name="ApplianceStatus" type="enum8" default="0x00">
+ <Range from="0x00" to="0xff"/>
+ </attribute>
+
+ <attribute id="0x0001" name="RemoteEnableFlags" type="uint8" >
+ <Range from="0x00" to="0xff"/>
+ </attribute>
+
+ <attribute id="0x0002" name="ApplianceStatus2" type="uint24" default="0x000000" mandatory="false">
+ <Range from="0x000000" to="0xffffff"/>
+ </attribute>
+
+ <!-- Appliance Functions Attribute Set -->
+ <attribute id="0x0100" name="CycleTarget0" type="uint8" default="0x00" mandatory="false">
+ <Range from="0x00" to="0xff"/>
+ </attribute>
+ <attribute id="0x0101" name="CycleTarget1" type="uint8" default="0x00" mandatory="false">
+ <Range from="0x00" to="0xff"/>
+ </attribute>
+ <attribute id="0x0102" name="TemperatureTarget0" type="int16" default="0x0000" mandatory="false">
+ <Range from="-50" to="+350"/>
+ </attribute>
+ <attribute id="0x0103" name="TemperatureTarget1" type="int16" default="0x0000" mandatory="false">
+ <Range from="-50" to="+350"/>
+ </attribute>
+ <attribute id="0x0104" name="AutomaticDryingSetPoint" type="uint8" default="0x00" mandatory="false">
+ <Range from="0x000000" to="0xffffff"/>
+ </attribute>
+ <attribute id="0x0105" name="TimedDryingSetPoint" type="uint8" default="0x00" mandatory="false">
+ <Range from="0x00" to="0xff"/>
+ </attribute>
+ <attribute id="0x0106" name="Spin" type="uint16" default="0x0000" mandatory="false">
+ <Range from="0x0000" to="0xFFFF"/>
+ </attribute>
+ <attribute id="0x0109" name="CycleDuration" type="uint16" default="0x0000" mandatory="false">
+ <Range from="0x0000" to="0xFFFF"/>
+ </attribute>
+
+ <attribute id="0x010a" name="SuperCoolMode" type="boolean" default="0x00" mandatory="false">
+ <Range from="0x00" to="0x01"/>
+ </attribute>
+
+ <attribute id="0x010b" name="SuperFreezeMode" type="boolean" default="0x00" mandatory="false">
+ <Range from="0x00" to="0x01"/>
+ </attribute>
+
+ <attribute id="0x010c" name="NormalMode" type="boolean" default="0x01" mandatory="false">
+ <Range from="0x00" to="0x01"/>
+ </attribute>
+
+ <attribute id="0x010d" name="EcoMode" type="boolean" default="0x00" mandatory="false">
+ <Range from="0x00" to="0x01"/>
+ </attribute>
+
+ <attribute id="0x010e" name="HolidayMode" type="boolean" default="0x00" mandatory="false">
+ <Range from="0x00" to="0x01"/>
+ </attribute>
+
+ <attribute id="0x010f" name="FabricSetPoint" type="uint8" access="r" default="0x00" mandatory="false">
+ <Range from="0x00" to="0x01"/>
+ </attribute>
+
+ <!-- Appliance Warnings and Faults Attribute Set -->
+ <attribute id="0x0010" name="ApplianceWarnings" type="enum16" default="0x0000">
+ <Range from="0x0000" to="0xffff"/>
+ </attribute>
+ <attribute id="0x0011" name="ApplianceFaults" type="uint8" default="0x0000">
+ <Range from="0x00" to="0xff"/>
+ </attribute>
+
+ <command id="0x00" name="CommandExecution">
+ <payload>
+ <field name="CommandId" type="enum"/>
+ </payload>
+ </command>
+
+ <command id="0x01" name="SignalState"/>
+ </cluster>
+
+ <cluster id="0x0A00" name="Appliance Identification">
+ <!-- Appliance Identification Attribute Set -->
+ <attribute id="0x0000" name="BasicIdentification" type="octects" size="7" >
+ </attribute>
+ <command id="0x00" name="GetApplianceIdentification"/>
+ </cluster>
+
+ <cluster id="0x0FF2" name="Indesit Bridge">
+ <!-- Digital Basic Frame Transmission -->
+ <command id="0x93" name="DBFT"/>
+
+ <!-- Digital Extended Frame Transmission -->
+ <command id="0x95" name="DEFT"/>
+
+ <!-- Digital Extended Frame Transmission Without Answer -->
+ <command id="0x9d" name="DEFTWA"/>
+ </cluster>
+</clusters>
Added: projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/xml/zigbee/zcl_v2.xml
==============================================================================
--- projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/xml/zigbee/zcl_v2.xml (added)
+++ projects/zb4osgi/sandbox/telecomItalia/initialContribution/jGAL/it.telecomitalia.osgi.ah.zigbee/xml/zigbee/zcl_v2.xml Mon Oct 22 13:55:46 2012
@@ -1,0 +1,843 @@
+<?xml version="1.0" encoding="utf-8"?>
+ <!-- Legenda
+
+ status:
+ "u" Work In progress (Undone)
+ "c" Complete but not tested (Complete)
+ "t" Under test
+ "d" Done
+
+ the default value for the status attribute is "d"
+
+ -->
+<clusters>
+ <!-- General functional domain -->
+ <cluster id="0x0000" name="Basic" package="general" status="c">
+ <!-- General Attribute Set -->
+ <attribute id="0x0000" name="ZCLVersion" type="uint8" default="0x00">
+ <Range from="0x00" to="0xFF"/>
+ </attribute>
+ <attribute id="0x0001" name="ApplicationVersion" type="uint8" default="0x00" mandatory="false">
+ <Range from="0x00" to="0xFF"/>
+ </attribute>
+ <attribute id="0x0002" name="StackVersion" type="uint8" default="0x00" mandatory="false">
+ <Range from="0x00" to="0xFF"/>
+ </attribute>
+ <attribute id="0x0003" name="HWVersion" type="uint8" default="0x00" mandatory="false">
+ <Range from="0x00" to="0xFF"/>
+ </attribute>
+ <attribute id="0x0004" name="ManifacturerName" type="string" default="0x00" mandatory="false">
+ <Range from="0" to="32"/>
+ </attribute>
+ <attribute id="0x0005" name="ModelIdentifier" type="string" mandatory="false">
+ <Range from="0" to="32"/>
+ </attribute>
+ <attribute id="0x0006" name="DateCode" type="string" mandatory="false">
+ <Range from="0" to="32"/>
+ </attribute>
+ <attribute id="0x0007" name="PowerSource" type="enum8" mandatory="false">
+ <Range from="0x00" to="0xFF"/>
+ </attribute>
+
+ <!-- Basic Device Settings -->
+ <!-- <attribute id="0x0010" name="LocationDescription" type="string" access="rw" mandatory="false">
+ <Range from="0" to="16"/>
+ </attribute> -->
+ <attribute id="0x0011" name="PhysicalEnvironment" type="enum8" access="rw" default="0x00" mandatory="false">
+ <Range from="0x00" to="0xFF"/>
+ </attribute>
+ <attribute id="0x0012" name="DeviceEnabled" type="boolean" access="rw" default="true" mandatory="false">
+ <Range from="0x00" to="0xFF"/>
+ </attribute>
+ <attribute id="0x0013" name="AlarmMask" type="bitmap8" access="rw" default="0x00" mandatory="false">
+ <Range from="0x00" to="0x03"/>
+ </attribute>
+ </cluster>
+
+ <!-- End Basic Cluster -->
+
+ <cluster id="0x0001" name="Power Configuration" package="general" status="u" />
+
+ <cluster id="0x0002" name="Device Temperature Configuration" package="general" status="c" >
+ <!-- Device Temperature Information Attribute Set -->
+ <attribute id="0x0000" name="CurrentTemperature" type="int16" >
+ <Range from="-200" to="200"/>
+ </attribute>
+ <attribute id="0x0001" name="MinTempExperienced" type="int16" mandatory="false">
+ <Range from="-200" to="200"/>
+ </attribute>
+ <attribute id="0x0003" name="MaxTempExperienced" type="int16" mandatory="false">
+ <Range from="-200" to="200"/>
+ </attribute>
+ <attribute id="0x0004" name="OverTempTotalDwell" type="uint16" default="0" mandatory="false">
+ <Range from="0x0000" to="0xFFFF"/>
+ </attribute>
+
+ <!-- Device Temperature Settings Attribute Set -->
+ <attribute id="0x0010" name="DeviceTempAlarmMask" type="bitmap8" access="rw" default="0" mandatory="false">
+ <Range from="0x00" to="0x03"/>
+ </attribute>
+ <attribute id="0x0011" name="LowTempThreshold" type="int16" access="rw" mandatory="false">
+ <Range from="-200" to="200"/>
+ </attribute>
+ <attribute id="0x0011" name="HighTempThreshold" type="int16" access="rw" mandatory="false">
+ <Range from="-200" to="200"/>
+ </attribute>
+ <attribute id="0x0011" name="LowTempDwellTripPoint" type="uint24" access="rw" mandatory="false">
+ <Range from="0x000000" to="0xFFFFFF"/>
+ </attribute>
+ <attribute id="0x0011" name="HighTempDwellTripPoint" type="uint24" access="rw" mandatory="false">
+ <Range from="0x000000" to="0xFFFFFF"/>
+ </attribute>
+ </cluster>
+
+ <cluster id="0x0003" name="Identify" package="general" status="c">
+ <server>
+ <attribute id="0x000" name="IdentifyTime" type="uint16" access="rw" default="0x0000">
+ <Range from="0x0000" to="0xffff"/>
+ </attribute>
+ <command id="0x00" name="Identify">
+ <payload>
+ <field name="IdentifyTime" type="uint16"/>
+ </payload>
+ </command>
+ <command id="0x01" name="IdentifyQuery" response_name="IdentifyQueryResponse"/>
+ </server>
+ <client>
+ <command id="0x00" name="IdentifyQueryResponse" response="true">
+ <payload>
+ <field name="Timeout" type="uint16"/>
+ </payload>
+ </command>
+ </client>
+ </cluster>
+
+ <cluster id="0x0004" name="Groups" package="general" status="u" />
+ <cluster id="0x0005" name="Scenes" package="general" status="u" />
+
+ <cluster id="0x0006" name="On/Off" package="general" status="c" >
+ <attribute id="0x0000" name="OnOff" type="boolean" default="0x00">
+ <Range from="0x00" to="0x01"/>
+ </attribute>
+
+ <command id="0x00" name="Off"/>
+ <command id="0x01" name="On"/>
+ <command id="0x02" name="Toggle"/>
+ </cluster>
+
+ <cluster id="0x0007" name="On/Off Switch Configuration" package="general" status="c" >
+ <attribute id="0x0000" name="SwitchType" type="enum">
+ <Range from="0x00" to="0x01"/>
+ </attribute>
+ <attribute id="0x0010" name="SwitchActions" type="enum8" access="rw" default="0x00">
+ <Range from="0x00" to="0x02"/>
+ </attribute>
+ </cluster>
+
+ <!-- Cluster fully Specified -->
+ <cluster id="0x0008" name="Level Control" package="general" status="c">
+ <attribute id="0x0000" name="CurrentLevel" type="uint8" default="0x00" >
+ <Range from="0x00" to="0xff"/>
+ </attribute>
+ <attribute id="0x0001" name="RemainingTime" type="uint16" default="0x0000" mandatory="false">
+ <Range from="0x0000" to="0xffff"/>
+ </attribute>
+
+ <attribute id="0x0010" name="OnOffTransitionTime" type="uint16" default="0x0000" mandatory="false">
+ <Range from="0x0000" to="0xffff"/>
+ </attribute>
+
+ <attribute id="0x0011" name="OnLevel" type="uint8" default="0x00" mandatory="false">
+ <Range from="0x00" to="0xff"/>
+ </attribute>
+
+ <command id="0x00" name="Move to Level">
+ <param name="Level" type="uint8"/>
+ <param name="TransitionTime" type="uint16"/>
+ </command>
+ <command id="0x01" name="Move">
+ <param name="MoveMode" type="enum8">
+ <value id="0x00" name="Up"/>
+ <value id="0x01" name="Down"/>
+ </param>
+ <param name="Rate" type="uint8"/>
+ </command>
+ <command id="0x02" name="Step">
+ <param name="StepMode" type="enum8">
+ <value id="0x00" name="Up"/>
+ <value id="0x01" name="Down"/>
+ </param>
+ <param name="StepSize" type="uint8"/>
+ <param name="TransitionTime" type="uint16"/>
+ </command>
+ <command id="0x03" name="Stop"/>
+
+ <command id="0x00" name="Move to Level (with On/Off)">
+ <param name="Level" type="uint8"/>
+ <param name="TransitionTime" type="uint16"/>
+ </command>
+ <command id="0x01" name="Move (with On/Off)">
+ <param name="MoveMode" type="enum8">
+ <value id="0x00" name="Up"/>
+ <value id="0x01" name="Down"/>
+ </param>
+ <param name="Rate" type="uint8"/>
+ </command>
+ <command id="0x02" name="Step (with On/Off)">
+ <param name="StepMode" type="enum8">
+ <value id="0x00" name="Up" desc="Moves up the Level"/>
+ <value id="0x01" name="Down" desc="Moves down the Level"/>
+ </param>
+ <param name="StepSize" type="uint8"/>
+ <param name="TransitionTime" type="uint16"/>
+ </command>
+ <command id="0x03" name="Stop (with On/Off)"/>
+ </cluster>
+
+ <cluster id="0x0009" name="Alarms" package="general" status="c" >
+ <server>
+ <attribute id="0x0000" name="AlarmCount" type="uint16" mandatory="false">
+ <Range from="0x0000" to="0xffff"/>
+ </attribute>
+ <command id="0x00" name="Reset Alarm">
+ <payload>
+ <field name="AlarmCode" type="enum8"/>
+ <field name="ClusterIdentifier" type="uint16"/> <!-- TODO: change to cluster Identifier type -->
+ </payload>
+ </command>
+ <command id="0x01" name="Reset All Alarms"/>
+ <command id="0x02" name="Get Alarm" />
+ <command id="0x02" name="Reset Alarm Log" mandatory="false" />
+ </server>
+ <client>
+ <command id="0x00" name="Alarm">
+ <payload>
+ <field name="AlarmCode" type="enum8"/>
+ <field name="ClusterIdentifier" type="uint16"/> <!-- TODO: change to cluster Identifier type -->
+ </payload>
+ </command>
+ <command id="0x01" name="Get Alarm Response" >
+ <payload>
+ <field name="Status" type="enum8"/>
+ <field name="AlarmCode" type="enum8"/>
+ <field name="ClusterIdentifier" type="uint16"/> <!-- TODO: change to cluster Identifier type -->
+ <field name="Timestamp" type="uint32"/>
+ </payload>
+ </command>
+ </client>
+ </cluster>
+ <cluster id="0x000A" name="Time" package="general" status="c">
+ <server>
+ <attribute id="0x0000" name="Time" type="utctime" />
+ <attribute id="0x0001" name="TimeStatus" type="bitmap8" default="0x00">
+ <Range from="0x0000" to="0xfff0"/> <!-- range not correct -->
+ </attribute>
+ <attribute id="0x0002" name="TimeZone" type="int32" default="0x00000000" mandatory="false">
+ <Range from="-86400" to="86400"/>
+ </attribute>
+ <attribute id="0x0003" name="DstStart" type="uint32" mandatory="false" />
+ <attribute id="0x0004" name="DstEnd" type="uint32" mandatory="false" />
+ <attribute id="0x0005" name="DstShift" type="int32" default="0x00000000" mandatory="false">
+ <Range from="-86400" to="86400"/>
+ </attribute>
+ <attribute id="0x0006" name="StandardTime" type="uint32" mandatory="false" />
+ <attribute id="0x0007" name="LocalTime" type="uint32" mandatory="false" />
+ </server>
+ </cluster>
+ <cluster id="0x000B" name="RSSI Location" package="general" status="u"/>
+
+ <cluster id="0x000C" name="Simple Metering 4Noks" package="custom" status="c">
+ <attribute id="0x0000" name="Power" type="int32" uom="W">
+ <Range from="0x00000000" to="0xffffffff"/>
+ </attribute>
+ <attribute id="0x0001" name="Energy" type="int32" factor="10" uom="Wh">
+ <Range from="0x00000000" to="0xffffffff"/>
+ </attribute>
+ <attribute id="0x0002" name="TimeValue" type="int32" uom="s">
+ <Range from="0x00000000" to="0xffffffff"/>
+ </attribute>
+ </cluster>
+
+ <!-- Closures functional domain -->
+ <cluster id="0100" name="Shade Configuration" package="closures" status="u"/>
+
+ <!-- HVAC functional domain -->
+ <cluster id="0x0200" name="Pump Configuration and Control" package="hvac" status="u"/>
+ <cluster id="0x0201" name="Thermostat" package="hvac" status="u"/>
+ <cluster id="0x0202" name="Fan Control" package="hvac" status="u"/>
+ <cluster id="0x0203" name="Dehumidification Control" package="hvac" status="u"/>
+ <cluster id="0x0204" name="Thermostat User Interface Configuration" package="hvac" status="u"/>
+
+ <!-- Lighting functional domain -->
+ <cluster id="0x0300" name="Color control" package="lighting" status="u"/>
+ <cluster id="0x0301" name="Ballast Configuration" package="lighting" status="u"/>
+
+ <!-- Measurement and Sensing functional domain -->
+ <cluster id="0x0400" name="Illuminance measurement" package="measurement" status="u"/>
+
+ <cluster id="0x0401" name="Illuminance level sensing" package="measurement" status="u"/>
+
+ <cluster id="0x0402" name="Temperature Measurement" package="measurement" status="c">
+ <!-- Temperature Measurement Information Attribute Set -->
+ <attribute id="0x0000" name="MeasuredValue" type="int16" default="0" factor="0.01" uom="^C">
+ </attribute>
+ <attribute id="0x0001" name="MinMeasuredValue" type="int16" factor="0.1" uom="^C">
+ <Range from="0x954d" to="0x7ffe"/>
+ </attribute>
+ <attribute id="0x0003" name="MaxMeasuredValue" type="int16" factor="0.1" uom="^C">
+ <Range from="0x954e" to="0x7fff"/>
+ </attribute>
+ <attribute id="0x0004" name="Tolerance" type="uint16" mandatory="false">
+ <Range from="0x0000" to="0x0800"/>
+ </attribute>
+ </cluster>
+
+ <cluster id="0x0403" name="Pressure measurement" package="measurement" status="u"/>
+ <cluster id="0x0404" name="Flow measurement" package="measurement" status="u"/>
+ <cluster id="0x0405" name="Relative humidity measurement" package="measurement" status="u"/>
+ <cluster id="0x0406" name="Occupancy sensing" package="measurement" status="u"/>
+
+ <!-- Security and Sefety functional domain -->
+ <cluster id="0x0500" name="IAS Zone" package="security" status="u" />
+ <cluster id="0x0501" name="IAS ACE" package="security" status="u" />
+ <cluster id="0x0502" name="IAS WD" package="security" status="u"/>
+ <cluster id="0x0503" name="IAS WD" package="security" status="u"/>
+
+ <cluster id="0x0A00" name="Appliance Identification" package="eh" status="c" >
+ <!-- Basic Appliance Identification Attribute Set -->
+ <attribute id="0x0000" name="BasicIdentification" type="octets" size="7" >
+ </attribute>
+ <!-- Extended Appliance Identification Attribute Set -->
+ <attribute id="0x010" name="CompanyName" type="string" default="" size="16" mandatory="false">
+ </attribute>
+ <attribute id="0x011" name="CompanyId" type="uint16" default="0x0000" mandatory="false">
+ <Range from="0x0000" to="0xFFFF"/>
+ </attribute>
+ <attribute id="0x012" name="BrandName" type="string" default="" size="16" mandatory="false">
+
+ </attribute>
+ <attribute id="0x013" name="BrandId" type="uint16" default="0x0000" mandatory="false">
+ <Range from="0x0000" to="0xFFFF"/>
+ </attribute>
+ <attribute id="0x014" name="Model" type="string" default="" size="16" mandatory="false">
+ </attribute>
+ <attribute id="0x015" name="PartNumber" type="string" default="" size="16" mandatory="false">
+ </attribute>
+ <attribute id="0x015" name="ProductRevision" type="string" default="" size="16" mandatory="false">
+ </attribute>
+ <attribute id="0x015" name="SoftwareRevision" type="string" default="" size="16" mandatory="false">
+ </attribute>
+ <attribute id="0x015" name="ProductTypeName" type="string" default="" size="2" mandatory="false">
+ </attribute>
+ <attribute id="0x011" name="ProductTypeId" type="uint16" default="0x0000" mandatory="false">
+ <Range from="0x0000" to="0xFFFF"/>
+ </attribute>
+ <attribute id="0x011" name="CECEDSpecificationVersion" type="uint8" default="0x10" mandatory="false">
+ </attribute>
+ </cluster>
+
+ <cluster id="0x0A01" name="Appliance Control" package="eh" status="c">
+ <server>
+ <!-- Appliance Status Attribute Set -->
+ <attribute id="0x0000" name="ApplianceStatus" type="enum8" default="0x00">
+ <Range from="0x00" to="0xff"/>
+ <enum>
+ <item id="0x01" name="Off" />
+ <item id="0x02" name="Stand-by" />
+ <item id="0x03" name="Programmed" />
+ <item id="0x04" name="Programmed Waiting to Start" />
+ <item id="0x05" name="Running" />
+ <item id="0x06" name="Pause" />
+ <item id="0x07" name="End Programmed" />
+ <item id="0x08" name="Failure" />
+ <item id="0x09" name="Programme Interrupted" />
+ <item id="0x0A" name="Idle" />
+ <item id="0x0B" name="Rinse Hold" />
+ <item id="0x0C" name="Service" />
+ <item id="0x0D" name="Superfreezing" />
+ <item id="0x0E" name="Supercooling" />
+ <item id="0x0F" name="Superheating" />
+ </enum>
+ </attribute>
+
+ <attribute id="0x0001" name="RemoteEnableFlags" type="uint8" default="0x00" >
+ <Range from="0x00" to="0xff"/>
+ <enum start="0" end="3" >
+ <item id="0x0" name="Disabled" />
+ <item id="0x7" name="Temporarily Locked/Disabled" />
+ <item id="0xF" name="Enabled Remote Control" />
+ <item id="0x1" name="Enabled Remote and Energy Control" />
+ </enum>
+ <enum start="4" end="7" >
+ <item id="0x2" name="Iris Symtom Code" />
+ </enum>
+ </attribute>
+
+ <attribute id="0x0002" name="ApplianceStatus2" type="uint24" default="0x000000" mandatory="false">
+ <Range from="0x000000" to="0xffffff"/>
+ <!-- TODO: put items -->
+ </attribute>
+
+ <!-- Appliance Functions Attribute Set -->
+ <attribute id="0x0100" name="StartTime" type="uint16" default="0x0000" mandatory="false">
+ <Range from="0x0000" to="0xffff"/>
+ </attribute>
+ <attribute id="0x0101" name="FinishTime" type="uint16" default="0x0000" mandatory="false">
+ <Range from="0x0000" to="0xffff"/>
+ </attribute>
+ <attribute id="0x0102" name="Duration" type="uint16" default="0x0000" mandatory="false">
+ <Range from="0x0000" to="0xffff"/>
+ </attribute>
+ <attribute id="0x0103" name="RemainingTime" type="uint16" default="0x0000" mandatory="false">
+ <Range from="0x0000" to="0xffff"/>
+ </attribute>
+ <attribute id="0x0104" name="CycleTarget0" type="uint8" default="0x00" mandatory="false">
+ <Range from="0x00" to="0xff"/>
+ </attribute>
+ <attribute id="0x0105" name="CycleTarget1" type="uint8" default="0x00" mandatory="false">
+ <Range from="0x00" to="0xff"/>
+ </attribute>
+ <attribute id="0x0106" name="TemperatureTarget0" type="int16" default="0x0000" mandatory="false">
+ <Range from="-50" to="+350"/>
+ </attribute>
+ <attribute id="0x0107" name="TemperatureTarget1" type="int16" default="0x0000" mandatory="false">
+ <Range from="-50" to="+350"/>
+ </attribute>
+ <attribute id="0x0108" name="AutomaticDryingSetPoint" type="uint8" default="0x00" mandatory="false">
+ <Range from="0x000000" to="0xffffff"/>
+ </attribute>
+ <attribute id="0x0109" name="TimedDryingSetPoint" type="uint8" default="0x00" mandatory="false">
+ <Range from="0x00" to="0xff"/>
+ </attribute>
+ <attribute id="0x010A" name="Spin" type="uint16" default="0x0000" mandatory="false">
+ <Range from="0x0000" to="0xFFFF"/>
+ </attribute>
+ <attribute id="0x010B" name="SuperCoolMode" type="boolean" default="0x00" mandatory="false">
+ <Range from="0x00" to="0x01"/>
+ <values>
+ <value id="0x00" name="Disabled" />
+ <value id="0x01" name="Enabled" />
+ </values>
+ </attribute>
+
+ <attribute id="0x010C" name="SuperFreezeMode" type="boolean" default="0x00" mandatory="false">
+ <Range from="0x00" to="0x01"/>
+ <values>
+ <value id="0x00" name="Disabled" />
+ <value id="0x01" name="Enabled" />
+ </values>
+ </attribute>
+
+ <attribute id="0x010D" name="NormalMode" type="boolean" default="0x01" mandatory="false">
+ <Range from="0x00" to="0x01"/>
+ <values>
+ <value id="0x00" name="Disabled" />
+ <value id="0x01" name="Enabled" />
+ </values>
+ </attribute>
+
+ <attribute id="0x010E" name="EcoMode" type="boolean" default="0x00" mandatory="false">
+ <Range from="0x00" to="0x01"/>
+ </attribute>
+
+ <attribute id="0x010F" name="HolidayMode" type="boolean" default="0x00" mandatory="false">
+ <Range from="0x00" to="0x01"/>
+ <values>
+ <value id="0x00" name="Disabled" />
+ <value id="0x01" name="Enabled" />
+ </values>
+ </attribute>
+
+ <attribute id="0x0110" name="FabricSetPoint" type="uint8" default="0x00" mandatory="false">
+ <Range from="0x00" to="0xff"/>
+ <enum>
+ <item id="0x00" name="Generic" />
+ <item id="0x01" name="Cotton" />
+ <item id="0x02" name="Syntetic" />
+ <item id="0x03" name="Wool" />
+ <item id="0x04" name="Silk" />
+ </enum>
+ </attribute>
+
+ <attribute id="0x0111" name="MacroPhase" type="uint8" default="0x00" mandatory="false">
+ <Range from="0x00" to="0xff"/>
+ <enum>
+ <item id="0x00" name="None" />
+ <item id="0x01" name="Washing" />
+ <item id="0x02" name="Rinsing" />
+ <item id="0x03" name="Spin" />
+ <item id="0x04" name="Pump out" />
+ <item id="0x10" name="Preheating" />
+ <item id="0x11" name="Cooking" />
+ </enum>
+ </attribute>
+
+ <command id="0x00" name="CommandExecution">
+ <payload>
+ <field name="CommandId" type="enum8">
+ <item id="0x01" name="Start"/>
+ <item id="0x02" name="Stop"/>
+ <item id="0x03" name="Pause"/>
+ <item id="0x04" name="Start Superfreezing"/>
+ <item id="0x05" name="Stop Superfreezing"/>
+ <item id="0x06" name="Start Supercooling"/>
+ <item id="0x07" name="Stop Supercooling"/>
+ <item id="0x08" name="Disable Gas"/>
+ <item id="0x09" name="Enable Gas"/>
+ <item id="0x0A" name="Enable Energy Control"/>
+ <item id="0x0B" name="Disable Energy Control"/>
+ </field>
+ </payload>
+ </command>
+ <command id="0x01" name="SignalState">
+ <responses>
+ <item name="SignalStateResponse"/>
+ </responses>
+ </command>
+
+ <command id="0x02" name="WriteFunctions" generate="false"/>
+
+ <command id="0x03" name="LoadManagementPause">
+ <payload>
+ <field name="Duration" type="uint16"/>
+ <field name="PowerProfileID" type="uint8" optional="true"/>
+ <field name="EnergyPhaseID" type="uint8" optional="true"/>
+ </payload>
+ <responses>
+ <item name="LoadManagementAcknowledge"/>
+ </responses>
+ </command>
+ <command id="0x03" name="OverloadPause">
+ <payload>
+ <field name="Duration" type="uint16"/>
+ <field name="PauseStartTime" type="uint16"/>
+ </payload>
+ </command>
+
+ <response id="0x00" name="SignalStateResponse">
+ <payload>
+ <field name="ApplianceStatus" type="enum8" generate="false">
+ <enum>
+ <item id="0x01" name="Off" />
+ <item id="0x02" name="Stand-by" />
+ <item id="0x03" name="Programmed" />
+ <item id="0x04" name="Programmed Waiting to Start" />
+ <item id="0x05" name="Running" />
+ <item id="0x06" name="Pause" />
+ <item id="0x07" name="End Programmed" />
+ <item id="0x08" name="Failure" />
+ <item id="0x09" name="Programme Interrupted" />
+ <item id="0x0A" name="Idle" />
+ <item id="0x0B" name="Rinse Hold" />
+ <item id="0x0C" name="Service" />
+ <item id="0x0D" name="Superfreezing" />
+ <item id="0x0E" name="Supercooling" />
+ <item id="0x0F" name="Superheating" />
+ </enum>
+ </field>
+ <field name="RemoteEnableFlags" type="uint8">
+ <enum start="0" end="3" >
+ <item id="0x0" name="Disabled" />
+ <item id="0x7" name="Temporarily Locked/Disabled" />
+ <item id="0xF" name="Enabled Remote Control" />
+ <item id="0x1" name="Enabled Remote and Energy Control" />
+ </enum>
+ <enum start="4" end="7" >
+ <item id="0x2" name="Iris Symtom Code" />
+ </enum>
+ </field>
+ <field name="ApplianceStatus2" type="uint24">
+
+ </field>
+ </payload>
+ </response>
+ <response id="0x02" name="LoadManagementAcknowledge">
+ <payload>
+ <field name="LoadManagementAcknowledge" type="enum8">
+ <enum>
+ <item id="0x00" name="Pause_Accepted" />
+ <item id="0x01" name="Parameters_Error" />
+ <item id="0x02" name="Invalid_Duration" />
+ <item id="0x03" name="Invalid_Power_Profile_ID" />
+ <item id="0x04" name="Invalid_Energy_Phase_ID" />
+ </enum>
+ </field>
+ </payload>
+ </response>
+ </server>
+
+ <client>
+ <command id= "0x01" name="SignalStateNotification">
+ <payload>
+ <field name="ApplianceStatus" type="enum8" generate="false">
+ <enum>
+ <item id="0x01" name="Off" />
+ <item id="0x02" name="Stand-by" />
+ <item id="0x03" name="Programmed" />
+ <item id="0x04" name="Programmed Waiting to Start" />
+ <item id="0x05" name="Running" />
+ <item id="0x06" name="Pause" />
+ <item id="0x07" name="End Programmed" />
+ <item id="0x08" name="Failure" />
+ <item id="0x09" name="Programme Interrupted" />
+ <item id="0x0A" name="Idle" />
+ <item id="0x0B" name="Rinse Hold" />
+ <item id="0x0C" name="Service" />
+ <item id="0x0D" name="Superfreezing" />
+ <item id="0x0E" name="Supercooling" />
+ <item id="0x0F" name="Superheating" />
+ </enum>
+ </field>
+ <field name="RemoteEnableFlags" type="uint8">
+ <enum start="0" end="3" >
+ <item id="0x0" name="Disabled" />
+ <item id="0x7" name="Temporarily Locked/Disabled" />
+ <item id="0xF" name="Enabled Remote Control" />
+ <item id="0x1" name="Enabled Remote and Energy Control" />
+ </enum>
+ <enum start="4" end="7" >
+ <item id="0x2" name="Iris Symtom Code" />
+ </enum>
+ </field>
+ <field name="ApplianceStatus2" type="uint24">
+
+ </field>
+ </payload>
+ </command>
+ </client>
+ </cluster>
+
+ <cluster id="0x0A01" name="Appliance Events" package="eh" status="c">
+ <server>
+ <!-- Appliance Warnings and Faults Attribute Set -->
+ <attribute id="0x0000" name="ApplianceEventList" type="array" default="0x0000" generate="false">
+ <Range from="0x0000" to="0xFFFF"/>
+ </attribute>
+
+ <command id="0x00" name="GetEventsAndAlerts" status="wip"/>
+ <response id="0x00" name="GetEventsAndAlertsResponse" status="wip"/>
+ </server>
+ </cluster>
+
+ <cluster id="0x0FF2" name="Indesit Bridge" manifactureCode="0x1111" package="eh" status="c">
+ <server>
+ <!-- Digital Basic Frame Transmission -->
+ <command id="0x93" name="DBFT">
+ <payload>
+ <field name="i2c" type="uint8"/>
+ <field name="header" type="uint8"/>
+ <field name="type" type="uint8"/>
+ <field name="data" type="octets"/>
+ </payload>
+ <response>
+ <item name="DBFTR"/>
+ </response>
+ </command>
+
+ <!-- Digital Extended Frame Transmission -->
+ <command id="0x95" name="DEFT">
+ <payload>
+ <field name="i2c" type="uint8"/>
+ <field name="header" type="uint8"/>
+ <field name="type" type="uint8"/>
+ <field name="data" type="octets"/>
+ </payload>
+ <response>
+ <item name="DEFTR"/>
+ </response>
+ </command>
+ <!-- Digital Extended Frame Transmission Without Answer -->
+ <command id="0x9d" name="DEFTWA"/>
+ </server>
+ <client>
+ <!-- Digital Basic Frame Transmission Answer -->
+ <command id="0x93" name="DBFTA">
+ <payload>
+ <field name="i2c" type="uint8"/>
+ <field name="header" type="uint8"/>
+ <field name="type" type="uint8"/>
+ <field name="data" type="octets"/>
+ </payload>
+ </command>
+ <!-- Digital Extended Frame Transmission Answer -->
+ <command id="0x93" name="DEFTA">
+ <payload>
+ <field name="i2c" type="uint8"/>
+ <field name="header" type="uint8"/>
+ <field name="type" type="uint8"/>
+ <field name="data" type="octets"/>
+ </payload>
+ </command>
+ </client>
+ </cluster>
+
+ <cluster id="0x0A05" name="Power Profile" package="eh" status="c">
+ <attribute id="0x0000" name="TotalProfileNum" type="uint8" reportable="false" >
+ <Range from="0x01" to="0xfe"/>
+ </attribute>
+ <attribute id="0x0001" name="CurrentPowerProfile" type="uint8" reportable="false" >
+ <Range from="0x01" to="0xfe"/>
+ </attribute>
+ <attribute id="0x0002" name="CurrentEnergyPhase" type="uint8" reportable="false" >
+ <Range from="0x01" to="0xfe"/>
+ </attribute>
+ <client>
+ <command id="0x00" name="PowerProfileRequest" dir="ctos" >
+ <payload>
+ <field name="PowerProfileID" type="uint8"/>
+ </payload>
+ <response>
+ <item name="PowerProfileResponse"/>
+ </response>
+ </command>
+
+ <command id="0x01" name="ReadCurrentProfiles" >
+ <response>
+ <item name="ReadCurrentPowerProfilesResponse"/>
+ </response>
+ </command>
+
+ <command id="0x02" name="GetPowerProfilePriceResponse">
+ <payload>
+ <field name="PowerProfileID" type="uint8"/>
+ <field name="Currency" type="uint16"/>
+ <field name="Price" type="uint32"/>
+ <field name="PriceTrailingDigit" type="uint8"/>
+ </payload>
+ </command>
+ </client>
+ <server>
+ <command id="0x00" name="PowerProfileNotification" >
+ <payload>
+ <field name="TotalProfileNum" type="uint8"/>
+ <field name="PowerProfileID" type="uint8"/>
+ <field name="NumOfTransferredPhases" type="uint8"/>
+ <array fieldname="NumOfTransferredPhases">
+ <field name="EnergyPhaseID" type="uint8"/>
+ <field name="MacroPhaseID" type="uint8"/>
+ <field name="ExpectedDuration" type="uint16"/>
+ <field name="PeakPower" type="uint16"/>
+ <field name="Energy" type="uint16"/>
+ <field name="MaxActivationDelay" type="uint16"/>
+ </array>
+ </payload>
+ </command>
+ <command id="0x01" name="PowerProfileResponse" mandatory="false">
+ </command>
+ <command id="0x02" name="ReadCurrentProfilesResponse" >
+ <payload>
+ <field name="PowerProfileCount" type="uint8"/>
+ <array fieldname="PowerProfileCount">
+ <field name="PowerProfileID" type="uint8"/>
+ <field name="EnergyPhaseID" type="uint8"/>
+ <field name="PowerProfileState" type="enum8">
+ <enum>
+ <item id="0x00" name="POWER_PROFILE_STARTED" />
+ <item id="0x01" name="RUNNING" />
+ <item id="0x02" name="ENERGY_PHASE_ENDED" />
+ <item id="0x03" name="ENERGY_PHASE_STARTED" />
+ <item id="0x04" name="WAITING_TO_START" />
+ <item id="0x05" name="POWER_PROFILE_ENDED" />
+ </enum>
+ </field>
+ </array>
+ </payload>
+ </command>
+ <command id="0x03" name="GetPowerProfilePrice" mandatory="false">
+ <response>
+ <item name="GetPowerProfilePriceResponse"/>
+ </response>
+ </command>
+ <command id="0x04" name="PowerProfilesStateNotification">
+ </command>
+ </server>
+ </cluster>
+
+ <cluster id="0x0A06" name="SmartInfo Identification" package="eh" status="c">
+ <attribute id="0x0010" name="CompanyName" type="octets" reportable="false" size="16">
+ <Range from="0x01" to="0xfe"/>
+ </attribute>
+ <attribute id="0x0011" name="Meter Type ID" type="uint16" reportable="false" >
+ <Range from="0x0000" to="0xffff"/>
+ <item id="0x0001" name="Utility Production Meter" />
+ <item id="0x0002" name="Utility Secondary Meter" />
+ <item id="0x0100" name="Private Primary Meter" />
+ <item id="0x0101" name="Private Production Meter" />
+ <item id="0x0102" name="Private Secondary Meters" />
+ <item id="0x0110" name="Generic Meter" />
+ </attribute>
+ <attribute id="0x0014" name="Data Quality ID" type="uint16" reportable="false" >
+ <Range from="0x0000" to="0xffff"/>
+ <item id="0x0000" name="All Data Certified" />
+ <item id="0x0001" name="Only Instantaneous Power not Certified" />
+ <item id="0x0002" name="Only Cumulated Consumption" />
+ <item id="0x0003" name="Not Certified data" />
+ <item id="0x0101" name="Private Production Meter" />
+ <item id="0x0102" name="Private Secondary Meters" />
+ <item id="0x0110" name="Generic Meter" />
+ </attribute>
+ <attribute id="0x0015" name="Customer Name" type="octets" mandatory="false" reportable="false" size="16">
+ </attribute>
+ <attribute id="0x0016" name="Model" type="octets" mandatory="false" reportable="false" size="16">
+ </attribute>
+ <attribute id="0x0017" name="PartNumber" type="octets" mandatory="false" reportable="false" size="16">
+ </attribute>
+ <attribute id="0x0018" name="ProductRevision" type="octets" mandatory="false" reportable="false" size="16">
+ </attribute>
+ <attribute id="0x001A" name="SoftwareRevision" type="octets" mandatory="false" reportable="false" size="16">
+ </attribute>
+ </cluster>
+ <cluster id="0x0700" name="Price" package="eh" status="u">
+ </cluster>
+
+ <cluster id="0x7001" name="Demand Response and Load Control" package="eh" status="u">
+ </cluster>
+
+ <cluster id="0x0702" name="Simple Metering" package="metering" status="u">
+ <!-- Reading Information Attribute Set -->
+ <attribute id="0x0000" name="CurrentSummationDelivered" type="uint48" >
+ <Range from="0x000000000000" to="0xffffffffffff"/>
+ </attribute>
+ <attribute id="0x0006" name="PowerFactor" type="int8" default="0x00" mandatory="false">
+ <Range from="-100" to="100"/>
+ </attribute>
+
+ <!-- Meter Status Attribute Set -->
+ <attribute id="0x0200" name="Status" type="bitmap8" default="0x00">
+ <Range from="0x00" to="0xff"/>
+ </attribute>
+
+ <!-- Formatting Attribute Set -->
+ <attribute id="0x0300" name="UnitOfMeasure" type="enum8" default="0x00">
+ <Range from="0x00" to="0xff"/>
+ </attribute>
+
+ <attribute id="0x0303" name="SummationFormatting" type="bitmap8" >
+ <Range from="0x00" to="0xff"/>
+ </attribute>
+
+ <attribute id="0x0304" name="DemandFormatting" type="bitmap8" mandatory="false" >
+ <Range from="0x00" to="0xff"/>
+ </attribute>
+
+ <attribute id="0x0306" name="MeteringDeviceType" type="bitmap8" >
+ <Range from="0x00" to="0xff"/>
+ </attribute>
+
+ <!-- Simple Metering Cluster - ESP Historical Consumption Attribute Set -->
+ <attribute id="0x0400" name="IstantaneousDemand" type="int24" default="0x000000" >
+ <Range from="0x000000" to="0xffffff"/>
+ </attribute>
+ </cluster>
+
+ <cluster id="0x7003" name="Message" package="eh" status="u">
+ </cluster>
+
+ <cluster id="0x70ff" name="Prepayment" package="eh" status="u">
+ </cluster>
+
+ <cluster id="0x0A03" name="Applicance Statistics" package="eh" status="u">
+ </cluster>
+ <cluster id="0x0A02" name="Appliance Events and Alerts" package="eh" status="u">
+ </cluster>
+</clusters>
More information about the Commit
mailing list