From b302ed5c9b0a7507bd3d00cc548c37658c381f88 Mon Sep 17 00:00:00 2001 From: Chris Jackson Date: Sun, 22 Mar 2015 22:32:40 +0000 Subject: [PATCH] Initial change to use mvn library --- .../org.openhab.binding.zigbee/pom.xml | 15 + .../org/bubblecloud/zigbee/ZigBeeApi.java | 296 ---- .../bubblecloud/zigbee/ZigBeeApiContext.java | 215 --- .../zigbee/api/AbstractDeviceDescription.java | 72 - .../zigbee/api/ClusterFactory.java | 38 - .../zigbee/api/ClusterFactoryBase.java | 95 - .../zigbee/api/ClusterFactoryImpl.java | 138 -- .../org/bubblecloud/zigbee/api/Device.java | 163 -- .../bubblecloud/zigbee/api/DeviceBase.java | 446 ----- .../zigbee/api/DeviceDescription.java | 72 - .../bubblecloud/zigbee/api/DeviceFactory.java | 71 - .../zigbee/api/DeviceFactoryBase.java | 109 -- .../zigbee/api/DeviceFactoryImpl.java | 118 -- .../zigbee/api/DeviceListener.java | 18 - .../zigbee/api/ReportingConfiguration.java | 58 - .../zigbee/api/ZigBeeApiConstants.java | 257 --- .../zigbee/api/ZigBeeDeviceException.java | 49 - .../zigbee/api/cluster/Cluster.java | 69 - .../zigbee/api/cluster/general/Alarms.java | 54 - .../api/cluster/general/AnalogInput.java | 66 - .../general/AnchorNodeAnnounceListener.java | 34 - .../zigbee/api/cluster/general/Basic.java | 57 - .../api/cluster/general/BinaryInput.java | 62 - .../api/cluster/general/ColorControl.java | 123 -- .../api/cluster/general/Commissioning.java | 118 -- .../DeviceTemperatureConfiguration.java | 48 - .../zigbee/api/cluster/general/DoorLock.java | 39 - .../api/cluster/general/FanControl.java | 39 - .../api/cluster/general/FlowMeasurement.java | 39 - .../zigbee/api/cluster/general/Groups.java | 56 - .../zigbee/api/cluster/general/Identify.java | 43 - .../general/IlluminanceLevelSensing.java | 39 - .../api/cluster/general/LevelControl.java | 85 - .../cluster/general/LocationDataListener.java | 54 - .../api/cluster/general/LocationMethod.java | 44 - .../api/cluster/general/LocationType.java | 44 - .../zigbee/api/cluster/general/Metering.java | 39 - .../cluster/general/NeighborsInformation.java | 99 -- .../api/cluster/general/NetworkKeyType.java | 39 - .../zigbee/api/cluster/general/OnOff.java | 61 - .../api/cluster/general/OnOffSwitch.java | 54 - .../general/OnOffSwitchConfiguration.java | 40 - .../cluster/general/PowerConfiguration.java | 55 - .../cluster/general/PressureMeasurement.java | 33 - .../general/PumpConfigurationAndControl.java | 39 - .../api/cluster/general/RSSILocation.java | 97 -- .../api/cluster/general/RSSIPingListener.java | 34 - .../ReportRSSIMeasurementsListener.java | 34 - .../zigbee/api/cluster/general/Scenes.java | 64 - .../cluster/general/ShadeConfiguration.java | 39 - .../api/cluster/general/StartupControl.java | 43 - .../api/cluster/general/Thermostat.java | 39 - .../ThermostatUserInterfaceConfiguration.java | 39 - .../zigbee/api/cluster/general/Time.java | 40 - .../api/cluster/general/WindowCovering.java | 39 - .../general/event/CurrentLevelEvent.java | 39 - .../general/event/CurrentLevelListener.java | 35 - .../api/cluster/general/event/OnOffEvent.java | 44 - .../cluster/general/event/OnOffListener.java | 35 - .../general/event/PresentValueEvent.java | 39 - .../general/event/PresentValueListener.java | 34 - .../general/event/StartWarningEvent.java | 37 - .../general/event/StartWarningListener.java | 33 - .../zigbee/api/cluster/impl/AlarmsImpl.java | 143 -- .../api/cluster/impl/AnalogInputImpl.java | 183 -- .../zigbee/api/cluster/impl/BasicImpl.java | 173 -- .../api/cluster/impl/BinaryInputImpl.java | 173 -- .../api/cluster/impl/ClusterMessageImpl.java | 50 - .../api/cluster/impl/ColorControlImpl.java | 207 --- .../api/cluster/impl/CommissioningImpl.java | 337 ---- .../DeviceTemperatureConfigurationImpl.java | 124 -- .../zigbee/api/cluster/impl/DoorLockImpl.java | 88 - .../api/cluster/impl/FanControlImpl.java | 86 - .../api/cluster/impl/FlowMeasurementImpl.java | 88 - .../zigbee/api/cluster/impl/GroupsImpl.java | 142 -- .../zigbee/api/cluster/impl/IASACEImpl.java | 133 -- .../zigbee/api/cluster/impl/IASWDImpl.java | 95 - .../zigbee/api/cluster/impl/IASZoneImpl.java | 146 -- .../zigbee/api/cluster/impl/IdentifyImpl.java | 108 -- .../impl/IlluminanceLevelSensingImpl.java | 89 - .../impl/IlluminanceMeasurementImpl.java | 142 -- .../api/cluster/impl/LevelControlImpl.java | 195 --- .../zigbee/api/cluster/impl/MeteringImpl.java | 88 - .../cluster/impl/OccupancySensingImpl.java | 135 -- .../zigbee/api/cluster/impl/OnOffImpl.java | 132 -- .../impl/OnOffSwitchConfigurationImpl.java | 84 - .../cluster/impl/PowerConfigurationImpl.java | 154 -- .../cluster/impl/PressureMeasurementImpl.java | 84 - .../impl/PumpConfigurationAndControlImpl.java | 87 - .../api/cluster/impl/RSSILocationImpl.java | 272 --- .../cluster/impl/RawClusterMessageImpl.java | 49 - .../impl/RelativeHumidityMeasurementImpl.java | 124 -- .../zigbee/api/cluster/impl/ScenesImpl.java | 180 -- .../cluster/impl/ShadeConfigurationImpl.java | 86 - .../impl/TemperatureMeasurementImpl.java | 122 -- .../api/cluster/impl/ThermostatImpl.java | 86 - ...rmostatUserInterfaceConfigurationImpl.java | 87 - .../zigbee/api/cluster/impl/TimeImpl.java | 84 - .../api/cluster/impl/WindowCoveringImpl.java | 87 - .../api/cluster/impl/api/HVAC/FanControl.java | 45 - .../api/HVAC/PumpConfigurationAndControl.java | 45 - .../api/cluster/impl/api/HVAC/Thermostat.java | 45 - .../ThermostatUserInterfaceConfiguration.java | 45 - .../cluster/impl/api/closures/DoorLock.java | 45 - .../impl/api/closures/ShadeConfiguration.java | 44 - .../impl/api/closures/WindowCovering.java | 44 - .../cluster/impl/api/core/AnalogReporter.java | 55 - .../api/cluster/impl/api/core/Attribute.java | 84 - .../api/cluster/impl/api/core/Command.java | 40 - .../api/cluster/impl/api/core/Message.java | 54 - .../cluster/impl/api/core/ReportListener.java | 46 - .../api/cluster/impl/api/core/Reporter.java | 85 - .../api/cluster/impl/api/core/Response.java | 37 - .../api/cluster/impl/api/core/Status.java | 106 -- .../cluster/impl/api/core/ZBDeserializer.java | 123 -- .../cluster/impl/api/core/ZBSerializer.java | 94 - .../api/cluster/impl/api/core/ZCLCluster.java | 115 -- .../impl/api/core/ZCLFrameControl.java | 40 - .../api/cluster/impl/api/core/ZCLHeader.java | 43 - .../impl/api/core/ZigBeeClusterException.java | 54 - .../api/cluster/impl/api/core/ZigBeeType.java | 115 -- .../api/cluster/impl/api/general/Alarms.java | 66 - .../cluster/impl/api/general/AnalogInput.java | 52 - .../api/cluster/impl/api/general/Basic.java | 79 - .../cluster/impl/api/general/BinaryInput.java | 63 - .../impl/api/general/Commissioning.java | 111 -- .../DeviceTemperatureConfiguration.java | 63 - .../api/cluster/impl/api/general/Groups.java | 66 - .../cluster/impl/api/general/Identify.java | 55 - .../impl/api/general/LevelControl.java | 92 - .../api/cluster/impl/api/general/OnOff.java | 57 - .../cluster/impl/api/general/OnOffSwitch.java | 69 - .../api/general/OnOffSwitchConfiguration.java | 49 - .../impl/api/general/PowerConfiguration.java | 73 - .../impl/api/general/RSSILocation.java | 42 - .../api/cluster/impl/api/general/Scenes.java | 81 - .../api/cluster/impl/api/general/Time.java | 49 - .../api/general/alarms/AlarmListener.java | 34 - .../api/general/alarms/AlarmResponse.java | 49 - .../api/general/alarms/GetAlarmResponse.java | 62 - .../commissioning/ResetStartupOptions.java | 36 - .../ResetStartupParametersResponse.java | 37 - .../commissioning/ResetStartupPayload.java | 34 - .../commissioning/RestartDeviceOptions.java | 45 - .../commissioning/RestartDevicePayload.java | 37 - .../commissioning/RestartDeviceResponse.java | 37 - .../RestoreStartupParametersResponse.java | 37 - .../SaveStartupParametersResponse.java | 37 - .../api/general/groups/AddGroupResponse.java | 51 - .../groups/GetGroupMembershipResponse.java | 50 - .../general/groups/RemoveGroupResponse.java | 52 - .../api/general/groups/ViewGroupResponse.java | 56 - .../identify/IdentifyQueryResponse.java | 44 - .../api/general/scenes/AddScenePayload.java | 42 - .../api/general/scenes/AddSceneResponse.java | 57 - .../scenes/ExtensionFieldSetAddScene.java | 53 - .../scenes/ExtensionFieldSetViewResponse.java | 41 - .../scenes/GetSceneMembershipResponse.java | 62 - .../scenes/RemoveAllScenesResponse.java | 51 - .../general/scenes/RemoveSceneResponse.java | 57 - .../general/scenes/StoreSceneResponse.java | 57 - .../api/general/scenes/ViewSceneResponse.java | 72 - .../impl/api/global/AttributeReport.java | 39 - ...AttributeReportingConfigurationRecord.java | 47 - .../api/global/AttributeStatusRecord.java | 38 - .../global/ConfigureReportingResponse.java | 37 - .../impl/api/global/DefaultResponse.java | 50 - .../api/global/ReadAttributesResponse.java | 38 - .../impl/api/global/ReadAttributesStatus.java | 40 - .../api/global/ReportAttributesResponse.java | 37 - .../impl/api/global/WriteAttributeRecord.java | 39 - .../api/global/WriteAttributesResponse.java | 37 - .../api/global/WriteAttributesStatus.java | 36 - .../impl/api/lighting/ColorControl.java | 234 --- .../measureament_sensing/FlowMeasurement.java | 45 - .../IlluminanceLevelSensing.java | 44 - .../IlluminanceMeasurement.java | 47 - .../OccupancySensing.java | 66 - .../PressureMeasurement.java | 45 - .../RelativeHumidityMeasurement.java | 51 - .../TemperatureMeasurement.java | 52 - .../protocol_interfaces/GenericTunnel.java | 42 - .../impl/api/security_safety/IASACE.java | 61 - .../impl/api/security_safety/IASWD.java | 52 - .../impl/api/security_safety/IASZone.java | 78 - .../security_safety/ias_ace/ArmResponse.java | 36 - .../ias_ace/BypassPayload.java | 34 - .../ias_ace/ZoneIDMapResponse.java | 37 - .../ias_ace/ZoneInformationResponse.java | 40 - .../security_safety/ias_ace/ZoneTable.java | 73 - .../security_safety/ias_wd/SquawkPayload.java | 36 - .../ias_wd/StartWarningPayload.java | 36 - .../ias_zone/ZoneEnrollRequestPayload.java | 34 - .../ias_zone/ZoneEnrollResponse.java | 40 - .../security_safety/ias_zone/ZoneState.java | 33 - .../ZoneStatusChangeNotificationListener.java | 32 - .../ZoneStatusChangeNotificationPayload.java | 34 - .../ZoneStatusChangeNotificationResponse.java | 38 - .../security_safety/ias_zone/ZoneType.java | 73 - .../impl/api/smart_energy/Metering.java | 44 - .../impl/attribute/AbstractAttribute.java | 101 -- .../impl/attribute/AttributeDescriptor.java | 44 - .../cluster/impl/attribute/Attributes.java | 925 ---------- .../cluster/impl/core/AbstractCommand.java | 109 -- .../cluster/impl/core/AnalogReporterImpl.java | 125 -- .../api/cluster/impl/core/AttributeImpl.java | 209 --- .../core/ByteArrayOutputStreamSerializer.java | 193 --- .../impl/core/DefaultDeserializer.java | 226 --- .../cluster/impl/core/DefaultSerializer.java | 184 -- .../impl/core/EmptyPayloadCommand.java | 107 -- .../api/cluster/impl/core/ReporterBase.java | 231 --- .../api/cluster/impl/core/ReporterImpl.java | 86 - .../api/cluster/impl/core/ResponseImpl.java | 142 -- .../impl/core/SubscriptionClusterFilter.java | 56 - .../api/cluster/impl/core/ZCLClusterBase.java | 137 -- .../api/cluster/impl/core/ZCLFrame.java | 87 - .../impl/core/ZCLFrameControlImpl.java | 106 -- .../api/cluster/impl/core/ZCLHeaderImpl.java | 138 -- .../api/cluster/impl/core/ZCLLayer.java | 37 - .../event/CurrentLevelBridgeListeners.java | 124 -- .../event/MeasuredValueBridgeListeners.java | 124 -- .../impl/event/OccupancyBridgeListeners.java | 121 -- .../impl/event/OnOffBridgeListeners.java | 122 -- .../event/PresentValueBridgeListeners.java | 119 -- .../impl/event/ToleranceBridgeListeners.java | 124 -- .../cluster/impl/general/AlarmsCluster.java | 215 --- .../impl/general/AnalogInputCluster.java | 136 -- .../cluster/impl/general/BasicCluster.java | 161 -- .../impl/general/BinaryInputCluster.java | 122 -- .../impl/general/ColorControlCluster.java | 525 ------ .../impl/general/CommissioningCluster.java | 210 --- ...DeviceTemperatureConfigurationCluster.java | 122 -- .../cluster/impl/general/DoorLockCluster.java | 77 - .../impl/general/FanControlCluster.java | 77 - .../impl/general/FlowMeasurementCluster.java | 76 - .../cluster/impl/general/GroupsCluster.java | 127 -- .../cluster/impl/general/IdentifyCluster.java | 92 - .../IlluminanceLevelSensingCluster.java | 75 - .../impl/general/LevelControlCluster.java | 161 -- .../cluster/impl/general/MeteringCluster.java | 76 - .../cluster/impl/general/OnOffCluster.java | 112 -- .../OnOffSwitchConfigurationCluster.java | 74 - .../general/PowerConfigurationCluster.java | 151 -- .../general/PressureMeasurementCluster.java | 75 - .../PumpConfigurationAndControlCluster.java | 76 - .../impl/general/RSSILocationCluster.java | 65 - .../cluster/impl/general/ScenesCluster.java | 159 -- .../general/ShadeConfigurationCluster.java | 77 - .../impl/general/ThermostatCluster.java | 76 - ...statUserInterfaceConfigurationCluster.java | 76 - .../api/cluster/impl/general/TimeCluster.java | 75 - .../impl/general/WindowCoveringCluster.java | 76 - .../general/alarms/AlarmResponseImpl.java | 59 - .../general/alarms/AlarmsClusterFilter.java | 61 - .../general/alarms/GetAlarmResponseImpl.java | 74 - .../general/alarms/ResetAlarmCommand.java | 54 - .../ResetStartupParametersResponseImpl.java | 54 - .../RestartDeviceResponseImpl.java | 54 - .../RestoreStartupParametersResponseImpl.java | 54 - .../SaveStartupParametersResponseImpl.java | 54 - .../impl/general/groups/AddGroupCommand.java | 58 - .../groups/AddGroupIfIdentyfingCommand.java | 64 - .../general/groups/AddGroupResponseImpl.java | 61 - .../groups/GetGroupMembershipCommand.java | 56 - .../GetGroupMembershipResponseImpl.java | 63 - .../general/groups/RemoveGroupCommand.java | 53 - .../groups/RemoveGroupResponseImpl.java | 59 - .../impl/general/groups/ViewGroupCommand.java | 53 - .../general/groups/ViewGroupResponseImpl.java | 72 - .../general/identify/IdentifyCommand.java | 53 - .../identify/IdentifyQueryResponseImpl.java | 52 - .../general/level_control/MoveCommand.java | 63 - .../level_control/MoveToLevelCommand.java | 63 - .../general/level_control/StepCommand.java | 65 - .../impl/general/scenes/AddSceneCommand.java | 81 - .../general/scenes/AddScenePayloadImpl.java | 70 - .../general/scenes/AddSceneResponseImpl.java | 65 - .../scenes/ExtensionFieldSetAddSceneImpl.java | 88 - .../ExtensionFieldSetViewResponseImpl.java | 91 - .../scenes/GetSceneMembershipCommand.java | 53 - .../GetSceneMembershipResponseImpl.java | 77 - .../general/scenes/RecallSceneCommand.java | 56 - .../scenes/RemoveAllScenesCommand.java | 51 - .../scenes/RemoveAllScenesResponseImpl.java | 60 - .../general/scenes/RemoveSceneCommand.java | 53 - .../scenes/RemoveSceneResponseImpl.java | 66 - .../general/scenes/StoreSceneCommand.java | 53 - .../scenes/StoreSceneResponseImpl.java | 67 - .../impl/general/scenes/ViewSceneCommand.java | 54 - .../general/scenes/ViewSceneResponseImpl.java | 95 - .../impl/global/DefaultResponseImpl.java | 57 - .../global/read/ReadAttributeCommand.java | 61 - .../global/read/ReadAttributeStatusImpl.java | 87 - .../read/ReadAttributesResponseImpl.java | 60 - .../global/reporting/AttributeReportImpl.java | 61 - ...ibuteReportingConfigurationRecordImpl.java | 91 - .../reporting/AttributeStatusRecordImpl.java | 98 -- .../reporting/ConfigureReportingCommand.java | 107 -- .../ConfigureReportingResponseImpl.java | 82 - .../reporting/ReportAttributesCommand.java | 68 - .../global/write/WriteAttributeCommand.java | 60 - .../write/WriteAttributeRecordImpl.java | 55 - .../write/WriteAttributeStatusImpl.java | 64 - .../write/WriteAttributesResponseImpl.java | 65 - .../IlluminanceMeasurementCluster.java | 100 -- .../OccupancySensingCluster.java | 116 -- .../RelativeHumidityMeasurementCluster.java | 89 - .../TemperatureMeasurementCluster.java | 90 - .../GenericTunnelCluster.java | 65 - .../impl/security_safety/IASACECluster.java | 119 -- .../impl/security_safety/IASWDCluster.java | 85 - .../impl/security_safety/IASZoneCluster.java | 212 --- .../security_safety/ias_ace/ArmCommand.java | 46 - .../ias_ace/ArmResponseImpl.java | 47 - .../ias_ace/BypassCommand.java | 52 - .../ias_ace/BypassPayloadImpl.java | 43 - .../ias_ace/EmergencyCommand.java | 32 - .../security_safety/ias_ace/FireCommand.java | 32 - .../security_safety/ias_ace/PanicCommand.java | 32 - .../ias_ace/ZoneIDMapCommand.java | 32 - .../ias_ace/ZoneIDMapResponseImpl.java | 56 - .../ias_ace/ZoneInformationCommand.java | 46 - .../ias_ace/ZoneInformationResponseImpl.java | 59 - .../ias_ace/ZoneTableImpl.java | 54 - .../security_safety/ias_wd/SquawkCommand.java | 49 - .../ias_wd/SquawkPayloadImpl.java | 48 - .../ias_wd/StartWarningCommand.java | 49 - .../ias_wd/StartWarningPayloadImpl.java | 49 - ...oneZoneStatusChangeNotificationFilter.java | 44 - .../ias_zone/ZoneEnrollRequestCommand.java | 49 - .../ZoneEnrollRequestPayloadImpl.java | 43 - .../ias_zone/ZoneEnrollResponseImpl.java | 67 - .../ZoneStatusChangeNotificationCommand.java | 49 - ...neStatusChangeNotificationPayloadImpl.java | 44 - ...eStatusChangeNotificationResponseImpl.java | 50 - .../IlluminanceMeasurement.java | 58 - .../OccupancySensing.java | 74 - .../RelativeHumidityMeasurement.java | 72 - .../TemperatureMeasurement.java | 69 - .../event/LightSensorTypeEvent.java | 37 - .../event/LightSensorTypeListener.java | 34 - .../event/MeasuredValueEvent.java | 39 - .../event/MeasuredValueListener.java | 35 - .../event/OccupancyEvent.java | 40 - .../event/OccupancyListener.java | 36 - .../event/ToleranceEvent.java | 39 - .../event/ToleranceListener.java | 35 - .../AdvertiseProtocolAddressListener.java | 32 - .../protocol_interfaces/GenericTunnel.java | 48 - .../MatchProtocolAddressResponse.java | 37 - .../api/cluster/security_safety/IASACE.java | 52 - .../api/cluster/security_safety/IASWD.java | 44 - .../api/cluster/security_safety/IASZone.java | 60 - .../device/generic/LevelControlSwitch.java | 55 - .../api/device/generic/MainsPowerOutlet.java | 60 - .../api/device/generic/OnOffOutput.java | 75 - .../api/device/generic/OnOffSwitch.java | 54 - .../api/device/generic/SimpleSensor.java | 53 - .../zigbee/api/device/hvac/Pump.java | 78 - .../api/device/hvac/TemperatureSensor.java | 61 - .../device/impl/ColorDimmableLightDevice.java | 115 -- .../api/device/impl/DimmableLightDevice.java | 109 -- .../zigbee/api/device/impl/GenericDevice.java | 111 -- .../IASAncillaryControlEquipmentDevice.java | 95 - ...ASControlAndIndicatingEquipmentDevice.java | 117 -- .../api/device/impl/IAS_Warning_Device.java | 109 -- .../api/device/impl/IAS_ZoneDevice.java | 83 - .../device/impl/LevelControlSwitchDevice.java | 79 - .../api/device/impl/LightSensorDevice.java | 92 - .../device/impl/MainsPowerOutletDevice.java | 98 -- .../device/impl/OccupancySensorDevice.java | 83 - .../api/device/impl/OnOffLightDevice.java | 105 -- .../device/impl/OnOffLightSwitchDevice.java | 82 - .../api/device/impl/OnOffOutputDevice.java | 99 -- .../api/device/impl/OnOffSwitchDevice.java | 87 - .../zigbee/api/device/impl/PumpDevice.java | 107 -- .../api/device/impl/SimpleSensorDevice.java | 81 - .../device/impl/TemperatureSensorDevice.java | 79 - .../device/lighting/ColorDimmableLight.java | 96 - .../api/device/lighting/DimmableLight.java | 88 - .../api/device/lighting/LightSensor.java | 52 - .../api/device/lighting/OccupancySensor.java | 60 - .../api/device/lighting/OnOffLight.java | 86 - .../api/device/lighting/OnOffLightSwitch.java | 56 - .../IASAncillaryControlEquipment.java | 52 - .../IASControlAndIndicatingEquipment.java | 63 - .../device/security_safety/IAS_Warning.java | 51 - .../api/device/security_safety/IAS_Zone.java | 46 - .../zigbee/network/AnnounceListener.java | 49 - .../ApplicationFrameworkMessageConsumer.java | 36 - .../ApplicationFrameworkMessageListener.java | 47 - .../ApplicationFrameworkMessageProducer.java | 36 - .../network/AsynchronousCommandListener.java | 37 - .../zigbee/network/ClusterFilter.java | 50 - .../zigbee/network/ClusterListener.java | 60 - .../zigbee/network/ClusterMessage.java | 37 - .../bubblecloud/zigbee/network/Constants.java | 43 - .../zigbee/network/EndpointListener.java | 18 - .../zigbee/network/NetworkManager.ucls | 20 - .../network/SynchronousCommandListener.java | 36 - .../network/ZigBeeDiscoveryMonitor.java | 35 - .../zigbee/network/ZigBeeEndpoint.java | 200 --- .../zigbee/network/ZigBeeNetworkManager.java | 159 -- .../zigbee/network/ZigBeeNode.java | 51 - .../discovery/AnnounceListenerImpl.java | 82 - .../discovery/AssociationNetworkBrowser.java | 198 --- .../network/discovery/EndpointBuilder.java | 335 ---- .../network/discovery/ImportingQueue.java | 129 -- .../LinkQualityIndicatorNetworkBrowser.java | 275 --- .../discovery/ZigBeeDiscoveryManager.java | 185 -- .../impl/ApplicationFrameworkLayer.java | 362 ---- .../network/impl/ClusterMessageImpl.java | 52 - .../network/impl/WaitForClusterResponse.java | 132 -- .../ZigBeeBasedriverTimeOutException.java | 44 - .../network/impl/ZigBeeEndpointImpl.java | 480 ----- .../zigbee/network/impl/ZigBeeException.java | 54 - .../zigbee/network/impl/ZigBeeNetwork.java | 295 ---- .../impl/ZigBeeNetworkManagerException.java | 40 - .../zigbee/network/impl/ZigBeeNodeImpl.java | 95 - .../zigbee/network/model/DiscoveryMode.java | 36 - .../zigbee/network/model/DriverStatus.java | 66 - .../zigbee/network/model/IEEEAddress.java | 103 -- .../zigbee/network/model/NetworkAddress.java | 66 - .../zigbee/network/model/NetworkMode.java | 36 - .../network/model/ProvidedClusterMode.java | 6 - .../zigbee/network/packet/Checksum.java | 104 -- .../zigbee/network/packet/ErrorPacket.java | 40 - .../zigbee/network/packet/ResponseStatus.java | 148 -- .../zigbee/network/packet/ZToolAddress.java | 49 - .../zigbee/network/packet/ZToolAddress16.java | 107 -- .../zigbee/network/packet/ZToolAddress64.java | 141 -- .../zigbee/network/packet/ZToolCMD.java | 810 --------- .../zigbee/network/packet/ZToolException.java | 70 - .../zigbee/network/packet/ZToolPacket.java | 179 -- .../network/packet/ZToolPacketHandler.java | 50 - .../network/packet/ZToolPacketParser.java | 162 -- .../network/packet/ZToolPacketStream.java | 443 ----- .../network/packet/ZToolParseException.java | 40 - .../network/packet/af/AF_DATA_CONFIRM.java | 95 - .../network/packet/af/AF_DATA_REQUEST.java | 138 -- .../network/packet/af/AF_DATA_SRSP.java | 56 - .../network/packet/af/AF_INCOMING_MSG.java | 173 -- .../zigbee/network/packet/af/AF_REGISTER.java | 171 -- .../network/packet/af/AF_REGISTER_SRSP.java | 77 - .../network/packet/simple/ZB_ALLOW_BIND.java | 52 - .../packet/simple/ZB_ALLOW_BIND_CONFIRM.java | 52 - .../packet/simple/ZB_ALLOW_BIND_RSP.java | 43 - .../simple/ZB_APP_REGISTER_REQUEST.java | 118 -- .../packet/simple/ZB_APP_REGISTER_RSP.java | 56 - .../packet/simple/ZB_BIND_CONFIRM.java | 63 - .../network/packet/simple/ZB_BIND_DEVICE.java | 77 - .../packet/simple/ZB_BIND_DEVICE_RSP.java | 43 - .../packet/simple/ZB_FIND_DEVICE_CONFIRM.java | 60 - .../packet/simple/ZB_FIND_DEVICE_REQUEST.java | 53 - .../simple/ZB_FIND_DEVICE_REQUEST_RSP.java | 43 - .../packet/simple/ZB_GET_DEVICE_INFO.java | 79 - .../packet/simple/ZB_GET_DEVICE_INFO_RSP.java | 92 - .../simple/ZB_PERMIT_JOINING_REQUEST.java | 60 - .../simple/ZB_PERMIT_JOINING_REQUEST_RSP.java | 58 - .../packet/simple/ZB_READ_CONFIGURATION.java | 75 - .../simple/ZB_READ_CONFIGURATION_RSP.java | 108 -- .../simple/ZB_RECEIVE_DATA_INDICATION.java | 74 - .../packet/simple/ZB_SEND_DATA_CONFIRM.java | 63 - .../packet/simple/ZB_SEND_DATA_REQUEST.java | 106 -- .../simple/ZB_SEND_DATA_REQUEST_RSP.java | 43 - .../packet/simple/ZB_START_CONFIRM.java | 58 - .../packet/simple/ZB_START_REQUEST.java | 39 - .../packet/simple/ZB_START_REQUEST_RSP.java | 43 - .../packet/simple/ZB_SYSTEM_RESET.java | 43 - .../packet/simple/ZB_WRITE_CONFIGURATION.java | 71 - .../simple/ZB_WRITE_CONFIGURATION_RSP.java | 58 - .../network/packet/system/SYS_ADC_READ.java | 70 - .../packet/system/SYS_ADC_READ_SRSP.java | 51 - .../network/packet/system/SYS_GPIO.java | 67 - .../network/packet/system/SYS_GPIO_SRSP.java | 53 - .../packet/system/SYS_OSAL_NV_READ.java | 68 - .../packet/system/SYS_OSAL_NV_READ_SRSP.java | 78 - .../packet/system/SYS_OSAL_NV_WRITE.java | 78 - .../packet/system/SYS_OSAL_NV_WRITE_SRSP.java | 56 - .../packet/system/SYS_OSAL_START_TIMER.java | 58 - .../system/SYS_OSAL_START_TIMER_SRSP.java | 56 - .../packet/system/SYS_OSAL_STOP_TIMER.java | 52 - .../system/SYS_OSAL_STOP_TIMER_SRSP.java | 56 - .../system/SYS_OSAL_TIMER_EXPIRED_IND.java | 57 - .../network/packet/system/SYS_PING.java | 41 - .../packet/system/SYS_PING_RESPONSE.java | 94 - .../network/packet/system/SYS_RANDOM.java | 40 - .../packet/system/SYS_RANDOM_SRSP.java | 51 - .../network/packet/system/SYS_RESET.java | 70 - .../packet/system/SYS_RESET_RESPONSE.java | 70 - .../network/packet/system/SYS_RPC_ERROR.java | 76 - .../packet/system/SYS_TEST_LOOPBACK.java | 49 - .../packet/system/SYS_TEST_LOOPBACK_SRSP.java | 47 - .../network/packet/system/SYS_TEST_RF.java | 80 - .../network/packet/system/SYS_VERSION.java | 40 - .../packet/system/SYS_VERSION_RESPONSE.java | 66 - .../packet/util/UTIL_CALLBACK_SUBSCRIBE.java | 77 - .../UTIL_CALLBACK_SUBSCRIBE_RESPONSE.java | 65 - .../packet/util/UTIL_GET_DEVICE_INFO.java | 40 - .../util/UTIL_GET_DEVICE_INFO_RESPONSE.java | 185 -- .../network/packet/util/UTIL_GET_NV_INFO.java | 41 - .../util/UTIL_GET_NV_INFO_RESPONSE.java | 195 --- .../packet/util/UTIL_SET_CHANNELS.java | 127 -- .../util/UTIL_SET_CHANNELS_RESPONSE.java | 66 - .../network/packet/util/UTIL_SET_PANID.java | 61 - .../packet/util/UTIL_SET_PANID_RESPONSE.java | 66 - .../packet/util/UTIL_SET_PRECONFIG_KEY.java | 65 - .../util/UTIL_SET_PRECONFIG_KEY_RESPONSE.java | 66 - .../packet/util/UTIL_SET_SECURITY_LEVEL.java | 60 - .../UTIL_SET_SECURITY_LEVEL_RESPONSE.java | 66 - .../network/packet/zdo/ZDO_ACTIVE_EP_REQ.java | 85 - .../packet/zdo/ZDO_ACTIVE_EP_REQ_SRSP.java | 56 - .../network/packet/zdo/ZDO_ACTIVE_EP_RSP.java | 103 -- .../network/packet/zdo/ZDO_BIND_REQ.java | 143 -- .../network/packet/zdo/ZDO_BIND_REQ_SRSP.java | 56 - .../network/packet/zdo/ZDO_BIND_RSP.java | 63 - .../packet/zdo/ZDO_END_DEVICE_ANNCE.java | 90 - .../packet/zdo/ZDO_END_DEVICE_ANNCE_IND.java | 69 - .../packet/zdo/ZDO_END_DEVICE_ANNCE_SRSP.java | 56 - .../packet/zdo/ZDO_END_DEVICE_BIND_REQ.java | 113 -- .../zdo/ZDO_END_DEVICE_BIND_REQ_SRSP.java | 56 - .../packet/zdo/ZDO_END_DEVICE_BIND_RSP.java | 62 - .../network/packet/zdo/ZDO_IEEE_ADDR_REQ.java | 122 -- .../packet/zdo/ZDO_IEEE_ADDR_REQ_SRSP.java | 56 - .../network/packet/zdo/ZDO_IEEE_ADDR_RSP.java | 128 -- .../packet/zdo/ZDO_MATCH_DESC_REQ.java | 108 -- .../packet/zdo/ZDO_MATCH_DESC_REQ_SRSP.java | 56 - .../packet/zdo/ZDO_MATCH_DESC_RSP.java | 83 - .../packet/zdo/ZDO_MGMT_LEAVE_REQ.java | 66 - .../packet/zdo/ZDO_MGMT_LEAVE_REQ_SRSP.java | 56 - .../packet/zdo/ZDO_MGMT_LEAVE_RSP.java | 62 - .../network/packet/zdo/ZDO_MGMT_LQI_REQ.java | 60 - .../packet/zdo/ZDO_MGMT_LQI_REQ_SRSP.java | 56 - .../network/packet/zdo/ZDO_MGMT_LQI_RSP.java | 162 -- .../packet/zdo/ZDO_MGMT_NWK_UPDATE_REQ.java | 111 -- .../zdo/ZDO_MGMT_NWK_UPDATE_REQ_SRSP.java | 61 - .../packet/zdo/ZDO_MGMT_PERMIT_JOIN_REQ.java | 65 - .../zdo/ZDO_MGMT_PERMIT_JOIN_REQ_SRSP.java | 56 - .../packet/zdo/ZDO_MGMT_PERMIT_JOIN_RSP.java | 62 - .../network/packet/zdo/ZDO_NODE_DESC_REQ.java | 77 - .../packet/zdo/ZDO_NODE_DESC_REQ_SRSP.java | 56 - .../network/packet/zdo/ZDO_NODE_DESC_RSP.java | 182 -- .../network/packet/zdo/ZDO_NWK_ADDR_REQ.java | 76 - .../packet/zdo/ZDO_NWK_ADDR_REQ_SRSP.java | 56 - .../network/packet/zdo/ZDO_NWK_ADDR_RSP.java | 95 - .../packet/zdo/ZDO_SIMPLE_DESC_REQ.java | 80 - .../packet/zdo/ZDO_SIMPLE_DESC_REQ_SRSP.java | 56 - .../packet/zdo/ZDO_SIMPLE_DESC_RSP.java | 208 --- .../packet/zdo/ZDO_STARTUP_FROM_APP.java | 71 - .../packet/zdo/ZDO_STARTUP_FROM_APP_SRSP.java | 58 - .../packet/zdo/ZDO_STATE_CHANGE_IND.java | 93 - .../network/packet/zdo/ZDO_UNBIND_REQ.java | 141 -- .../packet/zdo/ZDO_UNBIND_REQ_SRSP.java | 56 - .../network/packet/zdo/ZDO_UNBIND_RSP.java | 62 - .../packet/zdo/ZDO_USER_DESC_CONF.java | 56 - .../network/packet/zdo/ZDO_USER_DESC_REQ.java | 60 - .../packet/zdo/ZDO_USER_DESC_REQ_SRSP.java | 56 - .../network/packet/zdo/ZDO_USER_DESC_RSP.java | 84 - .../network/packet/zdo/ZDO_USER_DESC_SET.java | 81 - .../packet/zdo/ZDO_USER_DESC_SET_SRSP.java | 56 - .../zigbee/network/port/ZigBeeInterface.java | 338 ---- .../port/ZigBeeNetworkManagerImpl.java | 1544 ----------------- .../bubblecloud/zigbee/util/ArraysUtil.java | 47 - .../bubblecloud/zigbee/util/ByteUtils.java | 294 ---- .../java/org/bubblecloud/zigbee/util/Cie.java | 83 - .../zigbee/util/CircularBufferInt.java | 140 -- .../bubblecloud/zigbee/util/DoubleByte.java | 104 -- .../zigbee/util/IIntArrayInputStream.java | 39 - .../org/bubblecloud/zigbee/util/Integers.java | 415 ----- .../zigbee/util/MarkableInputStream.java | 132 -- .../zigbee/util/NetworkAddressUtil.java | 24 - .../zigbee/util/RunnableThread.java | 74 - .../bubblecloud/zigbee/util/Stoppable.java | 38 - .../bubblecloud/zigbee/util/ThreadUtils.java | 71 - .../org/bubblecloud/zigbee/util/Threaded.java | 42 - 575 files changed, 15 insertions(+), 49991 deletions(-) delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/ZigBeeApi.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/ZigBeeApiContext.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/AbstractDeviceDescription.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/ClusterFactory.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/ClusterFactoryBase.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/ClusterFactoryImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/Device.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/DeviceBase.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/DeviceDescription.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/DeviceFactory.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/DeviceFactoryBase.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/DeviceFactoryImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/DeviceListener.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/ReportingConfiguration.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/ZigBeeApiConstants.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/ZigBeeDeviceException.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/Cluster.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/Alarms.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/AnalogInput.java delete mode 100755 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/AnchorNodeAnnounceListener.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/Basic.java delete mode 100755 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/BinaryInput.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/ColorControl.java delete mode 100755 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/Commissioning.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/DeviceTemperatureConfiguration.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/DoorLock.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/FanControl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/FlowMeasurement.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/Groups.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/Identify.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/IlluminanceLevelSensing.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/LevelControl.java delete mode 100755 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/LocationDataListener.java delete mode 100755 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/LocationMethod.java delete mode 100755 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/LocationType.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/Metering.java delete mode 100755 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/NeighborsInformation.java delete mode 100755 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/NetworkKeyType.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/OnOff.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/OnOffSwitch.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/OnOffSwitchConfiguration.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/PowerConfiguration.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/PressureMeasurement.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/PumpConfigurationAndControl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/RSSILocation.java delete mode 100755 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/RSSIPingListener.java delete mode 100755 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/ReportRSSIMeasurementsListener.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/Scenes.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/ShadeConfiguration.java delete mode 100755 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/StartupControl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/Thermostat.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/ThermostatUserInterfaceConfiguration.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/Time.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/WindowCovering.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/event/CurrentLevelEvent.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/event/CurrentLevelListener.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/event/OnOffEvent.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/event/OnOffListener.java delete mode 100755 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/event/PresentValueEvent.java delete mode 100755 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/event/PresentValueListener.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/event/StartWarningEvent.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/event/StartWarningListener.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/AlarmsImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/AnalogInputImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/BasicImpl.java delete mode 100755 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/BinaryInputImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/ClusterMessageImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/ColorControlImpl.java delete mode 100755 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/CommissioningImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/DeviceTemperatureConfigurationImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/DoorLockImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/FanControlImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/FlowMeasurementImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/GroupsImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/IASACEImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/IASWDImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/IASZoneImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/IdentifyImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/IlluminanceLevelSensingImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/IlluminanceMeasurementImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/LevelControlImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/MeteringImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/OccupancySensingImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/OnOffImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/OnOffSwitchConfigurationImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/PowerConfigurationImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/PressureMeasurementImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/PumpConfigurationAndControlImpl.java delete mode 100755 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/RSSILocationImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/RawClusterMessageImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/RelativeHumidityMeasurementImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/ScenesImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/ShadeConfigurationImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/TemperatureMeasurementImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/ThermostatImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/ThermostatUserInterfaceConfigurationImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/TimeImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/WindowCoveringImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/HVAC/FanControl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/HVAC/PumpConfigurationAndControl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/HVAC/Thermostat.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/HVAC/ThermostatUserInterfaceConfiguration.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/closures/DoorLock.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/closures/ShadeConfiguration.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/closures/WindowCovering.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/AnalogReporter.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/Attribute.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/Command.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/Message.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/ReportListener.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/Reporter.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/Response.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/Status.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/ZBDeserializer.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/ZBSerializer.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/ZCLCluster.java delete mode 100755 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/ZCLFrameControl.java delete mode 100755 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/ZCLHeader.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/ZigBeeClusterException.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/ZigBeeType.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/Alarms.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/AnalogInput.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/Basic.java delete mode 100755 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/BinaryInput.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/Commissioning.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/DeviceTemperatureConfiguration.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/Groups.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/Identify.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/LevelControl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/OnOff.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/OnOffSwitch.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/OnOffSwitchConfiguration.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/PowerConfiguration.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/RSSILocation.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/Scenes.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/Time.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/alarms/AlarmListener.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/alarms/AlarmResponse.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/alarms/GetAlarmResponse.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/commissioning/ResetStartupOptions.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/commissioning/ResetStartupParametersResponse.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/commissioning/ResetStartupPayload.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/commissioning/RestartDeviceOptions.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/commissioning/RestartDevicePayload.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/commissioning/RestartDeviceResponse.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/commissioning/RestoreStartupParametersResponse.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/commissioning/SaveStartupParametersResponse.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/groups/AddGroupResponse.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/groups/GetGroupMembershipResponse.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/groups/RemoveGroupResponse.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/groups/ViewGroupResponse.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/identify/IdentifyQueryResponse.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/scenes/AddScenePayload.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/scenes/AddSceneResponse.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/scenes/ExtensionFieldSetAddScene.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/scenes/ExtensionFieldSetViewResponse.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/scenes/GetSceneMembershipResponse.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/scenes/RemoveAllScenesResponse.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/scenes/RemoveSceneResponse.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/scenes/StoreSceneResponse.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/scenes/ViewSceneResponse.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/AttributeReport.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/AttributeReportingConfigurationRecord.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/AttributeStatusRecord.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/ConfigureReportingResponse.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/DefaultResponse.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/ReadAttributesResponse.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/ReadAttributesStatus.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/ReportAttributesResponse.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/WriteAttributeRecord.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/WriteAttributesResponse.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/WriteAttributesStatus.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/lighting/ColorControl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/measureament_sensing/FlowMeasurement.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/measureament_sensing/IlluminanceLevelSensing.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/measureament_sensing/IlluminanceMeasurement.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/measureament_sensing/OccupancySensing.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/measureament_sensing/PressureMeasurement.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/measureament_sensing/RelativeHumidityMeasurement.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/measureament_sensing/TemperatureMeasurement.java delete mode 100755 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/protocol_interfaces/GenericTunnel.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/IASACE.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/IASWD.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/IASZone.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_ace/ArmResponse.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_ace/BypassPayload.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_ace/ZoneIDMapResponse.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_ace/ZoneInformationResponse.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_ace/ZoneTable.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_wd/SquawkPayload.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_wd/StartWarningPayload.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_zone/ZoneEnrollRequestPayload.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_zone/ZoneEnrollResponse.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_zone/ZoneState.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_zone/ZoneStatusChangeNotificationListener.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_zone/ZoneStatusChangeNotificationPayload.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_zone/ZoneStatusChangeNotificationResponse.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_zone/ZoneType.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/smart_energy/Metering.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/attribute/AbstractAttribute.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/attribute/AttributeDescriptor.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/attribute/Attributes.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/AbstractCommand.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/AnalogReporterImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/AttributeImpl.java delete mode 100755 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/ByteArrayOutputStreamSerializer.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/DefaultDeserializer.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/DefaultSerializer.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/EmptyPayloadCommand.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/ReporterBase.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/ReporterImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/ResponseImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/SubscriptionClusterFilter.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/ZCLClusterBase.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/ZCLFrame.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/ZCLFrameControlImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/ZCLHeaderImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/ZCLLayer.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/event/CurrentLevelBridgeListeners.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/event/MeasuredValueBridgeListeners.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/event/OccupancyBridgeListeners.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/event/OnOffBridgeListeners.java delete mode 100755 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/event/PresentValueBridgeListeners.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/event/ToleranceBridgeListeners.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/AlarmsCluster.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/AnalogInputCluster.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/BasicCluster.java delete mode 100755 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/BinaryInputCluster.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/ColorControlCluster.java delete mode 100755 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/CommissioningCluster.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/DeviceTemperatureConfigurationCluster.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/DoorLockCluster.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/FanControlCluster.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/FlowMeasurementCluster.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/GroupsCluster.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/IdentifyCluster.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/IlluminanceLevelSensingCluster.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/LevelControlCluster.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/MeteringCluster.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/OnOffCluster.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/OnOffSwitchConfigurationCluster.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/PowerConfigurationCluster.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/PressureMeasurementCluster.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/PumpConfigurationAndControlCluster.java delete mode 100755 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/RSSILocationCluster.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/ScenesCluster.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/ShadeConfigurationCluster.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/ThermostatCluster.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/ThermostatUserInterfaceConfigurationCluster.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/TimeCluster.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/WindowCoveringCluster.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/alarms/AlarmResponseImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/alarms/AlarmsClusterFilter.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/alarms/GetAlarmResponseImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/alarms/ResetAlarmCommand.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/commissioning/ResetStartupParametersResponseImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/commissioning/RestartDeviceResponseImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/commissioning/RestoreStartupParametersResponseImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/commissioning/SaveStartupParametersResponseImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/groups/AddGroupCommand.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/groups/AddGroupIfIdentyfingCommand.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/groups/AddGroupResponseImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/groups/GetGroupMembershipCommand.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/groups/GetGroupMembershipResponseImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/groups/RemoveGroupCommand.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/groups/RemoveGroupResponseImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/groups/ViewGroupCommand.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/groups/ViewGroupResponseImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/identify/IdentifyCommand.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/identify/IdentifyQueryResponseImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/level_control/MoveCommand.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/level_control/MoveToLevelCommand.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/level_control/StepCommand.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/AddSceneCommand.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/AddScenePayloadImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/AddSceneResponseImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/ExtensionFieldSetAddSceneImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/ExtensionFieldSetViewResponseImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/GetSceneMembershipCommand.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/GetSceneMembershipResponseImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/RecallSceneCommand.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/RemoveAllScenesCommand.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/RemoveAllScenesResponseImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/RemoveSceneCommand.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/RemoveSceneResponseImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/StoreSceneCommand.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/StoreSceneResponseImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/ViewSceneCommand.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/ViewSceneResponseImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/DefaultResponseImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/read/ReadAttributeCommand.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/read/ReadAttributeStatusImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/read/ReadAttributesResponseImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/reporting/AttributeReportImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/reporting/AttributeReportingConfigurationRecordImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/reporting/AttributeStatusRecordImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/reporting/ConfigureReportingCommand.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/reporting/ConfigureReportingResponseImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/reporting/ReportAttributesCommand.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/write/WriteAttributeCommand.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/write/WriteAttributeRecordImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/write/WriteAttributeStatusImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/write/WriteAttributesResponseImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/measureament_sensing/IlluminanceMeasurementCluster.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/measureament_sensing/OccupancySensingCluster.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/measureament_sensing/RelativeHumidityMeasurementCluster.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/measureament_sensing/TemperatureMeasurementCluster.java delete mode 100755 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/protocol_interfaces/GenericTunnelCluster.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/IASACECluster.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/IASWDCluster.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/IASZoneCluster.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/ArmCommand.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/ArmResponseImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/BypassCommand.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/BypassPayloadImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/EmergencyCommand.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/FireCommand.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/PanicCommand.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/ZoneIDMapCommand.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/ZoneIDMapResponseImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/ZoneInformationCommand.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/ZoneInformationResponseImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/ZoneTableImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_wd/SquawkCommand.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_wd/SquawkPayloadImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_wd/StartWarningCommand.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_wd/StartWarningPayloadImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_zone/IAS_ZoneZoneStatusChangeNotificationFilter.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_zone/ZoneEnrollRequestCommand.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_zone/ZoneEnrollRequestPayloadImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_zone/ZoneEnrollResponseImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_zone/ZoneStatusChangeNotificationCommand.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_zone/ZoneStatusChangeNotificationPayloadImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_zone/ZoneStatusChangeNotificationResponseImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/IlluminanceMeasurement.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/OccupancySensing.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/RelativeHumidityMeasurement.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/TemperatureMeasurement.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/event/LightSensorTypeEvent.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/event/LightSensorTypeListener.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/event/MeasuredValueEvent.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/event/MeasuredValueListener.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/event/OccupancyEvent.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/event/OccupancyListener.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/event/ToleranceEvent.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/event/ToleranceListener.java delete mode 100755 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/protocol_interfaces/AdvertiseProtocolAddressListener.java delete mode 100755 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/protocol_interfaces/GenericTunnel.java delete mode 100755 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/protocol_interfaces/MatchProtocolAddressResponse.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/security_safety/IASACE.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/security_safety/IASWD.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/security_safety/IASZone.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/generic/LevelControlSwitch.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/generic/MainsPowerOutlet.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/generic/OnOffOutput.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/generic/OnOffSwitch.java delete mode 100755 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/generic/SimpleSensor.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/hvac/Pump.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/hvac/TemperatureSensor.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/ColorDimmableLightDevice.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/DimmableLightDevice.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/GenericDevice.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/IASAncillaryControlEquipmentDevice.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/IASControlAndIndicatingEquipmentDevice.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/IAS_Warning_Device.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/IAS_ZoneDevice.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/LevelControlSwitchDevice.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/LightSensorDevice.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/MainsPowerOutletDevice.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/OccupancySensorDevice.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/OnOffLightDevice.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/OnOffLightSwitchDevice.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/OnOffOutputDevice.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/OnOffSwitchDevice.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/PumpDevice.java delete mode 100755 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/SimpleSensorDevice.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/TemperatureSensorDevice.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/lighting/ColorDimmableLight.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/lighting/DimmableLight.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/lighting/LightSensor.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/lighting/OccupancySensor.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/lighting/OnOffLight.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/lighting/OnOffLightSwitch.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/security_safety/IASAncillaryControlEquipment.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/security_safety/IASControlAndIndicatingEquipment.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/security_safety/IAS_Warning.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/security_safety/IAS_Zone.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/AnnounceListener.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ApplicationFrameworkMessageConsumer.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ApplicationFrameworkMessageListener.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ApplicationFrameworkMessageProducer.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/AsynchronousCommandListener.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ClusterFilter.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ClusterListener.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ClusterMessage.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/Constants.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/EndpointListener.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/NetworkManager.ucls delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/SynchronousCommandListener.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ZigBeeDiscoveryMonitor.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ZigBeeEndpoint.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ZigBeeNetworkManager.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ZigBeeNode.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/discovery/AnnounceListenerImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/discovery/AssociationNetworkBrowser.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/discovery/EndpointBuilder.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/discovery/ImportingQueue.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/discovery/LinkQualityIndicatorNetworkBrowser.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/discovery/ZigBeeDiscoveryManager.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/impl/ApplicationFrameworkLayer.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/impl/ClusterMessageImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/impl/WaitForClusterResponse.java delete mode 100755 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/impl/ZigBeeBasedriverTimeOutException.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/impl/ZigBeeEndpointImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/impl/ZigBeeException.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/impl/ZigBeeNetwork.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/impl/ZigBeeNetworkManagerException.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/impl/ZigBeeNodeImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/model/DiscoveryMode.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/model/DriverStatus.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/model/IEEEAddress.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/model/NetworkAddress.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/model/NetworkMode.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/model/ProvidedClusterMode.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/Checksum.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ErrorPacket.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ResponseStatus.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolAddress.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolAddress16.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolAddress64.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolCMD.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolException.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolPacket.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolPacketHandler.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolPacketParser.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolPacketStream.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolParseException.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/af/AF_DATA_CONFIRM.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/af/AF_DATA_REQUEST.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/af/AF_DATA_SRSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/af/AF_INCOMING_MSG.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/af/AF_REGISTER.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/af/AF_REGISTER_SRSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_ALLOW_BIND.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_ALLOW_BIND_CONFIRM.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_ALLOW_BIND_RSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_APP_REGISTER_REQUEST.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_APP_REGISTER_RSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_BIND_CONFIRM.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_BIND_DEVICE.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_BIND_DEVICE_RSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_FIND_DEVICE_CONFIRM.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_FIND_DEVICE_REQUEST.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_FIND_DEVICE_REQUEST_RSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_GET_DEVICE_INFO.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_GET_DEVICE_INFO_RSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_PERMIT_JOINING_REQUEST.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_PERMIT_JOINING_REQUEST_RSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_READ_CONFIGURATION.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_READ_CONFIGURATION_RSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_RECEIVE_DATA_INDICATION.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_SEND_DATA_CONFIRM.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_SEND_DATA_REQUEST.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_SEND_DATA_REQUEST_RSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_START_CONFIRM.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_START_REQUEST.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_START_REQUEST_RSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_SYSTEM_RESET.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_WRITE_CONFIGURATION.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_WRITE_CONFIGURATION_RSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_ADC_READ.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_ADC_READ_SRSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_GPIO.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_GPIO_SRSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_OSAL_NV_READ.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_OSAL_NV_READ_SRSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_OSAL_NV_WRITE.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_OSAL_NV_WRITE_SRSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_OSAL_START_TIMER.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_OSAL_START_TIMER_SRSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_OSAL_STOP_TIMER.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_OSAL_STOP_TIMER_SRSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_OSAL_TIMER_EXPIRED_IND.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_PING.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_PING_RESPONSE.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_RANDOM.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_RANDOM_SRSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_RESET.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_RESET_RESPONSE.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_RPC_ERROR.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_TEST_LOOPBACK.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_TEST_LOOPBACK_SRSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_TEST_RF.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_VERSION.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_VERSION_RESPONSE.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_CALLBACK_SUBSCRIBE.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_CALLBACK_SUBSCRIBE_RESPONSE.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_GET_DEVICE_INFO.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_GET_DEVICE_INFO_RESPONSE.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_GET_NV_INFO.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_GET_NV_INFO_RESPONSE.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_SET_CHANNELS.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_SET_CHANNELS_RESPONSE.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_SET_PANID.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_SET_PANID_RESPONSE.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_SET_PRECONFIG_KEY.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_SET_PRECONFIG_KEY_RESPONSE.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_SET_SECURITY_LEVEL.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_SET_SECURITY_LEVEL_RESPONSE.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_ACTIVE_EP_REQ.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_ACTIVE_EP_REQ_SRSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_ACTIVE_EP_RSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_BIND_REQ.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_BIND_REQ_SRSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_BIND_RSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_END_DEVICE_ANNCE.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_END_DEVICE_ANNCE_IND.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_END_DEVICE_ANNCE_SRSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_END_DEVICE_BIND_REQ.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_END_DEVICE_BIND_REQ_SRSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_END_DEVICE_BIND_RSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_IEEE_ADDR_REQ.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_IEEE_ADDR_REQ_SRSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_IEEE_ADDR_RSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MATCH_DESC_REQ.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MATCH_DESC_REQ_SRSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MATCH_DESC_RSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_LEAVE_REQ.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_LEAVE_REQ_SRSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_LEAVE_RSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_LQI_REQ.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_LQI_REQ_SRSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_LQI_RSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_NWK_UPDATE_REQ.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_NWK_UPDATE_REQ_SRSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_PERMIT_JOIN_REQ.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_PERMIT_JOIN_REQ_SRSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_PERMIT_JOIN_RSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_NODE_DESC_REQ.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_NODE_DESC_REQ_SRSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_NODE_DESC_RSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_NWK_ADDR_REQ.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_NWK_ADDR_REQ_SRSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_NWK_ADDR_RSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_SIMPLE_DESC_REQ.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_SIMPLE_DESC_REQ_SRSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_SIMPLE_DESC_RSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_STARTUP_FROM_APP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_STARTUP_FROM_APP_SRSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_STATE_CHANGE_IND.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_UNBIND_REQ.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_UNBIND_REQ_SRSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_UNBIND_RSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_USER_DESC_CONF.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_USER_DESC_REQ.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_USER_DESC_REQ_SRSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_USER_DESC_RSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_USER_DESC_SET.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_USER_DESC_SET_SRSP.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/port/ZigBeeInterface.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/port/ZigBeeNetworkManagerImpl.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/ArraysUtil.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/ByteUtils.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/Cie.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/CircularBufferInt.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/DoubleByte.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/IIntArrayInputStream.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/Integers.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/MarkableInputStream.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/NetworkAddressUtil.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/RunnableThread.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/Stoppable.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/ThreadUtils.java delete mode 100644 addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/Threaded.java diff --git a/addons/binding/org.openhab.binding.zigbee/pom.xml b/addons/binding/org.openhab.binding.zigbee/pom.xml index 6a7e1444d52bb..6a4227364b1f0 100644 --- a/addons/binding/org.openhab.binding.zigbee/pom.xml +++ b/addons/binding/org.openhab.binding.zigbee/pom.xml @@ -16,4 +16,19 @@ ZigBee Binding eclipse-plugin + + + bubblecloud-cloudbees-release + http://repository-bubblecloud.forge.cloudbees.com/release/ + + + + + + org.bubblecloud.zigbee4java + zigbee-api + 2.0.2 + + + diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/ZigBeeApi.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/ZigBeeApi.java deleted file mode 100644 index 96d7a8168b9be..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/ZigBeeApi.java +++ /dev/null @@ -1,296 +0,0 @@ -/** - * Copyright 2013 Tommi S.E. Laukkanen - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.bubblecloud.zigbee; - -import org.bubblecloud.zigbee.network.EndpointListener; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.network.discovery.ZigBeeDiscoveryManager; -import org.bubblecloud.zigbee.network.impl.ZigBeeNetwork; -import org.bubblecloud.zigbee.network.model.DiscoveryMode; -import org.bubblecloud.zigbee.network.model.DriverStatus; -import org.bubblecloud.zigbee.network.model.NetworkMode; -import org.bubblecloud.zigbee.api.DeviceListener; -import org.bubblecloud.zigbee.network.impl.ApplicationFrameworkLayer; -import org.bubblecloud.zigbee.api.*; -import org.bubblecloud.zigbee.api.device.generic.*; -import org.bubblecloud.zigbee.api.device.hvac.Pump; -import org.bubblecloud.zigbee.api.device.hvac.TemperatureSensor; -import org.bubblecloud.zigbee.api.device.lighting.*; -import org.bubblecloud.zigbee.api.device.security_safety.IASAncillaryControlEquipment; -import org.bubblecloud.zigbee.api.device.security_safety.IASControlAndIndicatingEquipment; -import org.bubblecloud.zigbee.api.device.security_safety.IAS_Warning; -import org.bubblecloud.zigbee.api.device.security_safety.IAS_Zone; -import org.bubblecloud.zigbee.api.device.impl.*; -import org.bubblecloud.zigbee.api.DeviceBase; -import org.bubblecloud.zigbee.network.port.ZigBeeNetworkManagerImpl; -import org.bubblecloud.zigbee.network.port.ZigBeePort; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.*; - -/** - * ZigBee Application Interface. - * - * @author Tommi S.E. Laukkanen - * @author Chris Hatton - */ -public class ZigBeeApi implements EndpointListener, DeviceListener { - /** - * The logger. - */ - private final static Logger LOGGER = LoggerFactory.getLogger(ZigBeeDiscoveryManager.class); - /** - * The ZigBee network manager. - */ - private final ZigBeeNetworkManagerImpl networkManager; - /** - * The ZigBee discovery manager. - */ - private final ZigBeeDiscoveryManager discoveryManager; - /** - * The ZigBee context. - */ - private ZigBeeApiContext context; - /** - * The zigbee network. - */ - private ZigBeeNetwork network; - - /** - * Constructor to configure the port interface. - * - * @param port the ZigBee interface port (reference implementation provided by the zigbee4java-serialPort module) - * @param pan the pan - * @param channel the channel - * @param discoveryModes the discovery modes - * @param resetNetwork the flag indicating network reset on startup - */ - public ZigBeeApi(final ZigBeePort port, final int pan, final int channel, - final EnumSet discoveryModes, final boolean resetNetwork) { - networkManager = new ZigBeeNetworkManagerImpl(port, - NetworkMode.Coordinator, pan, channel, resetNetwork, 2500L); - - discoveryManager = new ZigBeeDiscoveryManager(networkManager, discoveryModes); - } - - /** - * Constructor to configure the port interface. - * - * @param port the ZigBee interface port (reference implementation provided by the zigbee4java-serialPort module) - * @param pan the pan - * @param channel the channel - * @param resetNetwork the flag indicating network reset on startup - */ - public ZigBeeApi(final ZigBeePort port, final int pan, final int channel, - final boolean resetNetwork, final EnumSet discoveryModes) { - networkManager = new ZigBeeNetworkManagerImpl(port, NetworkMode.Coordinator, pan, channel, resetNetwork, 2500L); - - discoveryManager = new ZigBeeDiscoveryManager(networkManager, discoveryModes); - } - - - /** - * Starts up network manager, network, context and discovery manager. - * - * @return true if startup was success. - */ - public boolean startup() { - networkManager.startup(); - - while (true) { - if (networkManager.getDriverStatus() == DriverStatus.NETWORK_READY) { - break; - } - if (networkManager.getDriverStatus() == DriverStatus.CLOSED) { - return false; - } - try { - Thread.sleep(100); - } catch (final InterruptedException e) { - return false; - } - } - - network = ApplicationFrameworkLayer.getAFLayer(networkManager).getZigBeeNetwork(); - - network.addEndpointListenerListener(this); - - context = new ZigBeeApiContext(); - - final ClusterFactory clusterFactory = new ClusterFactoryImpl(context); - context.setClusterFactory(clusterFactory); - - final Map, Class> deviceIntefaceImplemetnationMap = new HashMap, Class>(); - deviceIntefaceImplemetnationMap.put(ColorDimmableLight.class, ColorDimmableLightDevice.class); - deviceIntefaceImplemetnationMap.put(DimmableLight.class, DimmableLightDevice.class); - deviceIntefaceImplemetnationMap.put(IAS_Zone.class, IAS_ZoneDevice.class); - deviceIntefaceImplemetnationMap.put(IASAncillaryControlEquipment.class, IASAncillaryControlEquipmentDevice.class); - deviceIntefaceImplemetnationMap.put(IASControlAndIndicatingEquipment.class, IASControlAndIndicatingEquipmentDevice.class); - deviceIntefaceImplemetnationMap.put(LevelControlSwitch.class, LevelControlSwitchDevice.class); - deviceIntefaceImplemetnationMap.put(LightSensor.class, LightSensorDevice.class); - deviceIntefaceImplemetnationMap.put(MainsPowerOutlet.class, MainsPowerOutletDevice.class); - deviceIntefaceImplemetnationMap.put(OccupancySensor.class, OccupancySensorDevice.class); - deviceIntefaceImplemetnationMap.put(OnOffLight.class, OnOffLightDevice.class); - deviceIntefaceImplemetnationMap.put(OnOffLightSwitch.class, OnOffLightSwitchDevice.class); - deviceIntefaceImplemetnationMap.put(OnOffOutput.class, OnOffOutputDevice.class); - deviceIntefaceImplemetnationMap.put(OnOffSwitch.class, OnOffSwitchDevice.class); - deviceIntefaceImplemetnationMap.put(OnOffLight.class, OnOffLightDevice.class); - deviceIntefaceImplemetnationMap.put(Pump.class, PumpDevice.class); - deviceIntefaceImplemetnationMap.put(TemperatureSensor.class, TemperatureSensorDevice.class); - deviceIntefaceImplemetnationMap.put(IAS_Warning.class, IAS_Warning_Device.class); - deviceIntefaceImplemetnationMap.put(SimpleSensor.class, SimpleSensorDevice.class); - - final Iterator, Class>> i = deviceIntefaceImplemetnationMap.entrySet().iterator(); - while (i.hasNext()) { - Map.Entry, Class> refining = i.next(); - try { - context.getDeviceFactories().add( - new DeviceFactoryImpl(context, refining.getKey(), refining.getValue())); - } catch (Exception ex) { - LOGGER.error("Failed to register DeviceFactoryImpl for " + refining.getKey(), ex); - } - } - - ApplicationFrameworkLayer.getAFLayer(networkManager).createDefaultSendingEndPoint(); - - context.addDeviceListener(this); - - discoveryManager.startup(); - - return true; - } - - /** - * Return true if initial networking browsing based on associations is complete. - * - * @return true if initial network browsing is complete. - */ - public boolean isInitialBrowsingComplete() { - return discoveryManager.isInitialNetworkBrowsingComplete(); - } - - /** - * Shuts down network manager, network, context and discovery manager. - */ - public void shutdown() { - context.removeDeviceListener(this); - network.removeEndpointListener(this); - discoveryManager.shutdown(); - networkManager.shutdown(); - } - - /** - * Gets ZigBee network manager. - * - * @return the ZigBee network manager. - */ - public ZigBeeNetworkManagerImpl getZigBeeNetworkManager() { - return networkManager; - } - - /** - * Gets ZigBee discovery manager. - * - * @return the ZigBee discovery manager. - */ - public ZigBeeDiscoveryManager getZigBeeDiscoveryManager() { - return discoveryManager; - } - - /** - * Gets ZigBee proxy context. - * - * @return the ZigBee proxy context. - */ - public ZigBeeApiContext getZigBeeApiContext() { - return context; - } - - /** - * Gets ZigBee network. - * - * @return the ZigBee network. - */ - public ZigBeeNetwork getZigBeeNetwork() { - return network; - } - - public Device getDevice(String endPointId) { - return context.getDevice(endPointId); - } - - public List getDevices() { - return context.getDevices(); - } - - public void addDeviceListener(DeviceListener deviceListener) { - context.addDeviceListener(deviceListener); - } - - public void removeDeviceListener(DeviceListener deviceListener) { - context.removeDeviceListener(deviceListener); - } - - @Override - public void endpointAdded(final ZigBeeEndpoint endpoint) { - final DeviceFactory factory = context.getBestDeviceProxyFactory(endpoint); - if (factory == null) { // pending services - LOGGER.warn("No proxy for ZigBee endpoint {} found.", endpoint.getDeviceTypeId()); - return; - } - - final DeviceBase haDevice = factory.getInstance(endpoint); - context.addDevice(haDevice); - LOGGER.trace("Endpoint added: " + endpoint.getEndpointId()); - } - - @Override - public void endpointUpdated(final ZigBeeEndpoint endpoint) { - LOGGER.trace("Endpoint updated: " + endpoint.getEndpointId()); - final Device device = context.getDevice(endpoint.getEndpointId()); - if (device != null) { - context.updateDevice(device); - } - } - - @Override - public void endpointRemoved(final ZigBeeEndpoint endpoint) { - LOGGER.trace("Endpoint removed: " + endpoint.getEndpointId()); - final Device device = context.getDevice(endpoint.getEndpointId()); - if (device != null) { - context.removeDevice(device); - } - } - - @Override - public void deviceAdded(final Device device) { - LOGGER.debug(device.getClass().getSimpleName() + - " added: " + device.getEndpoint().getEndpointId()); - } - - @Override - public void deviceUpdated(final Device device) { - LOGGER.trace(device.getClass().getSimpleName() + - " updated: " + device.getEndpoint().getEndpointId()); - } - - @Override - public void deviceRemoved(final Device device) { - LOGGER.debug(device.getClass().getSimpleName() + - " removed: " + device.getEndpoint().getEndpointId()); - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/ZigBeeApiContext.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/ZigBeeApiContext.java deleted file mode 100644 index 1d8a72ed00dc1..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/ZigBeeApiContext.java +++ /dev/null @@ -1,215 +0,0 @@ -/** - * Copyright 2013 Tommi S.E. Laukkanen - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.bubblecloud.zigbee; - -import org.bubblecloud.zigbee.api.*; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; - -import java.util.*; - -/** - * ZigBee proxy context. - * - * This class is thread safe. - * - * @author Tommi S.E. Laukkanen - */ -public class ZigBeeApiContext { - /** - * The cluster factory. - */ - private ClusterFactory clusterFactory; - /** - * The device factory. - */ - private List deviceFactories = new ArrayList(); - /** - * The devices. - */ - private List devices = new ArrayList(); - /** - * The id and device mapping. - * ID = [IEEE address]/[end point] - */ - private Map idDeviceMap = new HashMap(); - /** - * The device listeners. - */ - private final List deviceListeners = new ArrayList(); - /** - * @return the cluster factory. - */ - public ClusterFactory getClusterFactory() { - return clusterFactory; - } - - /** - * @param clusterFactory the cluster factory. - */ - public void setClusterFactory(ClusterFactory clusterFactory) { - this.clusterFactory = clusterFactory; - } - - /** - * @return list of device factories. - */ - public List getDeviceFactories() { - return deviceFactories; - } - - /** - * @param deviceFactories life of device factories - */ - public void setDeviceFactories(List deviceFactories) { - this.deviceFactories = deviceFactories; - } - - /** - * Gets the best matching device factory. - * - * @param device the zigbee device - * @return the best matching device factory. - */ - public DeviceFactory getBestDeviceProxyFactory(final ZigBeeEndpoint device) { - synchronized (deviceFactories) { - DeviceFactory bestMatchingFactory = null; - int bestMatching = -1; - - for (final DeviceFactory factory : deviceFactories) { - final int matching = factory.hasMatch(device); - if (matching > bestMatching) { - bestMatchingFactory = factory; - bestMatching = matching; - } - } - - return bestMatchingFactory; - } - } - - /** - * Adds device. - * @param device the device - */ - public void addDevice(final Device device) { - synchronized (devices) { - devices.add(device); - } - synchronized (idDeviceMap) { - idDeviceMap.put(device.getEndpoint().getEndpointId(), device); - } - notifyDeviceAdded(device); - } - - /** - * Updates device. - * @param device the device - */ - public void updateDevice(final Device device) { - notifyDeviceUpdated(device); - } - - /** - * Removes device. - * @param device the device - */ - public void removeDevice(final Device device) { - notifyDeviceRemoved(device); - synchronized (devices) { - devices.remove(device); - } - synchronized (idDeviceMap) { - idDeviceMap.remove(device.getEndpoint().getDeviceTypeId()); - } - } - - /** - * Adds device listener. - * @param deviceListener the device listener - */ - public void addDeviceListener(final DeviceListener deviceListener) { - synchronized (deviceListeners) { - deviceListeners.add(deviceListener); - } - } - - /** - * Removes device listener. - * @param deviceListener the device listener - */ - public void removeDeviceListener(final DeviceListener deviceListener) { - synchronized (deviceListeners) { - deviceListeners.remove(deviceListener); - } - } - - /** - * Notifies listeners that device has been added. - * @param device the device - */ - public void notifyDeviceAdded(final Device device) { - synchronized (deviceListeners) { - for (final DeviceListener deviceListener : deviceListeners) { - deviceListener.deviceAdded(device); - } - } - } - - /** - * Notifies listeners that device has been updated. - * @param device the device - */ - public void notifyDeviceUpdated(final Device device) { - synchronized (deviceListeners) { - for (final DeviceListener deviceListener : deviceListeners) { - deviceListener.deviceUpdated(device); - } - } - } - - /** - * Notifies listeners that device has been removed. - * @param device the device - */ - public void notifyDeviceRemoved(final Device device) { - synchronized (deviceListeners) { - for (final DeviceListener deviceListener : deviceListeners) { - deviceListener.deviceRemoved(device); - } - } - } - - /** - * Gets device by device ID. - * @param deviceId the device ID - * @return the device - */ - public Device getDevice(final String deviceId) { - synchronized (idDeviceMap) { - return idDeviceMap.get(deviceId); - } - } - - /** - * Gets list of devices. - * @return - */ - public List getDevices() { - synchronized (devices) { - return new ArrayList(devices); - } - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/AbstractDeviceDescription.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/AbstractDeviceDescription.java deleted file mode 100644 index 15d68741e0dd6..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/AbstractDeviceDescription.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public abstract class AbstractDeviceDescription implements DeviceDescription { - - public abstract int[] getCustomClusters(); - - public abstract int[] getMandatoryCluster(); - - public abstract int[] getOptionalCluster(); - - public abstract int[] getStandardClusters(); - - public boolean isCustom(int clusterId) { - int[] array = getCustomClusters(); - for (int i = 0; i < array.length; i++) { - if (array[i] == clusterId) return true; - } - return false; - } - - public boolean isMandatory(int clusterId) { - int[] array = getMandatoryCluster(); - for (int i = 0; i < array.length; i++) { - if (array[i] == clusterId) return true; - } - return false; - } - - public boolean isOptional(int clusterId) { - int[] array = getOptionalCluster(); - for (int i = 0; i < array.length; i++) { - if (array[i] == clusterId) return true; - } - return false; - } - - public boolean isStandard(int clusterId) { - int[] array = getStandardClusters(); - for (int i = 0; i < array.length; i++) { - if (array[i] == clusterId) return true; - } - return false; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/ClusterFactory.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/ClusterFactory.java deleted file mode 100644 index 1a1a8bb3f538a..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/ClusterFactory.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api; - -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.Cluster; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.4.0 - */ -public interface ClusterFactory { - - public Cluster getInstance(String key, ZigBeeEndpoint zbDevice) throws ZigBeeDeviceException; - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/ClusterFactoryBase.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/ClusterFactoryBase.java deleted file mode 100644 index 577f11e918dd9..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/ClusterFactoryBase.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api; - -import org.bubblecloud.zigbee.ZigBeeApiContext; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.Cluster; - -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.util.Enumeration; -import java.util.Hashtable; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.4.0 - */ -public class ClusterFactoryBase implements ClusterFactory { - - private ZigBeeApiContext ctx; - private Hashtable clusters; - - - public ClusterFactoryBase(ZigBeeApiContext ctx) { - this.ctx = ctx; - clusters = new Hashtable(); - } - - public void register() { - Enumeration keys = clusters.keys(); - String[] clusterIDs = new String[clusters.size()]; - int i = 0; - while (keys.hasMoreElements()) { - String key = (String) keys.nextElement(); - clusterIDs[i++] = key; - } - } - - protected void addCluster(String key, Class clazz) { - clusters.put(key, clazz); - } - - public Cluster getInstance(String key, ZigBeeEndpoint zbDevice) { - Class clazz = clusters.get(key); - if (clazz != null) { - try { - Constructor constructor = clazz.getConstructor(ZigBeeEndpoint.class); - Cluster cluster = (Cluster) constructor.newInstance(zbDevice); - return cluster; - } catch (SecurityException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (NoSuchMethodException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IllegalArgumentException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (InstantiationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IllegalAccessException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (InvocationTargetException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - return null; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/ClusterFactoryImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/ClusterFactoryImpl.java deleted file mode 100644 index 871a971acf836..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/ClusterFactoryImpl.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api; - -import org.bubblecloud.zigbee.api.cluster.impl.*; -import org.bubblecloud.zigbee.ZigBeeApiContext; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Giancarlo Riolo - */ -public class ClusterFactoryImpl extends ClusterFactoryBase { - - //General - final static String BASIC_KEY = ZigBeeApiConstants.PROFILE_ID_HOME_AUTOMATION + ":" + ZigBeeApiConstants.CLUSTER_ID_BASIC; - final static String POWER_CONFIGURATION_KEY = ZigBeeApiConstants.PROFILE_ID_HOME_AUTOMATION + ":"+ ZigBeeApiConstants.CLUSTER_ID_POWER_CONFIGURATION; - final static String DEVICE_TEMPERATURE_CONFIGURATION_KEY = ZigBeeApiConstants.PROFILE_ID_HOME_AUTOMATION + ":"+ ZigBeeApiConstants.CLUSTER_ID_DEVICE_TEMPERATURE_CONFIGURATION; - final static String IDENTIFY_KEY = ZigBeeApiConstants.PROFILE_ID_HOME_AUTOMATION + ":"+ ZigBeeApiConstants.CLUSTER_ID_IDENTIFY; - final static String GROUPS_KEY = ZigBeeApiConstants.PROFILE_ID_HOME_AUTOMATION + ":"+ ZigBeeApiConstants.CLUSTER_ID_GROUPS; - final static String SCENES_KEY = ZigBeeApiConstants.PROFILE_ID_HOME_AUTOMATION + ":"+ ZigBeeApiConstants.CLUSTER_ID_SCENES; - final static String ONOFF_KEY = ZigBeeApiConstants.PROFILE_ID_HOME_AUTOMATION + ":"+ ZigBeeApiConstants.CLUSTER_ID_ON_OFF; - final static String ON_OFF_SWITCH_CONFIGURATION_KEY = ZigBeeApiConstants.PROFILE_ID_HOME_AUTOMATION + ":"+ ZigBeeApiConstants.CLUSTER_ID_ON_OFF_SWITCH_CONFIGURATION; - final static String LEVEL_CONTROL_KEY = ZigBeeApiConstants.PROFILE_ID_HOME_AUTOMATION + ":"+ ZigBeeApiConstants.CLUSTER_ID_LEVEL_CONTROL; - final static String ALARMS_KEY = ZigBeeApiConstants.PROFILE_ID_HOME_AUTOMATION + ":"+ ZigBeeApiConstants.CLUSTER_ID_ALARMS; - final static String BINARY_INPUT_KEY = ZigBeeApiConstants.PROFILE_ID_HOME_AUTOMATION + ":"+ ZigBeeApiConstants.CLUSTER_ID_BINARY_INPUT; - - //Smart Energy - final static String METERING_KEY = ZigBeeApiConstants.PROFILE_ID_HOME_AUTOMATION + ":"+ ZigBeeApiConstants.CLUSTER_ID_METERING; - - //Measurement and Sensing - final static String ILLUMINANCE_LEVEL_SENSING_KEY = ZigBeeApiConstants.PROFILE_ID_HOME_AUTOMATION + ":"+ ZigBeeApiConstants.CLUSTER_ID_ILLUMINANCE_LEVEL_SENSING; // new - final static String ILLUMINANCE_MEASUREMENT_KEY = ZigBeeApiConstants.PROFILE_ID_HOME_AUTOMATION + ":"+ ZigBeeApiConstants.CLUSTER_ID_ILLUMINANCE_MEASUREMENT; // new - final static String TEMPERATURE_MEASUREMENT_KEY = ZigBeeApiConstants.PROFILE_ID_HOME_AUTOMATION + ":"+ ZigBeeApiConstants.CLUSTER_ID_TEMPERATURE_MEASUREMENT; - final static String PRESSURE_MEASUREMENT_KEY = ZigBeeApiConstants.PROFILE_ID_HOME_AUTOMATION + ":"+ ZigBeeApiConstants.CLUSTER_ID_PRESSURE_MEASUREMENT; - final static String FLOW_MEASUREMENT_KEY = ZigBeeApiConstants.PROFILE_ID_HOME_AUTOMATION + ":"+ ZigBeeApiConstants.CLUSTER_ID_FLOW_MEASUREMENT; - final static String RELATIVE_HUMIDITY_MEASUREMENT_KEY = ZigBeeApiConstants.PROFILE_ID_HOME_AUTOMATION + ":"+ ZigBeeApiConstants.CLUSTER_ID_RELATIVE_HUMIDITY_MEASUREMENT; - final static String OCCUPANCY_SENSING_KEY = ZigBeeApiConstants.PROFILE_ID_HOME_AUTOMATION + ":"+ ZigBeeApiConstants.CLUSTER_ID_OCCUPANCY_SENSING; - //Security and Safety - final static String IAS_ZONE_KEY = ZigBeeApiConstants.PROFILE_ID_HOME_AUTOMATION + ":"+ ZigBeeApiConstants.CLUSTER_ID_IAS_ZONE; - final static String IAS_WD_KEY = ZigBeeApiConstants.PROFILE_ID_HOME_AUTOMATION + ":"+ ZigBeeApiConstants.CLUSTER_ID_IAS_WD; - final static String IAS_ACE_KEY = ZigBeeApiConstants.PROFILE_ID_HOME_AUTOMATION + ":"+ ZigBeeApiConstants.CLUSTER_ID_IAS_ACE; - //fuori profilo HA - final static String TIME_KEY = ZigBeeApiConstants.PROFILE_ID_HOME_AUTOMATION + ":"+ ZigBeeApiConstants.CLUSTER_ID_TIME; - final static String COMMISSIONING_KEY = ZigBeeApiConstants.PROFILE_ID_HOME_AUTOMATION + ":"+ ZigBeeApiConstants.CLUSTER_ID_COMMISSIONING; - final static String ANALOG_INPUT_KEY = ZigBeeApiConstants.PROFILE_ID_HOME_AUTOMATION + ":"+ ZigBeeApiConstants.CLUSTER_ID_ANALOG_INPUT; - - //HVAC - private static final String THERMOSTAT_USER_INTERFACE_CONFIGURATION_KEY = ZigBeeApiConstants.PROFILE_ID_HOME_AUTOMATION + ":"+ ZigBeeApiConstants.CLUSTER_ID_THERMOSTAT_USER_INTERFACE_CONFIGURATION; - private static final String FAN_CONTROL_KEY = ZigBeeApiConstants.PROFILE_ID_HOME_AUTOMATION + ":"+ ZigBeeApiConstants.CLUSTER_ID_FAN_CONTROL; - private static final String THERMOSTAT_KEY = ZigBeeApiConstants.PROFILE_ID_HOME_AUTOMATION + ":"+ ZigBeeApiConstants.CLUSTER_ID_THERMOSTAT; - private static final String PUMP_CONFIGURATION_AND_CONTROL_KEY = ZigBeeApiConstants.PROFILE_ID_HOME_AUTOMATION + ":"+ ZigBeeApiConstants.CLUSTER_ID_PUMP_CONFIGURATION_AND_CONTROL; - //Closures - private static final String SHADE_CONFIGURATION_KEY = ZigBeeApiConstants.PROFILE_ID_HOME_AUTOMATION + ":"+ ZigBeeApiConstants.CLUSTER_ID_SHADE_CONFIGURATION; - private static final String DOOR_LOCK_KEY = ZigBeeApiConstants.PROFILE_ID_HOME_AUTOMATION + ":"+ ZigBeeApiConstants.CLUSTER_ID_DOOR_LOCK; - private static final String WINDOW_COVERING_KEY = ZigBeeApiConstants.PROFILE_ID_HOME_AUTOMATION + ":"+ ZigBeeApiConstants.CLUSTER_ID_WINDOW_COVERING; - //Lightening - private static final String COLOR_CONTROL_KEY = ZigBeeApiConstants.PROFILE_ID_HOME_AUTOMATION + ":"+ ZigBeeApiConstants.CLUSTER_ID_COLOR_CONTROL; - - public ClusterFactoryImpl(ZigBeeApiContext context){ - super(context); - - //General - addCluster(BASIC_KEY, BasicImpl.class); - addCluster(POWER_CONFIGURATION_KEY, PowerConfigurationImpl.class); - addCluster(DEVICE_TEMPERATURE_CONFIGURATION_KEY, DeviceTemperatureConfigurationImpl.class); - addCluster(IDENTIFY_KEY, IdentifyImpl.class); - addCluster(GROUPS_KEY, GroupsImpl.class); - addCluster(SCENES_KEY, ScenesImpl.class); - addCluster(ONOFF_KEY, OnOffImpl.class); - addCluster(ON_OFF_SWITCH_CONFIGURATION_KEY, OnOffSwitchConfigurationImpl.class); - addCluster(LEVEL_CONTROL_KEY, LevelControlImpl.class); - addCluster(ALARMS_KEY, AlarmsImpl.class); - addCluster(BINARY_INPUT_KEY, BinaryInputImpl.class); - - //Smart Energy - addCluster(METERING_KEY, MeteringImpl.class); - - //fuori profilo HA - addCluster(ANALOG_INPUT_KEY, AnalogInputImpl.class); - addCluster(COMMISSIONING_KEY, CommissioningImpl.class); // new - addCluster(TIME_KEY, TimeImpl.class); - - - //Measurement and Sensing - addCluster(ILLUMINANCE_MEASUREMENT_KEY, IlluminanceMeasurementImpl.class); // new - addCluster(TEMPERATURE_MEASUREMENT_KEY, TemperatureMeasurementImpl.class); - addCluster(RELATIVE_HUMIDITY_MEASUREMENT_KEY, RelativeHumidityMeasurementImpl.class); - addCluster(OCCUPANCY_SENSING_KEY, OccupancySensingImpl.class); - addCluster(PRESSURE_MEASUREMENT_KEY, PressureMeasurementImpl.class); - addCluster(FLOW_MEASUREMENT_KEY, FlowMeasurementImpl.class); - addCluster(ILLUMINANCE_LEVEL_SENSING_KEY, IlluminanceLevelSensingImpl.class); - - //Security and Safety - addCluster(IAS_ZONE_KEY, IASZoneImpl.class); - addCluster(IAS_WD_KEY, IASWDImpl.class); - addCluster(IAS_ACE_KEY, IASACEImpl.class); - - //HVAC - addCluster(PUMP_CONFIGURATION_AND_CONTROL_KEY, PumpConfigurationAndControlImpl.class); - addCluster(THERMOSTAT_KEY, ThermostatImpl.class); - addCluster(FAN_CONTROL_KEY, FanControlImpl.class); - addCluster(THERMOSTAT_USER_INTERFACE_CONFIGURATION_KEY, ThermostatUserInterfaceConfigurationImpl.class); - - //Closures - addCluster(SHADE_CONFIGURATION_KEY, ShadeConfigurationImpl.class); - addCluster(DOOR_LOCK_KEY, DoorLockImpl.class); - addCluster(WINDOW_COVERING_KEY, WindowCoveringImpl.class); - - - //Lighting - addCluster(COLOR_CONTROL_KEY, ColorControlImpl.class); - - - } - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/Device.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/Device.java deleted file mode 100644 index 8c729c58c5bd0..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/Device.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api; - -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.network.impl.ZigBeeNetworkManagerException; -import org.bubblecloud.zigbee.api.cluster.Cluster; -import org.bubblecloud.zigbee.api.cluster.general.Alarms; -import org.bubblecloud.zigbee.api.cluster.general.Basic; -import org.bubblecloud.zigbee.api.cluster.general.DeviceTemperatureConfiguration; -import org.bubblecloud.zigbee.api.cluster.general.Identify; -import org.bubblecloud.zigbee.api.cluster.general.PowerConfiguration; -import org.bubblecloud.zigbee.util.ArraysUtil; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface Device extends ZigBeeEndpoint { - - public static final String ZIGBEE_DEVICE_SERVICE = "zigbee.service.id"; - public static final String ZIGBEE_DEVICE_UUID = "zigbee.device.uuid"; - public static final String HA_DRIVER = "zigbee.ha.driver.name"; - public static final String HA_DEVICE_NAME = "zigbee.ha.name"; - public static final String HA_DEVICE_GROUP = "zigbee.ha.group"; - public static final String HA_DEVICE_STANDARD = "zigbee.ha.standard"; - - public static final int[] MANDATORY = {ZigBeeApiConstants.CLUSTER_ID_BASIC, ZigBeeApiConstants.CLUSTER_ID_IDENTIFY}; - public static final int[] OPTIONAL = {ZigBeeApiConstants.CLUSTER_ID_POWER_CONFIGURATION, ZigBeeApiConstants.CLUSTER_ID_DEVICE_TEMPERATURE_CONFIGURATION, ZigBeeApiConstants.CLUSTER_ID_ALARMS}; - public static final int[] STANDARD = ArraysUtil.append(MANDATORY, OPTIONAL); - - public String getDeviceType(); - - public int getProfileId(); - - /** - * Access method for the Mandatory cluster: {@link Basic} - * - * @return the {@link Basic} cluster object - */ - public Basic getBasic(); - - /** - * Access method for the Mandatory cluster: {@link Basic} - * - * @return the {@link Basic} cluster object - */ - public Identify getIdentify(); - - /** - * Access method for the Optional cluster: {@link PowerConfiguration} - * - * @return the {@link PowerConfiguration} cluster object - * @since 0.4.0 - */ - public PowerConfiguration getPowerConfiguration(); - - /** - * Access method for the Optional cluster: {@link DeviceTemperatureConfiguration} - * - * @return the {@link DeviceTemperatureConfiguration} cluster object - * @since 0.4.0 - */ - public DeviceTemperatureConfiguration getDeviceTemperatureConfiguration(); - - /** - * Access method for the Optional cluster: {@link Alarms} - * - * @return the {@link Alarms} cluster object - * @since 0.4.0 - */ - public Alarms getAlarms(); - - /** - * Access method to the {@link DeviceDescription}.
- *

- * NOTE: The {@link DeviceDescription} should be shared among all {@link DeviceBase}
- * sharing the same DeviceId - * - * @return the {@link DeviceDescription} - */ - public DeviceDescription getDescription(); - - /** - * @param id the int representing the ClusterId - * @return the {@link Cluster} identified by the given id if this device implements
- * otherwise null - * @since 0.2.0 - */ - public T getCluster(int id); - - /** - * @param clusterIntercace the cluster interface - * @return the {@link Cluster} identified by the given id if this device implements
- * otherwise null - * @since 0.2.0 - */ - public T getCluster(Class clusterIntercace); - - /** - * @return the {@link Cluster} array effectively implemented by the remote ZigBee Device
- * otherwise null - */ - public Cluster[] getAvailableCluster(); - - - /** - * @return return {@link org.bubblecloud.zigbee.network.ZigBeeEndpoint} service that has been refined has {@link Device} - * @since 0.2.0 - */ - public ZigBeeEndpoint getEndpoint(); - - /** - * This method modify the Binding Table of physical device by adding the following entry: - *

-     * this.getNode().getIEEEAddress(), this.getDeviceTypeId(), clusterId, device.getNode().getIEEEAddress(), device.getDeviceTypeId()
-     * 
- * - * @param device {@link org.bubblecloud.zigbee.network.ZigBeeEndpoint} the device proxy that we want to bound to - * @param clusterId the clusterId that we want to bound to - * @return true if and only if the operation succeeded - * @throws org.bubblecloud.zigbee.network.impl.ZigBeeNetworkManagerException - * - * @since 0.5.0 - */ - public boolean bindTo(Device device, int clusterId) throws ZigBeeNetworkManagerException; - - /** - * This method modify the Binding Table of physical device by removing the entry if exists - *
-     * this.getNode().getIEEEAddress(), this.getDeviceTypeId(), clusterId, device.getNode().getIEEEAddress(), device.getDeviceTypeId()
-     * 
- * - * @param device {@link org.bubblecloud.zigbee.network.ZigBeeEndpoint} the device that we want to bound to - * @param clusterId the clusterId that we want to unbound from - * @return true if and only if the operation succeeded - * @throws org.bubblecloud.zigbee.network.impl.ZigBeeNetworkManagerException - * @since 0.5.0 - */ - public boolean unbindFrom(Device device, int clusterId) throws ZigBeeNetworkManagerException; -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/DeviceBase.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/DeviceBase.java deleted file mode 100644 index b58c2e4289213..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/DeviceBase.java +++ /dev/null @@ -1,446 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api; - -import org.bubblecloud.zigbee.ZigBeeApiContext; -import org.bubblecloud.zigbee.network.ClusterListener; -import org.bubblecloud.zigbee.network.ClusterMessage; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.network.ZigBeeNode; -import org.bubblecloud.zigbee.network.impl.ZigBeeNetworkManagerException; -import org.bubblecloud.zigbee.api.cluster.Cluster; -import org.bubblecloud.zigbee.api.cluster.general.Alarms; -import org.bubblecloud.zigbee.api.cluster.general.Basic; -import org.bubblecloud.zigbee.api.cluster.general.DeviceTemperatureConfiguration; -import org.bubblecloud.zigbee.api.cluster.general.Identify; -import org.bubblecloud.zigbee.api.cluster.general.PowerConfiguration; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; - -import org.bubblecloud.zigbee.network.model.ProvidedClusterMode; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.Arrays; - - -/** - * This class represent a generic Home Automation Device as defined by the document:
- * ZigBee Home Automation public release version 075123r01ZB - *
- * NOTE: In general the mapping between ClusterId and Cluster is defined
- * by the profile, while the mapping between Name and Cluster is defined where the
- * Cluster is defined: usually inside a Cluster Library - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public abstract class DeviceBase implements Device { - - private final static Logger logger = LoggerFactory.getLogger(DeviceBase.class); - - protected ZigBeeEndpoint endpoint; - private ZigBeeApiContext context; - - - private Cluster[] clusters; - private int index; - - /* - * Mandatory clusters common to all Home Automation devices - */ - protected Basic basic; - protected Identify identify; - /* - * Optional clusters common to all Home Automation devices - */ - protected Alarms alarms; - protected DeviceTemperatureConfiguration deviceTemperature; - protected PowerConfiguration powerConfiguration; - private final ProvidedClusterMode clusterMode; - - - public DeviceBase(ZigBeeApiContext context, ZigBeeEndpoint endpoint) throws ZigBeeDeviceException { - this.endpoint = endpoint; - this.context = context; - - final int size; - clusterMode = ProvidedClusterMode.HomeAutomationProfileStrict; - if (clusterMode == ProvidedClusterMode.HomeAutomationProfileStrict) { - size = endpoint.getInputClusters().length; - } else { - size = endpoint.getInputClusters().length + endpoint.getOutputClusters().length; - } - clusters = new Cluster[size]; - - for (int i = 0; i < endpoint.getInputClusters().length; i++) { - addCluster(endpoint.getInputClusters()[i]); - } - if (clusterMode != ProvidedClusterMode.HomeAutomationProfileStrict) { - for (int i = 0; i < endpoint.getOutputClusters().length; i++) { - addCluster(endpoint.getOutputClusters()[i]); - } - } - - basic = (Basic) getCluster(ZigBeeApiConstants.CLUSTER_ID_BASIC); - identify = (Identify) getCluster(ZigBeeApiConstants.CLUSTER_ID_IDENTIFY); - - powerConfiguration = (PowerConfiguration) getCluster(ZigBeeApiConstants.CLUSTER_ID_POWER_CONFIGURATION); - deviceTemperature = (DeviceTemperatureConfiguration) getCluster(ZigBeeApiConstants.CLUSTER_ID_DEVICE_TEMPERATURE_CONFIGURATION); - alarms = (Alarms) getCluster(ZigBeeApiConstants.CLUSTER_ID_ALARMS); - } - - public abstract String getDeviceType(); - - public int getProfileId() { - return endpoint.getProfileId(); - } - - - protected boolean isClusterValid(int clusterId, ProvidedClusterMode complainanceMode) { - if (endpoint.providesInputCluster(clusterId)) { - return true; - } - return false; - } - - /** - * This method create a cluster for the Device if and only if the cluster is actually supported by the device. - * Depending on the current value of cluster mode it add or not the cluster - * to the set of cluster which will be returned by executing the method {@link #getAvailableCluster()} - * - * @param clusterId the id of the cluster - * @return {@link Cluster} if it is already present or if it has been added to the {@link DeviceBase} - * @throws ZigBeeDeviceException - */ - protected Cluster addCluster(int clusterId) throws ZigBeeDeviceException { - /* - * Verify if the cluster has already been added. For example, when the HA Driver is working with - * ProvidedClusterMode.EitherInputAndOutput mode the HA Driver adds either inputs and outputs cluster - * to the DeviceBase - */ - final Cluster duplicated = getCluster(clusterId); - if (duplicated != null) { - /*logger.warn( - "Cluster {}/{} already added to this device. " + - "It may identifies an error in the definition of the device description", - duplicated.getDeviceType(), Integer.toHexString(clusterId) - );*/ - return duplicated; - } - - - //TODO We should move this code in isClusterValid() method - /* - * We are trying to add a cluster which is not defined as input cluster and is optional then we are not going to add it - */ - if (!endpoint.providesInputCluster(clusterId) && getDescription().isOptional(clusterId)) { - logger.warn( - "ZigBeeEndpoint with DeviceId={} of Home Automation profile " + - "implements the OPTINAL cluster {} ONLY AS OUTPUT instead of input " + - "it may identify an error either on the Driver description or in " + - "in the implementation of firmware of the physical device", - endpoint.getDeviceTypeId(), clusterId - ); - return null; - } - - /* - * We are trying to add a cluster which is not defined as input cluster and is optional then we are not going to add it - */ - if (!endpoint.providesInputCluster(clusterId) && getDescription().isCustom(clusterId)) { - //TODO check if exists custom add-on by using ProfileModule interface - logger.warn( - "ZigBeeEndpoint with DeviceId={} of Home Automation profile " + - "implements a CUSTOM cluster {} but HA Driver does not support them yet", - endpoint.getDeviceTypeId(), clusterId - ); - return null; - } - - /* - * This is the last case, when a Cluster is not defined as input but it is among the mandotory cluster of the device - * so if ProvidedClusterMode.EitherInputAndOutput is set we will consider it as a firmware issue so we will add the cluster anyway - */ - if (!endpoint.providesInputCluster(clusterId) && getDescription().isMandatory(clusterId)) { - logger.warn( - "ZigBeeEndpoint with DeviceId={} of Home Automation profile " + - "doesn't implement mandatory cluster {}", endpoint.getDeviceTypeId(), clusterId - ); - if (endpoint.providesOutputCluster(clusterId)) { - logger.error( - "ZigBeeEndpoint with DeviceId={} of Home Automation profile " + - "implements the mandatory cluster {} as output instead of as input " + - "it may identify an error either on the Driver description or in " + - "in the implementation of firmware of the physical device", - endpoint.getDeviceTypeId(), clusterId - ); - } else { - logger.error( - "ZigBeeEndpoint with DeviceId={} of Home Automation profile " + - "doesn't implements the mandatory cluster {} neither as output " + - "nor as input it may identify an error either on the Driver " + - "description or in in the implementation of firmware of the " + - "physical device", - endpoint.getDeviceTypeId(), clusterId - ); - return null; - } - if (clusterMode == ProvidedClusterMode.HomeAutomationProfileStrict) { - logger.warn( - "The cluster {} of the device {} is PROVIDED AS OUTPUT instead of AS INPUT, " + - "if you want to add it anyway please change the value of the property {} " + - " from {} to {}", new Object[]{ - clusterId, - endpoint.getDeviceTypeId(), - "undefined", - ProvidedClusterMode.HomeAutomationProfileStrict, - ProvidedClusterMode.EitherInputAndOutput - } - ); - return null; - } else { - logger.warn( - "The cluster {} of the device {} is PROVIDED AS OUTPUT instead of AS INPUT, " + - "it will be added anyway to the device due to value of the property {} " + - ", if you want to disable this change the value from {} to {}", - new Object[]{ - clusterId, - endpoint.getDeviceTypeId(), - "undefined", - ProvidedClusterMode.EitherInputAndOutput, - ProvidedClusterMode.HomeAutomationProfileStrict - } - ); - } - } - - String key = ZigBeeApiConstants.PROFILE_ID_HOME_AUTOMATION + ":" + String.valueOf(clusterId); - ClusterFactory factory = (ClusterFactory) context.getClusterFactory(); - Cluster cluster = factory.getInstance(key, endpoint); - if (index >= clusters.length) { - logger.error( - "Device {} cluster {}. More than expected number of clusters. Skipping.", - endpoint.getDeviceTypeId(), clusterId - ); - return null; - } - if (cluster == null) { - logger.trace( - "Cluster {} for device {} not constructed by factory.", - Integer.toHexString(clusterId), endpoint.getDeviceTypeId() - ); - return null; - } - logger.trace( - "Cluster {} - {} added to {} device proxy.", - Integer.toHexString(clusterId), cluster.getName(), endpoint.getDeviceTypeId() - ); - - clusters[index++] = cluster; - return cluster; - } - - public Basic getBasic() { - return basic; - } - - - public Identify getIdentify() { - return identify; - } - - public PowerConfiguration getPowerConfiguration() { - return powerConfiguration; - } - - public DeviceTemperatureConfiguration getDeviceTemperatureConfiguration() { - return deviceTemperature; - } - - public Alarms getAlarms() { - return alarms; - } - - - public abstract DeviceDescription getDescription(); - - public T getCluster(int id) { - for (int i = 0; i < clusters.length; i++) { - if (clusters[i] != null && clusters[i].getId() == id) - return (T) clusters[i]; - } - return null; - } - - - public T getCluster(Class clusterIntercace) { - for (int i = 0; i < clusters.length; i++) { - if (clusters[i] != null && clusterIntercace.isInstance(clusters[i])) - return (T) clusters[i]; - } - return null; - } - - /** - * @param name the {@link String} representing the name associated to ClusterId - * @return the {@link ZCLCluster} identified by the given name if this device implements
- * otherwise null - */ - public Cluster getCluster(String name) { - for (int i = 0; i < clusters.length; i++) { - if (clusters[i] != null && clusters[i].getName().equals(name)) - return clusters[i]; - } - return null; - } - - public Cluster[] getAvailableCluster() { - return clusters; - } - - public void stop() { - for (int i = 0; i < clusters.length; i++) { - if (clusters[i] == null) continue; - - Reporter[] reporters = clusters[i].getAttributeReporters(); - if (reporters == null) continue; - - for (int j = 0; j < reporters.length; j++) { - if (reporters[j] == null) continue; - reporters[j].clear(); - } - } - } - - public ZigBeeEndpoint getEndpoint() { - return endpoint; - } - - @Override - public boolean bindTo(Device device, int clusterId) throws ZigBeeNetworkManagerException { - return this.endpoint.bindTo(device.getEndpoint(), clusterId); - } - - @Override - public boolean unbindFrom(Device device, int clusterId) throws ZigBeeNetworkManagerException { - return this.endpoint.unbindFrom(device.getEndpoint(), clusterId); - } - - @Override - public short getEndPointAddress() { - return endpoint.getEndPointAddress(); - } - - @Override - public int getDeviceTypeId() { - return endpoint.getDeviceTypeId(); - } - - @Override - public ZigBeeNode getNode() { - return endpoint.getNode(); - } - - @Override - public String getEndpointId() { - return endpoint.getEndpointId(); - } - - @Override - public short getDeviceVersion() { - return endpoint.getDeviceVersion(); - } - - @Override - public int[] getInputClusters() { - return endpoint.getInputClusters(); - } - - @Override - public boolean providesInputCluster(int id) { - return endpoint.providesInputCluster(id); - } - - @Override - public int[] getOutputClusters() { - return endpoint.getOutputClusters(); - } - - @Override - public boolean providesOutputCluster(int id) { - return endpoint.providesOutputCluster(id); - } - - @Override - public ClusterMessage invoke(ClusterMessage input) throws ZigBeeNetworkManagerException { - return endpoint.invoke(input); - } - - @Override - public void send(ClusterMessage input) throws ZigBeeNetworkManagerException { - endpoint.send(input); - } - - @Override - public boolean bindTo(ZigBeeEndpoint endpoint, int clusterId) throws ZigBeeNetworkManagerException { - return endpoint.bindTo(endpoint, clusterId); - } - - @Override - public boolean unbindFrom(ZigBeeEndpoint endpoint, int clusterId) throws ZigBeeNetworkManagerException { - return endpoint.unbindFrom(endpoint, clusterId); - } - - @Override - public boolean bindToLocal(int clusterId) throws ZigBeeNetworkManagerException { - return endpoint.bindToLocal(clusterId); - } - - @Override - public boolean unbindFromLocal(int clusterId) throws ZigBeeNetworkManagerException { - return endpoint.unbindFromLocal(clusterId); - } - - @Override - public boolean addClusterListener(ClusterListener listener) { - return endpoint.addClusterListener(listener); - } - - @Override - public boolean removeClusterListener(ClusterListener listener) { - return endpoint.removeClusterListener(listener); - } - - @Override - public int getNetworkAddress() { - return endpoint.getNetworkAddress(); - } - - @Override - public String getIEEEAddress() { - return endpoint.getIEEEAddress(); - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/DeviceDescription.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/DeviceDescription.java deleted file mode 100644 index e1978831453ff..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/DeviceDescription.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; - -/** - * This class represent static description associated to a generic Home Automation Device
- * as defined by the document:
- * ZigBee Home Automation public release version 075123r01ZB - *
- * In particular, this class can be used for inspecting by code the ZigBee Home Automation
- * definition. In fact, all the device belonging to the same DeviceId have a common definition.
- * Hence, a Singelton implementation that shares a {@link DeviceDescription} among all the {@link DeviceBase}
- * objects belonging to the DeviceId is adviced. - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface DeviceDescription { - - /** - * @return the {@link ZCLCluster} array of all the cluster defined as Optional by the
- * ZigBee Home Automation profile documentation - */ - public int[] getOptionalCluster(); - - /** - * @return the {@link ZCLCluster} array of all the cluster defined as Mandatory by the
- * ZigBee Home Automation profile documentation - */ - public int[] getMandatoryCluster(); - - /** - * @return - */ - public int[] getStandardClusters(); - - public int[] getCustomClusters(); - - public boolean isMandatory(int clusterId); - - public boolean isOptional(int clusterId); - - public boolean isStandard(int clusterId); - - public boolean isCustom(int clusterId); - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/DeviceFactory.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/DeviceFactory.java deleted file mode 100644 index fc6fa8fac1a04..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/DeviceFactory.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api; - -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; - -/** - * This class represent the main interface for the extendable architecture of the
- * refinement driver. Each refinement driver from {@link org.bubblecloud.zigbee.network.ZigBeeEndpoint} to {@link Device}
- * has to implement this interface as OSGi Service and register it on OSGi platform. - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.4.0 - */ -public interface DeviceFactory { - - //TODO Allow the creation of multi-device factory - - /** - * @return return the {@link String} representing the Device Id that this driver can refine - */ - public int getDeviceId(); - - /** - * @return return an array of {@link String} containing all the cluster interfaces
- * implemented by the refined device generated by this driver - */ - public int[] getDeviceClusters(); - - /** - * @return return an array of {@link String} containing all the interfaces
- * implemented by the refined device generated by this driver - */ - public String[] getRefinedInterfaces(); - - - /** - * @param zbd the {@link org.bubblecloud.zigbee.network.ZigBeeEndpoint} to refine - * @return the {@link DeviceBase} refined from {@link org.bubblecloud.zigbee.network.ZigBeeEndpoint} from this
- * refinement driver - * @throws ZigBeeDeviceException - */ - public DeviceBase getInstance(ZigBeeEndpoint zbd); - - /** - */ - public int hasMatch(ZigBeeEndpoint device); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/DeviceFactoryBase.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/DeviceFactoryBase.java deleted file mode 100644 index 222a9a7dd58df..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/DeviceFactoryBase.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api; - -import org.bubblecloud.zigbee.ZigBeeApiContext; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.util.ArraysUtil; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -/** - * @author Francesco Furfari - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.4.0 - */ -public abstract class DeviceFactoryBase implements DeviceFactory { - - private static final Logger logger = LoggerFactory.getLogger(DeviceFactoryBase.class); - - protected ZigBeeApiContext ctx; - - private Class refinement; - protected int[] clusters; - - /** - * @param ctx {@link org.bubblecloud.zigbee.ZigBeeApiContext} of the bundle extending the refinement capabilities - * @param refinement {@link Class} of the most refined interfaces provided by this factory - */ - public DeviceFactoryBase(ZigBeeApiContext ctx, Class refinement) { - this.ctx = ctx; - this.refinement = refinement; - } - - public abstract int getDeviceId(); - - public int[] getDeviceClusters() { - synchronized (this) { - if (clusters == null) { - try { - final int[] standard = (int[]) refinement.getDeclaredField("STANDARD").get(null); - final int[] custom = (int[]) refinement.getDeclaredField("CUSTOM").get(null); - clusters = ArraysUtil.append(standard, custom); - } catch (Exception e) { - logger.error( - "Unable to retrieve the implemented clusters by means of the reflection, " - + "the class {} does not provide the static field STANDARD or CUSTOM.\n" - + "Please modify the source code of the class by adding such static field or" - + "override the getDeviceClusters() method ", refinement.getName() - ); - logger.debug("Stack exception of the getDeviceClusters() error", e); - } - } - return clusters; - } - } - - public abstract String[] getRefinedInterfaces(); - - public abstract DeviceBase getInstance(ZigBeeEndpoint zbDevice); - - public int hasMatch(ZigBeeEndpoint device) { - if (device.getDeviceTypeId() == getDeviceId()) { - return Integer.MAX_VALUE; - } - - final Set factoryInputClusters = new HashSet(); - for (int cluster : getDeviceClusters()) { - factoryInputClusters.add(cluster); - } - - int score = device.getProfileId() == ZigBeeApiConstants.PROFILE_ID_HOME_AUTOMATION - ? ZigBeeEndpoint.MATCH_PROFILE_ID : 0; - - for (int c : device.getInputClusters()) { - if (factoryInputClusters.contains(c)) { - score++; - } - } - - return score; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/DeviceFactoryImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/DeviceFactoryImpl.java deleted file mode 100644 index 21658694fc8ec..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/DeviceFactoryImpl.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api; - -import org.bubblecloud.zigbee.ZigBeeApiContext; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.lang.reflect.Constructor; - -/** - * Generic class that simplify the creation of factory, and avoids the creation of a class for
- * each factory that we want to register - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Manlio Bacco - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) * - * @since 0.4.0 - */ -public class DeviceFactoryImpl extends DeviceFactoryBase { - - static final Logger logger = LoggerFactory.getLogger(DeviceFactoryImpl.class); - - final protected int deviceId; - final protected Class inter, impl; - - protected String[] classes; - - - /** - * Build an {@link DeviceFactory} that refine {@link org.bubblecloud.zigbee.network.ZigBeeEndpoint} by means of cImplementation,
- * into a cInterface service. This factory build the instance of the new service by invoking
- * the constructor cImplementation(ZigBeeApiContext, ZigBeeEndpoint).
- * By default the {@link #getRefinedInterfaces()} is built to return the values:
- *
-     * cInterface.getDeviceType()
-     * Device.class.getDeviceType()
-     * 
- * - * @param ctx {@link org.bubblecloud.zigbee.ZigBeeApiContext} to use for registering the {@link DeviceFactory} service - * @param cInterface {@link Class} representing the refined service that this factory will install - * @param cImplementation {@link Class} representing the implementation of the refinement service that will be created by the factory - * @throws ZigBeeDeviceException - */ - public DeviceFactoryImpl(ZigBeeApiContext ctx, Class cInterface, Class cImplementation) throws ZigBeeDeviceException { - super(ctx, cInterface); - - this.inter = cInterface; - this.impl = cImplementation; - classes = new String[]{cInterface.getName(), Device.class.getName()}; - - try { - deviceId = (Integer) cInterface.getField("DEVICE_ID").get(null); - } catch (Exception e) { - logger.error( - "Unable to retrive the implemented the DeviceId refined by this driver" - + " by means of the reflection, the class {} does not provide the static " - + "field DEVICE_ID.\n" - + "Please modify the source code of the class by adding such static field or" - + "implement a proper {} class", - cInterface.getName(), DeviceFactory.class.getName() - ); - logger.debug("Stack exception of the DeviceFactoryImpl() error", e); - - throw new ZigBeeDeviceException("Unable to retrieve DEVICE_ID by means of reflection", e); - } - } - - @Override - public int getDeviceId() { - return deviceId; - } - - public DeviceFactoryImpl setRefinedInterfaces(String[] classNames) { - classes = classNames; - return this; - } - - @Override - public String[] getRefinedInterfaces() { - return classes; - } - - @Override - public DeviceBase getInstance(ZigBeeEndpoint zbd) { - try { - Constructor builder = impl.getConstructor(ZigBeeApiContext.class, ZigBeeEndpoint.class); - DeviceBase device = (DeviceBase) builder.newInstance(ctx, zbd); - return device; - } catch (Exception e) { - logger.error("Unable to create an instance of the refined device due to:", e); - return null; - } - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/DeviceListener.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/DeviceListener.java deleted file mode 100644 index 0ed8da1b4fd0b..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/DeviceListener.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.bubblecloud.zigbee.api; - -/** - * Created with IntelliJ IDEA. - * User: tlaukkan - * Date: 12/15/13 - * Time: 8:48 AM - * To change this template use File | Settings | File Templates. - */ -public interface DeviceListener { - - public void deviceAdded(final Device device); - - public void deviceUpdated(final Device device); - - public void deviceRemoved(final Device device); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/ReportingConfiguration.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/ReportingConfiguration.java deleted file mode 100644 index 1137a281f2585..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/ReportingConfiguration.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api; - -/** - * The interface of the service registered by the Home Automation Driver architecture
- * which is used to provides among all the bundles composing the Home Automation Driver,
- * (i.e.: core drivers and driver extension) the default configuration of the reporting
- *
- * Interfaces that contains the definition of all the properties key and default values,
- * that affects the reporting behavior of the Home Automation Driver architecture - * - * @author Stefano "Kismet" Lenzi - * @author Manlio Bacco - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.6.0 - */ -public class ReportingConfiguration { - - - public int getReportingMinimum() { - return 60; - } - - public int getReportingMaximum() { - return 0; - } - - public double getReportingChange() { - return 0.0d; - } - - public boolean getReportingOverwrite() { - return true; - } - -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/ZigBeeApiConstants.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/ZigBeeApiConstants.java deleted file mode 100644 index a6a283760a1cc..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/ZigBeeApiConstants.java +++ /dev/null @@ -1,257 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -package org.bubblecloud.zigbee.api; - -import org.bubblecloud.zigbee.api.cluster.impl.api.HVAC.FanControl; -import org.bubblecloud.zigbee.api.cluster.impl.api.HVAC.PumpConfigurationAndControl; -import org.bubblecloud.zigbee.api.cluster.impl.api.HVAC.Thermostat; -import org.bubblecloud.zigbee.api.cluster.impl.api.HVAC.ThermostatUserInterfaceConfiguration; -import org.bubblecloud.zigbee.api.cluster.impl.api.closures.DoorLock; -import org.bubblecloud.zigbee.api.cluster.impl.api.closures.ShadeConfiguration; -import org.bubblecloud.zigbee.api.cluster.impl.api.closures.WindowCovering; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.*; -import org.bubblecloud.zigbee.api.cluster.impl.api.measureament_sensing.*; -import org.bubblecloud.zigbee.api.cluster.impl.api.smart_energy.Metering; -import org.bubblecloud.zigbee.api.device.generic.LevelControlSwitch; -import org.bubblecloud.zigbee.api.device.generic.MainsPowerOutlet; -import org.bubblecloud.zigbee.api.device.generic.OnOffOutput; -import org.bubblecloud.zigbee.api.device.generic.SimpleSensor; -import org.bubblecloud.zigbee.api.device.generic.OnOffSwitch; -import org.bubblecloud.zigbee.api.device.hvac.Pump; -import org.bubblecloud.zigbee.api.device.hvac.TemperatureSensor; -import org.bubblecloud.zigbee.api.device.lighting.DimmableLight; -import org.bubblecloud.zigbee.api.device.lighting.LightSensor; -import org.bubblecloud.zigbee.api.device.lighting.OccupancySensor; -import org.bubblecloud.zigbee.api.device.lighting.OnOffLight; -import org.bubblecloud.zigbee.api.device.lighting.OnOffLightSwitch; -import org.bubblecloud.zigbee.api.device.security_safety.IASControlAndIndicatingEquipment; -import org.bubblecloud.zigbee.api.device.security_safety.IAS_Warning; -import org.bubblecloud.zigbee.api.device.security_safety.IAS_Zone; -import org.bubblecloud.zigbee.api.cluster.impl.api.lighting.ColorControl; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.IASACE; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.IASWD; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.IASZone; - - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Han Alink - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.4.0 - */ -public class ZigBeeApiConstants { - - public static final int PROFILE_ID_HOME_AUTOMATION = 0x0104; - - //CLUSTERS - //Generic - public static final int CLUSTER_ID_BASIC = Basic.ID; - public static final int CLUSTER_ID_POWER_CONFIGURATION = PowerConfiguration.ID; - public static final int CLUSTER_ID_DEVICE_TEMPERATURE_CONFIGURATION = DeviceTemperatureConfiguration.ID; - public static final int CLUSTER_ID_IDENTIFY = Identify.ID; - public static final int CLUSTER_ID_GROUPS = Groups.ID; - public static final int CLUSTER_ID_SCENES = Scenes.ID; - public static final int CLUSTER_ID_ON_OFF = OnOff.ID; - public static final int CLUSTER_ID_ON_OFF_SWITCH_CONFIGURATION = OnOffSwitchConfiguration.ID; - public static final int CLUSTER_ID_LEVEL_CONTROL = LevelControl.ID; - public static final int CLUSTER_ID_ALARMS = Alarms.ID; - public static final int CLUSTER_ID_BINARY_INPUT = BinaryInput.ID; - //fuori specifica - public static final int CLUSTER_ID_TIME = Time.ID; - public static final int CLUSTER_ID_ANALOG_INPUT = AnalogInput.ID; - public static final int CLUSTER_ID_COMMISSIONING = Commissioning.ID; - //Smart Energy - public static final int CLUSTER_ID_METERING = Metering.ID; - //Closures - public static final int CLUSTER_ID_SHADE_CONFIGURATION = ShadeConfiguration.ID; - public static final int CLUSTER_ID_DOOR_LOCK = DoorLock.ID; - public static final int CLUSTER_ID_WINDOW_COVERING = WindowCovering.ID; - //HVAC - public static final int CLUSTER_ID_PUMP_CONFIGURATION_AND_CONTROL = PumpConfigurationAndControl.ID; - public static final int CLUSTER_ID_THERMOSTAT = Thermostat.ID; - public static final int CLUSTER_ID_FAN_CONTROL = FanControl.ID; - public static final int CLUSTER_ID_THERMOSTAT_USER_INTERFACE_CONFIGURATION = ThermostatUserInterfaceConfiguration.ID; - // Lighting - public static final int CLUSTER_ID_COLOR_CONTROL = ColorControl.ID; - //Measureament & Sensing - public static final int CLUSTER_ID_PRESSURE_MEASUREMENT = PressureMeasurement.ID; - public static final int CLUSTER_ID_ILLUMINANCE_MEASUREMENT = IlluminanceMeasurement.ID; - public static final int CLUSTER_ID_ILLUMINANCE_LEVEL_SENSING = IlluminanceLevelSensing.ID; - public static final int CLUSTER_ID_TEMPERATURE_MEASUREMENT = TemperatureMeasurement.ID; - public static final int CLUSTER_ID_FLOW_MEASUREMENT = FlowMeasurement.ID; - public static final int CLUSTER_ID_RELATIVE_HUMIDITY_MEASUREMENT = RelativeHumidityMeasurement.ID; - public static final int CLUSTER_ID_OCCUPANCY_SENSING = OccupancySensing.ID; - // Security & Safety - public static final int CLUSTER_ID_IAS_ZONE = IASZone.ID; - public static final int CLUSTER_ID_IAS_ACE = IASACE.ID; - public static final int CLUSTER_ID_IAS_WD = IASWD.ID; - - // devices - // GENERIC 0x0000 - 0x00FF - public static final int DEVICE_ID_ON_OFF_SWITCH = OnOffSwitch.DEVICE_ID; - public static final int DEVICE_ID_LEVEL_CONTROL = LevelControlSwitch.DEVICE_ID; - public static final int DEVICE_ID_ON_OFF_OUTPUT = OnOffOutput.DEVICE_ID; - public static final int DEVICE_ID_MAINS_POWER_OUTLET = MainsPowerOutlet.DEVICE_ID; - public static final int DEVICE_ID_SIMPLE_SENSOR = SimpleSensor.DEVICE_ID; - // LIGHTNING 0x0100 - 0x1FF - public static final int DEVICE_ID_ON_OFF_LIGHT = OnOffLight.DEVICE_ID; - public static final int DEVICE_ID_DIMMABLE_LIGHT = DimmableLight.DEVICE_ID; - public static final int DEVICE_ID_ON_OFF_LIGHT_SWITCH = OnOffLightSwitch.DEVICE_ID; - public static final int DEVICE_ID_LIGHT_SENSOR = LightSensor.DEVICE_ID; - public static final int DEVICE_ID_OCCUPANCY_SENSOR = OccupancySensor.DEVICE_ID; - // HVAC - 0x0300 - 0x3FF - public static final int DEVICE_ID_TEMPERATURE_SENSOR = TemperatureSensor.DEVICE_ID; - public static final int DEVICE_ID_PUMP = Pump.DEVICE_ID; - // Intruder Alarm Systems 0x0400 - 0xFFFF - public static final int DEVICE_ID_IAS_CONTROL_INDICATING_EQUIPMENT = IASControlAndIndicatingEquipment.DEVICE_ID; - public static final int DEVICE_ID_IASZONE = IAS_Zone.DEVICE_ID; - public static final int DEVICE_ID_IAS_WARNING_DEVICE = IAS_Warning.DEVICE_ID; - - public static String getDeviceName(int deviceID){ - - try{ - - String id = Integer.toHexString(deviceID); - - if(id.equals(Integer.toHexString(DEVICE_ID_ON_OFF_SWITCH))) - return OnOffSwitch.NAME; - else if(id.equals(Integer.toHexString(DEVICE_ID_LEVEL_CONTROL))) - return LevelControlSwitch.NAME; - else if(id.equals(Integer.toHexString(DEVICE_ID_ON_OFF_OUTPUT))) - return OnOffOutput.NAME; - else if(id.equals(Integer.toHexString(DEVICE_ID_MAINS_POWER_OUTLET))) - return MainsPowerOutlet.NAME; - else if(id.equals(Integer.toHexString(DEVICE_ID_SIMPLE_SENSOR))) - return SimpleSensor.NAME; - else if(id.equals(Integer.toHexString(DEVICE_ID_ON_OFF_LIGHT))) - return OnOffLight.NAME; - else if(id.equals(Integer.toHexString(DEVICE_ID_DIMMABLE_LIGHT))) - return DimmableLight.NAME; - else if(id.equals(Integer.toHexString(DEVICE_ID_ON_OFF_LIGHT_SWITCH))) - return OnOffLightSwitch.NAME; - else if(id.equals(Integer.toHexString(DEVICE_ID_LIGHT_SENSOR))) - return LightSensor.NAME; - else if(id.equals(Integer.toHexString(DEVICE_ID_OCCUPANCY_SENSOR))) - return OccupancySensor.NAME; - else if(id.equals(Integer.toHexString(DEVICE_ID_TEMPERATURE_SENSOR))) - return TemperatureSensor.NAME; - else if(id.equals(Integer.toHexString(DEVICE_ID_IAS_CONTROL_INDICATING_EQUIPMENT))) - return IASControlAndIndicatingEquipment.NAME; - else if(id.equals(Integer.toHexString(CLUSTER_ID_PRESSURE_MEASUREMENT))) - return PressureMeasurement.NAME; - else if(id.equals(Integer.toHexString(CLUSTER_ID_FLOW_MEASUREMENT))) - return FlowMeasurement.NAME; - else if(id.equals(Integer.toHexString(CLUSTER_ID_ILLUMINANCE_LEVEL_SENSING))) - return IlluminanceLevelSensing.NAME; - - - - else return null; - } - catch(Exception ex){ - return null; - } - } - - public static String getClusterName(int clusterID){ - - try{ - String id = Integer.toHexString(clusterID); - - if(id.equals(Integer.toHexString(CLUSTER_ID_BASIC))) - return Basic.NAME; - else if(id.equals(Integer.toHexString(CLUSTER_ID_POWER_CONFIGURATION))) - return PowerConfiguration.NAME; - else if(id.equals(Integer.toHexString(CLUSTER_ID_DEVICE_TEMPERATURE_CONFIGURATION))) - return DeviceTemperatureConfiguration.NAME; - else if(id.equals(Integer.toHexString(CLUSTER_ID_IDENTIFY))) - return Identify.NAME; - else if(id.equals(Integer.toHexString(CLUSTER_ID_GROUPS))) - return Groups.NAME; - else if(id.equals(Integer.toHexString(CLUSTER_ID_SCENES))) - return Scenes.NAME; - else if(id.equals(Integer.toHexString(CLUSTER_ID_ON_OFF))) - return OnOff.NAME; - else if(id.equals(Integer.toHexString(CLUSTER_ID_ON_OFF_SWITCH_CONFIGURATION))) - return OnOffSwitchConfiguration.NAME; - else if(id.equals(Integer.toHexString(CLUSTER_ID_LEVEL_CONTROL))) - return LevelControl.NAME; - else if(id.equals(Integer.toHexString(CLUSTER_ID_ALARMS))) - return Alarms.NAME; - else if(id.equals(Integer.toHexString(CLUSTER_ID_TIME))) - return Time.NAME; - else if(id.equals(Integer.toHexString(CLUSTER_ID_BINARY_INPUT))) - return BinaryInput.NAME; - else if(id.equals(Integer.toHexString(CLUSTER_ID_COMMISSIONING))) - return Commissioning.NAME; - else if(id.equals(Integer.toHexString(CLUSTER_ID_COLOR_CONTROL))) - return ColorControl.NAME; - else if(id.equals(Integer.toHexString(CLUSTER_ID_ILLUMINANCE_MEASUREMENT))) - return IlluminanceMeasurement.NAME; - else if(id.equals(Integer.toHexString(CLUSTER_ID_TEMPERATURE_MEASUREMENT))) - return TemperatureMeasurement.NAME; - else if(id.equals(Integer.toHexString(CLUSTER_ID_RELATIVE_HUMIDITY_MEASUREMENT))) - return RelativeHumidityMeasurement.NAME; - else if(id.equals(Integer.toHexString(CLUSTER_ID_OCCUPANCY_SENSING))) - return OccupancySensing.NAME; - else if(id.equals(Integer.toHexString(CLUSTER_ID_IAS_ZONE))) - return IASZone.NAME; - else if(id.equals(Integer.toHexString(CLUSTER_ID_IAS_ACE))) - return IASACE.NAME; - else if(id.equals(Integer.toHexString(CLUSTER_ID_IAS_WD))) - return IASWD.NAME; - else if(id.equals(Integer.toHexString(CLUSTER_ID_ANALOG_INPUT))) - return AnalogInput.NAME; - else if(id.equals(Integer.toHexString(CLUSTER_ID_METERING))) - return Metering.NAME; - - else return null; - } - catch(Exception ex){ - return null; - } - } - - public static String getCategoryDeviceName(int deviceID){ - - try{ - String id = Integer.toHexString(deviceID); - if(id.startsWith("0")) - return "Generic"; - else if(id.startsWith("1")) - return "Lighting"; - else if(id.startsWith("2")) - return "Closures"; - else if(id.startsWith("3")) - return "HVAC"; - else if(id.startsWith("4")) - return "IAS"; - else - return null; - } - catch(Exception ex){ - return null; - } - } -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/ZigBeeDeviceException.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/ZigBeeDeviceException.java deleted file mode 100644 index 04bcde5f651a4..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/ZigBeeDeviceException.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api; - -import org.bubblecloud.zigbee.network.impl.ZigBeeException; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class ZigBeeDeviceException extends ZigBeeException { - - public ZigBeeDeviceException(String msg) { - super(msg); - } - - public ZigBeeDeviceException(Throwable ex) { - super(ex); - } - - /** - * @since 0.4.0 - */ - public ZigBeeDeviceException(String msg, Throwable ex) { - super(msg, ex); - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/Cluster.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/Cluster.java deleted file mode 100644 index 715636a852214..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/Cluster.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public interface Cluster { - /** - * This method return the actual ClusterId. Please remember that the final and official ClusterId
- * is defined by the Profile even if the Cluster is defined by a Cluster Library. - * - * @return the ClusterId - */ - public int getId(); - - /** - * @return This method return the {@link String} identifying the human readable name of the cluster.
- * The name is assigned by the document defining the Cluster, either the Cluster Library or
- * or the Profile - */ - public String getName(); - - /** - * This method return an array of {@link org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter} objects according to the number of reportable {@link Attribute} - * currently used. - * - * @return an array of {@link org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter} - */ - public Reporter[] getAttributeReporters(); - - /** - * @return {@link Attribute} array with all the attribute implemented by the {@link Cluster} - * @since 0.2.0 - */ - public Attribute[] getAttributes(); - - /** - * @param id the int value identifying an attribute of the {@link Cluster} - * @return {@link Attribute} implemented by the cluster identified by the given id - * @since 0.2.0 - */ - public Attribute getAttribute(int id); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/Alarms.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/Alarms.java deleted file mode 100644 index c5fe5edc1d309..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/Alarms.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.general; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.Cluster; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.alarms.AlarmListener; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.alarms.GetAlarmResponse; - -/** - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 889 $ ($LastChangedDate: 2013-11-04 17:59:19 +0200 (Mon, 04 Nov 2013) $) - * - */ -public interface Alarms extends Cluster { - - public Attribute getAttributeAlarmCount(); - - public void resetAlarm(int clusterId, int attributeId) throws ZigBeeDeviceException; - - public void resetAllAlarms() throws ZigBeeDeviceException; - - public GetAlarmResponse getAlarm() throws ZigBeeDeviceException; - - public void resetAlarmLog() throws ZigBeeDeviceException; - - public boolean addAlarmListener(AlarmListener listener); - - public boolean removeAlarmListerner(AlarmListener listener); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/AnalogInput.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/AnalogInput.java deleted file mode 100644 index 1496bb40e7e57..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/AnalogInput.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.general; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.Cluster; -import org.bubblecloud.zigbee.api.cluster.general.event.PresentValueListener; - -/** - * - * @author Giancarlo Riolo - * @version $LastChangedRevision: $ ($LastChangedDate: $) - * - */ - -public interface AnalogInput extends Cluster{ - - - - public String getDescription() throws ZigBeeDeviceException; - public Float getMaxPresentValue() throws ZigBeeDeviceException; - public Float getMinPresentValue() throws ZigBeeDeviceException; - public boolean getOutOfService() throws ZigBeeDeviceException; - public Float getPresentValue() throws ZigBeeDeviceException; - public int getReliability() throws ZigBeeDeviceException; - public float getResolution() throws ZigBeeDeviceException; - public int getStatusFlags() throws ZigBeeDeviceException; - public int getEngineeringUnits() throws ZigBeeDeviceException; - public long getApplicationType() throws ZigBeeDeviceException; - - /** - * - * @param listener The {@link PresentValueListener} to subscribe for events - * @since 0.2.0 - */ - public boolean subscribe(PresentValueListener listener); - - /** - * - * @param listener The {@link PresentValueListener} to unsubscribe - * @since 0.2.0 - */ - public boolean unsubscribe(PresentValueListener listener); - -} - diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/AnchorNodeAnnounceListener.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/AnchorNodeAnnounceListener.java deleted file mode 100755 index 1d0b25eb30ede..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/AnchorNodeAnnounceListener.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - Copyright 2013-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.general; - - -/** - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.7.0 - */ -public interface AnchorNodeAnnounceListener { - - public void anchorNodeAnnounce(long ieeeAddress, int x, int y, int z); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/Basic.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/Basic.java deleted file mode 100644 index fe2a3d9b89eba..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/Basic.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.general; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.Cluster; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; - -/** - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * - */ -public interface Basic extends Cluster { - - public Attribute getZCLVersion(); - public Attribute getApplicationVersion(); - public Attribute getStackVersion(); - public Attribute getHWVersion(); - public Attribute getManufacturerName(); - public Attribute getModelIdentifier(); - public Attribute getDateCode(); - public Attribute getPowerSource(); - public String getLocationDescription() throws ZigBeeDeviceException; - public Attribute getPhysicalEnvironment(); - public boolean getDeviceEnabled() throws ZigBeeDeviceException; - public Attribute getAlarmMask(); - /** - * @since 0.7.0 - */ - public Attribute getDisableLocalConfig(); - - public void resetToFactoryDefault() throws ZigBeeDeviceException; - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/BinaryInput.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/BinaryInput.java deleted file mode 100755 index f5f20760ee681..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/BinaryInput.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - Copyright 2013-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.general; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.Cluster; -import org.bubblecloud.zigbee.api.cluster.general.event.PresentValueListener; - - -/** -* -* @author Han Alink -* @author Stefano "Kismet" Lenzi -* @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) -* @since 0.7.0 -* -*/ -public interface BinaryInput extends Cluster { - - public String getActiveText() throws ZigBeeDeviceException; - public String getDescription() throws ZigBeeDeviceException; - public String getInactiveText() throws ZigBeeDeviceException; - public boolean getOutOfService() throws ZigBeeDeviceException; - public boolean getPresentValue() throws ZigBeeDeviceException; - public int getPolarity() throws ZigBeeDeviceException; - public int getReliability() throws ZigBeeDeviceException; - public int getStatusFlags() throws ZigBeeDeviceException; - public long getApplicationType() throws ZigBeeDeviceException; - - /** - * - * @param listener The {@link PresentValueListener} to subscribe for events - */ - public boolean subscribe(PresentValueListener listener); - - /** - * - * @param listener The {@link PresentValueListener} to unsubscribe - */ - public boolean unsubscribe(PresentValueListener listener); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/ColorControl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/ColorControl.java deleted file mode 100644 index b780b46e4ecbc..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/ColorControl.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.general; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.Cluster; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; - -/** - * - * @author Giancarlo Riolo - * @version $LastChangedRevision: $ ($LastChangedDate: $) - * - */ - -public interface ColorControl extends Cluster { - - // commands - /** - * Sets hue according to HSV (aka HSB) color model. - * @param hue hue (degrees) / 360 * 254 in the range 0 - 254. - * @param direction 0 = shortest, 1 = longest, 2 = up, 3 = down - * @param transitionTime transition time in 1/10ths of a second. - * @throws ZigBeeDeviceException if connectivity or other exception occurs with the device. - */ - public void moveToHue(int hue, int direction, int transitionTime) throws ZigBeeDeviceException; - /** - * Moves hue according to HSV (aka HSB) color model. - * @param moveMode 0 = stop, 1 = up, 2 = reserved, 3 = down - * @param rate steps per second - * @throws ZigBeeDeviceException if connectivity or other exception occurs with the device. - */ - public void moveHue(int moveMode, int rate) throws ZigBeeDeviceException; - /** - * Steps hue according to HSV (aka HSB) color model. - * @param stepMode 0 = reserved, 1 = up, 2 = reserved, 3 = down - * @param stepSize step to be added or subtracted from current hue - * @param transtionTime transition time in 1/10ths of a second. - * @throws ZigBeeDeviceException if connectivity or other exception occurs with the device. - */ - public void stepHue(int stepMode, int stepSize, int transtionTime) throws ZigBeeDeviceException; - /** - * Moves to saturation according to HSV (aka HSB) color model. - * @param saturation saturation * 254 in the range 0 - 254. - * @param transitionTime transition time in 1/10ths of a second. - * @throws ZigBeeDeviceException if connectivity or other exception occurs with the device. - */ - public void movetoSaturation(int saturation, int transitionTime) throws ZigBeeDeviceException; - /** - * Moves saturation according to HSV (aka HSB) color model. - * @param moveMode 0 = stop, 1 = up, 2 = reserved, 3 = down - * @param rate steps per second - * @throws ZigBeeDeviceException if connectivity or other exception occurs with the device. - */ - public void moveSaturation(int moveMode, int rate) throws ZigBeeDeviceException; - /** - * Steps saturation according to HSV (aka HSB) color model. - * @param stepMode 0 = reserved, 1 = up, 2 = reserved, 3 = down - * @param stepSize step to be added or subtracted from current saturation - * @param transitionTime transition time in 1/10ths of a second. - * @throws ZigBeeDeviceException if connectivity or other exception occurs with the device. - */ - public void stepSaturation(int stepMode, int stepSize, int transitionTime) throws ZigBeeDeviceException; - /** - * Moves to hue and saturation according to HSV (aka HSB) color model. - * @param hue hue (degrees) / 360 * 254 in the range 0 - 254. - * @param saturation saturation * 254 in the range 0 - 254. - * @param transitionTime transition time in 1/10ths of a second. - * @throws ZigBeeDeviceException if connectivity or other exception occurs with the device. - */ - public void moveToHueAndSaturation(int hue, int saturation, int transitionTime) throws ZigBeeDeviceException; - /** - * Moves to color according to CIE 1931 Color Space. - * @param colorX x * 65536 where colorX can be in rance 0 to 65279 - * @param colorY y * 65536 where colorY can be in rance 0 to 65279 - * @param transitionTime transition time in 1/10ths of a second. - * @throws ZigBeeDeviceException if connectivity or other exception occurs with the device. - */ - public void moveToColor(int colorX, int colorY, int transitionTime) throws ZigBeeDeviceException; - /** - * Moves color according to CIE 1931 Color Space. - * @param rateX steps per second in X value - * @param rateY steps per second in X value - * @throws ZigBeeDeviceException if connectivity or other exception occurs with the device. - */ - public void moveColor(int rateX, int rateY) throws ZigBeeDeviceException; - /** - * Steps color according to CIE 1931 Color Space. - * @param stepX step to be added or subtracted from current X value - * @param stepY step to be added or subtracted from current Y value - * @param transitionTime transition time in 1/10ths of a second. - * @throws ZigBeeDeviceException if connectivity or other exception occurs with the device. - */ - public void stepColor(int stepX, int stepY, int transitionTime) throws ZigBeeDeviceException; - /** - * Moves to color temperature. - * @param colorTemperature 1 000 000 / color temperature (Kelvins) in the range 1 to 65279 - * @param transitionTime transition time in 1/10ths of a second. - * @throws ZigBeeDeviceException if connectivity or other exception occurs with the device. - */ - public void moveToColorTemperature(int colorTemperature, int transitionTime) throws ZigBeeDeviceException; -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/Commissioning.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/Commissioning.java deleted file mode 100755 index 29d4d3f1afa1f..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/Commissioning.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - Copyright 2013-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.general; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.Cluster; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; - -/** - * - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.7.0 - * - */ -public interface Commissioning extends Cluster { - - public abstract int getShortAddress(); - public abstract void setShortAddress(int shortAddress); - - public abstract long getExtendedPANId(); - public abstract void setExtendedPANId(long extendedPANId); - - public abstract int getPANId(); - public abstract void setPANId(int PANId); - - public abstract int getChannelmask(); - public abstract void setChannelmask(int channelMask); - - public int getProtocolVersion(); - public void setProtocolVersion(int protocolVersion); - - public int getStackProfile(); - public void setStackProfile(int stackProfile); - - public StartupControl getStartupControl(); - public void setStartupControl(StartupControl startupControl); - - public long getTrustCenterAddress(); - public void setTrustCenterAddress(long trustCenterAddress); - - public byte[] getTrustCenterMasterKey(); - public void setTrustCenterMasterKey(byte[] trustCenterMasterKey); - - public byte[] getNetworkKey(); - public void setNetworkKey(byte[] networkKey); - - public boolean isUseInsecureJoin(); - public void setUseInsecureJoin(boolean useInsecureJoin); - - public byte[] getPreconfiguredLinkKey(); - public void setPreconfiguredLinkKey(byte[] preconfiguredLinkKey); - - public int getNetworkKeySeqNum(); - public void setNetworkKeySeqNum(int networkKeySeqNum); - - public NetworkKeyType getNetworkKeyType(); - public void setNetworkKeyType(NetworkKeyType networkKeyType); - - public int getNetworkManagerAddress(); - public void setNetworkManagerAddress(int networkManagerAddress); - - public int getScanAttempts(); - public void setScanAttempts(int scanAttempts); - - public int getTimeBetweenScans(); - public void setTimeBetweenScans(int timeBetweenScans); - - public int getRejoinInterval(); - public void setRejoinInterval(int rejoinInterval); - - public int getMaxRejoinInterval(); - public void setMaxRejoinInterval(int maxRejoinInterval); - - public int getIndirectPollRate(); - public void setIndirectPollRate(int indirectPollRate); - - public int getParentRetryThreshold(); - public void setParentRetryThreshold(int parentRetryThreshold); - - public boolean isConcentratorFlag(); - public void setConcentratorFlag(boolean concentratorFlag); - - public int getConcentratorRadius(); - public void setConcentratorRadius(int concentratorRadius); - - public int getConcentratorDiscoveryTime(); - public void setConcentratorDiscoveryTime(int concentratorDiscoveryTime); - - public Status restartDevice(StartupControl mode, boolean immediate, int delay, int jitter); - public Status saveStartupParameters(int index); - public Status restoreStartupParameters(int index); - - public Status resetStartupParameter(int index); - public Status resetCurrentStartupParameters(); - public Status resetAllStartupParameters(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/DeviceTemperatureConfiguration.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/DeviceTemperatureConfiguration.java deleted file mode 100644 index ed24d77da1457..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/DeviceTemperatureConfiguration.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.general; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.Cluster; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; - -/** - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * - */ -public interface DeviceTemperatureConfiguration extends Cluster { - - public Attribute getCurrentTemperature(); - public Attribute getMinTempExperienced(); - public Attribute getMaxTempExperienced(); - public Attribute getOverTempTotalDwell(); - - public Attribute getDeviceTempAlarmMask(); - public Attribute getLowTempThreshold(); - public Attribute getHighTempThreshold(); - public Attribute getLowTempDwellTripPoint(); - public Attribute getHighTempDwellTripPoint(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/DoorLock.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/DoorLock.java deleted file mode 100644 index 97968fd17adff..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/DoorLock.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.general; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.Cluster; - -/** - * - * @author Giancarlo Riolo - * @version $LastChangedRevision: $ ($LastChangedDate: $) - * - */ - -public interface DoorLock extends Cluster { - - public String getDescription() throws ZigBeeDeviceException; - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/FanControl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/FanControl.java deleted file mode 100644 index be01f7024b012..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/FanControl.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.general; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.Cluster; - -/** - * - * @author Giancarlo Riolo - * @version $LastChangedRevision: $ ($LastChangedDate: $) - * - */ - -public interface FanControl extends Cluster { - - public String getDescription() throws ZigBeeDeviceException; - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/FlowMeasurement.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/FlowMeasurement.java deleted file mode 100644 index 6b0a5527887c7..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/FlowMeasurement.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.general; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.Cluster; - -/** - * - * @author Giancarlo Riolo - * @version $LastChangedRevision: $ ($LastChangedDate: $) - * - */ - -public interface FlowMeasurement extends Cluster { - - public String getDescription() throws ZigBeeDeviceException; - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/Groups.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/Groups.java deleted file mode 100644 index ef79bf886718e..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/Groups.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.general; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.Cluster; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.groups.AddGroupResponse; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.groups.GetGroupMembershipResponse; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.groups.RemoveGroupResponse; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.groups.ViewGroupResponse; - -/** - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * - */ -public interface Groups extends Cluster{ - - public AddGroupResponse addGroup(int groupId, String name) throws ZigBeeDeviceException; - - public void addGroupIfIdentifying(int groupId, String name) throws ZigBeeDeviceException; - - public GetGroupMembershipResponse getGroupMembership(int[] groupList) throws ZigBeeDeviceException; - - public void removeAllGroup() throws ZigBeeDeviceException; - - public RemoveGroupResponse removeGroup(int groupId) throws ZigBeeDeviceException; - - public ViewGroupResponse viewGroup(int groupId) throws ZigBeeDeviceException; - - public Attribute getNameSupport(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/Identify.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/Identify.java deleted file mode 100644 index c49b04e3dcf08..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/Identify.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.general; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.Cluster; -/** - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * - */ -public interface Identify extends Cluster{ - - public void identify(int time) throws ZigBeeDeviceException; - - public int IdentifyQuery() throws ZigBeeDeviceException; - - public int getIdentifyTime() throws ZigBeeDeviceException; - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/IlluminanceLevelSensing.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/IlluminanceLevelSensing.java deleted file mode 100644 index 3ed03eb0c1a53..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/IlluminanceLevelSensing.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.general; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.Cluster; - -/** - * - * @author Giancarlo Riolo - * @version $LastChangedRevision: $ ($LastChangedDate: $) - * - */ - -public interface IlluminanceLevelSensing extends Cluster { - - public String getDescription() throws ZigBeeDeviceException; - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/LevelControl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/LevelControl.java deleted file mode 100644 index f74b2a64cbee0..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/LevelControl.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.general; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.Cluster; -import org.bubblecloud.zigbee.api.cluster.general.event.CurrentLevelListener; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Alessandro Giari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - * - */ -public interface LevelControl extends Cluster { - - public Attribute getCurrentLevel(); - public Attribute getRemainingTime(); - public Attribute getOnOffTransitionTime(); - public Attribute getOnLevel(); - - /** - * - * @param listener The {@link org.bubblecloud.zigbee.api.cluster.general.event.CurrentLevelListener} to subscribe for events - * @since 0.2.0 - */ - public boolean subscribe(CurrentLevelListener listener); - - /** - * - * @param listener The {@link CurrentLevelListener} to unsubscribe - * @since 0.2.0 - */ - public boolean unsubscribe(CurrentLevelListener listener); - - - public void moveToLevel(short level, int time) throws ZigBeeDeviceException; - public void move(byte mode, short rate) throws ZigBeeDeviceException; - public void step(byte mode, short step, int time) throws ZigBeeDeviceException; - public void stop() throws ZigBeeDeviceException; - - /** - * @since 0.6.0 - */ - public void moveToLevelWithOnOff(short level, int time) throws ZigBeeDeviceException; - - /** - * @since 0.6.0 - */ - public void moveWithOnOff(byte mode, short rate) throws ZigBeeDeviceException; - - /** - * @since 0.6.0 - */ - public void stepWithOnOff(byte mode, short step, int time) throws ZigBeeDeviceException; - - /** - * @since 0.6.0 - */ - public void stopWithOnOff() throws ZigBeeDeviceException; - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/LocationDataListener.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/LocationDataListener.java deleted file mode 100755 index bd23e1114272f..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/LocationDataListener.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright 2013-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.general; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.Cluster; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; - - -/** - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.7.0 - */ -public interface LocationDataListener { - - public void locationDataFailure(Status state); - - public void locationAbsoluteData(boolean rectangular, int x, int y, int z, int power, int ple, LocationMethod method); - - public void locationAbsolute2DData(boolean rectangular, int x, int y, int power, int ple, LocationMethod method); - - public void locationData(boolean rectangular, int x, int y, int z, int power, int ple, LocationMethod method, int quality, int age); - - public void location2DData(boolean rectangular, int x, int y, int power, int ple, LocationMethod method, int quality, int age); - - public void locationAbsoluteData(boolean rectangular, int x, int y, int z); - - public void locationAbsolute2DData(boolean rectangular, int x, int y); - - public void locationData(boolean rectangular, int x, int y, int z, int quality, int age); - - public void location2DData(boolean rectangular, int x, int y, int quality, int age); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/LocationMethod.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/LocationMethod.java deleted file mode 100755 index 09c4943328f2b..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/LocationMethod.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - Copyright 2013-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.general; - - -/** - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.7.0 - */ -public enum LocationMethod { - Lateration(0x00,"A method based on RSSI measurements from three or more sources"), - Signposting(0x01,"The location reported is the location of the neighboring device"), - RF_Fingerprinting(0x02,"RSSI signatures are collected into a database at commissioning time"), - OutOfBand(0x03,"The location is obtained by accessing an out-of-band device"), - Centralized(0x04,"The location is performed by a centralized device"); - - public final byte value; - public final String description; - - private LocationMethod(int value, String description){ - this.value = (byte) value; - this.description = description; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/LocationType.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/LocationType.java deleted file mode 100755 index 243b2c6f55a3b..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/LocationType.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - Copyright 2013-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.general; - - -/** - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.7.0 - */ -public enum LocationType { - AbsoluteLocation(1,0), - MeasuredLocation(0,0), - TwoDimensional(1,1), - ThreeDimensional(0,1), - Rectangular(0,2); - - public final byte value; - public final byte bit; - - private LocationType(int value, int bit){ - this.value = (byte) value; - this.bit = (byte) bit; - } -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/Metering.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/Metering.java deleted file mode 100644 index 4c0b57eaf0111..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/Metering.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.general; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.Cluster; -/** - * - * @author Giancarlo Riolo - * @version $LastChangedRevision: $ ($LastChangedDate: $) - * - */ - - -public interface Metering extends Cluster { - - public String getDescription() throws ZigBeeDeviceException; - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/NeighborsInformation.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/NeighborsInformation.java deleted file mode 100755 index 7d95a92780b7a..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/NeighborsInformation.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - Copyright 2013-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.general; - - -/** - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.7.0 - */ -public class NeighborsInformation { - - private final long ieeeAddress; - private final int x; - private final int y; - private final int z; - private final int rssi; - private final int nSamples; - - /** - * @param ieeeAddress - * @param x - * @param y - * @param z - * @param rssi - * @param samples - */ - public NeighborsInformation( long ieeeAddress, int x, int y, int z, int rssi, int samples ) { - this.ieeeAddress = ieeeAddress; - this.x = x; - this.y = y; - this.z = z; - this.rssi = rssi; - nSamples = samples; - } - - /** - * @return the ieeeAddress - */ - public long getIeeeAddress() { - return ieeeAddress; - } - - /** - * @return the x - */ - public int getX() { - return x; - } - - /** - * @return the y - */ - public int getY() { - return y; - } - - /** - * @return the z - */ - public int getZ() { - return z; - } - - /** - * @return the rssi - */ - public int getRssi() { - return rssi; - } - - /** - * @return the nSamples - */ - public int getNSamples() { - return nSamples; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/NetworkKeyType.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/NetworkKeyType.java deleted file mode 100755 index de0cb5ca4b4d3..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/NetworkKeyType.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - Copyright 2013-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.general; - - -/** - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.7.0 - */ -public enum NetworkKeyType { - Standard(0x01), - HighSecurity(0x05); - - final public int value; - - private NetworkKeyType(int value){ - this.value = value; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/OnOff.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/OnOff.java deleted file mode 100644 index b87acef0976c5..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/OnOff.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.general; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.Cluster; -import org.bubblecloud.zigbee.api.cluster.general.event.OnOffListener; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Alessandro Giari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - * - */ -public interface OnOff extends Cluster{ - - public void on() throws ZigBeeDeviceException; - - public void off() throws ZigBeeDeviceException; - - public void toggle() throws ZigBeeDeviceException; - - public boolean getOnOff() throws ZigBeeDeviceException; - - /** - * - * @param listener The {@link org.bubblecloud.zigbee.api.cluster.general.event.OnOffListener} to subscribe for events - * @since 0.2.0 - */ - public boolean subscribe(OnOffListener listener); - - /** - * - * @param listener The {@link OnOffListener} to unsubscribe - * @since 0.2.0 - */ - public boolean unsubscribe(OnOffListener listener); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/OnOffSwitch.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/OnOffSwitch.java deleted file mode 100644 index 8ea5ec837454c..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/OnOffSwitch.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.general; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.Cluster; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; - -/** - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * - */ -public interface OnOffSwitch extends Cluster { - -public Attribute getAttributeOnOff(); - - public Response on(boolean disableDefatultResponse); - public Response off(boolean disableDefatultResponse); - public Response toggle(boolean disableDefatultResponse); - - - public void on(); - - - public void off(); - - - public void toggle(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/OnOffSwitchConfiguration.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/OnOffSwitchConfiguration.java deleted file mode 100644 index 8b1f980cdc9bc..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/OnOffSwitchConfiguration.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.general; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.Cluster; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; - -/** - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * - */ -public interface OnOffSwitchConfiguration extends Cluster { - - public Attribute getSwitchType(); - public Attribute getSwitchActions(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/PowerConfiguration.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/PowerConfiguration.java deleted file mode 100644 index 71c9399b83171..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/PowerConfiguration.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.general; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.Cluster; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; - -/** - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * - */ -public interface PowerConfiguration extends Cluster { - - public Attribute getMainsVoltage(); - public Attribute getMainsFrequency(); - - public Attribute getMainsAlarmMask(); - public Attribute getMainsVoltageMinThreshold(); - public Attribute getMainsVoltageMaxThreshold(); - public Attribute getMainsDwellTripPoint(); - - public Attribute getBatteryVoltage(); - - public Attribute getBatteryManufacturer(); - public Attribute getBatterySize(); - public Attribute getBatteryAHrRating(); - public Attribute getBatteryQuantity(); - public Attribute getBatteryRatedVoltage(); - public Attribute getBatteryAlarmMask(); - public Attribute getBatteryVoltageMinThreshold(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/PressureMeasurement.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/PressureMeasurement.java deleted file mode 100644 index 501fb6160c7a9..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/PressureMeasurement.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.general; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.Cluster; - - -public interface PressureMeasurement extends Cluster { - - public String getDescription() throws ZigBeeDeviceException; - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/PumpConfigurationAndControl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/PumpConfigurationAndControl.java deleted file mode 100644 index 3496250be7d96..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/PumpConfigurationAndControl.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.general; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.Cluster; - -/** - * - * @author Giancarlo Riolo - * @version $LastChangedRevision: $ ($LastChangedDate: $) - * - */ - -public interface PumpConfigurationAndControl extends Cluster { - - public String getDescription() throws ZigBeeDeviceException; - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/RSSILocation.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/RSSILocation.java deleted file mode 100644 index 25b69bc10f24b..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/RSSILocation.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.general; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.Cluster; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; - -import java.util.EnumSet; - -/** - * PLACEHOLDER TO IMPLEMENT - * - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.7.0 - * - */ -public interface RSSILocation extends Cluster { - - public EnumSet getLocationType(); - public void setLocationType(EnumSet type); - - public LocationMethod getLocationMethod(); - public void setLocationMethod(LocationMethod method); - - public int getLocationAge(); - - public int getQualityMeasure(); - - public int getNumberOfDevices(); - - public int getCoordinate1(); - public void setCoordinate1(int coordinate1); - - public int getCoordinate2(); - public void setCoordinate2(int coordinate2); - - public int getCoordinate3(); - public void setCoordinate3(int coordinate3); - - public int getPower(); - public void setPower(int power); - - public int getPathLossExponent(); - public void setPathLossExponent(int pathLossExponent); - - public int getReportingPeriod(); - public void setReportingPeriod(int reportingPeriod); - - public int getCalculationPeriod(); - public void setCalculationPeriod(int calculationPeriod); - - public int getNumberRSSIMeasurements(); - public void setNumberRSSIMeasurements(int numberRSSIMeasurements); - - public void setAbsoluteLocation(int x, int y, int z, int power, int ple); - public void setDeviceConfiguration(int power, int ple, int calcPeriod, int nRSSI, int reportPeriod); - public Response getDeviceConfiguration(long ieeeAddress); - - public void getAbsoluteLocationData(boolean compact, boolean unicastResponse, int nResponse, long ieeeAddress); - public void getLocationData(boolean compact, boolean unicastResponse, boolean recalc, int nResponse, long ieeeAddress); - public void broadcastAbsoluteLocationData(boolean compact, boolean unicastResponse, int nResponse); - public void broadcastLocationData(boolean compact, boolean unicastResponse, boolean recalc, int nResponse); - public boolean addAnchorNodeAnnounceListener(AnchorNodeAnnounceListener listner); - public boolean removeAnchorNodeAnnounceListener(AnchorNodeAnnounceListener listner); - - public void RSSIResponse(long ieeeAddress, int x, int y, int z, int rssi, int nsamples); - public void sendPings(long ieeeAddress, int nRSSI, int calcPeriod); - - public boolean addRSSIPingListener(RSSIPingListener listener); - public boolean removeRSSIPingListener(RSSIPingListener listener); - - public boolean addReportRSSIMeasurementsListener(ReportRSSIMeasurementsListener listener); - public boolean removeReportRSSIMeasurementsListener(ReportRSSIMeasurementsListener listener); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/RSSIPingListener.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/RSSIPingListener.java deleted file mode 100755 index 2fe8ab58edb64..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/RSSIPingListener.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - Copyright 2013-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.general; - - -/** - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.7.0 - */ -public interface RSSIPingListener { - - public void rssiPing(LocationType type); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/ReportRSSIMeasurementsListener.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/ReportRSSIMeasurementsListener.java deleted file mode 100755 index 32051822f809a..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/ReportRSSIMeasurementsListener.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - Copyright 2013-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.general; - - -/** - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.7.0 - */ -public interface ReportRSSIMeasurementsListener { - - public void reportRSSIMeasurements(long ieeeAdress, NeighborsInformation[] neighbors); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/Scenes.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/Scenes.java deleted file mode 100644 index d53656ddf82c8..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/Scenes.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.general; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.Cluster; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.scenes.*; - -/** - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * - */ -public interface Scenes extends Cluster{ - - public AddSceneResponse addScene(AddScenePayload scenePayload) throws ZigBeeDeviceException; - - public GetSceneMembershipResponse getSceneMembership(int groupId) throws ZigBeeDeviceException; - - public void recallScene(int groupId, short sceneId) throws ZigBeeDeviceException; - - public RemoveAllScenesResponse removeAllScene(int groupId) throws ZigBeeDeviceException; - - public RemoveSceneResponse removeScene(int groupId, short sceneId) throws ZigBeeDeviceException; - - public StoreSceneResponse storeScene(int groupId, short sceneId) throws ZigBeeDeviceException; - - public ViewSceneResponse viewScene(int groupId, short sceneId) throws ZigBeeDeviceException; - - public Attribute getSceneCount(); - - public Attribute getCurrentScene(); - - public Attribute getCurrentGroup(); - - public Attribute getSceneValid(); - - public Attribute getNameSupport(); - - public Attribute getLastConfiguredBy(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/ShadeConfiguration.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/ShadeConfiguration.java deleted file mode 100644 index 49d0c17b89326..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/ShadeConfiguration.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.general; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.Cluster; - -/** - * - * @author Giancarlo Riolo - * @version $LastChangedRevision: $ ($LastChangedDate: $) - * - */ - -public interface ShadeConfiguration extends Cluster { - - public String getDescription() throws ZigBeeDeviceException; - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/StartupControl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/StartupControl.java deleted file mode 100755 index 3e931812caf5f..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/StartupControl.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - Copyright 2013-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.general; - - -/** - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.7.0 - */ -public enum StartupControl { - PartOfNetwork(0x00,""), - CreateExtendPANIdNetwork(0x01,""), - RejoinExtendPANIdNetwork(0x02,""), - JoinNetwork(0x03,""); - - public final int value; - public final String description; - - private StartupControl(int value, String description){ - this.value = value; - this.description = description; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/Thermostat.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/Thermostat.java deleted file mode 100644 index cd1996bbcb63c..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/Thermostat.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.general; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.Cluster; - -/** - * - * @author Giancarlo Riolo - * @version $LastChangedRevision: $ ($LastChangedDate: $) - * - */ - -public interface Thermostat extends Cluster { - - public String getDescription() throws ZigBeeDeviceException; - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/ThermostatUserInterfaceConfiguration.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/ThermostatUserInterfaceConfiguration.java deleted file mode 100644 index 6df7c0f5aefc1..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/ThermostatUserInterfaceConfiguration.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.general; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.Cluster; - -/** - * - * @author Giancarlo Riolo - * @version $LastChangedRevision: $ ($LastChangedDate: $) - * - */ - -public interface ThermostatUserInterfaceConfiguration extends Cluster { - - public String getDescription() throws ZigBeeDeviceException; - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/Time.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/Time.java deleted file mode 100644 index 46c50c4fdbc7d..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/Time.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.general; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.Cluster; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; - -/** - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * - */ -public interface Time extends Cluster { - - public Attribute getTime(); - public Attribute getTimeStatus(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/WindowCovering.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/WindowCovering.java deleted file mode 100644 index 6b4d93a155ae5..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/WindowCovering.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.general; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.Cluster; - -/** - * - * @author Giancarlo Riolo - * @version $LastChangedRevision: $ ($LastChangedDate: $) - * - */ - -public interface WindowCovering extends Cluster { - - public String getDescription() throws ZigBeeDeviceException; - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/event/CurrentLevelEvent.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/event/CurrentLevelEvent.java deleted file mode 100644 index 1777b82d43fcf..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/event/CurrentLevelEvent.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.general.event; - -import org.bubblecloud.zigbee.api.cluster.Cluster; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.2.0 - */ -public interface CurrentLevelEvent { - - public int getEvent(); - - public Cluster getSource(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/event/CurrentLevelListener.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/event/CurrentLevelListener.java deleted file mode 100644 index c3d8c04722ad2..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/event/CurrentLevelListener.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.general.event; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.2.0 - */ -public interface CurrentLevelListener { - - public void changedCurrentLevel(CurrentLevelEvent event); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/event/OnOffEvent.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/event/OnOffEvent.java deleted file mode 100644 index eef6253138a46..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/event/OnOffEvent.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.general.event; - -import org.bubblecloud.zigbee.api.cluster.Cluster; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface OnOffEvent { - - public boolean getEvent(); - - /** - * @return the reference to the {@link Cluster} object which represent the Cluster whose
- * generated the event - * @since 0.6.0 - */ - public Cluster getSource(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/event/OnOffListener.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/event/OnOffListener.java deleted file mode 100644 index 7c156595557ba..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/event/OnOffListener.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.general.event; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface OnOffListener { - - public void changedOnOff(OnOffEvent event); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/event/PresentValueEvent.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/event/PresentValueEvent.java deleted file mode 100755 index 2ee389a984345..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/event/PresentValueEvent.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - Copyright 2013-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.general.event; - -import org.bubblecloud.zigbee.api.cluster.Cluster; - -/** - * @author Han Alink - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.7.0 - */ -public interface PresentValueEvent { - - public boolean getEvent(); - - public Cluster getSource(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/event/PresentValueListener.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/event/PresentValueListener.java deleted file mode 100755 index 40cca63465cfe..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/event/PresentValueListener.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - Copyright 2013-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.general.event; - -/** - * @author Han Alink - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.7.0 - */ -public interface PresentValueListener { - - public void changedPresentValue(PresentValueEvent event); -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/event/StartWarningEvent.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/event/StartWarningEvent.java deleted file mode 100644 index 9e263793f6425..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/event/StartWarningEvent.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.general.event; - -import org.bubblecloud.zigbee.api.cluster.Cluster; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.7.0 - */ -public interface StartWarningEvent { - - public boolean getEvent(); - - public Cluster getSource(); -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/event/StartWarningListener.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/event/StartWarningListener.java deleted file mode 100644 index 4117fb3d0d2f5..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/general/event/StartWarningListener.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.general.event; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.7.0 - */ -public interface StartWarningListener { - - public void changedStartWarning(StartWarningEvent event); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/AlarmsImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/AlarmsImpl.java deleted file mode 100644 index e572ea801d78a..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/AlarmsImpl.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl; - -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.general.Alarms; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.alarms.AlarmListener; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.alarms.GetAlarmResponse; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.DefaultResponse; -import org.bubblecloud.zigbee.api.cluster.impl.general.AlarmsCluster; - - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.4.0 - */ -public class AlarmsImpl implements Alarms { - - private final AlarmsCluster alarmsCluster; - private final Attribute attribute; - - public AlarmsImpl(ZigBeeEndpoint zbDevice) { - alarmsCluster = new AlarmsCluster(zbDevice); - attribute = alarmsCluster.getAttributeAlarmCount(); - } - - public boolean getOnOff() throws ZigBeeDeviceException { - try { - Boolean value = (Boolean) attribute.getValue(); - return value.booleanValue(); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public Reporter[] getAttributeReporters() { - return alarmsCluster.getAttributeReporters(); - } - - public int getId() { - return alarmsCluster.getId(); - } - - public String getName() { - return alarmsCluster.getName(); - } - - - public Attribute getAttribute(int id) { - Attribute[] attributes = alarmsCluster.getAvailableAttributes(); - for (int i = 0; i < attributes.length; i++) { - if (attributes[i].getId() == id) - return attributes[i]; - } - return null; - } - - public Attribute[] getAttributes() { - return alarmsCluster.getAvailableAttributes(); - } - - public Attribute getAttributeAlarmCount() { - return attribute; - } - - public boolean addAlarmListener(AlarmListener listener) { - return alarmsCluster.addAlarmListerner(listener); - } - - public boolean removeAlarmListerner(AlarmListener listener) { - return alarmsCluster.removeAlarmListerner(listener); - } - - public GetAlarmResponse getAlarm() throws ZigBeeDeviceException { - try { - Response response = alarmsCluster.getAlarm(); - if (response.getZCLHeader().getCommandId() != GetAlarmResponse.ID) - throw new ZigBeeDeviceException(((DefaultResponse) response).getStatus().toString()); - - return (GetAlarmResponse) response; - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public void resetAlarm(int clusterId, int attributeId) throws ZigBeeDeviceException { - try { - DefaultResponse response = (DefaultResponse) alarmsCluster.resetAlarm(clusterId, attributeId); - if (response.getStatus() != Status.SUCCESS) - throw new ZigBeeDeviceException(response.getStatus().toString()); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public void resetAlarmLog() throws ZigBeeDeviceException { - try { - DefaultResponse response = (DefaultResponse) alarmsCluster.resetAlarmLog(); - if (response.getStatus() != Status.SUCCESS) - throw new ZigBeeDeviceException(response.getStatus().toString()); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public void resetAllAlarms() throws ZigBeeDeviceException { - try { - DefaultResponse response = (DefaultResponse) alarmsCluster.resetAllAlarms(); - if (response.getStatus() != Status.SUCCESS) - throw new ZigBeeDeviceException(response.getStatus().toString()); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/AnalogInputImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/AnalogInputImpl.java deleted file mode 100644 index bdbcf7c213d15..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/AnalogInputImpl.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl; - -import org.bubblecloud.zigbee.api.ReportingConfiguration; -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.general.AnalogInput; -import org.bubblecloud.zigbee.api.cluster.general.event.PresentValueListener; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.event.PresentValueBridgeListeners; -import org.bubblecloud.zigbee.api.cluster.impl.general.AnalogInputCluster; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; - -/** - * - * @author Giancarlo Riolo - * @version $LastChangedRevision: $ ($LastChangedDate: $) - * - */ - - -public class AnalogInputImpl implements AnalogInput { - private final Attribute presentValue; - private final Attribute outOfService; - private final Attribute statusFlags; - private AnalogInputCluster analogInputCluster; - private PresentValueBridgeListeners eventBridge; - - public AnalogInputImpl(ZigBeeEndpoint zbDevice){ - analogInputCluster = new AnalogInputCluster(zbDevice); - presentValue = analogInputCluster.getAttributePresentValue(); - outOfService = analogInputCluster.getAttributeOutOfService(); - statusFlags = analogInputCluster.getAttributeStatusFlags(); - eventBridge = new PresentValueBridgeListeners(new ReportingConfiguration(), presentValue, this); - } - - - public boolean subscribe(PresentValueListener listener) { - return eventBridge.subscribe(listener); - } - - public boolean unsubscribe(PresentValueListener listener) { - return eventBridge.unsubscribe(listener); - } - - public Reporter[] getAttributeReporters() { - return analogInputCluster.getAttributeReporters(); - } - - public int getId() { - return analogInputCluster.getId(); - } - - public String getName() { - return analogInputCluster.getName(); - } - - - - public Attribute getAttribute(int id) { - Attribute[] attributes = analogInputCluster.getAvailableAttributes(); - for (int i = 0; i < attributes.length; i++) { - if( attributes[i].getId() == id ) - return attributes[i]; - } - return null; - } - - public Attribute[] getAttributes() { - return analogInputCluster.getAvailableAttributes(); - } - - - public String getDescription() throws ZigBeeDeviceException { - try { - return (String) analogInputCluster.getAttributeDescription().getValue(); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - public int getReliability() throws ZigBeeDeviceException { - try { - return (Integer) analogInputCluster.getAttributeReliability().getValue(); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - - public long getApplicationType() throws ZigBeeDeviceException { - try { - return (Long) analogInputCluster.getAttributeApplicationType().getValue(); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - - public boolean getOutOfService() throws ZigBeeDeviceException { - try { - return (Boolean) analogInputCluster.getAttributeOutOfService().getValue(); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - - public Float getPresentValue() throws ZigBeeDeviceException { - try { - return (Float) analogInputCluster.getAttributePresentValue().getValue(); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - - public int getStatusFlags() throws ZigBeeDeviceException { - try { - return (Integer) analogInputCluster.getAttributeStatusFlags().getValue(); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - - public Float getMaxPresentValue() throws ZigBeeDeviceException { - try { - return (Float) analogInputCluster.getAttributeMaxPresentValue().getValue(); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - - public Float getMinPresentValue() throws ZigBeeDeviceException { - try { - return (Float) analogInputCluster.getAttributeMinPresentValue().getValue(); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - - public float getResolution() throws ZigBeeDeviceException { - // TODO Auto-generated method stub - return 0; - } - - - public int getEngineeringUnits() throws ZigBeeDeviceException { - // TODO Auto-generated method stub - return 0; - } - - - - - - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/BasicImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/BasicImpl.java deleted file mode 100644 index eefc9b802702d..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/BasicImpl.java +++ /dev/null @@ -1,173 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.general.Basic; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.DefaultResponse; -import org.bubblecloud.zigbee.api.cluster.impl.general.BasicCluster; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Alessandro Giari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class BasicImpl implements Basic { - - private BasicCluster basicCluster; - private Attribute zclVersion; - private Attribute applicationVersion; - private Attribute stackVersion; - private Attribute hwVersion; - private Attribute manufacturerName; - private Attribute modelIdentifier; - private Attribute dateCode; - private Attribute powerSource; - private Attribute locationDescription; - private Attribute physicalEnviroment; - private Attribute deviceEnabled; - private Attribute alarmMask; - private Attribute disableLocalConfig; - - public BasicImpl(ZigBeeEndpoint zbDevice) { - basicCluster = new BasicCluster(zbDevice); - zclVersion = basicCluster.getAttributeZCLVersion(); - applicationVersion = basicCluster.getAttributeApplicationVersion(); - stackVersion = basicCluster.getAttributeStackVersion(); - hwVersion = basicCluster.getAttributeHWVersion(); - manufacturerName = basicCluster.getAttributeManufacturerName(); - modelIdentifier = basicCluster.getAttributeModelIdentifier(); - dateCode = basicCluster.getAttributeDateCode(); - powerSource = basicCluster.getPowerSource(); - locationDescription = basicCluster.getAttributeLocationDescription(); - physicalEnviroment = basicCluster.getAttributePhysicalEnvironment(); - deviceEnabled = basicCluster.getAttributeDeviceEnabled(); - alarmMask = basicCluster.getAttributeAlarmMask(); - disableLocalConfig = basicCluster.getAttributeDisableLocalConfig(); - } - - public Attribute getDisableLocalConfig() { - return disableLocalConfig; - } - - public Attribute getAlarmMask() { - return alarmMask; - } - - public Attribute getApplicationVersion() { - return applicationVersion; - } - - public Attribute getDateCode() { - return dateCode; - } - - public boolean getDeviceEnabled() throws ZigBeeDeviceException { - try { - Boolean value = (Boolean) deviceEnabled.getValue(); - return value.booleanValue(); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public Attribute getHWVersion() { - return hwVersion; - } - - public String getLocationDescription() throws ZigBeeDeviceException { - try { - String value = (String) locationDescription.getValue(); - return value; - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public Attribute getManufacturerName() { - return manufacturerName; - } - - public Attribute getModelIdentifier() { - return modelIdentifier; - } - - public Attribute getPhysicalEnvironment() { - return physicalEnviroment; - } - - public Attribute getPowerSource() { - return powerSource; - } - - public Attribute getStackVersion() { - return stackVersion; - } - - public Attribute getZCLVersion() { - return zclVersion; - } - - public void resetToFactoryDefault() throws ZigBeeDeviceException { - try { - DefaultResponse response = basicCluster.resetToFactoryDefault(); - if (!response.getStatus().equals(Status.SUCCESS)) - throw new ZigBeeDeviceException(response.getStatus().toString()); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public Reporter[] getAttributeReporters() { - return basicCluster.getAttributeReporters(); - } - - public int getId() { - return basicCluster.getId(); - } - - public String getName() { - return basicCluster.getName(); - } - - public Attribute getAttribute(int id) { - Attribute[] attributes = basicCluster.getAvailableAttributes(); - for (int i = 0; i < attributes.length; i++) { - if (attributes[i].getId() == id) - return attributes[i]; - } - return null; - } - - public Attribute[] getAttributes() { - return basicCluster.getAvailableAttributes(); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/BinaryInputImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/BinaryInputImpl.java deleted file mode 100755 index 6f4c457b6c781..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/BinaryInputImpl.java +++ /dev/null @@ -1,173 +0,0 @@ -/* - Copyright 2013-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.general.BinaryInput; -import org.bubblecloud.zigbee.api.cluster.general.event.PresentValueListener; -import org.bubblecloud.zigbee.api.cluster.impl.event.PresentValueBridgeListeners; -import org.bubblecloud.zigbee.api.ReportingConfiguration; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.general.BinaryInputCluster; - - -/** - * @author Han Alink - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.7.0 - */ -public class BinaryInputImpl implements BinaryInput { - - private final Attribute presentValue; - private final Attribute outOfService; - private final Attribute statusFlags; - private final BinaryInputCluster binaryInput; - private PresentValueBridgeListeners eventBridge; - - public BinaryInputImpl(ZigBeeEndpoint zbDevice) { - binaryInput = new BinaryInputCluster(zbDevice); - presentValue = binaryInput.getAttributePresentValue(); - outOfService = binaryInput.getAttributeOutOfService(); - statusFlags = binaryInput.getAttributeStatusFlags(); - eventBridge = new PresentValueBridgeListeners(new ReportingConfiguration(), presentValue, this); - } - - public boolean subscribe(PresentValueListener listener) { - return eventBridge.subscribe(listener); - } - - public boolean unsubscribe(PresentValueListener listener) { - return eventBridge.unsubscribe(listener); - } - - public Reporter[] getAttributeReporters() { - return binaryInput.getAttributeReporters(); - } - - public int getId() { - return binaryInput.getId(); - } - - public String getName() { - return binaryInput.getName(); - } - - public Attribute getAttribute(int id) { - Attribute[] attributes = binaryInput.getAvailableAttributes(); - for (int i = 0; i < attributes.length; i++) { - if (attributes[i].getId() == id) - return attributes[i]; - } - return null; - } - - public Attribute[] getAttributes() { - return binaryInput.getAvailableAttributes(); - } - - - public String getActiveText() throws ZigBeeDeviceException { - try { - return (String) binaryInput.getAttributeActiveText().getValue(); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - - public String getDescription() throws ZigBeeDeviceException { - try { - return (String) binaryInput.getAttributeDescription().getValue(); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - - public String getInactiveText() throws ZigBeeDeviceException { - try { - return (String) binaryInput.getAttributeInactiveText().getValue(); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - - public int getPolarity() throws ZigBeeDeviceException { - try { - return (Integer) binaryInput.getAttributePolarity().getValue(); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - - public int getReliability() throws ZigBeeDeviceException { - try { - return (Integer) binaryInput.getAttributeReliability().getValue(); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - - public long getApplicationType() throws ZigBeeDeviceException { - try { - return (Long) binaryInput.getAttributeApplicationType().getValue(); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - - public boolean getOutOfService() throws ZigBeeDeviceException { - try { - return (Boolean) binaryInput.getAttributeOutOfService().getValue(); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - - public boolean getPresentValue() throws ZigBeeDeviceException { - try { - return (Boolean) binaryInput.getAttributePresentValue().getValue(); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - - public int getStatusFlags() throws ZigBeeDeviceException { - try { - return (Integer) binaryInput.getAttributeStatusFlags().getValue(); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/ClusterMessageImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/ClusterMessageImpl.java deleted file mode 100644 index 76bc3666ea485..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/ClusterMessageImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl; - -import org.bubblecloud.zigbee.network.ClusterMessage; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLFrame; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ClusterMessageImpl implements ClusterMessage { - - private ZCLFrame frame; - private short id; - - public ClusterMessageImpl(short id, ZCLFrame frame) { - this.frame = frame; - this.id = id; - } - - public byte[] getClusterMsg() { - return frame.toByte(); - } - - public short getId() { - return id; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/ColorControlImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/ColorControlImpl.java deleted file mode 100644 index 8e7a582476be2..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/ColorControlImpl.java +++ /dev/null @@ -1,207 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.general.ColorControl; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.DefaultResponse; -import org.bubblecloud.zigbee.api.cluster.impl.general.ColorControlCluster; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; - -/** - * - * @author Giancarlo Riolo - * @version $LastChangedRevision: $ ($LastChangedDate: $) - * - */ -public class ColorControlImpl implements ColorControl { - - private ColorControlCluster colorControlCluster; - - - public ColorControlImpl(ZigBeeEndpoint zbDevice){ - colorControlCluster = new ColorControlCluster(zbDevice); - - } - - public int getId() { - - return colorControlCluster.getId(); - } - - public String getName() { - - return colorControlCluster.getName(); - } - - public Reporter[] getAttributeReporters() { - return colorControlCluster.getAttributeReporters(); - } - - public Attribute[] getAttributes() { - - return colorControlCluster.getAvailableAttributes(); - } - - public Attribute getAttribute(int id) { - Attribute[] attributes = colorControlCluster.getAvailableAttributes(); - for (int i = 0; i < attributes.length; i++) { - if( attributes[i].getId() == id ) - return attributes[i]; - } - return null; - } - - @Override - public void moveToHue(int hue, int direction, int transitionTime) throws ZigBeeDeviceException { - try { - DefaultResponse response = (DefaultResponse) colorControlCluster.moveToHue(hue, direction, transitionTime); - if (!response.getStatus().equals(Status.SUCCESS)) - throw new ZigBeeDeviceException(response.getStatus().toString()); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - @Override - public void moveHue(int moveMode, int rate) throws ZigBeeDeviceException { - try { - DefaultResponse response = (DefaultResponse) colorControlCluster.moveHue(moveMode, rate); - if (!response.getStatus().equals(Status.SUCCESS)) - throw new ZigBeeDeviceException(response.getStatus().toString()); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - @Override - public void stepHue(int stepMode, int stepSize, int transtionTime) throws ZigBeeDeviceException { - try { - DefaultResponse response = (DefaultResponse) colorControlCluster.stepHue(stepMode, stepSize, transtionTime); - if (!response.getStatus().equals(Status.SUCCESS)) - throw new ZigBeeDeviceException(response.getStatus().toString()); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - @Override - public void movetoSaturation(int saturation, int transitionTime) throws ZigBeeDeviceException { - try { - DefaultResponse response = (DefaultResponse) colorControlCluster.movetoSaturation(saturation, transitionTime); - if (!response.getStatus().equals(Status.SUCCESS)) - throw new ZigBeeDeviceException(response.getStatus().toString()); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - @Override - public void moveSaturation(int moveMode, int rate) throws ZigBeeDeviceException { - try { - DefaultResponse response = (DefaultResponse) colorControlCluster.moveSaturation(moveMode, rate); - if (!response.getStatus().equals(Status.SUCCESS)) - throw new ZigBeeDeviceException(response.getStatus().toString()); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - @Override - public void stepSaturation(int stepMode, int stepSize, int transitionTime) throws ZigBeeDeviceException { - try { - DefaultResponse response = (DefaultResponse) colorControlCluster.stepSaturation( - stepMode, stepSize, transitionTime); - if (!response.getStatus().equals(Status.SUCCESS)) - throw new ZigBeeDeviceException(response.getStatus().toString()); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - @Override - public void moveToHueAndSaturation(int hue, int saturation, int transitionTime) throws ZigBeeDeviceException { - try { - DefaultResponse response = (DefaultResponse) colorControlCluster.moveToHueAndSaturation( - hue, saturation, transitionTime); - if (!response.getStatus().equals(Status.SUCCESS)) - throw new ZigBeeDeviceException(response.getStatus().toString()); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - @Override - public void moveToColor(int colorX, int colorY, int transitionTime) throws ZigBeeDeviceException { - try { - DefaultResponse response = (DefaultResponse) colorControlCluster.moveToColor( - colorX, colorY, transitionTime); - if (!response.getStatus().equals(Status.SUCCESS)) - throw new ZigBeeDeviceException(response.getStatus().toString()); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - @Override - public void moveColor(int rateX, int rateY) throws ZigBeeDeviceException { - try { - DefaultResponse response = (DefaultResponse) colorControlCluster.moveColor( - rateX, rateY); - if (!response.getStatus().equals(Status.SUCCESS)) - throw new ZigBeeDeviceException(response.getStatus().toString()); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - @Override - public void stepColor(int stepX, int stepY, int transitionTime) throws ZigBeeDeviceException { - try { - DefaultResponse response = (DefaultResponse) colorControlCluster.stepColor( - stepX, stepY, transitionTime); - if (!response.getStatus().equals(Status.SUCCESS)) - throw new ZigBeeDeviceException(response.getStatus().toString()); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - @Override - public void moveToColorTemperature(int colorTemperature, int transitionTime) throws ZigBeeDeviceException { - try { - DefaultResponse response = (DefaultResponse) colorControlCluster.moveToColorTemperature( - colorTemperature, transitionTime); - if (!response.getStatus().equals(Status.SUCCESS)) - throw new ZigBeeDeviceException(response.getStatus().toString()); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/CommissioningImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/CommissioningImpl.java deleted file mode 100755 index a0463e3b2ee15..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/CommissioningImpl.java +++ /dev/null @@ -1,337 +0,0 @@ -/* - Copyright 2013-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl; - -import org.bubblecloud.zigbee.api.cluster.general.Commissioning; -import org.bubblecloud.zigbee.api.cluster.general.NetworkKeyType; -import org.bubblecloud.zigbee.api.cluster.general.StartupControl; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; - -/** - * PLACEHOLDER TO IMPLEMENT - * - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.7.0 - */ -public class CommissioningImpl implements Commissioning { - - public int getId() { - // TODO Auto-generated method stub - return 0; - } - - public String getName() { - // TODO Auto-generated method stub - return null; - } - - public Reporter[] getAttributeReporters() { - // TODO Auto-generated method stub - return null; - } - - public Attribute[] getAttributes() { - // TODO Auto-generated method stub - return null; - } - - public Attribute getAttribute(int id) { - // TODO Auto-generated method stub - return null; - } - - public int getShortAddress() { - // TODO Auto-generated method stub - return 0; - } - - public void setShortAddress(int shortAddress) { - // TODO Auto-generated method stub - - } - - public long getExtendedPANId() { - // TODO Auto-generated method stub - return 0; - } - - public void setExtendedPANId(long extendedPANId) { - // TODO Auto-generated method stub - - } - - public int getPANId() { - // TODO Auto-generated method stub - return 0; - } - - public void setPANId(int PANId) { - // TODO Auto-generated method stub - - } - - public int getChannelmask() { - // TODO Auto-generated method stub - return 0; - } - - public void setChannelmask(int channelMask) { - // TODO Auto-generated method stub - - } - - public int getProtocolVersion() { - // TODO Auto-generated method stub - return 0; - } - - public void setProtocolVersion(int protocolVersion) { - // TODO Auto-generated method stub - - } - - public int getStackProfile() { - // TODO Auto-generated method stub - return 0; - } - - public void setStackProfile(int stackProfile) { - // TODO Auto-generated method stub - - } - - public StartupControl getStartupControl() { - // TODO Auto-generated method stub - return null; - } - - public void setStartupControl(StartupControl startupControl) { - // TODO Auto-generated method stub - - } - - public long getTrustCenterAddress() { - // TODO Auto-generated method stub - return 0; - } - - public void setTrustCenterAddress(long trustCenterAddress) { - // TODO Auto-generated method stub - - } - - public byte[] getTrustCenterMasterKey() { - // TODO Auto-generated method stub - return null; - } - - public void setTrustCenterMasterKey(byte[] trustCenterMasterKey) { - // TODO Auto-generated method stub - - } - - public byte[] getNetworkKey() { - // TODO Auto-generated method stub - return null; - } - - public void setNetworkKey(byte[] networkKey) { - // TODO Auto-generated method stub - - } - - public boolean isUseInsecureJoin() { - // TODO Auto-generated method stub - return false; - } - - public void setUseInsecureJoin(boolean useInsecureJoin) { - // TODO Auto-generated method stub - - } - - public byte[] getPreconfiguredLinkKey() { - // TODO Auto-generated method stub - return null; - } - - public void setPreconfiguredLinkKey(byte[] preconfiguredLinkKey) { - // TODO Auto-generated method stub - - } - - public int getNetworkKeySeqNum() { - // TODO Auto-generated method stub - return 0; - } - - public void setNetworkKeySeqNum(int networkKeySeqNum) { - // TODO Auto-generated method stub - - } - - public NetworkKeyType getNetworkKeyType() { - // TODO Auto-generated method stub - return null; - } - - public void setNetworkKeyType(NetworkKeyType networkKeyType) { - // TODO Auto-generated method stub - - } - - public int getNetworkManagerAddress() { - // TODO Auto-generated method stub - return 0; - } - - public void setNetworkManagerAddress(int networkManagerAddress) { - // TODO Auto-generated method stub - - } - - public int getScanAttempts() { - // TODO Auto-generated method stub - return 0; - } - - public void setScanAttempts(int scanAttempts) { - // TODO Auto-generated method stub - - } - - public int getTimeBetweenScans() { - // TODO Auto-generated method stub - return 0; - } - - public void setTimeBetweenScans(int timeBetweenScans) { - // TODO Auto-generated method stub - - } - - public int getRejoinInterval() { - // TODO Auto-generated method stub - return 0; - } - - public void setRejoinInterval(int rejoinInterval) { - // TODO Auto-generated method stub - - } - - public int getMaxRejoinInterval() { - // TODO Auto-generated method stub - return 0; - } - - public void setMaxRejoinInterval(int maxRejoinInterval) { - // TODO Auto-generated method stub - - } - - public int getIndirectPollRate() { - // TODO Auto-generated method stub - return 0; - } - - public void setIndirectPollRate(int indirectPollRate) { - // TODO Auto-generated method stub - - } - - public int getParentRetryThreshold() { - // TODO Auto-generated method stub - return 0; - } - - public void setParentRetryThreshold(int parentRetryThreshold) { - // TODO Auto-generated method stub - - } - - public boolean isConcentratorFlag() { - // TODO Auto-generated method stub - return false; - } - - public void setConcentratorFlag(boolean concentratorFlag) { - // TODO Auto-generated method stub - - } - - public int getConcentratorRadius() { - // TODO Auto-generated method stub - return 0; - } - - public void setConcentratorRadius(int concentratorRadius) { - // TODO Auto-generated method stub - - } - - public int getConcentratorDiscoveryTime() { - // TODO Auto-generated method stub - return 0; - } - - public void setConcentratorDiscoveryTime(int concentratorDiscoveryTime) { - // TODO Auto-generated method stub - - } - - public Status restartDevice(StartupControl mode, boolean immediate, - int delay, int jitter) { - // TODO Auto-generated method stub - return null; - } - - public Status saveStartupParameters(int index) { - // TODO Auto-generated method stub - return null; - } - - public Status restoreStartupParameters(int index) { - // TODO Auto-generated method stub - return null; - } - - public Status resetStartupParameter(int index) { - // TODO Auto-generated method stub - return null; - } - - public Status resetCurrentStartupParameters() { - // TODO Auto-generated method stub - return null; - } - - public Status resetAllStartupParameters() { - // TODO Auto-generated method stub - return null; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/DeviceTemperatureConfigurationImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/DeviceTemperatureConfigurationImpl.java deleted file mode 100644 index 3f299bd373311..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/DeviceTemperatureConfigurationImpl.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.general.DeviceTemperatureConfiguration; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.general.DeviceTemperatureConfigurationCluster; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.4.0 - */ -public class DeviceTemperatureConfigurationImpl implements DeviceTemperatureConfiguration { - - private final DeviceTemperatureConfigurationCluster cluster; - private final Attribute currentTemperature; - private final Attribute deviceTemperature; - private final Attribute highTemperature; - private final Attribute highTemperatureThreshold; - private final Attribute lowTemperature; - private final Attribute lowTemperatureThreshold; - private final Attribute maxTemperature; - private final Attribute minTemperature; - private final Attribute overTemperature; - - public DeviceTemperatureConfigurationImpl(ZigBeeEndpoint zbDevice) { - cluster = new DeviceTemperatureConfigurationCluster(zbDevice); - currentTemperature = cluster.getAttributeCurrentTemperature(); - deviceTemperature = cluster.getAttributeDeviceTempAlarmMask(); - highTemperature = cluster.getAttributeHighTempDwellTripPoint(); - highTemperatureThreshold = cluster.getAttributeHighTempThreshold(); - lowTemperature = cluster.getAttributeLowTempDwellTripPoint(); - lowTemperatureThreshold = cluster.getAttributeLowTempThreshold(); - maxTemperature = cluster.getAttributeMaxTempExperienced(); - minTemperature = cluster.getAttributeMinTempExperienced(); - overTemperature = cluster.getAttributeOverTempTotalDwell(); - } - - public Reporter[] getAttributeReporters() { - return cluster.getAttributeReporters(); - } - - public int getId() { - return cluster.getId(); - } - - public String getName() { - return cluster.getName(); - } - - public Attribute getAttribute(int id) { - Attribute[] attributes = cluster.getAvailableAttributes(); - for (int i = 0; i < attributes.length; i++) { - if (attributes[i].getId() == id) - return attributes[i]; - } - return null; - } - - public Attribute[] getAttributes() { - return cluster.getAvailableAttributes(); - } - - public Attribute getCurrentTemperature() { - return currentTemperature; - } - - public Attribute getDeviceTempAlarmMask() { - return deviceTemperature; - } - - public Attribute getHighTempDwellTripPoint() { - return highTemperature; - } - - public Attribute getHighTempThreshold() { - return highTemperatureThreshold; - } - - public Attribute getLowTempDwellTripPoint() { - return lowTemperature; - } - - public Attribute getLowTempThreshold() { - return lowTemperatureThreshold; - } - - public Attribute getMaxTempExperienced() { - return maxTemperature; - } - - public Attribute getMinTempExperienced() { - return minTemperature; - } - - public Attribute getOverTempTotalDwell() { - return overTemperature; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/DoorLockImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/DoorLockImpl.java deleted file mode 100644 index 319fd86e763b3..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/DoorLockImpl.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl; - - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.general.DoorLock; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.general.DoorLockCluster; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; - -/** - * - * @author Giancarlo Riolo - * @version $LastChangedRevision: $ ($LastChangedDate: $) - * - */ - -public class DoorLockImpl implements DoorLock { - - private DoorLockCluster doorLockCluster; - - - public DoorLockImpl(ZigBeeEndpoint zbDevice){ - doorLockCluster = new DoorLockCluster(zbDevice); - - } - - public int getId() { - - return doorLockCluster.getId(); - } - - public String getName() { - - return doorLockCluster.getName(); - } - - public Reporter[] getAttributeReporters() { - return doorLockCluster.getAttributeReporters(); - } - - public Attribute[] getAttributes() { - - return doorLockCluster.getAvailableAttributes(); - } - - public Attribute getAttribute(int id) { - Attribute[] attributes = doorLockCluster.getAvailableAttributes(); - for (int i = 0; i < attributes.length; i++) { - if( attributes[i].getId() == id ) - return attributes[i]; - } - return null; - } - - public String getDescription() throws ZigBeeDeviceException { - try { - return (String) doorLockCluster.getAttributeDescription().getValue(); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/FanControlImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/FanControlImpl.java deleted file mode 100644 index aeec6ae1b5c0a..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/FanControlImpl.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.general.FanControl; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.general.FanControlCluster; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; - -/** - * - * @author Giancarlo Riolo - * @version $LastChangedRevision: $ ($LastChangedDate: $) - * - */ -public class FanControlImpl implements FanControl { - - private FanControlCluster fanControlCluster; - - - public FanControlImpl(ZigBeeEndpoint zbDevice){ - fanControlCluster = new FanControlCluster(zbDevice); - - } - - public int getId() { - - return fanControlCluster.getId(); - } - - public String getName() { - - return fanControlCluster.getName(); - } - - public Reporter[] getAttributeReporters() { - return fanControlCluster.getAttributeReporters(); - } - - public Attribute[] getAttributes() { - - return fanControlCluster.getAvailableAttributes(); - } - - public Attribute getAttribute(int id) { - Attribute[] attributes = fanControlCluster.getAvailableAttributes(); - for (int i = 0; i < attributes.length; i++) { - if( attributes[i].getId() == id ) - return attributes[i]; - } - return null; - } - - public String getDescription() throws ZigBeeDeviceException { - try { - return (String) fanControlCluster.getAttributeDescription().getValue(); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/FlowMeasurementImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/FlowMeasurementImpl.java deleted file mode 100644 index d3884f8a2653f..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/FlowMeasurementImpl.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.general.FlowMeasurement; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.general.FlowMeasurementCluster; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; - -/** - * - * @author Giancarlo Riolo - * @version $LastChangedRevision: $ ($LastChangedDate: $) - * - */ -public class FlowMeasurementImpl implements FlowMeasurement { - - private FlowMeasurementCluster flowMeasurementCluster; - - - public FlowMeasurementImpl(ZigBeeEndpoint zbDevice){ - flowMeasurementCluster = new FlowMeasurementCluster(zbDevice); - - } - - public int getId() { - - return flowMeasurementCluster.getId(); - } - - public String getName() { - - return flowMeasurementCluster.getName(); - } - - public Reporter[] getAttributeReporters() { - return flowMeasurementCluster.getAttributeReporters(); - } - - public Attribute[] getAttributes() { - - return flowMeasurementCluster.getAvailableAttributes(); - } - - public Attribute getAttribute(int id) { - Attribute[] attributes = flowMeasurementCluster.getAvailableAttributes(); - for (int i = 0; i < attributes.length; i++) { - if( attributes[i].getId() == id ) - return attributes[i]; - } - return null; - } - - public String getDescription() throws ZigBeeDeviceException { - try { - return (String) flowMeasurementCluster.getAttributeDescription().getValue(); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - - - -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/GroupsImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/GroupsImpl.java deleted file mode 100644 index 1168092b26771..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/GroupsImpl.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl; - -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.general.Groups; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.groups.AddGroupResponse; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.groups.GetGroupMembershipResponse; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.groups.RemoveGroupResponse; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.groups.ViewGroupResponse; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.DefaultResponse; -import org.bubblecloud.zigbee.api.cluster.impl.general.GroupsCluster; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Alessandro Giari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class GroupsImpl implements Groups { - - private GroupsCluster groupCluster; - private Attribute nameSupport; - - public GroupsImpl(ZigBeeEndpoint zbDevice) { - groupCluster = new GroupsCluster(zbDevice); - nameSupport = groupCluster.getAttributeNameSupport(); - } - - public AddGroupResponse addGroup(int groupId, String name) throws ZigBeeDeviceException { - try { - AddGroupResponse response = (AddGroupResponse) groupCluster.addGroup(groupId, name); - return response; - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public void addGroupIfIdentifying(int groupId, String name) throws ZigBeeDeviceException { - try { - DefaultResponse response = (DefaultResponse) groupCluster.addGroupIfIdentifying(groupId, name); - if (!response.getStatus().equals(Status.SUCCESS)) - throw new ZigBeeDeviceException(response.getStatus().toString()); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - - } - - public GetGroupMembershipResponse getGroupMembership(int[] groupList) throws ZigBeeDeviceException { - try { - GetGroupMembershipResponse response = (GetGroupMembershipResponse) groupCluster.getGroupMembership(groupList); - return response; - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public Attribute getNameSupport() { - return nameSupport; - } - - public void removeAllGroup() throws ZigBeeDeviceException { - try { - DefaultResponse response = (DefaultResponse) groupCluster.removeAllGroup(); - if (!response.getStatus().equals(Status.SUCCESS)) - throw new ZigBeeDeviceException(response.getStatus().toString()); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public RemoveGroupResponse removeGroup(int groupId) throws ZigBeeDeviceException { - try { - RemoveGroupResponse response = (RemoveGroupResponse) groupCluster.removeGroup(groupId); - return response; - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public ViewGroupResponse viewGroup(int groupId) throws ZigBeeDeviceException { - try { - ViewGroupResponse response = (ViewGroupResponse) groupCluster.viewGroup(groupId); - return response; - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public Reporter[] getAttributeReporters() { - return groupCluster.getAttributeReporters(); - } - - public int getId() { - return groupCluster.getId(); - } - - public String getName() { - return groupCluster.getName(); - } - - public Attribute getAttribute(int id) { - Attribute[] attributes = groupCluster.getAvailableAttributes(); - for (int i = 0; i < attributes.length; i++) { - if (attributes[i].getId() == id) - return attributes[i]; - } - return null; - } - - public Attribute[] getAttributes() { - return groupCluster.getAvailableAttributes(); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/IASACEImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/IASACEImpl.java deleted file mode 100644 index b89b77fa38f50..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/IASACEImpl.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.security_safety.IASACE; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_ace.BypassPayload; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_ace.ZoneIDMapResponse; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_ace.ZoneInformationResponse; -import org.bubblecloud.zigbee.api.cluster.impl.security_safety.IASACECluster; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.7.0 - */ -public class IASACEImpl implements IASACE { - - private final IASACECluster cluster; - - public IASACEImpl(ZigBeeEndpoint zbDevice) { - cluster = new IASACECluster(zbDevice); - } - - public int getId() { - return cluster.getId(); - } - - public String getName() { - return cluster.getName(); - } - - public Reporter[] getAttributeReporters() { - return cluster.getAttributeReporters(); - } - - public Attribute[] getAttributes() { - return cluster.getAvailableAttributes(); - } - - public Attribute getAttribute(int id) { - Attribute[] attributes = cluster.getAvailableAttributes(); - for (int i = 0; i < attributes.length; i++) { - if (attributes[i].getId() == id) - return attributes[i]; - } - return null; - } - - public Response arm(byte armMode) throws ZigBeeDeviceException { - try { - Response response = (Response) cluster.arm(armMode); - return response; - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public void bypass(BypassPayload payload) throws ZigBeeDeviceException { - try { - cluster.bypass(payload); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public void emergency() throws ZigBeeDeviceException { - try { - cluster.emergency(); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public void fire() throws ZigBeeDeviceException { - try { - cluster.fire(); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public void panic() throws ZigBeeDeviceException { - try { - cluster.panic(); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public ZoneIDMapResponse getZoneIdMap() throws ZigBeeDeviceException { - try { - ZoneIDMapResponse response = (ZoneIDMapResponse) cluster.getZoneIdMap(); - return response; - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public ZoneInformationResponse getZoneInformation(int zoneID) throws ZigBeeDeviceException { - try { - ZoneInformationResponse response = (ZoneInformationResponse) cluster.getZoneInformation(zoneID); - return response; - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/IASWDImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/IASWDImpl.java deleted file mode 100644 index fb73b80520146..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/IASWDImpl.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.security_safety.IASWD; -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_wd.SquawkPayload; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_wd.StartWarningPayload; -import org.bubblecloud.zigbee.api.cluster.impl.security_safety.IASWDCluster; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.7.0 - */ -public class IASWDImpl implements IASWD { - - private final IASWDCluster iaswdcluster; - private final Attribute maxDuration; - - public IASWDImpl(ZigBeeEndpoint zbDevice) { - - iaswdcluster = new IASWDCluster(zbDevice); - maxDuration = iaswdcluster.getAttributeMaxDuration(); - } - - public int getId() { - return iaswdcluster.getId(); - } - - public String getName() { - return iaswdcluster.getName(); - } - - public Reporter[] getAttributeReporters() { - return iaswdcluster.getAttributeReporters(); - } - - public Attribute[] getAttributes() { - return iaswdcluster.getAvailableAttributes(); - } - - public Attribute getAttribute(int id) { - Attribute[] attributes = iaswdcluster.getAvailableAttributes(); - for (int i = 0; i < attributes.length; i++) { - if (attributes[i].getId() == id) - return attributes[i]; - } - return null; - } - - public Attribute getMaxDuration() { - return maxDuration; - } - - public void startWarning(StartWarningPayload payload) throws ZigBeeDeviceException { - try { - iaswdcluster.startWarning(payload); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public void squawk(SquawkPayload payload) throws ZigBeeDeviceException { - try { - iaswdcluster.squawk(payload); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/IASZoneImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/IASZoneImpl.java deleted file mode 100644 index bde300349d135..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/IASZoneImpl.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.security_safety.IASZone; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.alarms.GetAlarmResponse; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.DefaultResponse; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_zone.ZoneEnrollRequestPayload; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_zone.ZoneEnrollResponse; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_zone.ZoneStatusChangeNotificationListener; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_zone.ZoneStatusChangeNotificationPayload; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_zone.ZoneStatusChangeNotificationResponse; -import org.bubblecloud.zigbee.api.cluster.impl.security_safety.IASZoneCluster; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.7.0 - */ -public class IASZoneImpl implements IASZone { - - private final IASZoneCluster cluster; - - private final Attribute zoneState; - private final Attribute zoneType; - private final Attribute zoneStatus; - private final Attribute iasCIEaddress; - - public IASZoneImpl(ZigBeeEndpoint zbDevice) { - - cluster = new IASZoneCluster(zbDevice); - zoneState = cluster.getAttributeZoneState(); - zoneType = cluster.getAttributeZoneType(); - zoneStatus = cluster.getAttributeZoneStatus(); - iasCIEaddress = cluster.getAttributeIASCIEAddress(); - } - - public int getId() { - return cluster.getId(); - } - - public String getName() { - return cluster.getName(); - } - - public Reporter[] getAttributeReporters() { - return cluster.getAttributeReporters(); - } - - public Attribute[] getAttributes() { - return cluster.getAvailableAttributes(); - } - - public Attribute getAttribute(int id) { - - Attribute[] attributes = cluster.getAvailableAttributes(); - for (int i = 0; i < attributes.length; i++) { - if (attributes[i].getId() == id) - return attributes[i]; - } - return null; - } - - public Attribute getZoneState() { - - return zoneState; - } - - public Attribute getZoneType() { - - return zoneType; - } - - public Attribute getZoneStatus() { - - return zoneStatus; - } - - public Attribute getIASCIEAddress() { - - return iasCIEaddress; - } - - public ZoneEnrollResponse zoneEnrollRequest(ZoneEnrollRequestPayload payload) throws ZigBeeDeviceException { - - try { - ZoneEnrollResponse response = (ZoneEnrollResponse) cluster.zoneEnrollRequest(payload); - return response; - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public Response zoneStatusChangeNotification(ZoneStatusChangeNotificationPayload payload) throws ZigBeeDeviceException { - try { - Response response = cluster.zoneStatusChangeNotification(payload); - if (response.getZCLHeader().getCommandId() != ZoneStatusChangeNotificationResponse.ID) - throw new ZigBeeDeviceException(((DefaultResponse) response).getStatus().toString()); - - return (GetAlarmResponse) response; - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - - /*try { - cluster.zoneStatusChangeNotification(); - } - catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - }*/ - } - - public boolean addZoneStatusChangeNotificationListener(ZoneStatusChangeNotificationListener listener) { - return cluster.addZoneStatusChangeNotificationListener(listener); - } - - public boolean removeZoneStatusChangeNotificationListener(ZoneStatusChangeNotificationListener listener) { - return cluster.removeZoneStatusChangeNotificationListener(listener); - } -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/IdentifyImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/IdentifyImpl.java deleted file mode 100644 index b83a98c97b6d2..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/IdentifyImpl.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl; - -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.general.Identify; -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.identify.IdentifyQueryResponse; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.DefaultResponse; -import org.bubblecloud.zigbee.api.cluster.impl.general.IdentifyCluster; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Alessandro Giari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class IdentifyImpl implements Identify { - - private IdentifyCluster identifyCluster; - private Attribute identifyTime; - - - public IdentifyImpl(ZigBeeEndpoint zbDevice) { - identifyCluster = new IdentifyCluster(zbDevice); - - } - - public int IdentifyQuery() throws ZigBeeDeviceException { - try { - IdentifyQueryResponse response = (IdentifyQueryResponse) identifyCluster.identifyQuery(); - return response.getTimeout(); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public int getIdentifyTime() throws ZigBeeDeviceException { - try { - return (Integer) identifyTime.getValue(); - - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public void identify(int time) throws ZigBeeDeviceException { - try { - DefaultResponse response = (DefaultResponse) identifyCluster.identify(time); - if (!response.getStatus().equals(Status.SUCCESS)) - throw new ZigBeeDeviceException(response.getStatus().toString()); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public Reporter[] getAttributeReporters() { - return identifyCluster.getAttributeReporters(); - } - - public int getId() { - return identifyCluster.getId(); - } - - public String getName() { - return identifyCluster.getName(); - } - - public Attribute getAttribute(int id) { - Attribute[] attributes = identifyCluster.getAvailableAttributes(); - for (int i = 0; i < attributes.length; i++) { - if (attributes[i].getId() == id) - return attributes[i]; - } - return null; - } - - public Attribute[] getAttributes() { - return identifyCluster.getAvailableAttributes(); - } - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/IlluminanceLevelSensingImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/IlluminanceLevelSensingImpl.java deleted file mode 100644 index c84c36f261911..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/IlluminanceLevelSensingImpl.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl; - - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.general.IlluminanceLevelSensing; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.general.IlluminanceLevelSensingCluster; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; - -/** - * - * @author Giancarlo Riolo - * @version $LastChangedRevision: $ ($LastChangedDate: $) - * - */ -public class IlluminanceLevelSensingImpl implements IlluminanceLevelSensing { - - private IlluminanceLevelSensingCluster illuminanceLevelSensingCluster; - - - public IlluminanceLevelSensingImpl(ZigBeeEndpoint zbDevice){ - illuminanceLevelSensingCluster = new IlluminanceLevelSensingCluster(zbDevice); - - } - - public int getId() { - - return illuminanceLevelSensingCluster.getId(); - } - - public String getName() { - - return illuminanceLevelSensingCluster.getName(); - } - - public Reporter[] getAttributeReporters() { - return illuminanceLevelSensingCluster.getAttributeReporters(); - } - - public Attribute[] getAttributes() { - - return illuminanceLevelSensingCluster.getAvailableAttributes(); - } - - public Attribute getAttribute(int id) { - Attribute[] attributes = illuminanceLevelSensingCluster.getAvailableAttributes(); - for (int i = 0; i < attributes.length; i++) { - if( attributes[i].getId() == id ) - return attributes[i]; - } - return null; - } - - public String getDescription() throws ZigBeeDeviceException { - try { - return (String) illuminanceLevelSensingCluster.getAttributeDescription().getValue(); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - - - -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/IlluminanceMeasurementImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/IlluminanceMeasurementImpl.java deleted file mode 100644 index 6c9247e1c58e7..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/IlluminanceMeasurementImpl.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.IlluminanceMeasurement; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.event.MeasuredValueListener; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.event.ToleranceListener; -import org.bubblecloud.zigbee.api.cluster.impl.event.MeasuredValueBridgeListeners; -import org.bubblecloud.zigbee.api.cluster.impl.event.ToleranceBridgeListeners; -import org.bubblecloud.zigbee.api.ReportingConfiguration; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.measureament_sensing.IlluminanceMeasurementCluster; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.7.0 - */ -public class IlluminanceMeasurementImpl implements IlluminanceMeasurement { - - private final IlluminanceMeasurementCluster cluster; - - private final Attribute measuredValue; - private final Attribute minMeasuredValue; - private final Attribute maxMeasuredValue; - private final Attribute tolerance; - private final Attribute lightSensorType; - - private final MeasuredValueBridgeListeners measureBridge; - private final ToleranceBridgeListeners toleranceBridge; - //private final ToleranceBridgeListeners toleranceBridge; - - public IlluminanceMeasurementImpl(ZigBeeEndpoint zbDevice) { - - cluster = new IlluminanceMeasurementCluster(zbDevice); - measuredValue = cluster.getMeasuredValue(); - minMeasuredValue = cluster.getMinMeasuredValue(); - maxMeasuredValue = cluster.getMaxMeasuredValue(); - tolerance = cluster.getTolerance(); - lightSensorType = cluster.getLightSensorType(); - - toleranceBridge = new ToleranceBridgeListeners(new ReportingConfiguration(), tolerance, this); - measureBridge = new MeasuredValueBridgeListeners(new ReportingConfiguration(), measuredValue, this); - } - - public int getId() { - - return cluster.getId(); - } - - public String getName() { - - return cluster.getName(); - } - - public Reporter[] getAttributeReporters() { - - return cluster.getAttributeReporters(); - } - - public Attribute[] getAttributes() { - - return cluster.getAvailableAttributes(); - } - - public Attribute getAttribute(int id) { - - Attribute[] attributes = cluster.getAvailableAttributes(); - for (int i = 0; i < attributes.length; i++) { - if (attributes[i].getId() == id) - return attributes[i]; - } - return null; - } - - public Attribute getMeasuredValue() { - - return measuredValue; - } - - public Attribute getMinMeasuredValue() { - - return minMeasuredValue; - } - - public Attribute getMaxMeasuredValue() { - - return maxMeasuredValue; - } - - public Attribute getTolerance() { - - return tolerance; - } - - public Attribute getLightSensorType() { - - return lightSensorType; - } - - public boolean subscribe(MeasuredValueListener tl) { - - return measureBridge.subscribe(tl); - } - - public boolean unsubscribe(MeasuredValueListener tl) { - - return measureBridge.unsubscribe(tl); - } - - public boolean subscribe(ToleranceListener tl) { - - return toleranceBridge.subscribe(tl); - } - - public boolean unsubscribe(ToleranceListener tl) { - - return toleranceBridge.unsubscribe(tl); - } -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/LevelControlImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/LevelControlImpl.java deleted file mode 100644 index 22466434e7420..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/LevelControlImpl.java +++ /dev/null @@ -1,195 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.general.LevelControl; -import org.bubblecloud.zigbee.api.cluster.general.event.CurrentLevelListener; -import org.bubblecloud.zigbee.api.cluster.impl.event.CurrentLevelBridgeListeners; -import org.bubblecloud.zigbee.api.ReportingConfiguration; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.DefaultResponse; -import org.bubblecloud.zigbee.api.cluster.impl.general.LevelControlCluster; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class LevelControlImpl implements LevelControl { - - private LevelControlCluster levelControlCluster; - private Attribute currentLevel; - private Attribute remainingTime; - private Attribute onOffTransitionTime; - private Attribute onLevel; - private final CurrentLevelBridgeListeners eventBridge; - - public LevelControlImpl(ZigBeeEndpoint zbDevice) { - levelControlCluster = new LevelControlCluster(zbDevice); - currentLevel = levelControlCluster.getAttributeCurrentLevel(); - remainingTime = levelControlCluster.getAttributeRemainingTime(); - onOffTransitionTime = levelControlCluster.getAttributeOnOffTransitionTime(); - onLevel = levelControlCluster.getAttributeOnLevel(); - eventBridge = new CurrentLevelBridgeListeners(new ReportingConfiguration(), currentLevel, this); - } - - - public Attribute getCurrentLevel() { - return currentLevel; - } - - public Attribute getOnLevel() { - return onLevel; - } - - public Attribute getOnOffTransitionTime() { - return onOffTransitionTime; - } - - public Attribute getRemainingTime() { - return remainingTime; - } - - public void move(byte mode, short rate) throws ZigBeeDeviceException { - try { - DefaultResponse response = (DefaultResponse) levelControlCluster.move(mode, rate); - if (!response.getStatus().equals(Status.SUCCESS)) - throw new ZigBeeDeviceException(response.getStatus().toString()); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public void moveWithOnOff(byte mode, short rate) throws ZigBeeDeviceException { - try { - DefaultResponse response = (DefaultResponse) levelControlCluster.moveWithOnOff(mode, rate); - if (!response.getStatus().equals(Status.SUCCESS)) - throw new ZigBeeDeviceException(response.getStatus().toString()); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - - public void moveToLevel(short level, int time) throws ZigBeeDeviceException { - try { - DefaultResponse response = (DefaultResponse) levelControlCluster.moveToLevel(level, time); - if (!response.getStatus().equals(Status.SUCCESS)) - throw new ZigBeeDeviceException(response.getStatus().toString()); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public void moveToLevelWithOnOff(short level, int time) throws ZigBeeDeviceException { - try { - DefaultResponse response = (DefaultResponse) levelControlCluster.moveToLevelWithOnOff(level, time); - if (!response.getStatus().equals(Status.SUCCESS)) - throw new ZigBeeDeviceException(response.getStatus().toString()); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public void step(byte mode, short step, int time) throws ZigBeeDeviceException { - try { - DefaultResponse response = (DefaultResponse) levelControlCluster.step(mode, step, time); - if (!response.getStatus().equals(Status.SUCCESS)) - throw new ZigBeeDeviceException(response.getStatus().toString()); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public void stepWithOnOff(byte mode, short step, int time) throws ZigBeeDeviceException { - try { - DefaultResponse response = (DefaultResponse) levelControlCluster.stepWithOnOff(mode, step, time); - if (!response.getStatus().equals(Status.SUCCESS)) - throw new ZigBeeDeviceException(response.getStatus().toString()); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - - public void stop() throws ZigBeeDeviceException { - try { - DefaultResponse response = (DefaultResponse) levelControlCluster.stop(); - if (!response.getStatus().equals(Status.SUCCESS)) - throw new ZigBeeDeviceException(response.getStatus().toString()); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public void stopWithOnOff() throws ZigBeeDeviceException { - try { - DefaultResponse response = (DefaultResponse) levelControlCluster.stopWithOnOff(); - if (!response.getStatus().equals(Status.SUCCESS)) - throw new ZigBeeDeviceException(response.getStatus().toString()); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - - public Reporter[] getAttributeReporters() { - return levelControlCluster.getAttributeReporters(); - } - - public int getId() { - return levelControlCluster.getId(); - } - - public String getName() { - return levelControlCluster.getName(); - } - - public Attribute getAttribute(int id) { - Attribute[] attributes = levelControlCluster.getAvailableAttributes(); - for (int i = 0; i < attributes.length; i++) { - if (attributes[i].getId() == id) - return attributes[i]; - } - return null; - } - - public Attribute[] getAttributes() { - return levelControlCluster.getAvailableAttributes(); - } - - - public boolean subscribe(CurrentLevelListener listener) { - return eventBridge.subscribe(listener); - } - - public boolean unsubscribe(CurrentLevelListener listener) { - return eventBridge.unsubscribe(listener); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/MeteringImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/MeteringImpl.java deleted file mode 100644 index 187021b1e76e6..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/MeteringImpl.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl; - - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.general.Metering; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.general.MeteringCluster; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; - -/** - * - * @author Giancarlo Riolo - * @version $LastChangedRevision: $ ($LastChangedDate: $) - * - */ - -public class MeteringImpl implements Metering { - - private MeteringCluster meteringCluster; - - - public MeteringImpl(ZigBeeEndpoint zbDevice){ - meteringCluster = new MeteringCluster(zbDevice); - - } - - public int getId() { - - return meteringCluster.getId(); - } - - public String getName() { - - return meteringCluster.getName(); - } - - public Reporter[] getAttributeReporters() { - return meteringCluster.getAttributeReporters(); - } - - public Attribute[] getAttributes() { - - return meteringCluster.getAvailableAttributes(); - } - - public Attribute getAttribute(int id) { - Attribute[] attributes = meteringCluster.getAvailableAttributes(); - for (int i = 0; i < attributes.length; i++) { - if( attributes[i].getId() == id ) - return attributes[i]; - } - return null; - } - - public String getDescription() throws ZigBeeDeviceException { - try { - return (String) meteringCluster.getAttributeDescription().getValue(); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/OccupancySensingImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/OccupancySensingImpl.java deleted file mode 100644 index ce7dcc6c0aeae..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/OccupancySensingImpl.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl; - -import org.bubblecloud.zigbee.api.cluster.impl.measureament_sensing.OccupancySensingCluster; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.OccupancySensing; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.event.OccupancyListener; -import org.bubblecloud.zigbee.api.cluster.impl.event.OccupancyBridgeListeners; -import org.bubblecloud.zigbee.api.ReportingConfiguration; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; - -/** - * @author Stefano "Kismet" Lenzi - * @author Manlio Bacco - * @author Francesco Furfari - * @author Alessandro Giari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class OccupancySensingImpl implements OccupancySensing { - - private OccupancySensingCluster occupacySensingCluster; - private Attribute occupancy; - private Attribute occupancySensorType; - private Attribute pirOccupiedToUnoccupiedDelay; - private Attribute pirUnoccupiedToOccupiedDelay; - private Attribute pirUnoccupiedToOccupiedThreshold; - private Attribute ultraSonicOccupiedToUnoccupiedDelay; - private Attribute ultraSonicUnoccupiedToOccupiedDelay; - private Attribute ultrasonicUnoccupiedToOccupiedThreshold; - - private OccupancyBridgeListeners eventBridge; - - public OccupancySensingImpl(ZigBeeEndpoint zbDevice) { - - occupacySensingCluster = new OccupancySensingCluster(zbDevice); - occupancy = occupacySensingCluster.getAttributeOccupancy(); - occupancySensorType = occupacySensingCluster.getAttributeOccupancySensorType(); - pirOccupiedToUnoccupiedDelay = occupacySensingCluster.getAttributePIROccupiedToUnoccupiedDelay(); - pirUnoccupiedToOccupiedDelay = occupacySensingCluster.getAttributePIRUnoccupiedToOccupiedDelay(); - ultraSonicOccupiedToUnoccupiedDelay = occupacySensingCluster.getAttributeUltraSonicOccupiedToUnoccupiedDelay(); - ultraSonicUnoccupiedToOccupiedDelay = occupacySensingCluster.getAttributeUltraSonicUnoccupiedToOccupiedDelay(); - pirUnoccupiedToOccupiedThreshold = occupacySensingCluster.getAttributePIRUnoccupiedToOccupiedThreshold(); - ultrasonicUnoccupiedToOccupiedThreshold = occupacySensingCluster.getAttributeUltrasonicUnoccupiedToOccupiedThreshold(); - - eventBridge = new OccupancyBridgeListeners(new ReportingConfiguration(), occupancy, this); - } - - public Attribute getOccupancy() { - return occupancy; - } - - public Attribute getOccupancySensorType() { - return occupancySensorType; - } - - public Attribute getPIROccupiedToUnoccupiedDelay() { - return pirUnoccupiedToOccupiedDelay; - } - - public Attribute getPIRUnoccupiedToOccupiedDelay() { - return pirOccupiedToUnoccupiedDelay; - } - - public Attribute getUltraSonicOccupiedToUnoccupiedDelay() { - return ultraSonicOccupiedToUnoccupiedDelay; - } - - public Attribute getUltraSonicUnoccupiedToOccupiedDelay() { - return ultraSonicUnoccupiedToOccupiedDelay; - } - - public Reporter[] getAttributeReporters() { - return occupacySensingCluster.getAttributeReporters(); - } - - public int getId() { - return occupacySensingCluster.getId(); - } - - public String getName() { - return occupacySensingCluster.getName(); - } - - public void subscribe(OccupancyListener listener) { - eventBridge.subscribe(listener); - } - - public void unsubscribe(OccupancyListener listener) { - eventBridge.unsubscribe(listener); - } - - public Attribute getAttribute(int id) { - Attribute[] attributes = occupacySensingCluster.getAvailableAttributes(); - for (int i = 0; i < attributes.length; i++) { - if (attributes[i].getId() == id) - return attributes[i]; - } - return null; - } - - public Attribute[] getAttributes() { - return occupacySensingCluster.getAvailableAttributes(); - } - - public Attribute getPIRUnoccupiedToOccupiedThreshold() { - return pirUnoccupiedToOccupiedThreshold; - } - - public Attribute getUltraSonicUnoccupiedToOccupiedThreshold() { - return ultrasonicUnoccupiedToOccupiedThreshold; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/OnOffImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/OnOffImpl.java deleted file mode 100644 index 95f2a8dc05382..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/OnOffImpl.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl; - -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.general.OnOff; -import org.bubblecloud.zigbee.api.cluster.general.event.OnOffListener; -import org.bubblecloud.zigbee.api.cluster.impl.event.OnOffBridgeListeners; -import org.bubblecloud.zigbee.api.ReportingConfiguration; -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.DefaultResponse; -import org.bubblecloud.zigbee.api.cluster.impl.general.OnOffCluster; - - -/** - * @author Stefano "Kismet" Lenzi - * @author Manlio Bacco - * @author Francesco Furfari - * @author Alessandro Giari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class OnOffImpl implements OnOff { - - private final Attribute onOff; - private final OnOffCluster onOffCluster; - private OnOffBridgeListeners eventBridge; - - public OnOffImpl(ZigBeeEndpoint zbDevice) { - onOffCluster = new OnOffCluster(zbDevice); - onOff = onOffCluster.getAttributeOnOff(); - eventBridge = new OnOffBridgeListeners(new ReportingConfiguration(), onOff, this); - } - - public boolean getOnOff() throws ZigBeeDeviceException { - try { - Boolean value = (Boolean) onOff.getValue(); - return value.booleanValue(); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public boolean subscribe(OnOffListener listener) { - return eventBridge.subscribe(listener); - } - - public boolean unsubscribe(OnOffListener listener) { - return eventBridge.unsubscribe(listener); - } - - public void off() throws ZigBeeDeviceException { - try { - DefaultResponse response = onOffCluster.off(); - if (response.getStatus() != Status.SUCCESS) - throw new ZigBeeDeviceException(response.getStatus().toString()); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public void on() throws ZigBeeDeviceException { - try { - DefaultResponse response = onOffCluster.on(); - if (response.getStatus() != Status.SUCCESS) - throw new ZigBeeDeviceException(response.getStatus().toString()); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public void toggle() throws ZigBeeDeviceException { - try { - DefaultResponse response = onOffCluster.toggle(); - if (response.getStatus() != Status.SUCCESS) - throw new ZigBeeDeviceException(response.getStatus().toString()); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public Reporter[] getAttributeReporters() { - return onOffCluster.getAttributeReporters(); - } - - public int getId() { - return onOffCluster.getId(); - } - - public String getName() { - return onOffCluster.getName(); - } - - public Attribute getAttribute(int id) { - Attribute[] attributes = onOffCluster.getAvailableAttributes(); - for (int i = 0; i < attributes.length; i++) { - if (attributes[i].getId() == id) - return attributes[i]; - } - return null; - } - - public Attribute[] getAttributes() { - return onOffCluster.getAvailableAttributes(); - } - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/OnOffSwitchConfigurationImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/OnOffSwitchConfigurationImpl.java deleted file mode 100644 index 941aa4a9df62a..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/OnOffSwitchConfigurationImpl.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl; - -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.general.OnOffSwitchConfiguration; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.api.cluster.impl.general.OnOffSwitchConfigurationCluster; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Alessandro Giari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class OnOffSwitchConfigurationImpl implements OnOffSwitchConfiguration { - - private OnOffSwitchConfigurationCluster onOffSwitchConfiguratioCluster; - private Attribute switchType; - private Attribute switchActions; - - public OnOffSwitchConfigurationImpl(ZigBeeEndpoint zbDevice) { - onOffSwitchConfiguratioCluster = new OnOffSwitchConfigurationCluster(zbDevice); - switchType = onOffSwitchConfiguratioCluster.getAttributeSwitchType(); - switchActions = onOffSwitchConfiguratioCluster.getAttributeSwitchActions(); - - } - - public Attribute getSwitchActions() { - return switchActions; - } - - public Attribute getSwitchType() { - return switchType; - } - - public Reporter[] getAttributeReporters() { - return onOffSwitchConfiguratioCluster.getAttributeReporters(); - } - - public int getId() { - return onOffSwitchConfiguratioCluster.getId(); - } - - public String getName() { - return onOffSwitchConfiguratioCluster.getName(); - } - - public Attribute getAttribute(int id) { - Attribute[] attributes = onOffSwitchConfiguratioCluster.getAvailableAttributes(); - for (int i = 0; i < attributes.length; i++) { - if (attributes[i].getId() == id) - return attributes[i]; - } - return null; - } - - public Attribute[] getAttributes() { - return onOffSwitchConfiguratioCluster.getAvailableAttributes(); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/PowerConfigurationImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/PowerConfigurationImpl.java deleted file mode 100644 index a107a0afd62db..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/PowerConfigurationImpl.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl; - -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.general.PowerConfiguration; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.api.cluster.impl.general.PowerConfigurationCluster; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.4.0 - */ -public class PowerConfigurationImpl implements PowerConfiguration { - - private final PowerConfigurationCluster cluster; - private final Attribute batteryRating; - private final Attribute batteryAlarm; - private final Attribute batteryManufacturer; - private final Attribute batteryQty; - private final Attribute batteryRatedVoltage; - private final Attribute batterySize; - private final Attribute batteryVoltage; - private final Attribute batteryVoltageMin; - private final Attribute mainsAlarm; - private final Attribute mainsDwell; - private final Attribute mainsHz; - private final Attribute mainsV; - private final Attribute mainsVMax; - private final Attribute mainsVMin; - - public PowerConfigurationImpl(ZigBeeEndpoint zbDevice) { - cluster = new PowerConfigurationCluster(zbDevice); - batteryRating = cluster.getAttributeBatteryAHrRating(); - batteryAlarm = cluster.getAttributeBatteryAlarmMask(); - batteryManufacturer = cluster.getAttributeBatteryManufacturer(); - batteryQty = cluster.getAttributeBatteryQuantity(); - batteryRatedVoltage = cluster.getAttributeBatteryRatedVoltage(); - batterySize = cluster.getAttributeBatterySize(); - batteryVoltage = cluster.getAttributeBatteryVoltage(); - batteryVoltageMin = cluster.getAttributeBatteryVoltageMinThreshold(); - mainsAlarm = cluster.getAttributeMainsAlarmMask(); - mainsDwell = cluster.getAttributeMainsDwellTripPoint(); - mainsHz = cluster.getAttributeMainsFrequency(); - mainsV = cluster.getAttributeMainsVoltage(); - mainsVMax = cluster.getAttributeMainsVoltageMaxThreshold(); - mainsVMin = cluster.getAttributeMainsVoltageMinThreshold(); - } - - public Reporter[] getAttributeReporters() { - return cluster.getAttributeReporters(); - } - - public int getId() { - return cluster.getId(); - } - - public String getName() { - return cluster.getName(); - } - - public Attribute getAttribute(int id) { - Attribute[] attributes = cluster.getAvailableAttributes(); - for (int i = 0; i < attributes.length; i++) { - if (attributes[i].getId() == id) - return attributes[i]; - } - return null; - } - - public Attribute[] getAttributes() { - return cluster.getAvailableAttributes(); - } - - public Attribute getBatteryAHrRating() { - return batteryRating; - } - - public Attribute getBatteryAlarmMask() { - return batteryAlarm; - } - - public Attribute getBatteryManufacturer() { - return batteryManufacturer; - } - - public Attribute getBatteryQuantity() { - return batteryQty; - } - - public Attribute getBatteryRatedVoltage() { - return batteryRatedVoltage; - } - - public Attribute getBatterySize() { - return batterySize; - } - - public Attribute getBatteryVoltage() { - return batteryVoltage; - } - - public Attribute getBatteryVoltageMinThreshold() { - return batteryVoltageMin; - } - - public Attribute getMainsAlarmMask() { - return mainsAlarm; - } - - public Attribute getMainsDwellTripPoint() { - return mainsDwell; - } - - public Attribute getMainsFrequency() { - return mainsHz; - } - - public Attribute getMainsVoltage() { - return mainsV; - } - - public Attribute getMainsVoltageMaxThreshold() { - return mainsVMax; - } - - public Attribute getMainsVoltageMinThreshold() { - return mainsVMin; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/PressureMeasurementImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/PressureMeasurementImpl.java deleted file mode 100644 index b8dc6d5f45af8..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/PressureMeasurementImpl.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.general.PressureMeasurement; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.general.PressureMeasurementCluster; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; - -/** - * - * @author Giancarlo Riolo - * @version $LastChangedRevision: $ ($LastChangedDate: $) - * - */ -public class PressureMeasurementImpl implements PressureMeasurement { - - private PressureMeasurementCluster pressureMeasurementCluster; - - - public PressureMeasurementImpl(ZigBeeEndpoint zbDevice){ - pressureMeasurementCluster = new PressureMeasurementCluster(zbDevice); - - } - - public int getId() { - - return pressureMeasurementCluster.getId(); - } - - public String getName() { - - return pressureMeasurementCluster.getName(); - } - - public Reporter[] getAttributeReporters() { - return pressureMeasurementCluster.getAttributeReporters(); - } - - public Attribute[] getAttributes() { - - return pressureMeasurementCluster.getAvailableAttributes(); - } - - public Attribute getAttribute(int id) { - Attribute[] attributes = pressureMeasurementCluster.getAvailableAttributes(); - for (int i = 0; i < attributes.length; i++) { - if( attributes[i].getId() == id ) - return attributes[i]; - } - return null; - } - - public String getDescription() throws ZigBeeDeviceException { - try { - return (String) pressureMeasurementCluster.getAttributeDescription().getValue(); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/PumpConfigurationAndControlImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/PumpConfigurationAndControlImpl.java deleted file mode 100644 index 39beb9b5c0635..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/PumpConfigurationAndControlImpl.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.general.PumpConfigurationAndControl; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.general.PumpConfigurationAndControlCluster; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; - -/** - * - * @author Giancarlo Riolo - * @version $LastChangedRevision: $ ($LastChangedDate: $) - * - */ - -public class PumpConfigurationAndControlImpl implements PumpConfigurationAndControl { - - private PumpConfigurationAndControlCluster pumpConfigurationAndControlCluster; - - - public PumpConfigurationAndControlImpl(ZigBeeEndpoint zbDevice){ - pumpConfigurationAndControlCluster = new PumpConfigurationAndControlCluster(zbDevice); - - } - - public int getId() { - - return pumpConfigurationAndControlCluster.getId(); - } - - public String getName() { - - return pumpConfigurationAndControlCluster.getName(); - } - - public Reporter[] getAttributeReporters() { - return pumpConfigurationAndControlCluster.getAttributeReporters(); - } - - public Attribute[] getAttributes() { - - return pumpConfigurationAndControlCluster.getAvailableAttributes(); - } - - public Attribute getAttribute(int id) { - Attribute[] attributes = pumpConfigurationAndControlCluster.getAvailableAttributes(); - for (int i = 0; i < attributes.length; i++) { - if( attributes[i].getId() == id ) - return attributes[i]; - } - return null; - } - - public String getDescription() throws ZigBeeDeviceException { - try { - return (String) pumpConfigurationAndControlCluster.getAttributeDescription().getValue(); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/RSSILocationImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/RSSILocationImpl.java deleted file mode 100755 index da115dbe83150..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/RSSILocationImpl.java +++ /dev/null @@ -1,272 +0,0 @@ -/* - Copyright 2013-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl; - -import org.bubblecloud.zigbee.api.cluster.general.AnchorNodeAnnounceListener; -import org.bubblecloud.zigbee.api.cluster.general.LocationMethod; -import org.bubblecloud.zigbee.api.cluster.general.LocationType; -import org.bubblecloud.zigbee.api.cluster.general.RSSILocation; -import org.bubblecloud.zigbee.api.cluster.general.RSSIPingListener; -import org.bubblecloud.zigbee.api.cluster.general.ReportRSSIMeasurementsListener; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; - -import java.util.EnumSet; - -/** - * PLACEHOLDER TO IMPLEMENT - * - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.7.0 - */ -public class RSSILocationImpl implements RSSILocation { - - public int getId() { - // TODO Auto-generated method stub - return 0; - } - - public String getName() { - // TODO Auto-generated method stub - return null; - } - - public Reporter[] getAttributeReporters() { - // TODO Auto-generated method stub - return null; - } - - public Attribute[] getAttributes() { - // TODO Auto-generated method stub - return null; - } - - public Attribute getAttribute(int id) { - // TODO Auto-generated method stub - return null; - } - - public EnumSet getLocationType() { - // TODO Auto-generated method stub - return null; - } - - public void setLocationType(EnumSet type) { - // TODO Auto-generated method stub - - } - - public LocationMethod getLocationMethod() { - // TODO Auto-generated method stub - return null; - } - - public void setLocationMethod(LocationMethod method) { - // TODO Auto-generated method stub - - } - - public int getLocationAge() { - // TODO Auto-generated method stub - return 0; - } - - public int getQualityMeasure() { - // TODO Auto-generated method stub - return 0; - } - - public int getNumberOfDevices() { - // TODO Auto-generated method stub - return 0; - } - - public int getCoordinate1() { - // TODO Auto-generated method stub - return 0; - } - - public void setCoordinate1(int coordinate1) { - // TODO Auto-generated method stub - - } - - public int getCoordinate2() { - // TODO Auto-generated method stub - return 0; - } - - public void setCoordinate2(int coordinate2) { - // TODO Auto-generated method stub - - } - - public int getCoordinate3() { - // TODO Auto-generated method stub - return 0; - } - - public void setCoordinate3(int coordinate3) { - // TODO Auto-generated method stub - - } - - public int getPower() { - // TODO Auto-generated method stub - return 0; - } - - public void setPower(int power) { - // TODO Auto-generated method stub - - } - - public int getPathLossExponent() { - // TODO Auto-generated method stub - return 0; - } - - public void setPathLossExponent(int pathLossExponent) { - // TODO Auto-generated method stub - - } - - public int getReportingPeriod() { - // TODO Auto-generated method stub - return 0; - } - - public void setReportingPeriod(int reportingPeriod) { - // TODO Auto-generated method stub - - } - - public int getCalculationPeriod() { - // TODO Auto-generated method stub - return 0; - } - - public void setCalculationPeriod(int calculationPeriod) { - // TODO Auto-generated method stub - - } - - public int getNumberRSSIMeasurements() { - // TODO Auto-generated method stub - return 0; - } - - public void setNumberRSSIMeasurements(int numberRSSIMeasurements) { - // TODO Auto-generated method stub - - } - - public void setAbsoluteLocation(int x, int y, int z, int power, int ple) { - // TODO Auto-generated method stub - - } - - public void setDeviceConfiguration(int power, int ple, int calcPeriod, - int nRSSI, int reportPeriod) { - // TODO Auto-generated method stub - - } - - public Response getDeviceConfiguration(long ieeeAddress) { - // TODO Auto-generated method stub - return null; - } - - public void getAbsoluteLocationData(boolean compact, - boolean unicastResponse, int nResponse, long ieeeAddress) { - // TODO Auto-generated method stub - - } - - public void getLocationData(boolean compact, boolean unicastResponse, - boolean recalc, int nResponse, long ieeeAddress) { - // TODO Auto-generated method stub - - } - - public void broadcastAbsoluteLocationData(boolean compact, - boolean unicastResponse, int nResponse) { - // TODO Auto-generated method stub - - } - - public void broadcastLocationData(boolean compact, boolean unicastResponse, - boolean recalc, int nResponse) { - // TODO Auto-generated method stub - - } - - public boolean addAnchorNodeAnnounceListener( - AnchorNodeAnnounceListener listner) { - // TODO Auto-generated method stub - return false; - } - - public boolean removeAnchorNodeAnnounceListener( - AnchorNodeAnnounceListener listner) { - // TODO Auto-generated method stub - return false; - } - - public void RSSIResponse(long ieeeAddress, int x, int y, int z, int rssi, - int nsamples) { - // TODO Auto-generated method stub - - } - - public void sendPings(long ieeeAddress, int nRSSI, int calcPeriod) { - // TODO Auto-generated method stub - - } - - public boolean addRSSIPingListener(RSSIPingListener listener) { - // TODO Auto-generated method stub - return false; - } - - public boolean removeRSSIPingListener(RSSIPingListener listener) { - // TODO Auto-generated method stub - return false; - } - - public boolean addReportRSSIMeasurementsListener( - ReportRSSIMeasurementsListener listener) { - // TODO Auto-generated method stub - return false; - } - - public boolean removeReportRSSIMeasurementsListener( - ReportRSSIMeasurementsListener listener) { - // TODO Auto-generated method stub - return false; - } - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/RawClusterMessageImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/RawClusterMessageImpl.java deleted file mode 100644 index 35e788f54ad65..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/RawClusterMessageImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl; - -import org.bubblecloud.zigbee.network.ClusterMessage; - -/** - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2010-09-23 14:21:48 +0200(Thu, 23 Sep 2010) $) - * @since 0.8.0 - */ -public class RawClusterMessageImpl implements ClusterMessage { - - private byte[] frame; - private short id; - - public RawClusterMessageImpl(short id, byte[] frame) { - this.frame = frame; - this.id = id; - } - - public byte[] getClusterMsg() { - return frame; - } - - public short getId() { - return id; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/RelativeHumidityMeasurementImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/RelativeHumidityMeasurementImpl.java deleted file mode 100644 index c388caae296a0..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/RelativeHumidityMeasurementImpl.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl; - -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.RelativeHumidityMeasurement; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.event.MeasuredValueListener; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.event.ToleranceListener; -import org.bubblecloud.zigbee.api.cluster.impl.event.MeasuredValueBridgeListeners; -import org.bubblecloud.zigbee.api.cluster.impl.event.ToleranceBridgeListeners; -import org.bubblecloud.zigbee.api.ReportingConfiguration; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.api.cluster.impl.measureament_sensing.RelativeHumidityMeasurementCluster; - -/** - * Implementation of the {@link RelativeHumidityMeasurement} interface, that wraps the - * {@link RelativeHumidityMeasurementCluster}. - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.4.0 - */ -public class RelativeHumidityMeasurementImpl implements RelativeHumidityMeasurement { - - private RelativeHumidityMeasurementCluster relativeHumidityMeasurementCluster; - private Attribute measuredValue; - private Attribute minMeasuredValue; - private Attribute maxMeasuredValue; - private Attribute tolerance; - - private final MeasuredValueBridgeListeners measureBridge; - private final ToleranceBridgeListeners toleranceBridge; - - public RelativeHumidityMeasurementImpl(ZigBeeEndpoint zbDevice) { - relativeHumidityMeasurementCluster = new RelativeHumidityMeasurementCluster(zbDevice); - measuredValue = relativeHumidityMeasurementCluster.getAttributeMeasuredValue(); - minMeasuredValue = relativeHumidityMeasurementCluster.getAttributeMinMeasuredValue(); - maxMeasuredValue = relativeHumidityMeasurementCluster.getAttributeMaxMeasuredValue(); - tolerance = relativeHumidityMeasurementCluster.getAttributeTolerance(); - - toleranceBridge = new ToleranceBridgeListeners(new ReportingConfiguration(), tolerance, this); - measureBridge = new MeasuredValueBridgeListeners(new ReportingConfiguration(), measuredValue, this); - } - - public Attribute getMaxMeasuredValue() { - return maxMeasuredValue; - } - - public Attribute getMeasuredValue() { - return measuredValue; - } - - public Attribute getMinMeasuredValue() { - return minMeasuredValue; - } - - public Attribute getTolerance() { - return tolerance; - } - - public Reporter[] getAttributeReporters() { - return relativeHumidityMeasurementCluster.getAttributeReporters(); - } - - public int getId() { - return relativeHumidityMeasurementCluster.getId(); - } - - public String getName() { - return relativeHumidityMeasurementCluster.getName(); - } - - public Attribute getAttribute(int id) { - Attribute[] attributes = relativeHumidityMeasurementCluster.getAvailableAttributes(); - for (int i = 0; i < attributes.length; i++) { - if (attributes[i].getId() == id) - return attributes[i]; - } - return null; - } - - public Attribute[] getAttributes() { - return relativeHumidityMeasurementCluster.getAvailableAttributes(); - } - - public boolean subscribe(MeasuredValueListener listener) { - return measureBridge.subscribe(listener); - } - - public boolean subscribe(ToleranceListener listener) { - return toleranceBridge.subscribe(listener); - } - - public boolean unsubscribe(MeasuredValueListener listener) { - return measureBridge.unsubscribe(listener); - } - - public boolean unsubscribe(ToleranceListener listener) { - return toleranceBridge.unsubscribe(listener); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/ScenesImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/ScenesImpl.java deleted file mode 100644 index 18721a7e2b994..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/ScenesImpl.java +++ /dev/null @@ -1,180 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.general.Scenes; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.scenes.AddScenePayload; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.scenes.AddSceneResponse; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.scenes.GetSceneMembershipResponse; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.scenes.RemoveAllScenesResponse; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.scenes.RemoveSceneResponse; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.scenes.StoreSceneResponse; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.scenes.ViewSceneResponse; -import org.bubblecloud.zigbee.api.cluster.impl.general.ScenesCluster; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Alessandro Giari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class ScenesImpl implements Scenes { - - private ScenesCluster scenesCluster; - private Attribute sceneCount; - private Attribute currentScene; - private Attribute currentGroup; - private Attribute sceneValid; - private Attribute nameSupport; - private Attribute lastConfiguredBy; - - public ScenesImpl(ZigBeeEndpoint zbDevice) { - scenesCluster = new ScenesCluster(zbDevice); - sceneCount = scenesCluster.getAttributeSceneCount(); - currentScene = scenesCluster.getAttributeCurrentScene(); - currentGroup = scenesCluster.getAttributeCurrentGroup(); - sceneValid = scenesCluster.getAttributeSceneValid(); - nameSupport = scenesCluster.getAttributeNameSupport(); - lastConfiguredBy = scenesCluster.getAttributeLastConfiguredBy(); - - } - - public AddSceneResponse addScene(AddScenePayload scenepayload) throws ZigBeeDeviceException { - try { - AddSceneResponse response = (AddSceneResponse) scenesCluster.addScene(scenepayload); - return response; - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public Attribute getCurrentGroup() { - return currentGroup; - } - - public Attribute getCurrentScene() { - return currentScene; - } - - public Attribute getLastConfiguredBy() { - return lastConfiguredBy; - } - - public Attribute getNameSupport() { - return nameSupport; - } - - public Attribute getSceneCount() { - return sceneCount; - } - - public GetSceneMembershipResponse getSceneMembership(int groupId) throws ZigBeeDeviceException { - try { - GetSceneMembershipResponse response = (GetSceneMembershipResponse) scenesCluster.getSceneMembership(groupId); - return response; - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public Attribute getSceneValid() { - return sceneValid; - } - - public void recallScene(int groupId, short sceneId) throws ZigBeeDeviceException { - try { - scenesCluster.recallScene(groupId, sceneId); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - - } - - public RemoveAllScenesResponse removeAllScene(int groupId) throws ZigBeeDeviceException { - try { - RemoveAllScenesResponse response = (RemoveAllScenesResponse) scenesCluster.removeAllScenes(groupId); - return response; - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public RemoveSceneResponse removeScene(int groupId, short sceneId) throws ZigBeeDeviceException { - try { - RemoveSceneResponse response = (RemoveSceneResponse) scenesCluster.removeScene(groupId, sceneId); - return response; - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public StoreSceneResponse storeScene(int groupId, short sceneId) throws ZigBeeDeviceException { - try { - StoreSceneResponse response = (StoreSceneResponse) scenesCluster.storeScene(groupId, sceneId); - return response; - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public ViewSceneResponse viewScene(int groupId, short sceneId) throws ZigBeeDeviceException { - try { - ViewSceneResponse response = (ViewSceneResponse) scenesCluster.viewScene(groupId, sceneId); - return response; - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - public Reporter[] getAttributeReporters() { - return scenesCluster.getAttributeReporters(); - } - - public int getId() { - return scenesCluster.getId(); - } - - public String getName() { - return scenesCluster.getName(); - } - - public Attribute getAttribute(int id) { - Attribute[] attributes = scenesCluster.getAvailableAttributes(); - for (int i = 0; i < attributes.length; i++) { - if (attributes[i].getId() == id) - return attributes[i]; - } - return null; - } - - public Attribute[] getAttributes() { - return scenesCluster.getAvailableAttributes(); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/ShadeConfigurationImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/ShadeConfigurationImpl.java deleted file mode 100644 index 4e6ee287f7293..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/ShadeConfigurationImpl.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.general.ShadeConfiguration; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.general.ShadeConfigurationCluster; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; - -/** - * - * @author Giancarlo Riolo - * @version $LastChangedRevision: $ ($LastChangedDate: $) - * - */ -public class ShadeConfigurationImpl implements ShadeConfiguration { - - private ShadeConfigurationCluster shadeConfigurationCluster; - - - public ShadeConfigurationImpl(ZigBeeEndpoint zbDevice){ - shadeConfigurationCluster = new ShadeConfigurationCluster(zbDevice); - - } - - public int getId() { - - return shadeConfigurationCluster.getId(); - } - - public String getName() { - - return shadeConfigurationCluster.getName(); - } - - public Reporter[] getAttributeReporters() { - return shadeConfigurationCluster.getAttributeReporters(); - } - - public Attribute[] getAttributes() { - - return shadeConfigurationCluster.getAvailableAttributes(); - } - - public Attribute getAttribute(int id) { - Attribute[] attributes = shadeConfigurationCluster.getAvailableAttributes(); - for (int i = 0; i < attributes.length; i++) { - if( attributes[i].getId() == id ) - return attributes[i]; - } - return null; - } - - public String getDescription() throws ZigBeeDeviceException { - try { - return (String) shadeConfigurationCluster.getAttributeDescription().getValue(); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/TemperatureMeasurementImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/TemperatureMeasurementImpl.java deleted file mode 100644 index b848b51129e3b..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/TemperatureMeasurementImpl.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.TemperatureMeasurement; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.event.MeasuredValueListener; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.event.ToleranceListener; -import org.bubblecloud.zigbee.api.cluster.impl.event.MeasuredValueBridgeListeners; -import org.bubblecloud.zigbee.api.cluster.impl.event.ToleranceBridgeListeners; -import org.bubblecloud.zigbee.api.ReportingConfiguration; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.measureament_sensing.TemperatureMeasurementCluster; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Alessandro Giari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class TemperatureMeasurementImpl implements TemperatureMeasurement { - - private final TemperatureMeasurementCluster temperatureMeasurementCluster; - private final Attribute measuredValue; - private final Attribute minMeasuredValue; - private final Attribute maxMeasuredValue; - private final Attribute tolerance; - - private final MeasuredValueBridgeListeners measureBridge; - private final ToleranceBridgeListeners toleranceBridge; - - public TemperatureMeasurementImpl(ZigBeeEndpoint zbDevice) { - temperatureMeasurementCluster = new TemperatureMeasurementCluster(zbDevice); - measuredValue = temperatureMeasurementCluster.getAttributeMeasuredValue(); - minMeasuredValue = temperatureMeasurementCluster.getAttributeMinMeasuredValue(); - maxMeasuredValue = temperatureMeasurementCluster.getAttributeMaxMeasuredValue(); - tolerance = temperatureMeasurementCluster.getAttributeTolerance(); - - toleranceBridge = new ToleranceBridgeListeners(new ReportingConfiguration(), tolerance, this); - measureBridge = new MeasuredValueBridgeListeners(new ReportingConfiguration(), measuredValue, this); - } - - public Attribute getMaxMeasuredValue() { - return maxMeasuredValue; - } - - public Attribute getMeasuredValue() { - return measuredValue; - } - - public Attribute getMinMeasuredValue() { - return minMeasuredValue; - } - - public Attribute getTolerance() { - return tolerance; - } - - public Reporter[] getAttributeReporters() { - return temperatureMeasurementCluster.getAttributeReporters(); - } - - public int getId() { - return temperatureMeasurementCluster.getId(); - } - - public String getName() { - return temperatureMeasurementCluster.getName(); - } - - public Attribute getAttribute(int id) { - Attribute[] attributes = temperatureMeasurementCluster.getAvailableAttributes(); - for (int i = 0; i < attributes.length; i++) { - if (attributes[i].getId() == id) - return attributes[i]; - } - return null; - } - - public Attribute[] getAttributes() { - return temperatureMeasurementCluster.getAvailableAttributes(); - } - - public boolean subscribe(MeasuredValueListener listener) { - return measureBridge.subscribe(listener); - } - - public boolean subscribe(ToleranceListener listener) { - return toleranceBridge.subscribe(listener); - } - - public boolean unsubscribe(MeasuredValueListener listener) { - return measureBridge.unsubscribe(listener); - } - - public boolean unsubscribe(ToleranceListener listener) { - return toleranceBridge.unsubscribe(listener); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/ThermostatImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/ThermostatImpl.java deleted file mode 100644 index a411d6f1f0a22..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/ThermostatImpl.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.general.Thermostat; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.general.ThermostatCluster; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; - -/** - * - * @author Giancarlo Riolo - * @version $LastChangedRevision: $ ($LastChangedDate: $) - * - */ -public class ThermostatImpl implements Thermostat { - - private ThermostatCluster thermostatCluster; - - - public ThermostatImpl(ZigBeeEndpoint zbDevice){ - thermostatCluster = new ThermostatCluster(zbDevice); - - } - - public int getId() { - - return thermostatCluster.getId(); - } - - public String getName() { - - return thermostatCluster.getName(); - } - - public Reporter[] getAttributeReporters() { - return thermostatCluster.getAttributeReporters(); - } - - public Attribute[] getAttributes() { - - return thermostatCluster.getAvailableAttributes(); - } - - public Attribute getAttribute(int id) { - Attribute[] attributes = thermostatCluster.getAvailableAttributes(); - for (int i = 0; i < attributes.length; i++) { - if( attributes[i].getId() == id ) - return attributes[i]; - } - return null; - } - - public String getDescription() throws ZigBeeDeviceException { - try { - return (String) thermostatCluster.getAttributeDescription().getValue(); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/ThermostatUserInterfaceConfigurationImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/ThermostatUserInterfaceConfigurationImpl.java deleted file mode 100644 index fc6142a8f7b5b..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/ThermostatUserInterfaceConfigurationImpl.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.general.ThermostatUserInterfaceConfiguration; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.general.ThermostatUserInterfaceConfigurationCluster; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; - -/** - * - * @author Giancarlo Riolo - * @version $LastChangedRevision: $ ($LastChangedDate: $) - * - */ - -public class ThermostatUserInterfaceConfigurationImpl implements ThermostatUserInterfaceConfiguration { - - private ThermostatUserInterfaceConfigurationCluster thermostatUserInterfaceConfigurationCluster; - - - public ThermostatUserInterfaceConfigurationImpl(ZigBeeEndpoint zbDevice){ - thermostatUserInterfaceConfigurationCluster = new ThermostatUserInterfaceConfigurationCluster(zbDevice); - - } - - public int getId() { - - return thermostatUserInterfaceConfigurationCluster.getId(); - } - - public String getName() { - - return thermostatUserInterfaceConfigurationCluster.getName(); - } - - public Reporter[] getAttributeReporters() { - return thermostatUserInterfaceConfigurationCluster.getAttributeReporters(); - } - - public Attribute[] getAttributes() { - - return thermostatUserInterfaceConfigurationCluster.getAvailableAttributes(); - } - - public Attribute getAttribute(int id) { - Attribute[] attributes = thermostatUserInterfaceConfigurationCluster.getAvailableAttributes(); - for (int i = 0; i < attributes.length; i++) { - if( attributes[i].getId() == id ) - return attributes[i]; - } - return null; - } - - public String getDescription() throws ZigBeeDeviceException { - try { - return (String) thermostatUserInterfaceConfigurationCluster.getAttributeDescription().getValue(); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/TimeImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/TimeImpl.java deleted file mode 100644 index b87026d1c9a53..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/TimeImpl.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl; - -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.general.Time; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.api.cluster.impl.general.TimeCluster; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Alessandro Giari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class TimeImpl implements Time { - - private TimeCluster timeCluster; - private Attribute time; - private Attribute timeStatus; - - public TimeImpl(ZigBeeEndpoint zbDevice) { - timeCluster = new TimeCluster(zbDevice); - time = timeCluster.getAttributeTime(); - timeStatus = timeCluster.getAttributeTimeStatus(); - } - - public Attribute getTime() { - return time; - } - - public Attribute getTimeStatus() { - return timeStatus; - } - - public Reporter[] getAttributeReporters() { - return timeCluster.getAttributeReporters(); - } - - public int getId() { - return timeCluster.getId(); - } - - public String getName() { - return timeCluster.getName(); - } - - public Attribute getAttribute(int id) { - Attribute[] attributes = timeCluster.getAvailableAttributes(); - for (int i = 0; i < attributes.length; i++) { - if (attributes[i].getId() == id) - return attributes[i]; - } - return null; - } - - public Attribute[] getAttributes() { - return timeCluster.getAvailableAttributes(); - } - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/WindowCoveringImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/WindowCoveringImpl.java deleted file mode 100644 index ea86484a76d21..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/WindowCoveringImpl.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.general.WindowCovering; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.general.WindowCoveringCluster; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; - -/** - * - * @author Giancarlo Riolo - * @version $LastChangedRevision: $ ($LastChangedDate: $) - * - */ - -public class WindowCoveringImpl implements WindowCovering { - - private WindowCoveringCluster windowCovering; - - - public WindowCoveringImpl(ZigBeeEndpoint zbDevice){ - windowCovering = new WindowCoveringCluster(zbDevice); - - } - - public int getId() { - - return windowCovering.getId(); - } - - public String getName() { - - return windowCovering.getName(); - } - - public Reporter[] getAttributeReporters() { - return windowCovering.getAttributeReporters(); - } - - public Attribute[] getAttributes() { - - return windowCovering.getAvailableAttributes(); - } - - public Attribute getAttribute(int id) { - Attribute[] attributes = windowCovering.getAvailableAttributes(); - for (int i = 0; i < attributes.length; i++) { - if( attributes[i].getId() == id ) - return attributes[i]; - } - return null; - } - - public String getDescription() throws ZigBeeDeviceException { - try { - return (String) windowCovering.getAttributeDescription().getValue(); - } catch (ZigBeeClusterException e) { - throw new ZigBeeDeviceException(e); - } - } - - -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/HVAC/FanControl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/HVAC/FanControl.java deleted file mode 100644 index 83855bbc3a169..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/HVAC/FanControl.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.HVAC; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; - - -/** - * This class represent the Fan Control Cluster as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * @author Giancarlo Riolo - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 18:00:05 +0200 (mar, 06 ago 2013) $) - * @since 0.8.0 - */ - -public interface FanControl extends ZCLCluster { - - public static final short ID = 0x0202; - static final String NAME = "Fan Control"; - static final String DESCRIPTION = "blablabla"; - - public Attribute getAttributeDescription(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/HVAC/PumpConfigurationAndControl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/HVAC/PumpConfigurationAndControl.java deleted file mode 100644 index 54ee75bc738f4..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/HVAC/PumpConfigurationAndControl.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.HVAC; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; - - -/** - * This class represent the Pump Configuration And Control Cluster as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * @author Giancarlo Riolo - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 18:00:05 +0200 (mar, 06 ago 2013) $) - * @since 0.8.0 - */ - -public interface PumpConfigurationAndControl extends ZCLCluster { - - public static final short ID = 0x0200; - static final String NAME = "Pump Configuration And Control"; - static final String DESCRIPTION = "blablabla"; - - public Attribute getAttributeDescription(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/HVAC/Thermostat.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/HVAC/Thermostat.java deleted file mode 100644 index 907f676f223f4..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/HVAC/Thermostat.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.HVAC; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; - - -/** - * This class represent the Thermostat Cluster as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * @author Giancarlo Riolo - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 18:00:05 +0200 (mar, 06 ago 2013) $) - * @since 0.8.0 - */ - -public interface Thermostat extends ZCLCluster { - - public static final short ID = 0x0201; - static final String NAME = "Thermostat"; - static final String DESCRIPTION = "blablabla"; - - public Attribute getAttributeDescription(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/HVAC/ThermostatUserInterfaceConfiguration.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/HVAC/ThermostatUserInterfaceConfiguration.java deleted file mode 100644 index b3e0707293a00..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/HVAC/ThermostatUserInterfaceConfiguration.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.HVAC; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; - - -/** - * This class represent the Pump Configuration And Control Cluster as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * @author Giancarlo Riolo - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 18:00:05 +0200 (mar, 06 ago 2013) $) - * @since 0.8.0 - */ - -public interface ThermostatUserInterfaceConfiguration extends ZCLCluster { - - public static final short ID = 0x0204; - static final String NAME = "Pump Configuration And Control"; - static final String DESCRIPTION = "blablabla"; - - public Attribute getAttributeDescription(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/closures/DoorLock.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/closures/DoorLock.java deleted file mode 100644 index 982ad1b2499ae..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/closures/DoorLock.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.closures; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; - - -/** - * This class represent the Door Lock Cluster as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * @author Giancarlo Riolo - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 18:00:05 +0200 (mar, 06 ago 2013) $) - * @since 0.8.0 - */ - -public interface DoorLock extends ZCLCluster { - - public static final short ID = 0x101; - static final String NAME = "Door Lock"; - static final String DESCRIPTION = "blablabla"; - - public Attribute getAttributeDescription(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/closures/ShadeConfiguration.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/closures/ShadeConfiguration.java deleted file mode 100644 index 663459464576c..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/closures/ShadeConfiguration.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.closures; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; - -/** - * This class represent the Shade Configuration Cluster as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * @author Giancarlo Riolo - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 18:00:05 +0200 (mar, 06 ago 2013) $) - * @since 0.8.0 - */ - -public interface ShadeConfiguration extends ZCLCluster { - - public static final short ID = 0x100; - static final String NAME = "Shade Configuration"; - static final String DESCRIPTION = "blablabla"; - - public Attribute getAttributeDescription(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/closures/WindowCovering.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/closures/WindowCovering.java deleted file mode 100644 index f8d81ce46f0cb..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/closures/WindowCovering.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.closures; - - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; - -/** - * This class represent the Window Covering Cluster as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * @author Giancarlo Riolo - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 18:00:05 +0200 (mar, 06 ago 2013) $) - * @since 0.8.0 - */ -public interface WindowCovering extends ZCLCluster { - - public static final short ID = 0x102; - static final String NAME = "Window Covering"; - static final String DESCRIPTION = "blablabla"; - - public Attribute getAttributeDescription(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/AnalogReporter.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/AnalogReporter.java deleted file mode 100644 index 50b6f6f518cfe..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/AnalogReporter.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.core; - -/** - * This interface extends the {@link Reporter} interface for the analog attribute.
- * In fact, for the analog attribute a report is sent only if the value changes by a value
- * that is greater than the ReportableChagne property. - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface AnalogReporter extends Reporter { - - /** - * By default all the new {@link AnalogReporter} will reported when the value change is greater
- * equal of the following value - */ - public static final double DEFAULT_REPORTABLE_CHANGE_INTERVAL = 0.0d; - - /** - * @return the current value of the ReportableChagne property - */ - public Object getReportableChange(); - - /** - * Set the value of the ReportableChagne property to the value - * - * @param value the new value for the ReportableChagne - */ - public void setReportableChange(Object value); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/Attribute.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/Attribute.java deleted file mode 100644 index eede57c5b5547..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/Attribute.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.core; - - -/** - * This class represent an Attribute as defined by the ZigBee Cluster Library specification - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface Attribute { - - /** - * @return the 16-bit identifier of the attribute as specified by the cluster - */ - public int getId(); - - /** - * @return the {@link String} associated to this attribute as specified by the cluster - */ - public String getName(); - - /** - * @return the java {@link Class} used to represent the attribute value - */ - @SuppressWarnings("unchecked") - public Class getType(); - - /** - * @return the {@link ZigBeeType} that describes the attribute type - */ - public ZigBeeType getZigBeeType(); - - /** - * @return the true if and only if the attribute can be written - */ - public boolean isWritable(); - - /** - * @return the true if and only if the attribute support the {@link Reporter} - */ - public boolean isReportable(); - - /** - * @return the current value of the attribute - */ - public Object getValue() throws ZigBeeClusterException; - - /** - * If the attribute can be written ({@link #isWritable()} this method set its value. - * - * @param o the value of to set the attribute to - */ - public void setValue(Object o) throws ZigBeeClusterException; - - /** - * @return the {@link Reporter} - */ - public Reporter getReporter(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/Command.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/Command.java deleted file mode 100644 index ce259c977578c..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/Command.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.core; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface Command extends Message { - - /** - * @return the an int[] containing the list of possible {@link Response}
- * to this {@link Command} - */ - public byte[] getAllowedResponseId(); - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/Message.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/Message.java deleted file mode 100644 index b822f54782d0f..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/Message.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.core; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface Message { - - - /** - * @return the field Command identifier as defined in the ZCL header
- * of the ZigBee Cluster Library specification - */ - public byte getHeaderCommandId(); - - /** - * @return true if and only if the {@link Message} id refers to
- * a particular cluster definition. - */ - public boolean isClusterSpecific(); - - public boolean isManufacturerExtension(); - - public boolean isClientServerDirection(); - - public byte[] getManufacturerId(); - - public byte[] getPayload(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/ReportListener.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/ReportListener.java deleted file mode 100644 index 857e291e21ec5..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/ReportListener.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.core; - -import java.util.Dictionary; - -/** - * This class represent interface that must be implemented to be reported by driver, - * according to the {@link Reporter} where this object is added to. - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface ReportListener { - - /** - * This is the method invoked by the driver when a report arrives - * - * @param endPointId the end point ID - * @param clusterId the cluster ID - * @param reports the reports - */ - public void receivedReport(String endPointId, short clusterId, Dictionary reports); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/Reporter.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/Reporter.java deleted file mode 100644 index 4f51799872b88..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/Reporter.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.core; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface Reporter { - - /** - * By default all the new subscription will reported up to one per minute - */ - public static final int DEFAULT_MAX_REPORTING_INTERVAL = 60; - - /** - * By default all the new subscription will announce only when the value of the attribute change - */ - public static final int DEFAULT_MIN_REPORTING_INTERVAL = 0; - - public boolean addReportListener(ReportListener listner); - - public boolean removeReportListener(ReportListener listner); - - public int getMinimumReportingInterval(); - - public int setMinimumReportingInterval(int value); - - public int getMaximumReportingInterval(); - - public int setMaximumReportingInterval(int value); - - /** - * Remove all the {@link ReportListener} from this subscription - */ - public void clear(); - - /** - * @return true if and only if a {@link ReportListener} is subscribed - * @see #getReportListenersCount() - * @since 0.2.0 - */ - public boolean isActive(); - - /** - * @return the number of {@link ReportListener} subscribed - * @see #isActive() - * @since 0.2.0 - */ - public int getReportListenersCount(); - - /** - * @return update the subscription configuration for the device - * @since 0.6.0 - */ - public boolean updateConfiguration(); - - /** - * Gets the attribute subscribed to. - * @return the attribute - */ - Attribute getAttribute(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/Response.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/Response.java deleted file mode 100644 index 789b87f3bb92c..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/Response.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.core; - - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface Response extends Message { - - public boolean isDefaultResponseEnabled(); - - public ZCLHeader getZCLHeader(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/Status.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/Status.java deleted file mode 100644 index 8f5dc5fab0186..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/Status.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.core; - - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public enum Status { - - SUCCESS(0x00, "Operation was successful."), - FAILURE(0x01, "Operation was not successful."), - RESERVED_01(0x02, 0x7f, "Value is reserved"), - MALFORMED_COMMAND(0x80, - "The command appears to contain the wrong fields, as detected either by the presence of one or more invalid field entries or by there " + - "being missing fields. Command not carried out. Implementer has discretion as to whether to return this error or INVALID_FIELD." - ), - UNSUP_CLUSTER_COMMAND(0x81, "The specified general ZCL command is not supported on the device. Command not carried out."), - UNSUP_GENERAL_COMMAND(0x82, "The specified cluster command is not supported on the device."), - - UNSUP_MANUF_CLUSTER_COMMAND(0x83, - "A manufacturer specific unicast, cluster specific command was received with an " + - "unknown manufacturer code, or the manufacturer code was recognized but the " + - "command is not supported."), - UNSUP_MANUF_GENERAL_COMMAND(0x84, "A manufacturer specific unicast, ZCL specific command was " + - "received with an unknown manufacturer code, or the manufacturer code " + - "was recognized but the command is not supported."), - INVALID_FIELD(0x85, "At least one field of the command contains an incorrect value, " + - "according to the specification the device is implemented to."), - UNSUPPORTED_ATTRIBUTE(0x86, "The specified attribute does not exist on the device."), - INVALID_VALUE(0x87, "Out of range error, or set to a reserved value. Attribute keeps its old value. " + - "Note that an attribute value may be out of range if an attribute is related to another, " + - "e.g. with minimum and maximum attributes. See the individual attribute descriptions for " + - "specific details."), - READ_ONLY(0x88, "Attempt to write a read only attribute."), - INSUFFICIENT_SPACE(0x89, "An operation (e.g. an attempt to create an entry in a table) failed due to an insufficient " + - "amount of free space available."), - DUPLICATE_EXISTS(0x8a, "An attempt to create an entry in a table failed due to a duplicate entry already being present " + - "in the table."), - NOT_FOUND(0x8b, "The requested information (e.g. table entry) could not be found."), - UNREPORTABLE_ATTRIBUTE(0x8c, "Periodic reports cannot be issued for this attribute."), - INVALID_DATA_TYPE(0x8d, "The data type given for an attribute is incorrect. Command not carried out."), - RESERVED_02(0x8e, 0xbf, "Value is reserved"), - HARDWARE_FAILURE(0xc0, "An operation was unsuccessful due to a hardware failure."), - SOFTWARE_FAILURE(0xc1, "An operation was unsuccessful due to a software failure."), - CALIBRATION_ERROR(0xc2, "An error occurred during calibration."), - RESERVED_03(0xc3, 0xff, "Value is reserved"); - - public final int id; - public final String description; - private final int range; - private static Status[] map; - - private Status(int id, String description) { - this.id = id; - this.description = description; - this.range = 1; - getMap()[id & 0xFF] = this; - } - - private Status(int start, int end, String description) { - this.id = start; - this.range = end - start; - this.description = description; - - for (int i = id; i < end; i++) { - getMap()[i & 0xFF] = this; - } - } - - public static Status getStatus(byte b) { - return map[b & 0xFF]; - } - - private static Status[] getMap() { - if (map == null) { - map = new Status[256]; - } - return map; - } - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/ZBDeserializer.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/ZBDeserializer.java deleted file mode 100644 index 1037b887ae0f9..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/ZBDeserializer.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.core; - - -/** - * The interface for helping the deserialization ZCL frame on array of byte - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface ZBDeserializer { - - /** - * @return true if and only if no byte left to read from the payload - * @since 0.8.0 - */ - public boolean endOfStream(); - - /** - * @param the {@link ZigBeeType} to use for parsing the data - * @return the parsed {@link Object} - * @since 0.4.0 - */ - public Object readZigBeeType(ZigBeeType type); - - - /** - * Parse a {@link String} from the stream considering the first byte as the length of the
- * String itself as specified by the ZigBee Cluster Library (Document 075123r01ZB - * - * @return the parsed {@link String} - * @since 0.4.0 - * @deprecated {@link #readZigBeeType(ZigBeeType)} should be used instead - */ - public String readString(); - - - /** - * Since version 0.4.0 the method must not used, use {@link #readZigBeeType(ZigBeeType)} instead.
- * This method has a conceptual bug in respect to the parsing of 8, 16, or 24 bit long data, in fact
- * the methods can only fail in such cases. - * - * @param clazz the {@link Class} used to select the proper parsing - * @return the parse {@link Object} from the stream depending the {@link Class} specified - * @deprecated Use {@link #readZigBeeType(ZigBeeType)} instead - */ - public Object readObject(Class clazz); - - public Boolean readBoolean(); - - public Byte readByte(); - - public Short readShort(); - - public Integer readInteger(); - - public Long readLong(); - - public boolean read_boolean(); - - public byte read_byte(); - - public short read_short(); - - public int read_int(); - - /** - * @return the 8bit unsigned - * @since 0.8.0 - */ - public short read_uint8bit(); - - /** - * @return the 24bit parsed - * @since 0.4.0 - */ - public int read_int24bit(); - - public long read_long(); - - /** - * @return - * @since 0.2.0 - */ - public int getPosition(); - - /** - * @param n - * @since 0.2.0 - */ - public void skip(int n); - - - /** - * @return an integer read from a 16bit - * @since 0.8.0 - */ - public int read_uint16bit(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/ZBSerializer.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/ZBSerializer.java deleted file mode 100644 index 56d129b599e60..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/ZBSerializer.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.core; - - -/** - * The interface for helping the serialization ZCL frame on array of byte - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface ZBSerializer { - - /** - * @param data {@link Object} containing the value to append - * @param type {@link ZigBeeType} to select of data has to be appended - * @since 0.4.0 - */ - public void appendZigBeeType(Object data, ZigBeeType type); - - /** - * Append a {@link String} to the stream by prefixing it with the length of the String itself
- * as specified by the ZigBee Cluster Library (Document 075123r01ZB - * - * @param str the {@link String} to append - * @throws IllegalArgumentException if the length of the {@link String} is greater then 255 - * @since 0.4.0 - */ - public void appendString(String str); - - /** - * Since version 0.4.0 the method must not used, use {@link #appendZigBeeType(Object, ZigBeeType)} instead.
- * This method has a conceptual bug in respect to appending 8, 16, or 24 bit long data, in fact
- * the methods can only fail in such cases. - * - * @param data {@link Object} to serialize as Java type - * @deprecated Use {@link #appendZigBeeType(Object, ZigBeeType)} instead - */ - public void appendObject(Object data); - - public void appendBoolean(Boolean data); - - public void appendByte(Byte data); - - public void appendShort(Short data); - - public void appendInteger(Integer data); - - public void appendLong(Long data); - - public void append_boolean(boolean data); - - public void append_byte(byte data); - - public void append_short(short data); - - public void append_int(int data); - - /** - * @param data int value to append - * @since 0.4.0 - */ - public void append_int24bit(int data); - - public void append_long(long data); - - /** - * @return a copy of the payload - * @since 0.8.0 - */ - public byte[] getPayload(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/ZCLCluster.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/ZCLCluster.java deleted file mode 100644 index 2534e6710f493..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/ZCLCluster.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.core; - -import java.io.IOException; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface ZCLCluster { - - /** - * @return true if and only if the Default response command is enabled - */ - public boolean isDefaultResponseEnabled(); - - /** - * This method enable the Default response command to be sent by the device that
- * receives the {@link Command} - */ - public void enableDefaultResponse(); - - /** - * This method return the actual ClusterId. Please remember that the final and official ClusterId
- * is defined by the Profile even if the Cluster is defined by a Cluster Library. - * - * @return the ClusterId - */ - public short getId(); - - /** - * @return This method returns -1 if and only if no Manufacturer specific extension
- * are implement, otherwise it returns the ManufacturerId - */ - public int getManufacturerId(); - - /** - * @return This method return the {@link String} identifying the human readable name of the cluster.
- * The name is assigned by the document defining the Cluster, either the Cluster Library or
- * or the Profile - */ - public String getName(); - - - /** - * This method returns an {@link Attribute} array containing the {@link Attribute} that are actually
- * implemented on the cluster instance. Hence this method should return even the {@link Attribute}
- * defined by the Manufacturer. - * - * @return The {@link Attribute} arrays - */ - Attribute[] getAvailableAttributes(); - - /** - * This method returns an {@link Attribute} array containing the {@link Attribute} defined by
- * the specification of the cluster. Hence, this method returns all {@link Attribute} defined
- * either as Mandatory or as Optional, but does not return the {@link Attribute}
- * defined by the Manufacturer. - * - * @return The {@link Attribute} arrays - */ - Attribute[] getStandardAttributes(); - - - /** - * This method is an alias for {@link #invoke(Command, false)} - * - * @throws IOException - * @throws ZigBeeClusterException - * @see #invoke(Command, boolean) - */ - public Response invoke(Command cmd) throws ZigBeeClusterException; - - - /** - * This method invokes the {@link Command} on this Cluster and wait for its {@link Response} - * - * @param cmd the {@link Command} to invoke - * @param if suppressResponse true Default response are disabled - * @return {@link Response} the response to the invoked {@link Command}. This method returns null - * @throws IOException - * @throws org.bubblecloud.zigbee.network.impl.ZigBeeNetworkManagerException - */ - public Response invoke(Command cmd, boolean suppressResponse) throws ZigBeeClusterException; //TODO Remove - - /** - * @param id the id of attribute to get - * @return {@link Attribute} identified by the given id - * @since 0.2.0 - */ - public Attribute getAttribute(int id); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/ZCLFrameControl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/ZCLFrameControl.java deleted file mode 100755 index 462c8a49a9540..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/ZCLFrameControl.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright 2013-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.core; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.8.0 - */ -public interface ZCLFrameControl { - - public abstract boolean isClusterSpecificCommand(); - - public abstract boolean isManufacturerExtension(); - - public abstract boolean isClientServerDirection(); - - public abstract boolean isDefaultResponseEnabled(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/ZCLHeader.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/ZCLHeader.java deleted file mode 100755 index 257cc74d18dfa..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/ZCLHeader.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - Copyright 2013-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.api.core; - - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.8.0 - */ -public interface ZCLHeader { - - public abstract ZCLFrameControl getFramecontrol(); - - public abstract byte[] getManufacturerId(); - - public abstract byte getTransactionId(); - - public abstract byte getCommandId(); - - public abstract byte[] toByte(); - -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/ZigBeeClusterException.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/ZigBeeClusterException.java deleted file mode 100644 index 798b1fe25fdc1..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/ZigBeeClusterException.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.core; -//TODO discuss about the Exception Hierarchy from the basedriver to the refinement drivers - -import org.bubblecloud.zigbee.network.impl.ZigBeeException; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZigBeeClusterException extends ZigBeeException { - - private Response response; - - public ZigBeeClusterException(String msg) { - super(msg); - } - - public ZigBeeClusterException(Throwable ex) { - super(ex); - } - - public ZigBeeClusterException(String msg, Response response) { - super(msg); - this.response = response; - } - - public Response getResponse() { - return response; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/ZigBeeType.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/ZigBeeType.java deleted file mode 100644 index 3b6a6fdd4ceea..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/core/ZigBeeType.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.core; - -import java.util.Hashtable; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public enum ZigBeeType { - - //TODO Add missing data types - - Boolean(0x10, 1, false, Boolean.class), - Data8bit(0x08, 1, false, Integer.class), - Data16bit(0x09, 2, false, Integer.class), - Data24bit(0x0a, 3, false, Integer.class), - Data32bit(0x0b, 4, false, Integer.class), - Bitmap32bit(0x1b, 4, false, Integer.class), - Bitmap24bit(0x1a, 3, false, Integer.class), - Bitmap16bit(0x19, 2, false, Integer.class), - Bitmap8bit(0x18, 1, false, Integer.class), - UnsignedInteger8bit(0x20, 1, true, Integer.class), - UnsignedInteger16bit(0x21, 2, true, Integer.class), - UnsignedInteger24bit(0x22, 3, true, Integer.class), - UnsignedInteger32bit(0x23, 4, true, Long.class), - OctectString(0x41, -1, false, String.class), - CharacterString(0x42, -1, false, String.class), - LongOctectString(0x43, -1, false, String.class), - LongCharacterString(0x44, -1, false, String.class), - Enumeration8bit(0x30, 1, false, Byte.class), - Enumeration16bit(0x31, 2, false, Byte.class), - IEEEAddress(0xf0, 8, false, String.class), - SignedInteger8bit(0x28, 1, true, Integer.class), - SignedInteger16bit(0x29, 2, true, Integer.class), - SignedInteger24bit(0x2a, 3, true, Integer.class), - SignedInteger32bit(0x2b, 4, true, Integer.class), - SemiPrecision(0x38, 2, true, Short.class), - SinglePrecision(0x39, 4, true, Float.class), - DoublePrecision(0x3a, 8, true, Double.class); - - - - - static Hashtable MAP; - - private int id; - private int length; - private boolean analog; - private Class javaClass; - - private ZigBeeType(int id, int length, boolean analog, Class javaClass){ - this.id = id; - this.length = length; - this.analog = analog; - this.javaClass = javaClass; - if (ZigBeeType.getMap() == null) ZigBeeType.setMap(); - ZigBeeType.getMap().put(Byte.valueOf((byte) id),this); - } - - public int getId() { - return id; - } - - /** - * - * @return the length, in bytes, required for storing the data. -1 if and - * only if the type has a variable length - */ - public int getLength() { - return length; - } - - public boolean isAnalog() { - return analog; - } - - public Class getJavaClass() { - return javaClass; - } - - public static ZigBeeType getType(byte b){ - return MAP.get(Byte.valueOf(b)); - } - - private static Hashtable getMap(){ - return MAP; - } - - private static void setMap(){ - MAP = new Hashtable(); - } -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/Alarms.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/Alarms.java deleted file mode 100644 index 48f0fe4fa7414..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/Alarms.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.general; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.alarms.AlarmListener; - -/** - * This class represent the Alarm Cluster as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * - * @author Stefano "Kismet" Lenzi - * @author Manlio Bacco - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface Alarms extends ZCLCluster { - - static final short ID = 0x0009; - static final String NAME = "Alarms"; - static final String DESCRIPTION = "Attributes and commands for sending notifications and configuring alarm functionaly"; - - static final byte RESET_ALARM_ID = 0x00; - static final byte RESET_ALL_ALARMS_ID = 0x01; - static final byte GET_ALARM_ID = 0x03; - static final byte RESET_ALARM_LOG_ID = 0x03; - - public Attribute getAttributeAlarmCount(); - - public Response resetAlarm(int clusterId, int attributeId) throws ZigBeeClusterException; - - public Response resetAllAlarms() throws ZigBeeClusterException; - - public Response getAlarm() throws ZigBeeClusterException; - - public Response resetAlarmLog() throws ZigBeeClusterException; - - public boolean addAlarmListerner(AlarmListener listener); - - public boolean removeAlarmListerner(AlarmListener listener); -} - diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/AnalogInput.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/AnalogInput.java deleted file mode 100644 index da4e750f609eb..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/AnalogInput.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.general; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; - -/** - * This class represent the Groups Cluster as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * - */ - -public interface AnalogInput extends ZCLCluster { - - public static final short ID = 0x000C; - static final String NAME = "AnalogInput"; - static final String DESCRIPTION = "An interface for reading the value of an analog measurement and accessing various characteristics of that measurement."; - - - public Attribute getAttributeDescription(); - public Attribute getAttributeMaxPresentValue(); - public Attribute getAttributeMinPresentValue(); - public Attribute getAttributeOutOfService(); - public Attribute getAttributePresentValue(); - public Attribute getAttributeReliability(); - public Attribute getAttributeResolution(); - public Attribute getAttributeStatusFlags(); - public Attribute getAttributeEngineeringUnits(); - public Attribute getAttributeApplicationType(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/Basic.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/Basic.java deleted file mode 100644 index 215925905fa20..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/Basic.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.general; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.DefaultResponse; - -/** - * This class represent the Basic Cluster as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Alessandro Giari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface Basic extends ZCLCluster { - - static final short ID = 0x0000; - static final String NAME = "Basic"; - static final String DESCRIPTION = "Attributes and commands for determining basic information about a device, setting user device information such as location, and enabling a device."; - - static final byte RESET_TO_FACTORY_DEFAULT_ID = 0x00; - - public Attribute getAttributeZCLVersion(); - - public Attribute getAttributeApplicationVersion(); - - public Attribute getAttributeStackVersion(); - - public Attribute getAttributeHWVersion(); - - public Attribute getAttributeManufacturerName(); - - public Attribute getAttributeModelIdentifier(); - - public Attribute getAttributeDateCode(); - - public Attribute getPowerSource(); - - public Attribute getAttributeLocationDescription(); - - public Attribute getAttributePhysicalEnvironment(); - - public Attribute getAttributeDeviceEnabled(); - - public Attribute getAttributeAlarmMask(); - - /** - * @since 0.7.1 - */ - public Attribute getAttributeDisableLocalConfig(); - - - public DefaultResponse resetToFactoryDefault() throws ZigBeeClusterException; -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/BinaryInput.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/BinaryInput.java deleted file mode 100755 index 38037b81b6490..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/BinaryInput.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - Copyright 2013-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -package org.bubblecloud.zigbee.api.cluster.impl.api.general; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; - -/** - * This class represent the Binary Input (Basic) Cluster as defined by the document:
- * ZigBee Cluster Library public release version 075123r04ZB - * - * @author Han Alink - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.8.0 - */ -public interface BinaryInput extends ZCLCluster { - - static final short ID = 0x000F; - static final String NAME = "Binary Input (Basic)"; - static final String DESCRIPTION = - "An interface for reading the value of a binary measurement and accessing " - + "various characteristics of that measurement."; - - - public Attribute getAttributeActiveText(); - - public Attribute getAttributeDescription(); - - public Attribute getAttributeInactiveText(); - - public Attribute getAttributeOutOfService(); - - public Attribute getAttributePolarity(); - - public Attribute getAttributePresentValue(); - - public Attribute getAttributeReliability(); - - public Attribute getAttributeStatusFlags(); - - public Attribute getAttributeApplicationType(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/Commissioning.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/Commissioning.java deleted file mode 100644 index e3b9e84996e32..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/Commissioning.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - Copyright 2012-2012 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -package org.bubblecloud.zigbee.api.cluster.impl.api.general; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.commissioning.ResetStartupPayload; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.commissioning.RestartDevicePayload; - -/** - * This class represent the Commissioning Cluster as defined by the document:
- * ZigBee Cluster Library public release version 075366r01 - * - * @author Manlio Bacco - * @author Francesco Furfari - * @version $LastChangedRevision: 42 $ ($LastChangedDate: 2010-09-23 14:21:48 +0200 (gio, 23 set 2010) $) - * @since 0.8.0 - */ -public interface Commissioning extends ZCLCluster { - - static final short ID = 0x0015; - static final String NAME = "Commissioning"; - static final String DESCRIPTION = "Attributes and commands pertaining to the commissioning and api of ZigBee devices operating in a network."; - - static final byte RESTART_DEVICE_ID = 0x00; - static final byte SAVE_STARTUP_PARAMETERS_ID = 0x01; - static final byte RESTORE_STARTUP_PARAMETERS_ID = 0x02; - static final byte RESET_STARTUP_PARAMETERS_ID = 0x03; - - // Startup Parameters - public Attribute getAttributeShortAddress(); - - public Attribute getAttributeExtendedPanID(); - - public Attribute getAttributePanID(); - - public Attribute getAttributeChannelMask(); - - public Attribute getAttributeProtocolVersion(); - - public Attribute getAttributeStackProfile(); - - public Attribute getAttributeStartupControl(); - - public Attribute getAttributeTrustCenterAddress(); - - public Attribute getAttributeTrustCenterMasterKey(); - - public Attribute getAttributeNetworkKey(); - - public Attribute getAttributeUseInsecureJoin(); - - public Attribute getAttributePreconfiguredLinkKey(); - - public Attribute getAttributeNetworkKeySeqNum(); - - public Attribute getAttributeNetworkKeyType(); - - public Attribute getAttributeNetworkManagerAddress(); - - // Join Parameters - public Attribute getAttributeScanAttempts(); - - public Attribute getAttributeTimeBetweenScans(); - - public Attribute getAttributeRejoinInterval(); - - public Attribute getAttributeMaxRejoinInterval(); - - // End Device Parameters - public Attribute getAttributeIndirectPollRate(); - - public Attribute getAttributeParentRetryThreshold(); - - // Concentrator Parameters - public Attribute getAttributeConcentratorFlag(); - - public Attribute getAttributeConcentratorRadius(); - - public Attribute getAttributeConcentratorDiscoveryTime(); - - // Commands - public Response restartDevice(RestartDevicePayload payload) throws ZigBeeClusterException; - - public Response saveStartupParameters(int index) throws ZigBeeClusterException; - - public Response restoreStartupParameters(int index) throws ZigBeeClusterException; - - public Response resetStartupParameters(ResetStartupPayload payload) throws ZigBeeClusterException; -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/DeviceTemperatureConfiguration.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/DeviceTemperatureConfiguration.java deleted file mode 100644 index ce5e410681ed1..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/DeviceTemperatureConfiguration.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.general; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; - -/** - * This class represent the Device Temperature Configuration Cluster as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Alessandro Giari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface DeviceTemperatureConfiguration extends ZCLCluster { - - static final short ID = 0x0002; - static final String NAME = "DeviceTemperatureConfiguration"; - static final String DESCRIPTION = "Attributes for determining information about a device's internal temperature, and for configuring under/over temperature alarms."; - - - public Attribute getAttributeCurrentTemperature(); - - public Attribute getAttributeMinTempExperienced(); - - public Attribute getAttributeMaxTempExperienced(); - - public Attribute getAttributeOverTempTotalDwell(); - - public Attribute getAttributeDeviceTempAlarmMask(); - - public Attribute getAttributeLowTempThreshold(); - - public Attribute getAttributeHighTempThreshold(); - - public Attribute getAttributeLowTempDwellTripPoint(); - - public Attribute getAttributeHighTempDwellTripPoint(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/Groups.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/Groups.java deleted file mode 100644 index ca35a3dd20f8b..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/Groups.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.general; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; - -/** - * This class represent the Groups Cluster as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Alessandro Giari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface Groups extends ZCLCluster { - - static final short ID = 0x0004; - static final String NAME = "Groups"; - static final String DESCRIPTION = "Attributes and commands for group configuration and manipulation"; - - static final byte ADD_GROUP_ID = 0x00; - static final byte VIEW_GROUP_ID = 0x01; - static final byte GET_GROUP_MEMBERSHIP_ID = 0x02; - static final byte REMOVE_GROUP_ID = 0x03; - static final byte REMOVE_ALL_GROUP_ID = 0x04; - static final byte ADD_GROUP_IF_IDENTIFYING_ID = 0x05; - - public Attribute getAttributeNameSupport(); - - public Response addGroup(int groupId, String name) throws ZigBeeClusterException; - - public Response viewGroup(int groupId) throws ZigBeeClusterException; - - public Response getGroupMembership(int[] groupList) throws ZigBeeClusterException; - - public Response removeGroup(int groupId) throws ZigBeeClusterException; - - public Response removeAllGroup() throws ZigBeeClusterException; - - public Response addGroupIfIdentifying(int groupId, String name) throws ZigBeeClusterException; -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/Identify.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/Identify.java deleted file mode 100644 index 8e527b4309564..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/Identify.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.general; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; - -/** - * This class represent the Identify Cluster as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Alessandro Giari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface Identify extends ZCLCluster { - - static final short ID = 0x0003; - static final String NAME = "Identify"; - static final String DESCRIPTION = "Attributes and commands for putting a device into Identification mode."; - - static final byte IDENTIFY_ID = 0x00; - static final byte IDENTIFY_QUERY_ID = 0x01; - - - public Attribute getAttributeIdentifyTime(); - - public Response identify(int time) throws ZigBeeClusterException; - - public Response identifyQuery() throws ZigBeeClusterException; -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/LevelControl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/LevelControl.java deleted file mode 100644 index 4180550d73f39..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/LevelControl.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.general; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; - -/** - * This class represent the Level Control Cluster as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Alessandro Giari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface LevelControl extends ZCLCluster { - - static final short ID = 0x0008; - static final String NAME = "LevelControl"; - static final String DESCRIPTION = "Attributes and commands for controlling devices that"; - - static final byte MOVE_TO_LEVEL_ID = 0x00; - static final byte MOVE_ID = 0x01; - static final byte STEP_ID = 0x02; - static final byte STOP_ID = 0x03; - - static final byte MOVE_TO_LEVEL_WITH_ONOFF_ID = 0x04; - static final byte MOVE_WITH_ONOFF_ID = 0x05; - static final byte STEP_WITH_ONOFF_ID = 0x06; - static final byte STOP_WITH_ONOFF_ID = 0x07; - - public Attribute getAttributeCurrentLevel(); - - public Attribute getAttributeRemainingTime(); - - public Attribute getAttributeOnOffTransitionTime(); - - public Attribute getAttributeOnLevel(); - - public Response moveToLevel(short level, int time) throws ZigBeeClusterException; - - public Response move(byte mode, short rate) throws ZigBeeClusterException; - - public Response step(byte mode, short step, int time) throws ZigBeeClusterException; - - public Response stop() throws ZigBeeClusterException; - - /** - * @since 0.6.0 - */ - public Response moveToLevelWithOnOff(short level, int time) throws ZigBeeClusterException; - - /** - * @since 0.6.0 - */ - public Response moveWithOnOff(byte mode, short rate) throws ZigBeeClusterException; - - /** - * @since 0.6.0 - */ - public Response stepWithOnOff(byte mode, short step, int time) throws ZigBeeClusterException; - - /** - * @since 0.6.0 - */ - public Response stopWithOnOff() throws ZigBeeClusterException; - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/OnOff.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/OnOff.java deleted file mode 100644 index 87f73b7fe8899..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/OnOff.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.general; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; - -/** - * This class represent the On/off Cluster as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface OnOff extends ZCLCluster { - - static final short ID = 0x0006; - static final String NAME = "OnOff"; - static final String DESCRIPTION = "Attributes and commands for switching devices between 'On' and 'Off' states."; - - static final byte OFF_ID = 0x00; - static final byte ON_ID = 0x01; - static final byte TOGGLE_ID = 0x02; - - public Attribute getAttributeOnOff(); - - public Response on() throws ZigBeeClusterException; - - public Response off() throws ZigBeeClusterException; - - public Response toggle() throws ZigBeeClusterException; - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/OnOffSwitch.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/OnOffSwitch.java deleted file mode 100644 index 92ba17a88c822..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/OnOffSwitch.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.general; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; - -/** - * This class represent the On/off Cluster as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface OnOffSwitch extends ZCLCluster { - - public Attribute getAttributeOnOff(); - - public Response on(boolean disableDefatultResponse); - - public Response off(boolean disableDefatultResponse); - - public Response toggle(boolean disableDefatultResponse); - - - /** - * Alias for the method {@link #on(true)} - * - * @see #on(boolean) - */ - public void on(); - - /** - * Alias for the method {@link #off(true)} - * - * @see #off(boolean) - */ - public void off(); - - /** - * Alias for the method {@link #toggle(true)} - * - * @see #toggle(boolean) - */ - public void toggle(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/OnOffSwitchConfiguration.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/OnOffSwitchConfiguration.java deleted file mode 100644 index d1fc853db5d1a..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/OnOffSwitchConfiguration.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.general; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; - -/** - * This class represent the On Off Switch Configuration Cluster as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Alessandro Giari - * @author Manlio Bacco - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface OnOffSwitchConfiguration extends ZCLCluster { - - static final short ID = 0x0007; - static final String NAME = "OnOff Switch Configuration"; - static final String DESCRIPTION = "Attributes and commands for configuring OnOff switching devices."; - - public Attribute getAttributeSwitchType(); - - public Attribute getAttributeSwitchActions(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/PowerConfiguration.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/PowerConfiguration.java deleted file mode 100644 index 3fe321cf1c49c..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/PowerConfiguration.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.general; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; - -/** - * This class represent the Power Configuration Cluster as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Alessandro Giari * - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface PowerConfiguration extends ZCLCluster { - - static final short ID = 0x0001; - static final String NAME = "PowerConfiguration"; - static final String DESCRIPTION = "Attributes for determining more detailed information about a device's power source, and for configuring under/over voltage alarms."; - - - public Attribute getAttributeMainsVoltage(); - - public Attribute getAttributeMainsFrequency(); - - public Attribute getAttributeMainsAlarmMask(); - - public Attribute getAttributeMainsVoltageMinThreshold(); - - public Attribute getAttributeMainsVoltageMaxThreshold(); - - public Attribute getAttributeMainsDwellTripPoint(); - - public Attribute getAttributeBatteryVoltage(); - - public Attribute getAttributeBatteryManufacturer(); - - public Attribute getAttributeBatterySize(); - - public Attribute getAttributeBatteryAHrRating(); - - public Attribute getAttributeBatteryQuantity(); - - public Attribute getAttributeBatteryRatedVoltage(); - - public Attribute getAttributeBatteryAlarmMask(); - - public Attribute getAttributeBatteryVoltageMinThreshold(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/RSSILocation.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/RSSILocation.java deleted file mode 100644 index a1c0c25bedb39..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/RSSILocation.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.general; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; - -/** - * This class represent the On/off Cluster as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * NODE: THIS CLASS IS ONLY A PLACEHOLDER THE INTERFACE IS WRONG - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface RSSILocation extends ZCLCluster { - - //TODO Generate this class - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/Scenes.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/Scenes.java deleted file mode 100644 index a0d87cd7551c6..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/Scenes.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.general; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.scenes.AddScenePayload; - -/** - * This class represent the Scenes Cluster as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Alessandro Giari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface Scenes extends ZCLCluster { - - static final short ID = 0x0005; - static final String NAME = "Scenes"; - static final String DESCRIPTION = "Attributes and commands for scene configuration and manipulation."; - - static final byte ADD_SCENE = 0x00; - static final byte VIEW_SCENE = 0x01; - static final byte REMOVE_SCENE = 0x02; - static final byte REMOVE_ALL_SCENES = 0x03; - static final byte STORE_SCENE = 0x04; - static final byte RECALL_SCENE = 0x05; - static final byte GET_SCENE_MEMBERSHIP = 0x06; - - public Attribute getAttributeSceneCount(); - - public Attribute getAttributeCurrentScene(); - - public Attribute getAttributeCurrentGroup(); - - public Attribute getAttributeSceneValid(); - - public Attribute getAttributeNameSupport(); - - public Attribute getAttributeLastConfiguredBy(); - - public Response addScene(AddScenePayload scenepayload) throws ZigBeeClusterException; //TODO Create proper class - - public Response viewScene(int groupId, short sceneId) throws ZigBeeClusterException; - - public Response removeScene(int groupId, short sceneId) throws ZigBeeClusterException; - - public Response removeAllScenes(int groupId) throws ZigBeeClusterException; - - public Response storeScene(int groupId, short sceneId) throws ZigBeeClusterException; - - public void recallScene(int groupId, short sceneId) throws ZigBeeClusterException; - - public Response getSceneMembership(int groupId) throws ZigBeeClusterException; - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/Time.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/Time.java deleted file mode 100644 index 761d8a12dda05..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/Time.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.general; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; - -/** - * This class represent the Time Cluster as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Alessandro Giari * - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface Time extends ZCLCluster { - - static final short ID = 0x000A; - static final String NAME = "Time"; - static final String DESCRIPTION = "Attributes and commands that provide a basic interface to a real-time clock."; - - - public Attribute getAttributeTime(); - - public Attribute getAttributeTimeStatus(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/alarms/AlarmListener.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/alarms/AlarmListener.java deleted file mode 100644 index 00b1106e73373..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/alarms/AlarmListener.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.general.alarms; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface AlarmListener { - - public void alarm(int code, int clusterId); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/alarms/AlarmResponse.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/alarms/AlarmResponse.java deleted file mode 100644 index 8b87c801bcbc5..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/alarms/AlarmResponse.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.general.alarms; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; - -/** - * This class represent the Get Alarm Response as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.4.0 - */ -public interface AlarmResponse extends Response { - - public static final byte ID = 0x00; - - /** - * @return the int representing the Alarm Code field. - */ - public int getAllarmCode(); - - /** - * @return the int representing the Cluster PROFILE_ID_HOME_AUTOMATION field. - */ - public int getClusterID(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/alarms/GetAlarmResponse.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/alarms/GetAlarmResponse.java deleted file mode 100644 index 1e863191aae0c..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/alarms/GetAlarmResponse.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.general.alarms; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; - -/** - * This class represent the Alarm Command as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.4.0 - */ -public interface GetAlarmResponse extends Response { - - public static final byte ID = 0x01; - - /** - * @return the {@link Status} representing the Status field - */ - public Status getStatus(); - - /** - * @return the int representing the Alarm Code field. The value is valid only if getStatus() = Status.SUCCESS - */ - public int getAllarmCode(); - - /** - * @return the int representing the Cluster PROFILE_ID_HOME_AUTOMATION field. The value is valid only if getStatus() = Status.SUCCESS - */ - public int getClusterID(); - - /** - * @return the long representing the Time stamp field. The value is valid only if getStatus() = Status.SUCCESS - */ - public long getTimestamp(); - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/commissioning/ResetStartupOptions.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/commissioning/ResetStartupOptions.java deleted file mode 100644 index 5060f0007452e..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/commissioning/ResetStartupOptions.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.api.general.commissioning; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.8.0 - */ -public interface ResetStartupOptions { - - byte getResetCurrent(); - - byte getResetAll(); - - byte getEraseIndex(); -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/commissioning/ResetStartupParametersResponse.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/commissioning/ResetStartupParametersResponse.java deleted file mode 100644 index 4d2aac3dcd256..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/commissioning/ResetStartupParametersResponse.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.api.general.commissioning; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.8.0 - */ -public interface ResetStartupParametersResponse extends Response { - - public static final byte ID = 0x03; - - public Status getStatus(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/commissioning/ResetStartupPayload.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/commissioning/ResetStartupPayload.java deleted file mode 100644 index ce6cebd59772e..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/commissioning/ResetStartupPayload.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.api.general.commissioning; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.8.0 - */ -public interface ResetStartupPayload { - - ResetStartupOptions getOptions(); - - int getIndex(); -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/commissioning/RestartDeviceOptions.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/commissioning/RestartDeviceOptions.java deleted file mode 100644 index 367dcdda9b784..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/commissioning/RestartDeviceOptions.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.api.general.commissioning; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.8.0 - */ -public interface RestartDeviceOptions { - - /* startup mode - * 0b000: restart installing and using current startup parameters set - * 0b001: restart using and not replacing current set of stack attributes * - */ - byte[] getStartupMode(); - - /* immediate - * 1: restart either immediately on receipt of the RestartDeviceRequest frame if delay 0 - * or immediately after prescribed delay and jitter has transpired if not - * 0: restart until after prescribed delay and jitter (if any) has transpired - * but can also wait for a "convenient" moment (i.e. all pending frames have been transmitted) - */ - byte getImmediate(); - // byte[] getReserved(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/commissioning/RestartDevicePayload.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/commissioning/RestartDevicePayload.java deleted file mode 100644 index aecdbc879b0e2..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/commissioning/RestartDevicePayload.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.api.general.commissioning; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.8.0 - */ -public interface RestartDevicePayload { - - RestartDeviceOptions getOptions(); - - int getDelay(); - - int getJitter(); - -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/commissioning/RestartDeviceResponse.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/commissioning/RestartDeviceResponse.java deleted file mode 100644 index df73a695b854d..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/commissioning/RestartDeviceResponse.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.api.general.commissioning; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.8.0 - */ -public interface RestartDeviceResponse extends Response { - - public static final byte ID = 0x00; - - public Status getStatus(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/commissioning/RestoreStartupParametersResponse.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/commissioning/RestoreStartupParametersResponse.java deleted file mode 100644 index 0a8723eab55b3..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/commissioning/RestoreStartupParametersResponse.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.api.general.commissioning; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.8.0 - */ -public interface RestoreStartupParametersResponse extends Response { - - public static final byte ID = 0x02; - - public Status getStatus(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/commissioning/SaveStartupParametersResponse.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/commissioning/SaveStartupParametersResponse.java deleted file mode 100644 index b8b42485c7b69..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/commissioning/SaveStartupParametersResponse.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.api.general.commissioning; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.8.0 - */ -public interface SaveStartupParametersResponse extends Response { - - public static final byte ID = 0x01; - - public Status getStatus(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/groups/AddGroupResponse.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/groups/AddGroupResponse.java deleted file mode 100644 index e4d1f3ccd3289..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/groups/AddGroupResponse.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.general.groups; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; - -/** - * This class represent the Add Group Response as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface AddGroupResponse extends Response { - - public static final byte ID = 0x00; - - /** - * @return {@link Status} representing the Status field - */ - public Status getStatus(); - - /** - * @return the int representing the Group PROFILE_ID_HOME_AUTOMATION field - */ - public int getGroupId(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/groups/GetGroupMembershipResponse.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/groups/GetGroupMembershipResponse.java deleted file mode 100644 index 315b9e8d86dad..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/groups/GetGroupMembershipResponse.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.general.groups; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; - -/** - * This class represent the Add Group Response as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface GetGroupMembershipResponse extends Response { - - public static final byte ID = 0x02; - - /** - * @return a short representing the Capacity field - */ - public short getCapacity(); - - /** - * @return int[] representing the Group list and Group count field - */ - public int[] getGroupList(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/groups/RemoveGroupResponse.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/groups/RemoveGroupResponse.java deleted file mode 100644 index 02237c986a93f..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/groups/RemoveGroupResponse.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.general.groups; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; - -/** - * This class represent the Remove Group Response as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface RemoveGroupResponse extends Response { - - public static final byte ID = 0x03; - - /** - * @return {@link Status} representing the Status field - */ - public Status getStatus(); - - /** - * @return the int representing the Group PROFILE_ID_HOME_AUTOMATION field - */ - public int getGroupId(); - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/groups/ViewGroupResponse.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/groups/ViewGroupResponse.java deleted file mode 100644 index 001c2bafdaa06..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/groups/ViewGroupResponse.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.general.groups; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; - -/** - * This class represent the View Group Response as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface ViewGroupResponse extends Response { - - public static final byte ID = 0x01; - - /** - * @return {@link Status} representing the Status field - */ - public Status getStatus(); - - /** - * @return the int representing the Group PROFILE_ID_HOME_AUTOMATION field - */ - public int getGroupId(); - - /** - * @return the {@link String} representing the Group Name field - */ - public String getGroupName(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/identify/IdentifyQueryResponse.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/identify/IdentifyQueryResponse.java deleted file mode 100644 index ab697876182c1..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/identify/IdentifyQueryResponse.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.general.identify; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; - -/** - * This class represent the Identify Query Response as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface IdentifyQueryResponse extends Response { - public static final byte ID = 0x00; - - /** - * @return the int representing the Timeout field - */ - public int getTimeout(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/scenes/AddScenePayload.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/scenes/AddScenePayload.java deleted file mode 100644 index 7fad24033f02d..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/scenes/AddScenePayload.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.general.scenes; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public interface AddScenePayload { - - int getGroupId(); - - short getSceneId(); - - int getTransitionTime(); - - String getSceneName(); - - ExtensionFieldSetAddScene[] getExtensionFieldSet(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/scenes/AddSceneResponse.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/scenes/AddSceneResponse.java deleted file mode 100644 index 10b0d23794f2a..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/scenes/AddSceneResponse.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.general.scenes; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; - -/** - * This class represent the Add Scene Response as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface AddSceneResponse extends Response { - - public static final byte ID = 0x00; - - /** - * @return {@link Status} representing the Status field - */ - public Status getStatus(); - - /** - * @return the int representing the Group PROFILE_ID_HOME_AUTOMATION field - */ - public int getGroupId(); - - - /** - * @return the short representing the Scene PROFILE_ID_HOME_AUTOMATION field - */ - public short getSceneId(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/scenes/ExtensionFieldSetAddScene.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/scenes/ExtensionFieldSetAddScene.java deleted file mode 100644 index 9ced061f5651d..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/scenes/ExtensionFieldSetAddScene.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.general.scenes; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface ExtensionFieldSetAddScene { - //TODO This signatures of this interface has to be confirmed by practical experiment - - public int getClusterId(); - - public Attribute[] getAttributes(int clusterId); - - public Object getValue(Attribute attribute); - - public int getLength(); - - - - /* - public int[] getClusters(); - public int[] getAttributes(int clusterId); - public Object getValue(int clusterId, int attributeId); - */ - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/scenes/ExtensionFieldSetViewResponse.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/scenes/ExtensionFieldSetViewResponse.java deleted file mode 100644 index 3a6a2f6033986..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/scenes/ExtensionFieldSetViewResponse.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.general.scenes; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public interface ExtensionFieldSetViewResponse { - - public int getClusterId(); - - public int[] getAttributes(int clusterId); - - public Object getValue(int attribute); - - public boolean endSet(); - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/scenes/GetSceneMembershipResponse.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/scenes/GetSceneMembershipResponse.java deleted file mode 100644 index dbdf2658c3197..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/scenes/GetSceneMembershipResponse.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.general.scenes; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; - -/** - * This class represent the Get Scene Membership Response as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface GetSceneMembershipResponse extends Response { - - public static final byte ID = 0x06; - - /** - * @return {@link Status} representing the Status field - */ - public Status getStatus(); - - /** - * @return the short representing the Capacity field - */ - public short getCapacity(); - - /** - * @return the int representing the Group PROFILE_ID_HOME_AUTOMATION field - */ - public int getGroupId(); - - - /** - * @return the short representing the Scene Count and Scene List field - */ - public short[] getSceneList(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/scenes/RemoveAllScenesResponse.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/scenes/RemoveAllScenesResponse.java deleted file mode 100644 index fe881e16abcca..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/scenes/RemoveAllScenesResponse.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.general.scenes; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; - -/** - * This class represent the Remove All Scene Response as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface RemoveAllScenesResponse extends Response { - - public static final byte ID = 0x03; - - /** - * @return {@link Status} representing the Status field - */ - public Status getStatus(); - - /** - * @return the int representing the Group PROFILE_ID_HOME_AUTOMATION field - */ - public int getGroupId(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/scenes/RemoveSceneResponse.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/scenes/RemoveSceneResponse.java deleted file mode 100644 index 0b189ac420e50..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/scenes/RemoveSceneResponse.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.general.scenes; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; - -/** - * This class represent the Remove Scene Response as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface RemoveSceneResponse extends Response { - - public static final byte ID = 0x02; - - /** - * @return {@link Status} representing the Status field - */ - public Status getStatus(); - - /** - * @return the int representing the Group PROFILE_ID_HOME_AUTOMATION field - */ - public int getGroupId(); - - - /** - * @return the short representing the Scene PROFILE_ID_HOME_AUTOMATION field - */ - public short getSceneId(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/scenes/StoreSceneResponse.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/scenes/StoreSceneResponse.java deleted file mode 100644 index 859ab896cd181..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/scenes/StoreSceneResponse.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.general.scenes; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; - -/** - * This class represent the Store Scene Response as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface StoreSceneResponse extends Response { - - public static final short ID = 0x04; - - /** - * @return {@link Status} representing the Status field - */ - public Status getStatus(); - - /** - * @return the int representing the Group PROFILE_ID_HOME_AUTOMATION field - */ - public int getGroupId(); - - - /** - * @return the short representing the Scene PROFILE_ID_HOME_AUTOMATION field - */ - public short getSceneId(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/scenes/ViewSceneResponse.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/scenes/ViewSceneResponse.java deleted file mode 100644 index d01ffb3b8a62a..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/general/scenes/ViewSceneResponse.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.general.scenes; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; - -/** - * This class represent the View Scene Response as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface ViewSceneResponse extends Response { - - public static final short ID = 0x01; - - /** - * @return {@link Status} representing the Status field - */ - public Status getStatus(); - - /** - * @return the int representing the Group PROFILE_ID_HOME_AUTOMATION field - */ - public int getGroupId(); - - - /** - * @return the short representing the Scene PROFILE_ID_HOME_AUTOMATION field - */ - public short getSceneId(); - - /** - * @return the int representing the Transition time field - */ - public int getTransitionTime(); - - /** - * @return the {@link String} representing the Scene Name field - */ - public String getSceneName(); - - /** - * @return the {@link ExtensionFieldSet} representing the Extension field - */ - public ExtensionFieldSetViewResponse[] getExstensionFieldSet(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/AttributeReport.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/AttributeReport.java deleted file mode 100644 index 73b89e71a008e..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/AttributeReport.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.global; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeType; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public interface AttributeReport { - - public int getAttributeId(); - - public ZigBeeType getAttributeDataType(); - - public Object getAttributeData(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/AttributeReportingConfigurationRecord.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/AttributeReportingConfigurationRecord.java deleted file mode 100644 index 6ee7902d91f16..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/AttributeReportingConfigurationRecord.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.global; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeType; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public interface AttributeReportingConfigurationRecord { - - public int getDiretion(); - - public int getAttributeId(); - - public ZigBeeType getAttributeDataType(); - - public int getMinimumReportingInterval(); - - public int getMaximumReportinInterval(); - - public Object getReportableChange(); - - public int getTimeoutPeriod(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/AttributeStatusRecord.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/AttributeStatusRecord.java deleted file mode 100644 index 3ea44dde68ed5..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/AttributeStatusRecord.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.global; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public interface AttributeStatusRecord { - - public byte getStatus(); - - public int getDirection(); - - public int getAttributeId(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/ConfigureReportingResponse.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/ConfigureReportingResponse.java deleted file mode 100644 index e70d9691844d8..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/ConfigureReportingResponse.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.global; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public interface ConfigureReportingResponse extends Response { - - public static byte ID = 0x7; - - public AttributeStatusRecord[] getAttributeStatusRecord(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/DefaultResponse.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/DefaultResponse.java deleted file mode 100644 index 1e7baa318b02c..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/DefaultResponse.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.global; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface DefaultResponse extends Response { - - - public static final byte ID = 0x0b; - - /** - * @return the short representing the id of the invoking command that generated as result
- * this {@link IdentifyQueryResponse} - */ - public byte getCommandId(); - - /** - * @return the {@link Status} of result of the invoked command - */ - - public Status getStatus(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/ReadAttributesResponse.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/ReadAttributesResponse.java deleted file mode 100644 index a9bff20f387ec..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/ReadAttributesResponse.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.global; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public interface ReadAttributesResponse extends Response { - - public static byte ID = 0x1; - - - public ReadAttributesStatus[] getReadAttributeStatus(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/ReadAttributesStatus.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/ReadAttributesStatus.java deleted file mode 100644 index cb566d87e4df1..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/ReadAttributesStatus.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.global; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public interface ReadAttributesStatus { - - public int getAttributeId(); - - public byte getStatus(); - - public byte getAttributeDataType(); - - public Object getAttributeData(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/ReportAttributesResponse.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/ReportAttributesResponse.java deleted file mode 100644 index 07ebafc4ada68..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/ReportAttributesResponse.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.global; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public interface ReportAttributesResponse extends Response { - public static byte ID = 0x0a; - - public AttributeReport[] getAttributeReports(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/WriteAttributeRecord.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/WriteAttributeRecord.java deleted file mode 100644 index 1974e035e0c5a..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/WriteAttributeRecord.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.global; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeType; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public interface WriteAttributeRecord { - - public int getAttributeId(); - - public ZigBeeType getAttributeDataType(); - - public Object getAttributeData(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/WriteAttributesResponse.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/WriteAttributesResponse.java deleted file mode 100644 index 63037e4cd3d48..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/WriteAttributesResponse.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.global; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public interface WriteAttributesResponse extends Response { - - public static byte ID = 0x4; - - public WriteAttributesStatus[] getWriteAttributesStatus(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/WriteAttributesStatus.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/WriteAttributesStatus.java deleted file mode 100644 index 2fcc4d31b228d..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/global/WriteAttributesStatus.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.global; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public interface WriteAttributesStatus { - - public int getAttributeId(); - - public byte getStatus(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/lighting/ColorControl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/lighting/ColorControl.java deleted file mode 100644 index 6a68535fe89f1..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/lighting/ColorControl.java +++ /dev/null @@ -1,234 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.lighting; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Manlio Bacco - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.8.0 - */ -public interface ColorControl extends ZCLCluster { - - static final short ID = 0x0300; - static final String NAME = "Color Control"; - static final String DESCRIPTION = "Attributes and commands for changing the color of a light."; - - public static final byte MOVE_TO_HUE_ID = 0x00; - public static final byte MOVE_HUE_ID = 0x01; - public static final byte STEP_HUE_ID = 0x02; - public static final byte MOVE_TO_SATURATION_ID = 0x03; - public static final byte MOVE_SATURATION_ID = 0x04; - public static final byte STEP_SATURATION_ID = 0x05; - public static final byte MOVE_TO_HUE_AND_SATURATION_ID = 0x06; - public static final byte MOVE_TO_COLOR_ID = 0x07; - public static final byte MOVE_COLOR_ID = 0x08; - public static final byte STEP_COLOR_ID = 0x09; - public static final byte MOVE_TO_COLOR_TEMPERATURE_ID = 0x0a; - - // color information - public Attribute getAttributeCurrentHue(); - - public Attribute getAttributeCurrentSaturation(); - - public Attribute getAttributeRemainingTime(); - - public Attribute getAttributeCurrentX(); - - public Attribute getAttributeCurrentY(); - - public Attribute getAttributeDriftCompensation(); - - public Attribute getAttributeCompensationText(); - - public Attribute getAttributeColorTemperature(); - - public Attribute getAttributeColorMode(); - - // defined primaries information - public Attribute getAttributeNumberOfPrimaries(); - - public Attribute getAttributePrimary1X(); - - public Attribute getAttributePrimary1Y(); - - public Attribute getAttributePrimary1Intensity(); - - public Attribute getAttributePrimary2X(); - - public Attribute getAttributePrimary2Y(); - - public Attribute getAttributePrimary2Intensity(); - - public Attribute getAttributePrimary3X(); - - public Attribute getAttributePrimary3Y(); - - public Attribute getAttributePrimary3Intensity(); - - // additional defined primaries information - public Attribute getAttributePrimary4X(); - - public Attribute getAttributePrimary4Y(); - - public Attribute getAttributePrimary4Intensity(); - - public Attribute getAttributePrimary5X(); - - public Attribute getAttributePrimary5Y(); - - public Attribute getAttributePrimary5Intensity(); - - public Attribute getAttributePrimary6X(); - - public Attribute getAttributePrimary6Y(); - - public Attribute getAttributePrimary6Intensity(); - - // defined color point settings - public Attribute getAttributeWhitePointX(); - - public Attribute getAttributeWhitePointY(); - - public Attribute getAttributeColorPointRX(); - - public Attribute getAttributeColorPointRY(); - - public Attribute getAttributeColorPointRIntensity(); - - public Attribute getAttributeColorPointGX(); - - public Attribute getAttributeColorPointGY(); - - public Attribute getAttributeColorPointGIntensity(); - - public Attribute getAttributeColorPointBX(); - - public Attribute getAttributeColorPointBY(); - - public Attribute getAttributeColorPointBIntensity(); - - // commands - - /** - * Sets hue according to HSV (aka HSB) color model. - * @param hue hue (degrees) / 360 * 254 in the range 0 - 254. - * @param direction 0 = shortest, 1 = longest, 2 = up, 3 = down - * @param transitionTime transition time in 1/10ths of a second. - * @return the response - * @throws ZigBeeClusterException if connectivity or other exception occurs with the device. - */ - public Response moveToHue(int hue, int direction, int transitionTime) throws ZigBeeClusterException; - /** - * Moves hue according to HSV (aka HSB) color model. - * @param moveMode 0 = stop, 1 = up, 2 = reserved, 3 = down - * @param rate steps per second - * @return the response - * @throws ZigBeeClusterException if connectivity or other exception occurs with the device. - */ - public Response moveHue(int moveMode, int rate) throws ZigBeeClusterException; - /** - * Steps hue according to HSV (aka HSB) color model. - * @param stepMode 0 = reserved, 1 = up, 2 = reserved, 3 = down - * @param stepSize step to be added or subtracted from current hue - * @param transtionTime transition time in 1/10ths of a second. - * @return the response - * @throws ZigBeeClusterException if connectivity or other exception occurs with the device. - */ - public Response stepHue(int stepMode, int stepSize, int transtionTime) throws ZigBeeClusterException; - /** - * Moves to saturation according to HSV (aka HSB) color model. - * @param saturation saturation * 254 in the range 0 - 254. - * @param transitionTime transition time in 1/10ths of a second. - * @return the response - * @throws ZigBeeClusterException if connectivity or other exception occurs with the device. - */ - public Response movetoSaturation(int saturation, int transitionTime) throws ZigBeeClusterException; - /** - * Moves saturation according to HSV (aka HSB) color model. - * @param moveMode 0 = stop, 1 = up, 2 = reserved, 3 = down - * @param rate steps per second - * @return the result - * @throws ZigBeeClusterException if connectivity or other exception occurs with the device. - */ - public Response moveSaturation(int moveMode, int rate) throws ZigBeeClusterException; - /** - * Steps saturation according to HSV (aka HSB) color model. - * @param stepMode 0 = reserved, 1 = up, 2 = reserved, 3 = down - * @param stepSize step to be added or subtracted from current saturation - * @param transitionTime transition time in 1/10ths of a second. - * @return the result - * @throws ZigBeeClusterException if connectivity or other exception occurs with the device. - */ - public Response stepSaturation(int stepMode, int stepSize, int transitionTime) throws ZigBeeClusterException; - /** - * Moves to hue and saturation according to HSV (aka HSB) color model. - * @param hue hue (degrees) / 360 * 254 in the range 0 - 254. - * @param saturation saturation * 254 in the range 0 - 254. - * @param transitionTime transition time in 1/10ths of a second. - * @return the result - * @throws ZigBeeClusterException if connectivity or other exception occurs with the device. - */ - public Response moveToHueAndSaturation(int hue, int saturation, int transitionTime) throws ZigBeeClusterException; - /** - * Moves to color according to CIE 1931 Color Space. - * - * @param colorX x * 65536 where colorX can be in rance 0 to 65279 - * @param colorY y * 65536 where colorY can be in rance 0 to 65279 - * @param transitionTime transition time in 1/10ths of a second. - * @return the response - * @throws ZigBeeClusterException if connectivity or other exception occurs with the device. - */ - public Response moveToColor(int colorX, int colorY, int transitionTime) throws ZigBeeClusterException; - /** - * Moves color according to CIE 1931 Color Space. - * @param rateX steps per second in X value - * @param rateY steps per second in X value - * @return the response - * @throws ZigBeeClusterException if connectivity or other exception occurs with the device. - */ - public Response moveColor(int rateX, int rateY) throws ZigBeeClusterException; - /** - * Steps color according to CIE 1931 Color Space. - * @param stepX step to be added or subtracted from current X value - * @param stepY step to be added or subtracted from current Y value - * @param transitionTime transition time in 1/10ths of a second. - * @return the response - * @throws ZigBeeClusterException if connectivity or other exception occurs with the device. - */ - public Response stepColor(int stepX, int stepY, int transitionTime) throws ZigBeeClusterException; - /** - * Moves to color temperature. - * @param colorTemperature 1 000 000 / color temperature (Kelvins) in the range 1 to 65279 - * @param transitionTime transition time in 1/10ths of a second. - * @return the response - * @throws ZigBeeClusterException if connectivity or other exception occurs with the device. - */ - public Response moveToColorTemperature(int colorTemperature, int transitionTime) throws ZigBeeClusterException; -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/measureament_sensing/FlowMeasurement.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/measureament_sensing/FlowMeasurement.java deleted file mode 100644 index 49e504e51f685..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/measureament_sensing/FlowMeasurement.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.measureament_sensing; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; - - -/** - * This class represent the Flow Measurement Cluster as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * @author Giancarlo Riolo - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 18:00:05 +0200 (mar, 06 ago 2013) $) - * @since 0.8.0 - */ - -public interface FlowMeasurement extends ZCLCluster { - - public static final short ID = 0x0404; - static final String NAME = "Flow Measurement"; - static final String DESCRIPTION = "blablabla"; - - public Attribute getAttributeDescription(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/measureament_sensing/IlluminanceLevelSensing.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/measureament_sensing/IlluminanceLevelSensing.java deleted file mode 100644 index 9f747d15b15d7..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/measureament_sensing/IlluminanceLevelSensing.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.measureament_sensing; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; - -/** - * This class represent the Illuminance Level Sensing Cluster as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * @author Giancarlo Riolo - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 18:00:05 +0200 (mar, 06 ago 2013) $) - * @since 0.8.0 - */ - -public interface IlluminanceLevelSensing extends ZCLCluster { - - public static final short ID = 0x0401; - static final String NAME = "Illuminance Level Sensing"; - static final String DESCRIPTION = "blablabla"; - - public Attribute getAttributeDescription(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/measureament_sensing/IlluminanceMeasurement.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/measureament_sensing/IlluminanceMeasurement.java deleted file mode 100644 index e04afe6282254..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/measureament_sensing/IlluminanceMeasurement.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.api.measureament_sensing; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision: 42 $ ($LastChangedDate: 2010-09-23 14:21:48 +0200 (Thu, 23 Sep 2010) $) - * @since 0.8.0 - */ -public interface IlluminanceMeasurement extends ZCLCluster { - - static final short ID = 0x0400; - static final String NAME = "Illuminance Measurement"; - static final String DESCRIPTION = "Attributes and commands for configuring the measurement of illuminance and reporting illuminance measurement."; - - public Attribute getMeasuredValue(); - - public Attribute getMinMeasuredValue(); - - public Attribute getMaxMeasuredValue(); - - public Attribute getTolerance(); - - public Attribute getLightSensorType(); -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/measureament_sensing/OccupancySensing.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/measureament_sensing/OccupancySensing.java deleted file mode 100644 index 8c8b4693c58bb..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/measureament_sensing/OccupancySensing.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.measureament_sensing; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; - -/** - * This class represent the Occupancy sensing Cluster as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Manlio Bacco - * @author Alessandro Giari * - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface OccupancySensing extends ZCLCluster { - - static final short ID = 0x0406; - static final String NAME = "OccupancySensing"; - static final String DESCRIPTION = "Attributes and commands for configuring occupancy sensing, and reporting occupancy status."; - - public Attribute getAttributeOccupancy(); - - public Attribute getAttributeOccupancySensorType(); - - public Attribute getAttributePIROccupiedToUnoccupiedDelay(); - - public Attribute getAttributePIRUnoccupiedToOccupiedDelay(); - - /* - * @since 0.8.0 - */ - public Attribute getAttributePIRUnoccupiedToOccupiedThreshold(); - - public Attribute getAttributeUltraSonicOccupiedToUnoccupiedDelay(); - - public Attribute getAttributeUltraSonicUnoccupiedToOccupiedDelay(); - - /* - * @since 0.8.0 - */ - public Attribute getAttributeUltrasonicUnoccupiedToOccupiedThreshold(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/measureament_sensing/PressureMeasurement.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/measureament_sensing/PressureMeasurement.java deleted file mode 100644 index 65df3f95b74aa..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/measureament_sensing/PressureMeasurement.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.measureament_sensing; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; - -/** - * This class represent the Metering Cluster as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * @author Giancarlo Riolo - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 18:00:05 +0200 (mar, 06 ago 2013) $) - * @since 0.8.0 - */ - -public interface PressureMeasurement extends ZCLCluster { - - public static final short ID = 0x0403; - static final String NAME = "Pressure Measurement"; - static final String DESCRIPTION = "Attributes and commands for configuring the measurement" - + " of pressure, and reporting pressure measurements"; - - public Attribute getAttributeDescription(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/measureament_sensing/RelativeHumidityMeasurement.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/measureament_sensing/RelativeHumidityMeasurement.java deleted file mode 100644 index 36e8efc16991b..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/measureament_sensing/RelativeHumidityMeasurement.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.measureament_sensing; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; - -/** - * This class represent the Relative Humidity Measurement Cluster as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.4.0 - */ -public interface RelativeHumidityMeasurement extends ZCLCluster { - - static final short ID = 0x0405; - static final String NAME = "Relative Humidity Measurement"; - static final String DESCRIPTION = "Attributes and commands for configuring the measurement of temperature, and reporting relative humidity measurements."; - - - public Attribute getAttributeMeasuredValue(); - - public Attribute getAttributeMinMeasuredValue(); - - public Attribute getAttributeMaxMeasuredValue(); - - public Attribute getAttributeTolerance(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/measureament_sensing/TemperatureMeasurement.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/measureament_sensing/TemperatureMeasurement.java deleted file mode 100644 index 483c8e6244545..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/measureament_sensing/TemperatureMeasurement.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.measureament_sensing; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; - -/** - * This class represent the Temperature Measurement Cluster as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Alessandro Giari * - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface TemperatureMeasurement extends ZCLCluster { - - static final short ID = 0x0402; - static final String NAME = "TemperatureMeasurement"; - static final String DESCRIPTION = "Attributes and commands for configuring the measurement of temperature, and reporting temperature measurements."; - - - public Attribute getAttributeMeasuredValue(); - - public Attribute getAttributeMinMeasuredValue(); - - public Attribute getAttributeMaxMeasuredValue(); - - public Attribute getAttributeTolerance(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/protocol_interfaces/GenericTunnel.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/protocol_interfaces/GenericTunnel.java deleted file mode 100755 index dbb7352727b60..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/protocol_interfaces/GenericTunnel.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - Copyright 2013-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.protocol_interfaces; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; - -/** - * This class represent the Generic Tunnel Cluster as defined by the document:
- * ZigBee Cluster Library public release version 075123r04ZB - *

- * NORE: THIS CLASS IS ONLY A PLACEHOLDER THE INTERFACE IS WRONG - * - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.8.0 - */ -public interface GenericTunnel extends ZCLCluster { - - //TODO Generate this class - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/IASACE.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/IASACE.java deleted file mode 100644 index 125bb4dddd3cb..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/IASACE.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.api.security_safety; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_ace.BypassPayload; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision: 42 $ ($LastChangedDate: 2010-09-23 14:21:48 +0200 (Thu, 23 Sep 2010) $) - * @since 0.8.0 - */ -public interface IASACE extends ZCLCluster { - - public static final short ID = 0x0501; - static final String NAME = "IAS ACE"; - static final String DESCRIPTION = "Attributes and commands for any Ancillary Control Equipment device."; - - static final byte ARM = 0x00; - static final byte BYPASS = 0x01; - static final byte EMERGENCY = 0x02; - static final byte FIRE = 0x03; - static final byte PANIC = 0x04; - static final byte GET_ZONE_ID_MAP = 0x05; - static final byte GET_ZONE_INFORMATION = 0x06; - - public Response arm(byte armMode) throws ZigBeeClusterException; - - public void bypass(BypassPayload payload) throws ZigBeeClusterException; - - public void emergency() throws ZigBeeClusterException; - - public void fire() throws ZigBeeClusterException; - - public void panic() throws ZigBeeClusterException; - - public Response getZoneIdMap() throws ZigBeeClusterException; - - public Response getZoneInformation(int zoneID) throws ZigBeeClusterException; -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/IASWD.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/IASWD.java deleted file mode 100644 index 173bbd3beb177..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/IASWD.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.security_safety; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_wd.SquawkPayload; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_wd.StartWarningPayload; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Manlio Bacco - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface IASWD extends ZCLCluster { - - public static final short ID = 0x0502; - static final String NAME = "IAS WD"; - static final String DESCRIPTION = "Attributes and commands for any Warning Device Equipment device."; - - static final byte START_WARNING = 0x00; - static final byte SQUAWK = 0x01; - - public Attribute getAttributeMaxDuration(); - - public void startWarning(StartWarningPayload payload) throws ZigBeeClusterException; - - public void squawk(SquawkPayload payload) throws ZigBeeClusterException; -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/IASZone.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/IASZone.java deleted file mode 100644 index e59d8e838fcf9..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/IASZone.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.security_safety; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_zone.ZoneEnrollRequestPayload; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_zone.ZoneEnrollResponse; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_zone.ZoneStatusChangeNotificationListener; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_zone.ZoneStatusChangeNotificationPayload; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Manlio Bacco - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface IASZone extends ZCLCluster { - - public static final short ID = 0x0500; - static final String NAME = "IAS Zone"; - static final String DESCRIPTION = "Attributes and commands for IAS security zone device."; - - //received - static final byte ZONE_ENROLL_RESPONSE_ID = 0x00; - - //generated - static final byte ZONE_STATUS_CHANGE_NOTIFICATION_ID = 0x00; - static final byte ZONE_ENROLL_REQUEST_ID = 0x01; - - // zone information attribute set - public Attribute getAttributeZoneState(); - - public Attribute getAttributeZoneType(); - - public Attribute getAttributeZoneStatus(); - - // zone settings attribute set - public Attribute getAttributeIASCIEAddress(); - - // commands generated - public Response zoneStatusChangeNotification(ZoneStatusChangeNotificationPayload payload) throws ZigBeeClusterException; - - public ZoneEnrollResponse zoneEnrollRequest(ZoneEnrollRequestPayload payload) throws ZigBeeClusterException; - - /* - * @since 0.8.0 - */ - public boolean addZoneStatusChangeNotificationListener(ZoneStatusChangeNotificationListener listener); - - /* - * @since 0.8.0 - */ - public boolean removeZoneStatusChangeNotificationListener(ZoneStatusChangeNotificationListener listener); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_ace/ArmResponse.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_ace/ArmResponse.java deleted file mode 100644 index 148782c0cf023..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_ace/ArmResponse.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_ace; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.8.0 - */ -public interface ArmResponse extends Response { - - public static final byte ID = 0x00; - - public byte getArmNotification(); -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_ace/BypassPayload.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_ace/BypassPayload.java deleted file mode 100644 index 17608b06780af..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_ace/BypassPayload.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_ace; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.8.0 - */ -public interface BypassPayload { - - int getNumberOfZones(); - - int[] getZonesID(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_ace/ZoneIDMapResponse.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_ace/ZoneIDMapResponse.java deleted file mode 100644 index fab04eeea0285..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_ace/ZoneIDMapResponse.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_ace; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_ace.ZoneTable.Zone; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.8.0 - */ -public interface ZoneIDMapResponse extends Response { - - public static final byte ID = 0x01; - - public Zone[] getZonesID(); -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_ace/ZoneInformationResponse.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_ace/ZoneInformationResponse.java deleted file mode 100644 index 0ca37266cf65b..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_ace/ZoneInformationResponse.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_ace; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.8.0 - */ -public interface ZoneInformationResponse extends Response { - - public static final byte ID = 0x02; - - public int getZoneID(); - - public short getZoneType(); - - public String getIEEEAddress(); -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_ace/ZoneTable.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_ace/ZoneTable.java deleted file mode 100644 index 0626985c1c69d..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_ace/ZoneTable.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_ace; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.8.0 - */ -public interface ZoneTable { - - class Zone { - - Short zoneID; - Short zoneType; - String zoneAddress; - - public Zone(Short zoneID, Short zoneType, String zoneAddress) { - this.zoneID = zoneID; - this.zoneType = zoneType; - this.zoneAddress = zoneAddress; - } - - public Short getZoneID() { - return zoneID; - } - - public void setZoneID(Short zoneID) { - this.zoneID = zoneID; - } - - public Short getZoneType() { - return zoneType; - } - - public void setZoneType(Short zoneType) { - this.zoneType = zoneType; - } - - public String getZoneAddress() { - return zoneAddress; - } - - public void setZoneAddress(String zoneAddress) { - this.zoneAddress = zoneAddress; - } - } - - public Zone[] getZoneTable(); - - public void addZone(Short zoneID, Short zoneType, String zoneAddress); - - public void removeZone(Short zoneID); -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_wd/SquawkPayload.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_wd/SquawkPayload.java deleted file mode 100644 index 10cfe2a463784..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_wd/SquawkPayload.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_wd; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.8.0 - */ -public interface SquawkPayload { - - public short getSquawkMode(); - - public short getStrobe(); - - public short getSquawkLevel(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_wd/StartWarningPayload.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_wd/StartWarningPayload.java deleted file mode 100644 index 54e9796eaffad..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_wd/StartWarningPayload.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_wd; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.8.0 - */ -public interface StartWarningPayload { - - public short getWarningMode(); - - public short getStrobe(); - - public int getWarningDuration(); -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_zone/ZoneEnrollRequestPayload.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_zone/ZoneEnrollRequestPayload.java deleted file mode 100644 index 60a0d9517b89d..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_zone/ZoneEnrollRequestPayload.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_zone; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision: 42 $ ($LastChangedDate: 2010-09-23 14:21:48 +0200 (Thu, 23 Sep 2010) $) - * @since 0.8.0 - */ -public interface ZoneEnrollRequestPayload { - - public short getZoneType(); - - public int getManufacturerCode(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_zone/ZoneEnrollResponse.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_zone/ZoneEnrollResponse.java deleted file mode 100644 index 5fb469687438f..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_zone/ZoneEnrollResponse.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_zone; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Manlio Bacco - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public interface ZoneEnrollResponse extends Response { - - public static final byte ID = 0x00; - - public int getEnrollResponseCode(); - - public int getZoneID(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_zone/ZoneState.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_zone/ZoneState.java deleted file mode 100644 index efb0f7dd1002f..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_zone/ZoneState.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_zone; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision: 42 $ ($LastChangedDate: 2010-09-23 14:21:48 +0200 (Thu, 23 Sep 2010) $) - * @since 0.8.0 - */ -public interface ZoneState { - - public final String NOT_ENROLLED = "0x00"; - public final String ENROLLED = "0x01"; -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_zone/ZoneStatusChangeNotificationListener.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_zone/ZoneStatusChangeNotificationListener.java deleted file mode 100644 index 191693af0b5a5..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_zone/ZoneStatusChangeNotificationListener.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_zone; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.8.0 - */ -public interface ZoneStatusChangeNotificationListener { - - public void zoneStatusChangeNotification(short zoneStatus); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_zone/ZoneStatusChangeNotificationPayload.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_zone/ZoneStatusChangeNotificationPayload.java deleted file mode 100644 index d5bb5f4e24f83..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_zone/ZoneStatusChangeNotificationPayload.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_zone; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision: 42 $ ($LastChangedDate: 2010-09-23 14:21:48 +0200 (Thu, 23 Sep 2010) $) - * @since 0.8.0 - */ -public interface ZoneStatusChangeNotificationPayload { - - public short getZoneStatus(); - - public byte getExtendedStatus(); -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_zone/ZoneStatusChangeNotificationResponse.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_zone/ZoneStatusChangeNotificationResponse.java deleted file mode 100644 index 152e555d6bd96..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_zone/ZoneStatusChangeNotificationResponse.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_zone; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision: 42 $ ($LastChangedDate: 2010-09-23 14:21:48 +0200 (Thu, 23 Sep 2010) $) - * @since 0.8.0 - */ -public interface ZoneStatusChangeNotificationResponse extends Response { - - public static final byte ID = 0x00; - - public short getZoneStatus(); - - public byte getExtendedStatus(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_zone/ZoneType.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_zone/ZoneType.java deleted file mode 100644 index e40ebf1b2cc65..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/security_safety/ias_zone/ZoneType.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_zone; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision: 42 $ ($LastChangedDate: 2010-09-23 14:21:48 +0200 (Thu, 23 Sep 2010) $) - * @since 0.8.0 - */ -public interface ZoneType { - - public class ZT { - String attributeValue; - String description; - String alarm1; - String alarm2; - - public ZT(String attributeValue, String description, String alarm1, String alarm2) { - this.attributeValue = attributeValue; - this.description = description; - this.alarm1 = alarm1; - this.alarm2 = alarm2; - } - - public String getAttributeValue() { - return this.attributeValue; - } - - public String getDescription() { - return this.description; - } - - public String getAlarm1() { - return this.alarm1; - } - - public String getAlarm2() { - return this.alarm2; - } - } - - public final ZT STANDARD_CIE = new ZT("0000", "Standard CIE", "System Alarm", ""); - public final ZT MOTION_SENSOR = new ZT("000d", "Motion Sensor", "Intrusion detection", "Presence indication"); - public final ZT CONTACT_SWITCH = new ZT("0015", "Contact Switch", "First portal startup-shutdown", "Second portal startup-shutdown"); - public final ZT FIRE_SENSOR = new ZT("0028", "Fire Sensor", "Fire indication", ""); - public final ZT WATER_SENSOR = new ZT("002a", "Water Sensor", "Water overflow indication", ""); - public final ZT GAS_SENSOR = new ZT("002b", "Gas Sensor", "CO indication", "Cooking indication"); - public final ZT PERSONAL_EMERGENCY_DEVICE = new ZT("002c", "Personal Emergency Device", "Fall or concussion", "Emergency button"); - public final ZT VIBRATION_MOVEMENT_SENSOR = new ZT("002d", "Vibration / Movement Sensor", "Movement indication", "Vibration"); - public final ZT REMOTE_CONTROL = new ZT("010f", "Remote Control", "Panic", "Emergency"); - public final ZT KEY_FOB = new ZT("0115", "Key FOB", "Panic", "Emergency"); - public final ZT KEYPAD = new ZT("021d", "Keypad", "Panic", "Emergency"); - public final ZT STANDARD_WARNING_DEVICES = new ZT("0225", "Standard Warning Device", "", ""); -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/smart_energy/Metering.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/smart_energy/Metering.java deleted file mode 100644 index 5812f02e00292..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/api/smart_energy/Metering.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.api.smart_energy; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLCluster; - -/** - * This class represent the Metering Cluster as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * @author Giancarlo Riolo - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 18:00:05 +0200 (mar, 06 ago 2013) $) - * @since 0.8.0 - */ - -public interface Metering extends ZCLCluster { - - public static final short ID = 0x0702; - static final String NAME = "Metering"; - static final String DESCRIPTION = "Mechanism to retrieve usage information from Electric, Gas, Water and potentially metering devices"; - - public Attribute getAttributeDescription(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/attribute/AbstractAttribute.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/attribute/AbstractAttribute.java deleted file mode 100644 index 3190f3a8e8f6a..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/attribute/AbstractAttribute.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.attribute; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeType; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class AbstractAttribute implements AttributeDescriptor { - - private int id; - private String name; - private Class clazz; - private ZigBeeType zbType; - private boolean isReportable; - private boolean isWritable; - - public AbstractAttribute() { - } - - final public int getId() { - return id; - } - - public AbstractAttribute setId(int id) { - this.id = id; - return this; - } - - final public String getName() { - return name; - } - - public AbstractAttribute setName(String name) { - this.name = name; - return this; - } - - final public Class getType() { - return clazz; - } - - private AbstractAttribute setType(Class clazz) { - this.clazz = clazz; - return this; - } - - - final public boolean isReportable() { - return isReportable; - } - - public AbstractAttribute setReportable(boolean isReportable) { - this.isReportable = isReportable; - return this; - } - - final public boolean isWritable() { - return isWritable; - } - - public AbstractAttribute setWritable(boolean isWritable) { - this.isWritable = isWritable; - return this; - } - - public AbstractAttribute setZigBeeType(ZigBeeType type) { - this.zbType = type; - setType(type.getJavaClass()); - return this; - } - - final public ZigBeeType getZigBeeType() { - return zbType; - } - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/attribute/AttributeDescriptor.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/attribute/AttributeDescriptor.java deleted file mode 100644 index c15ec1223bd84..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/attribute/AttributeDescriptor.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.attribute; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeType; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public interface AttributeDescriptor { - public int getId(); - - public String getName(); - - public Class getType(); - - public boolean isWritable(); - - public boolean isReportable(); - - public ZigBeeType getZigBeeType(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/attribute/Attributes.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/attribute/Attributes.java deleted file mode 100644 index f068cc89b0137..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/attribute/Attributes.java +++ /dev/null @@ -1,925 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.attribute; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeType; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Manlio Bacco - * @author Han Alink - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class Attributes { - - final static public AttributeDescriptor ON_OFF = new AbstractAttribute() - .setId(0x0000) - .setName("OnOff") - .setReportable(true) - .setZigBeeType(ZigBeeType.Boolean) - .setWritable(false); - - final static public AttributeDescriptor ZCL_VERSION = new AbstractAttribute() - .setId(0x0000) - .setName("ZCLVersion") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger8bit) - .setWritable(false); - - final static public AttributeDescriptor APPLICATION_VERSION = new AbstractAttribute() - .setId(0x0001) - .setName("ApplicationVersion") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger8bit) - .setWritable(false); - - final static public AttributeDescriptor STACK_VERSION = new AbstractAttribute() - .setId(0x0002) - .setName("StackVersion") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger8bit) - .setWritable(false); - - final static public AttributeDescriptor HW_VERSION = new AbstractAttribute() - .setId(0x0003) - .setName("HWVersion") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger8bit) - .setWritable(false); - - final static public AttributeDescriptor MANUFACTURER_NAME = new AbstractAttribute() - .setId(0x0004) - .setName("ManufacturerName") - .setReportable(false) - .setZigBeeType(ZigBeeType.CharacterString) - .setWritable(false); - - final static public AttributeDescriptor MODEL_IDENTIFIER = new AbstractAttribute() - .setId(0x0005) - .setName("ModelIdentifier") - .setReportable(false) - .setZigBeeType(ZigBeeType.CharacterString) - .setWritable(false); - - final static public AttributeDescriptor DATE_CODE = new AbstractAttribute() - .setId(0x0006) - .setName("DateCode") - .setReportable(false) - .setZigBeeType(ZigBeeType.CharacterString) - .setWritable(false); - - final static public AttributeDescriptor POWER_SOURCE = new AbstractAttribute() - .setId(0x0007) - .setName("PowerSource") - .setReportable(false) - .setZigBeeType(ZigBeeType.Enumeration8bit) - .setWritable(false); - - final static public AttributeDescriptor LOCATION_DESCRIPTION = new AbstractAttribute() - .setId(0x0010) - .setName("LocationDescription") - .setReportable(false) - .setZigBeeType(ZigBeeType.CharacterString) - .setWritable(true); - - final static public AttributeDescriptor PHYSICAL_ENVIRONMENT = new AbstractAttribute() - .setId(0x0011) - .setName("PhysicalEnvironment") - .setReportable(false) - .setZigBeeType(ZigBeeType.Enumeration8bit) - .setWritable(true); - - final static public AttributeDescriptor DEVICE_ENABLED = new AbstractAttribute() - .setId(0x0012) - .setName("DeviceEnabled") - .setReportable(false) - .setZigBeeType(ZigBeeType.Boolean) - .setWritable(true); - - final static public AttributeDescriptor ALARM_MASK = new AbstractAttribute() - .setId(0x0013) - .setName("AlarmMask") - .setReportable(false) - .setZigBeeType(ZigBeeType.Bitmap8bit) - .setWritable(true); - - final static public AttributeDescriptor DISABLE_LOCAL_CONFIG = new AbstractAttribute() - .setId(0x0014) - .setName("DisableLocalConfig") - .setReportable(false) - .setZigBeeType(ZigBeeType.Bitmap8bit) - .setWritable(true); - - - final static public AttributeDescriptor IDENTIFY_TIME = new AbstractAttribute() - .setId(0x0000) - .setName("IdentifyTime") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(true); - - final static public AttributeDescriptor SCENE_COUNT = new AbstractAttribute() - .setId(0x0000) - .setName("SceneCount") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger8bit) - .setWritable(false); - - final static public AttributeDescriptor CURRENT_SCENE = new AbstractAttribute() - .setId(0x0001) - .setName("CurrentScene") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger8bit) - .setWritable(false); - - final static public AttributeDescriptor CURRENT_GROUP = new AbstractAttribute() - .setId(0x0002) - .setName("CurrentGroup") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(false); - - final static public AttributeDescriptor SCENE_VALID = new AbstractAttribute() - .setId(0x0003) - .setName("SceneValid") - .setReportable(false) - .setZigBeeType(ZigBeeType.Boolean) - .setWritable(false); - - final static public AttributeDescriptor LAST_CONFIGURED_BY = new AbstractAttribute() - .setId(0x0005) - .setName("LastConfiguredBy") - .setReportable(false) - .setZigBeeType(ZigBeeType.IEEEAddress) - .setWritable(false); - - final static public AttributeDescriptor NAME_SUPPORT_GROUPS = new AbstractAttribute() - .setId(0x0000) - .setName("NameSupport") - .setReportable(false) - .setZigBeeType(ZigBeeType.Bitmap8bit) - .setWritable(false); - - final static public AttributeDescriptor NAME_SUPPORT_SCENES = new AbstractAttribute() - .setId(0x0004) - .setName("NameSupport") - .setReportable(false) - .setZigBeeType(ZigBeeType.Bitmap8bit) - .setWritable(false); - - final static public AttributeDescriptor OCCUPANCY = new AbstractAttribute() - .setId(0x0000) - .setName("Occupancy") - .setReportable(true) - .setZigBeeType(ZigBeeType.Bitmap8bit) - .setWritable(false); - - final static public AttributeDescriptor OCCUPANCY_SENSOR_TYPE = new AbstractAttribute() - .setId(0x0001) - .setName("OccupancySensorType") - .setReportable(false) - .setZigBeeType(ZigBeeType.Enumeration8bit) - .setWritable(false); - - final static public AttributeDescriptor PIR_OCCUPIED_TO_UNOCCUPIED_DELAY = new AbstractAttribute() - .setId(0x0010) - .setName("PIROccupiedToUnoccupiedDelay") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger8bit) - .setWritable(true); - - final static public AttributeDescriptor PIR_UNOCCUPIED_TO_OCCUPIED_DELAY = new AbstractAttribute() - .setId(0x0011) - .setName("PIRUnoccupiedToOccupiedDelay") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(true); - - final static public AttributeDescriptor PIR_UNOCCUPIED_TO_OCCUPIED_THRESHOLD = new AbstractAttribute() - .setId(0x0012) - .setName("PIRUnoccupiedToOccupiedThreshold") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger8bit) - .setWritable(true); - - final static public AttributeDescriptor ULTRA_SONIC_OCCUPIED_TO_UNOCCUPIED_DELAY = new AbstractAttribute() - .setId(0x0020) - .setName("UltraSonicOccupiedToUnoccupiedDelay") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger8bit) - .setWritable(true); - - final static public AttributeDescriptor ULTRA_SONIC_UNOCCUPIED_TO_OCCUPIED_DELAY = new AbstractAttribute() - .setId(0x0021) - .setName("UltraSonicUnoccupiedToOccupiedDelay") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(true); - - final static public AttributeDescriptor ULTRASONIC_UNOCCUPIED_TO_OCCUPIED_THRESHOLD = new AbstractAttribute() - .setId(0x0022) - .setName("UltrasonicUnoccupiedToOccupiedThreshold") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger8bit) - .setWritable(true); - - final static public AttributeDescriptor MAINS_VOLTAGE = new AbstractAttribute() - .setId(0x0000) - .setName("MainsVoltage") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(false); - - final static public AttributeDescriptor MAINS_FREQUENCY = new AbstractAttribute() - .setId(0x0001) - .setName("MainsFrequency") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger8bit) - .setWritable(false); - - final static public AttributeDescriptor MAINS_ALARM_MASK = new AbstractAttribute() - .setId(0x0010) - .setName("MainsAlarmMask") - .setReportable(false) - .setZigBeeType(ZigBeeType.Bitmap8bit) - .setWritable(true); - - final static public AttributeDescriptor MAINS_VOLTAGE_MIN_THRESHOLD = new AbstractAttribute() - .setId(0x0011) - .setName("MainsVoltageMinThreshold") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(true); - - final static public AttributeDescriptor MAINS_VOLTAGE_MAX_THRESHOLD = new AbstractAttribute() - .setId(0x0012) - .setName("MainsVoltageMaxThreshold") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(true); - - final static public AttributeDescriptor MAINS_VOLTAGE_DWELL_TRIP_POINT = new AbstractAttribute() - .setId(0x0013) - .setName("MainsVoltageDwellTripPoint") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(true); - - final static public AttributeDescriptor BATTERY_VOLTAGE = new AbstractAttribute() - .setId(0x0020) - .setName("BatteryVoltage") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger8bit) - .setWritable(false); - - final static public AttributeDescriptor BATTERY_MANUFACTURER = new AbstractAttribute() - .setId(0x0030) - .setName("BatteryManufacturer") - .setReportable(false) - .setZigBeeType(ZigBeeType.CharacterString) - .setWritable(true); - - final static public AttributeDescriptor BATTERY_SIZE = new AbstractAttribute() - .setId(0x0031) - .setName("BatterySize") - .setReportable(false) - .setZigBeeType(ZigBeeType.Enumeration8bit) - .setWritable(true); - - final static public AttributeDescriptor BATTERY_AHr_RATING = new AbstractAttribute() - .setId(0x0032) - .setName("BatteryAHrRating") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(true); - - final static public AttributeDescriptor BATTERY_QUANTITY = new AbstractAttribute() - .setId(0x0033) - .setName("BatteryQuantity") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger8bit) - .setWritable(true); - - final static public AttributeDescriptor BATTERY_RATED_VOLTAGE = new AbstractAttribute() - .setId(0x0034) - .setName("BatteryRatedVoltage") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger8bit) - .setWritable(true); - - final static public AttributeDescriptor BATTERY_ALARM_MASK = new AbstractAttribute() - .setId(0x0035) - .setName("BatteryAlarmMask") - .setReportable(false) - .setZigBeeType(ZigBeeType.Bitmap8bit) - .setWritable(true); - - final static public AttributeDescriptor BATTERY_VOLTAGE_MIN_THRESHOLD = new AbstractAttribute() - .setId(0x0036) - .setName("BatteryVoltageMinThreshold") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger8bit) - .setWritable(true); - - final static public AttributeDescriptor CURRENT_TEMPERATURE = new AbstractAttribute() - .setId(0x0000) - .setName("CurrentTemperature") - .setReportable(false) - .setZigBeeType(ZigBeeType.SignedInteger16bit) - .setWritable(false); - - final static public AttributeDescriptor MIN_TEMP_EXPERIENCED = new AbstractAttribute() - .setId(0x0001) - .setName("MinTempExperienced") - .setReportable(false) - .setZigBeeType(ZigBeeType.SignedInteger16bit) - .setWritable(false); - - final static public AttributeDescriptor MAX_TEMP_EXPERIENCED = new AbstractAttribute() - .setId(0x0002) - .setName("MaxTempExperienced") - .setReportable(false) - .setZigBeeType(ZigBeeType.SignedInteger16bit) - .setWritable(false); - - final static public AttributeDescriptor OVER_TEMP_TOTAL_DWELL = new AbstractAttribute() - .setId(0x0003) - .setName("OverTempTotalDwell") - .setReportable(false) - .setZigBeeType(ZigBeeType.SignedInteger16bit) - .setWritable(false); - - final static public AttributeDescriptor DEVICE_TEMP_ALARM_MASK = new AbstractAttribute() - .setId(0x0010) - .setName("DeviceTempAlarmMask") - .setReportable(false) - .setZigBeeType(ZigBeeType.Bitmap8bit) - .setWritable(true); - - final static public AttributeDescriptor LOW_TEMP_THRESHOLD = new AbstractAttribute() - .setId(0x0011) - .setName("LowTempThreshold") - .setReportable(false) - .setZigBeeType(ZigBeeType.SignedInteger16bit) - .setWritable(true); - - final static public AttributeDescriptor HIGH_TEMP_THRESHOLD = new AbstractAttribute() - .setId(0x0012) - .setName("HighTempThreshold") - .setReportable(false) - .setZigBeeType(ZigBeeType.SignedInteger16bit) - .setWritable(true); - - final static public AttributeDescriptor LOW_TEMP_DWELL_TRIP_POINT = new AbstractAttribute() - .setId(0x0013) - .setName("LowTempDwellTripPoint") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger24bit) - .setWritable(true); - - final static public AttributeDescriptor HIGH_TEMP_DWELL_TRIP_POINT = new AbstractAttribute() - .setId(0x0014) - .setName("HighTempDwellTripPoint") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger24bit) - .setWritable(true); - - final static public AttributeDescriptor SWITCH_TYPE = new AbstractAttribute() - .setId(0x0000) - .setName("SwitchType") - .setReportable(false) - .setZigBeeType(ZigBeeType.Enumeration8bit) - .setWritable(false); - - final static public AttributeDescriptor SWITCH_ACTIONS = new AbstractAttribute() - .setId(0x0000) - .setName("SwitchActions") - .setReportable(false) - .setZigBeeType(ZigBeeType.Enumeration8bit) - .setWritable(true); - - final static public AttributeDescriptor CURRENT_LEVEL = new AbstractAttribute() - .setId(0x0000) - .setName("CurrentLevel") - .setReportable(true) - .setZigBeeType(ZigBeeType.UnsignedInteger8bit) - .setWritable(false); - - final static public AttributeDescriptor REMAINING_TIME = new AbstractAttribute() - .setId(0x0001) - .setName("RemainingTime") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(false); - - final static public AttributeDescriptor ON_OFF_TRANSITION_TIME = new AbstractAttribute() - .setId(0x0010) - .setName("OnOffTransitionTime") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(true); - - final static public AttributeDescriptor ON_LEVEL = new AbstractAttribute() - .setId(0x0011) - .setName("OnLevel") - .setReportable(true) - .setZigBeeType(ZigBeeType.UnsignedInteger8bit) - .setWritable(true); - - final static public AttributeDescriptor TIME = new AbstractAttribute() - .setId(0x0000) - .setName("Time") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger32bit) - .setWritable(true); - - final static public AttributeDescriptor TIME_STATUS = new AbstractAttribute() - .setId(0x0001) - .setName("TimeStatus") - .setReportable(false) - .setZigBeeType(ZigBeeType.Bitmap8bit) - .setWritable(true); - - final static public AttributeDescriptor MEASURED_VALUE_SIGNED_16_BIT = new AbstractAttribute() - .setId(0x0000) - .setName("MeasuredValue") - .setReportable(true) - .setZigBeeType(ZigBeeType.SignedInteger16bit) - .setWritable(false); - - final static public AttributeDescriptor MIN_MEASURED_VALUE_SIGNED_16_BIT = new AbstractAttribute() - .setId(0x0001) - .setName("MinMeasuredValue") - .setReportable(false) - .setZigBeeType(ZigBeeType.SignedInteger16bit) - .setWritable(false); - - final static public AttributeDescriptor MAX_MEASURED_VALUE_SIGNED_16_BIT = new AbstractAttribute() - .setId(0x0002) - .setName("MaxMeasuredValue") - .setReportable(false) - .setZigBeeType(ZigBeeType.SignedInteger16bit) - .setWritable(false); - - final static public AttributeDescriptor MEASURED_VALUE_UNSIGNED_16_BIT = new AbstractAttribute() - .setId(0x0000) - .setName("MeasuredValue") - .setReportable(true) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(false); - - final static public AttributeDescriptor MIN_MEASURED_VALUE_UNSIGNED_16_BIT = new AbstractAttribute() - .setId(0x0001) - .setName("MinMeasuredValue") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(false); - - final static public AttributeDescriptor MAX_MEASURED_VALUE_UNSIGNED_16_BIT = new AbstractAttribute() - .setId(0x0002) - .setName("MaxMeasuredValue") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(false); - - final static public AttributeDescriptor TOLERANCE = new AbstractAttribute() - .setId(0x0003) - .setName("Tolerance") - .setReportable(true) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(false); - - final static public AttributeDescriptor ALLARM_COUNT = new AbstractAttribute() - .setId(0x0000) - .setName("AlarmCount") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(false); - - final static public AttributeDescriptor LIGHT_SENSOR_TYPE = new AbstractAttribute() - .setId(0x0004) - .setName("LightSensorType") - .setReportable(false) - .setZigBeeType(ZigBeeType.Enumeration8bit) - .setWritable(false); - - final static public AttributeDescriptor ZONE_STATE = new AbstractAttribute() - .setId(0x0000) - .setName("ZoneState") - .setReportable(false) - .setZigBeeType(ZigBeeType.Enumeration8bit) - .setWritable(false); - - final static public AttributeDescriptor ZONE_TYPE = new AbstractAttribute() - .setId(0x0001) - .setName("ZoneType") - .setReportable(false) - .setZigBeeType(ZigBeeType.Enumeration16bit) - .setWritable(false); - - final static public AttributeDescriptor ZONE_STATUS = new AbstractAttribute() - .setId(0x0002) - .setName("ZoneStatus") - .setReportable(false) - .setZigBeeType(ZigBeeType.Bitmap16bit) - .setWritable(false); - - final static public AttributeDescriptor IAS_CIE_ADDRESS = new AbstractAttribute() - .setId(0x00010) - .setName("IASCieAddress") - .setReportable(false) - .setZigBeeType(ZigBeeType.IEEEAddress) - .setWritable(true); - - final static public AttributeDescriptor CURRENT_HUE = new AbstractAttribute() - .setId(0x0000) - .setName("CurrentHue") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger8bit) - .setWritable(false); - - final static public AttributeDescriptor CURRENT_SATURATION = new AbstractAttribute() - .setId(0x0001) - .setName("CurrentSaturation") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger8bit) - .setWritable(false); - - final static public AttributeDescriptor REMAINING_TIME_COLOR_CONTROL = new AbstractAttribute() - .setId(0x0002) - .setName("RemainingTime") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(false); - - final static public AttributeDescriptor CURRENT_X = new AbstractAttribute() - .setId(0x0003) - .setName("CurrentX") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(false); - - final static public AttributeDescriptor CURRENT_Y = new AbstractAttribute() - .setId(0x0004) - .setName("CurrentY") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(false); - - final static public AttributeDescriptor DRIFT_COMPENSATION = new AbstractAttribute() - .setId(0x0005) - .setName("DriftCompensation") - .setReportable(false) - .setZigBeeType(ZigBeeType.Enumeration8bit) - .setWritable(false); - - final static public AttributeDescriptor COMPENSATION_TEXT = new AbstractAttribute() - .setId(0x0006) - .setName("CompensationText") - .setReportable(false) - .setZigBeeType(ZigBeeType.CharacterString) - .setWritable(false); - - final static public AttributeDescriptor COLOR_TEMPERATURE = new AbstractAttribute() - .setId(0x0007) - .setName("ColorTemperature") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(false); - - final static public AttributeDescriptor COLOR_MODE = new AbstractAttribute() - .setId(0x0008) - .setName("ColorMode") - .setReportable(false) - .setZigBeeType(ZigBeeType.Enumeration8bit) - .setWritable(false); - - final static public AttributeDescriptor NUMBER_OF_PRIMARIES = new AbstractAttribute() - .setId(0x0010) - .setName("NumberOfPrimaries") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger8bit) - .setWritable(false); - - final static public AttributeDescriptor PRIMARY_1_X = new AbstractAttribute() - .setId(0x0011) - .setName("Primary1X") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(false); - - final static public AttributeDescriptor PRIMARY_1_Y = new AbstractAttribute() - .setId(0x0012) - .setName("Primary1Y") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(false); - - final static public AttributeDescriptor PRIMARY_1_INTENSITY = new AbstractAttribute() - .setId(0x0013) - .setName("Primary1Intensity") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger8bit) - .setWritable(false); - - final static public AttributeDescriptor PRIMARY_2_X = new AbstractAttribute() - .setId(0x0015) - .setName("Primary2X") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(false); - - final static public AttributeDescriptor PRIMARY_2_Y = new AbstractAttribute() - .setId(0x0016) - .setName("Primary2Y") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(false); - - final static public AttributeDescriptor PRIMARY_2_INTENSITY = new AbstractAttribute() - .setId(0x0017) - .setName("Primary2Intensity") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger8bit) - .setWritable(false); - - final static public AttributeDescriptor PRIMARY_3_X = new AbstractAttribute() - .setId(0x0019) - .setName("Primary3X") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(false); - - final static public AttributeDescriptor PRIMARY_3_Y = new AbstractAttribute() - .setId(0x001a) - .setName("Primary3Y") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(false); - - final static public AttributeDescriptor PRIMARY_3_INTENSITY = new AbstractAttribute() - .setId(0x001b) - .setName("Primary3Intensity") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger8bit) - .setWritable(false); - - final static public AttributeDescriptor PRIMARY_4_X = new AbstractAttribute() - .setId(0x0020) - .setName("Primary4X") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(false); - - final static public AttributeDescriptor PRIMARY_4_Y = new AbstractAttribute() - .setId(0x0021) - .setName("Primary4Y") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(false); - - final static public AttributeDescriptor PRIMARY_4_INTENSITY = new AbstractAttribute() - .setId(0x0022) - .setName("Primary1Intensity") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger8bit) - .setWritable(false); - - final static public AttributeDescriptor PRIMARY_5_X = new AbstractAttribute() - .setId(0x0024) - .setName("Primary5X") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(false); - - final static public AttributeDescriptor PRIMARY_5_Y = new AbstractAttribute() - .setId(0x0025) - .setName("Primary5Y") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(false); - - final static public AttributeDescriptor PRIMARY_5_INTENSITY = new AbstractAttribute() - .setId(0x0026) - .setName("Primary5Intensity") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger8bit) - .setWritable(false); - - final static public AttributeDescriptor PRIMARY_6_X = new AbstractAttribute() - .setId(0x0028) - .setName("Primary6X") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(false); - - final static public AttributeDescriptor PRIMARY_6_Y = new AbstractAttribute() - .setId(0x0029) - .setName("Primary6Y") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(false); - - final static public AttributeDescriptor PRIMARY_6_INTENSITY = new AbstractAttribute() - .setId(0x002a) - .setName("Primary6Intensity") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger8bit) - .setWritable(false); - - final static public AttributeDescriptor WHITE_POINT_X = new AbstractAttribute() - .setId(0x0030) - .setName("WhitePointX") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(true); - - final static public AttributeDescriptor WHITE_POINT_Y = new AbstractAttribute() - .setId(0x0031) - .setName("WhitePointY") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(true); - - final static public AttributeDescriptor COLOR_POINT_RX = new AbstractAttribute() - .setId(0x0032) - .setName("ColorPointRX") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(true); - - final static public AttributeDescriptor COLOR_POINT_RY = new AbstractAttribute() - .setId(0x0033) - .setName("ColorPointRY") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(true); - - final static public AttributeDescriptor COLOR_POINT_R_INTENSITY = new AbstractAttribute() - .setId(0x0034) - .setName("ColorPointRIntensity") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger8bit) - .setWritable(true); - - final static public AttributeDescriptor COLOR_POINT_GX = new AbstractAttribute() - .setId(0x0036) - .setName("ColorPointGX") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(true); - - final static public AttributeDescriptor COLOR_POINT_GY = new AbstractAttribute() - .setId(0x0037) - .setName("ColorPointGY") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(true); - - final static public AttributeDescriptor COLOR_POINT_G_INTENSITY = new AbstractAttribute() - .setId(0x0038) - .setName("ColorPointGIntensity") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger8bit) - .setWritable(true); - - final static public AttributeDescriptor COLOR_POINT_BX = new AbstractAttribute() - .setId(0x003a) - .setName("ColorPointBX") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(true); - - final static public AttributeDescriptor COLOR_POINT_BY = new AbstractAttribute() - .setId(0x003b) - .setName("ColorPointBY") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(true); - - final static public AttributeDescriptor COLOR_POINT_B_INTENSITY = new AbstractAttribute() - .setId(0x003d) - .setName("ColorPointBIntensity") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger8bit) - .setWritable(true); - - final static public AttributeDescriptor MAX_DURATION = new AbstractAttribute() - .setId(0x0000) - .setName("MaxDuration") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger16bit) - .setWritable(true); - - final static public AttributeDescriptor OUT_OF_SERVICE = new AbstractAttribute() - .setId(0x0051) - .setName("OutOfService") - .setReportable(false) - .setZigBeeType(ZigBeeType.Boolean) - .setWritable(true); - - final static public AttributeDescriptor STATUS_FLAGS = new AbstractAttribute() - .setId(0x006F) - .setName("StatusFlags") - .setReportable(true) - .setZigBeeType(ZigBeeType.Bitmap8bit) - .setWritable(false); - - final static public AttributeDescriptor PRESENT_VALUE = new AbstractAttribute() - .setId(0x0055) - .setName("PresentValue") - .setReportable(true) - .setZigBeeType(ZigBeeType.SinglePrecision) - .setWritable(true); - - final static public AttributeDescriptor APPLICATION_TYPE = new AbstractAttribute() - .setId(0x0100) - .setName("ApplicationType") - .setReportable(false) - .setZigBeeType(ZigBeeType.UnsignedInteger32bit) - .setWritable(true); - - final static public AttributeDescriptor RELIABILITY = new AbstractAttribute() - .setId(0x0067) - .setName("Reliability") - .setReportable(false) - .setZigBeeType(ZigBeeType.Enumeration8bit) - .setWritable(true); - - final static public AttributeDescriptor POLARITY = new AbstractAttribute() - .setId(0x0054) - .setName("Polarity") - .setReportable(false) - .setZigBeeType(ZigBeeType.Enumeration8bit) - .setWritable(false); - - final static public AttributeDescriptor INACTIVE_TEXT = new AbstractAttribute() - .setId(0x002E) - .setName("InactiveText") - .setReportable(false) - .setZigBeeType(ZigBeeType.CharacterString) - .setWritable(true); - - final static public AttributeDescriptor ACTIVE_TEXT = new AbstractAttribute() - .setId(0x0004) - .setName("ActiveText") - .setReportable(false) - .setZigBeeType(ZigBeeType.CharacterString) - .setWritable(true); - - final static public AttributeDescriptor DESCRIPTION = new AbstractAttribute() - .setId(0x001C) - .setName("Description") - .setReportable(false) - .setZigBeeType(ZigBeeType.CharacterString) - .setWritable(true); - - public static final AttributeDescriptor MAX_PRESENT_VALUE = new AbstractAttribute() - .setId(0x0041) - .setName("MaxPresentValue") - .setReportable(false) - .setZigBeeType(ZigBeeType.SinglePrecision) - .setWritable(true); - - public static final AttributeDescriptor MIN_PRESENT_VALUE= new AbstractAttribute() - .setId(0x0045) - .setName("MinPresentValue") - .setReportable(false) - .setZigBeeType(ZigBeeType.SinglePrecision) - .setWritable(true); - - public static final AttributeDescriptor RESOLUTION = new AbstractAttribute() - .setId(0x006A) - .setName("Resolution") - .setReportable(false) - .setZigBeeType(ZigBeeType.SinglePrecision) - .setWritable(true); - - public static final AttributeDescriptor ENGINEERING_UNITS = new AbstractAttribute() - .setId(0x0075) - .setName("EngineeringUnits") - .setReportable(false) - .setZigBeeType(ZigBeeType.Enumeration16bit) - .setWritable(true); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/AbstractCommand.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/AbstractCommand.java deleted file mode 100644 index 33a9529da4c80..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/AbstractCommand.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.core; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Command; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class AbstractCommand implements Command { - - private byte id; - private byte[] manufacturerId; - private boolean isClientServerDirection; - private boolean isClusterSpecific; - private boolean isManufacturerExtension; - private byte[] allowedResponseIds; - protected byte[] payload = null; - protected int freeIdxPayload = 0; - - public AbstractCommand(byte id) { - this(id, null, true); - } - - public AbstractCommand(byte id, boolean isClusterSpecific) { - this(id, null, true, isClusterSpecific, null); - } - - public AbstractCommand(byte id, byte[] manufacturerId, boolean isClientServerDirection) { - this(id, manufacturerId, isClientServerDirection, true, null); - } - - public AbstractCommand(byte id, byte[] manufacturerId, boolean isClientServerDirection, boolean isClusterSpecific) { - this(id, manufacturerId, isClientServerDirection, isClusterSpecific, null); - } - - public AbstractCommand(byte id, byte[] manufacturerId, boolean isClientServerDirection, boolean isClusterSpecific, - byte[] allowedResponseIds) { - super(); - this.id = id; - this.manufacturerId = manufacturerId; - this.isClientServerDirection = isClientServerDirection; - this.isClusterSpecific = isClusterSpecific; - this.isManufacturerExtension = manufacturerId != null; - this.allowedResponseIds = allowedResponseIds; - } - - public byte[] getAllowedResponseId() { - return allowedResponseIds; - } - - protected AbstractCommand setAllowedResponseId(byte[] allowedResponseIds) { - this.allowedResponseIds = allowedResponseIds; - return this; - } - - public byte getHeaderCommandId() { - return id; - } - - public byte[] getManufacturerId() { - return manufacturerId; - } - - public boolean isClientServerDirection() { - return isClientServerDirection; - } - - public boolean isClusterSpecific() { - return isClusterSpecific; - } - - public boolean isManufacturerExtension() { - return isManufacturerExtension; - } - - protected void setId(byte id) { - this.id = id; - } - - public byte[] getPayload() { - if (payload == null) { - payload = new byte[0]; - } - return payload; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/AnalogReporterImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/AnalogReporterImpl.java deleted file mode 100644 index f5dc5fe1a9e50..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/AnalogReporterImpl.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.core; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.*; -import org.bubblecloud.zigbee.network.ClusterMessage; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.network.impl.ZigBeeNetworkManagerException; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.AnalogReporter; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.AttributeReportingConfigurationRecord; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.AttributeStatusRecord; -import org.bubblecloud.zigbee.api.cluster.impl.ClusterMessageImpl; -import org.bubblecloud.zigbee.api.cluster.impl.global.reporting.AttributeReportingConfigurationRecordImpl; -import org.bubblecloud.zigbee.api.cluster.impl.global.reporting.ConfigureReportingCommand; -import org.bubblecloud.zigbee.api.cluster.impl.global.reporting.ConfigureReportingResponseImpl; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.6.0 - */ -public class AnalogReporterImpl extends ReporterBase implements AnalogReporter { - - private final Logger log = LoggerFactory.getLogger(AnalogReporterImpl.class); - - private Object minimumChange = null; - - public AnalogReporterImpl(final ZigBeeEndpoint zb, final ZCLCluster c, final Attribute attrib) { - super(zb, c, attrib); - final ZigBeeType type = attrib.getZigBeeType(); - if (type.isAnalog() == false) { - throw new IllegalArgumentException( - "AnalogReporter applies only to Attribute with analog data type, " + - "the attribute " + attrib.getName() + " (" + attrib.getId() + ") of type " + type.toString() + - " is DISCRETE" - ); - } - setReportableChangeValue(new Double(AnalogReporter.DEFAULT_REPORTABLE_CHANGE_INTERVAL)); - } - - protected boolean doConfigureServer() throws ZigBeeClusterException { - - log.debug( - "Subscring to analog attribute {} ( {} )with the following parameter min = {}, max = {}, change = {}", - new Object[]{attribute.getName(), attribute.getId(), min, max, minimumChange} - ); - - AttributeReportingConfigurationRecordImpl config = new AttributeReportingConfigurationRecordImpl( - attribute, 0x00, max, min, minimumChange, max - ); - ConfigureReportingCommand cmd = new ConfigureReportingCommand( - new AttributeReportingConfigurationRecord[]{config} - ); - - final ZCLFrame frame = new ZCLFrame(cmd, true); - final ClusterMessageImpl input = new ClusterMessageImpl(cluster.getId(), frame); - ClusterMessage clusterMessage = null; - try { - clusterMessage = device.invoke(input); - final ConfigureReportingResponseImpl response = new ConfigureReportingResponseImpl( - new ResponseImpl(clusterMessage, clusterMessage.getId()), new Attribute[]{attribute} - ); - final AttributeStatusRecord[] results = response.getAttributeStatusRecord(); - if (results[0].getStatus() != 0) { - throw new ZigBeeClusterException("ConfigureReporting answered with a Failed status: {} " + results[0].getStatus()); - } - } catch (ZigBeeNetworkManagerException e) { - throw new ZigBeeClusterException(e); - } - - return true; - } - - public Object getReportableChange() { - return minimumChange; - } - - private void setReportableChangeValue(Number n) { - final ZigBeeType type = attribute.getZigBeeType(); - if (type.getJavaClass() == Long.class) { - minimumChange = new Long(n.longValue()); - } else if (type.getJavaClass() == Integer.class) { - minimumChange = new Integer(n.intValue()); - } else if (type.getJavaClass() == Float.class) { - minimumChange = new Float(n.floatValue()); - } else if (type.getJavaClass() == Double.class) { - minimumChange = new Double(n.doubleValue()); - } else { - throw new IllegalArgumentException( - "Java class used for the interpretation of the " + - "the attribute " + attribute.getName() + " (" + attribute.getId() + ") of type " + type.toString() + - " is not recognized " - ); - } - } - - public void setReportableChange(Object value) { - setReportableChangeValue((Number) value); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/AttributeImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/AttributeImpl.java deleted file mode 100644 index abe2461a7bad5..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/AttributeImpl.java +++ /dev/null @@ -1,209 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.core; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.*; -import org.bubblecloud.zigbee.network.ClusterMessage; -import org.bubblecloud.zigbee.network.impl.ZigBeeNetworkManagerException; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.DefaultResponse; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.ReadAttributesResponse; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.ReadAttributesStatus; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.WriteAttributeRecord; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.WriteAttributesResponse; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.WriteAttributesStatus; -import org.bubblecloud.zigbee.api.cluster.impl.ClusterMessageImpl; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.AttributeDescriptor; -import org.bubblecloud.zigbee.api.cluster.impl.global.DefaultResponseImpl; -import org.bubblecloud.zigbee.api.cluster.impl.global.read.ReadAttributeCommand; -import org.bubblecloud.zigbee.api.cluster.impl.global.read.ReadAttributesResponseImpl; -import org.bubblecloud.zigbee.api.cluster.impl.global.write.WriteAttributeCommand; -import org.bubblecloud.zigbee.api.cluster.impl.global.write.WriteAttributeRecordImpl; -import org.bubblecloud.zigbee.api.cluster.impl.global.write.WriteAttributesResponseImpl; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Alessandro Giari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class AttributeImpl implements Attribute { - - private static final Logger logger = LoggerFactory.getLogger(AttributeImpl.class); - - final private Object LazyInstantiation = new Object(); - private ZigBeeEndpoint zbDevice; - private ZCLCluster zclCluster; - private Reporter reporter; - private AttributeDescriptor descriptor; - - public AttributeImpl(ZigBeeEndpoint zbDevice, ZCLCluster zclCluster, AttributeDescriptor descriptor) { - this.zbDevice = zbDevice; - this.zclCluster = zclCluster; - this.descriptor = descriptor; - } - - public int getId() { - return descriptor.getId(); - } - - public String getName() { - return descriptor.getName(); - } - - @SuppressWarnings("unchecked") - public Class getType() { - return descriptor.getType(); - } - - public ZigBeeType getZigBeeType() { - return descriptor.getZigBeeType(); - } - - public boolean isReportable() { - return descriptor.isReportable(); - } - - public boolean isWritable() { - return descriptor.isWritable(); - } - - public void setValue(Object o) throws ZigBeeClusterException { - if (isWritable() == false) { - throw new ZigBeeClusterException( - "Trying to set the attribute " + getName() + "(" + getId() + ") that is Read Only" - ); - } - doClusterWideWrite(o); - } - - public Object getValue() throws ZigBeeClusterException { - return doClusterWideRead(); - } - - public Reporter getReporter() { - if (isReportable() == false) - return null; - - synchronized (LazyInstantiation) { - if (reporter == null) { - if (getZigBeeType().isAnalog()) { - reporter = new AnalogReporterImpl(zbDevice, zclCluster, this); - } else { - reporter = new ReporterImpl(zbDevice, zclCluster, this); - } - } - } - return reporter; - } - - private Object doClusterWideRead() throws ZigBeeClusterException { - - logger.info("Reading " + getName() + " from " + zbDevice.getIEEEAddress()); - ReadAttributeCommand readAttrCom = new ReadAttributeCommand(new int[]{getId()}); - ZCLFrame frame = new ZCLFrame(readAttrCom, zclCluster.isDefaultResponseEnabled()); - ClusterMessageImpl input; - input = new ClusterMessageImpl(zclCluster.getId(), frame); - ClusterMessage clusterMessage = null; - try { - clusterMessage = zbDevice.invoke(input); - Response response = new ResponseImpl(clusterMessage, zclCluster.getId()); - if (response.getZCLHeader().getTransactionId() != frame.getHeader().getTransactionId()) { - logger.error( - "Received mismatching transaction response, " + - "we have to change heuristic for dispatching. Received {} while sent {}", - response.getZCLHeader().getTransactionId(), frame.getHeader().getTransactionId() - ); - return null; - } - AttributeDescriptor[] requestedAttributes = new AttributeDescriptor[]{descriptor}; - - switch (response.getZCLHeader().getCommandId()) { - case ReadAttributesResponse.ID: - ReadAttributesResponse readResponse = new ReadAttributesResponseImpl(response, requestedAttributes); - ReadAttributesStatus attributeStatus = readResponse.getReadAttributeStatus()[0]; - if (attributeStatus.getStatus() == Status.SUCCESS.id) { - return attributeStatus.getAttributeData(); - } else { - Status state = Status.getStatus(attributeStatus.getStatus()); - throw new ZigBeeClusterException( - "Read Attribute of " + getName() + " (" + getId() + " ) failed." + - "Due to " + state + " that means " + state.description - ); - } - case DefaultResponse.ID: - //Means that the read command is not supported - final DefaultResponse result = new DefaultResponseImpl(response); - Status state = result.getStatus(); - throw new ZigBeeClusterException( - "Read Attribute of " + getId() + " failed because command is not supported." - + "Due to " + state + " that means " + state.description - + " Follows the ZCLFrame recieved " + ResponseImpl.toString(response) - ); - - default: - throw new ZigBeeClusterException( - "Read Attribute of " + getId() + " failed due to: Unsupported answer: " + response - + " Follows the ZCLFrame recieved " + ResponseImpl.toString(response) - ); - } - } catch (ZigBeeNetworkManagerException e) { - throw new ZigBeeClusterException("Read Attribute of " + getId() + " failed due to: " + e); - } - } - - private void doClusterWideWrite(Object o) throws ZigBeeClusterException { - WriteAttributeRecord writeAttrComRec = new WriteAttributeRecordImpl(this, o); - WriteAttributeCommand writeAttrCom = new WriteAttributeCommand(new WriteAttributeRecord[]{writeAttrComRec}); - ZCLFrame frame = new ZCLFrame(writeAttrCom, zclCluster.isDefaultResponseEnabled()); - ClusterMessageImpl input = new ClusterMessageImpl(zclCluster.getId(), frame); - try { - ClusterMessage clusterMessage = zbDevice.invoke(input); - Response response = new ResponseImpl(clusterMessage, zclCluster.getId()); - AttributeDescriptor[] requestedAttributes = new AttributeDescriptor[]{descriptor}; - WriteAttributesResponse writeResposne = new WriteAttributesResponseImpl(response, requestedAttributes); - WriteAttributesStatus attributeStatus = writeResposne.getWriteAttributesStatus()[0]; - if (attributeStatus.getStatus() != Status.SUCCESS.id) { - Status state = Status.getStatus(attributeStatus.getStatus()); - throw new ZigBeeClusterException( - "Unable to write value " + o.toString() - + ". It failed with error " + state + "(" + state.id + "):" + state.description - + ". Follows the ZCLFrame recieved " + ResponseImpl.toString(writeResposne) - ); - } - } catch (ZigBeeNetworkManagerException e) { - throw new ZigBeeClusterException(e); - } - return; - } - - public Object getDefaultValue() throws ZigBeeClusterException { - // TODO Auto-generated method stub - return null; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/ByteArrayOutputStreamSerializer.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/ByteArrayOutputStreamSerializer.java deleted file mode 100755 index b02d66499ba5e..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/ByteArrayOutputStreamSerializer.java +++ /dev/null @@ -1,193 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.core; - -import org.bubblecloud.zigbee.util.Integers; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBSerializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeType; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; - -/** - * The implementation of the {@link ZBSerializer} that will replace the {@link DefaultSerializer}.
- * In fact, this class does not require the user to build in advance a payload buffer. - * - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.7.1 - */ -public class ByteArrayOutputStreamSerializer implements ZBSerializer { - - private ByteArrayOutputStream payload; - private byte[] buffer = new byte[8]; - - public ByteArrayOutputStreamSerializer() { - this.payload = new ByteArrayOutputStream(); - } - - public ByteArrayOutputStreamSerializer(ByteArrayOutputStream payload) { - this.payload = payload; - } - - public void appendBoolean(Boolean data) { - int used = Integers.writeBooleanObject(buffer, 0, data); - payload.write(buffer, 0, used); - } - - public void appendByte(Byte data) { - int used = Integers.writeByteObject(buffer, 0, data); - payload.write(buffer, 0, used); - } - - public void appendInteger(Integer data) { - int used = Integers.writeIntObject(buffer, 0, data); - payload.write(buffer, 0, used); - } - - public void appendLong(Long data) { - int used = Integers.writeLongObject(buffer, 0, data); - payload.write(buffer, 0, used); - } - - public void appendString(String str) { - try { - payload.write(str.getBytes()); - } catch (IOException e) { - e.printStackTrace(); - } - } - - public void appendZigBeeType(Object data, ZigBeeType type) { - if (data == null) { - throw new NullPointerException("You can not append null data to a stream"); - } - switch (type) { - case Boolean: - appendBoolean((Boolean) data); - break; - case Data8bit: - case SignedInteger8bit: - case Bitmap8bit: - case UnsignedInteger8bit: - case Enumeration8bit: - final Number b = (Number) data; - append_byte(b.byteValue()); - break; - case Data16bit: - case SignedInteger16bit: - case Bitmap16bit: - case UnsignedInteger16bit: - case Enumeration16bit: - final Number s = (Number) data; - append_short(s.shortValue()); - break; - case Data24bit: - case SignedInteger24bit: - case Bitmap24bit: - case UnsignedInteger24bit: - new IllegalArgumentException( - "No reader defined by this " + ZBDeserializer.class.getName() + - " for " + type.toString() + " (" + type.getId() + ")" - ); - break; - case Data32bit: - case SignedInteger32bit: - case Bitmap32bit: - case UnsignedInteger32bit: - if (type == ZigBeeType.UnsignedInteger32bit) { - final Long l = (Long) data; - append_int(l.intValue()); - } else { - final Integer i = (Integer) data; - append_int(i.intValue()); - } - break; - case CharacterString: - case OctectString: { - final String str = (String) data; - append_byte((byte) (str.length() & (0xFF))); - appendString(str); - } - break; - case LongCharacterString: - case LongOctectString: { - final String str = (String) data; - append_short((short) (str.length() & (0xFFFF))); - appendString(str); - } - break; - default: - throw new IllegalArgumentException( - "No reader defined by this " + ZBDeserializer.class.getName() + - " for " + type.toString() + " (" + type.getId() + ")" - ); - } - } - - public void appendObject(Object data) { - int used = Integers.writeObject(buffer, 0, data); - payload.write(buffer, 0, used); - } - - public void appendShort(Short data) { - int used = Integers.writeShortObject(buffer, 0, data); - payload.write(buffer, 0, used); - } - - public void append_boolean(boolean data) { - int used = Integers.writeBoolean(buffer, 0, data); - payload.write(buffer, 0, used); - } - - public void append_byte(byte data) { - int used = Integers.writeByte(buffer, 0, data); - payload.write(buffer, 0, used); - } - - public void append_int(int data) { - int used = Integers.writeInt(buffer, 0, data); - payload.write(buffer, 0, used); - } - - public void append_int24bit(int data) { - int used = Integers.writeInt24bit(buffer, 0, data); - payload.write(buffer, 0, used); - } - - public void append_long(long data) { - int used = Integers.writeLong(buffer, 0, data); - payload.write(buffer, 0, used); - } - - public void append_short(short data) { - int used = Integers.writeShort(buffer, 0, data); - payload.write(buffer, 0, used); - } - - public byte[] getPayload() { - return payload.toByteArray(); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/DefaultDeserializer.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/DefaultDeserializer.java deleted file mode 100644 index 4f2c5d197c27e..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/DefaultDeserializer.java +++ /dev/null @@ -1,226 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.core; - -import org.bubblecloud.zigbee.util.Integers; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeType; - -/** - * The defualt implementation of the {@link ZBDeserializer} - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class DefaultDeserializer implements ZBDeserializer { - int index = 0; - private byte[] payload; - - public DefaultDeserializer(byte[] payload, int index) { - this.payload = payload; - this.index = index; - } - - public boolean endOfStream() { - return index >= payload.length; - } - - public Boolean readBoolean() { - Object value = Integers.readBooleanObject(payload, index); - index++; - return (Boolean) value; - } - - public Byte readByte() { - Byte value = Integers.readByteObject(payload, index); - index += 1; - return value; - } - - public Integer readInteger() { - Integer value = Integers.readIntObject(payload, index); - index += 4; - return value; - } - - public Long readLong() { - Long value = Integers.readLongObject(payload, index); - index += 8; - return value; - } - - @SuppressWarnings("unchecked") - public Object readObject(Class clazz) { - Object[] value = new Object[1]; - int step = Integers.readObject(payload, index, clazz, value); - index += step; - return value[0]; - } - - public Short readShort() { - Short value = Integers.readShortObject(payload, index); - index += 2; - return value; - } - - public boolean read_boolean() { - boolean value = Integers.readBoolean(payload, index); - index += 1; - return value; - } - - public short read_uint8bit() { - short value = Integers.readByte(payload, index); - value = (short) (value & 0x000000FF); - index += 1; - return value; - } - - public int read_uint16bit() { - int value = Integers.readShort(payload, index); - value = value & 0x0000FFFF; - index += 2; - return value; - } - - public byte read_byte() { - byte value = Integers.readByte(payload, index); - index += 1; - return value; - } - - public int read_int() { - int value = Integers.readInt(payload, index); - index += 4; - return value; - } - - public long read_long() { - long value = Integers.readLong(payload, index); - index += 8; - return value; - } - - public short read_short() { - short value = Integers.readShort(payload, index); - index += 2; - return value; - } - - public int getPosition() { - return index; - } - - public void skip(int n) { - index += n; - } - - public String readString() { - final String result = new String(payload, index + 1, payload[index] & 0xFF); - index += payload[index] + 1; - return result; - } - - public String readString(int size) { - final String result = new String(payload, index, size); - index += size; - return result; - } - - public Object readZigBeeType(ZigBeeType type) { - Object[] value = new Object[1]; - switch (type) { - case Boolean: - value[0] = readBoolean(); - break; - case Data8bit: - case Bitmap8bit: - case Enumeration8bit: - case UnsignedInteger8bit: - case SignedInteger8bit: - byte b = read_byte(); - if (type == ZigBeeType.UnsignedInteger8bit) { - value[0] = new Integer(b & 0xFF); - } else { - value[0] = new Integer(b); - } - break; - case Data16bit: - case Bitmap16bit: - case Enumeration16bit: - case UnsignedInteger16bit: - case SignedInteger16bit: - short s = read_short(); - if (type == ZigBeeType.UnsignedInteger16bit) { - value[0] = new Integer(s & 0xFFFF); - } else { - value[0] = new Integer(s); - } - break; - case Data24bit: - case Bitmap24bit: - case UnsignedInteger24bit: - case SignedInteger24bit: - int i = read_int24bit(); - if (type == ZigBeeType.UnsignedInteger32bit) { - value[0] = new Long(i & 0xFFFFFFFF); - } else { - value[0] = new Integer(i); - } - break; - case Data32bit: - case Bitmap32bit: - case UnsignedInteger32bit: - case SignedInteger32bit: - int i24 = read_int24bit(); - value[0] = new Integer(i24); - break; - case CharacterString: - case OctectString: { - int size = read_byte(); - value[0] = readString(size); - } - break; - case LongCharacterString: - case LongOctectString: { - int size = read_short(); - value[0] = readString(size); - } - default: - throw new IllegalArgumentException( - "No reader defined by this " + ZBDeserializer.class.getName() + - " for " + type.toString() + " (" + type.getId() + ")" - ); - } - return value[0]; - } - - public int read_int24bit() { - int value = Integers.readInt24bit(payload, index); - index += 3; - return value; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/DefaultSerializer.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/DefaultSerializer.java deleted file mode 100644 index 3ab915fe9f98d..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/DefaultSerializer.java +++ /dev/null @@ -1,184 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.core; - -import org.bubblecloud.zigbee.util.Integers; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBSerializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeType; - -/** - * The defualt implementation of the {@link ZBSerializer} - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - * @deprecated From version 0.7.0 please use the {@link ByteArrayOutputStreamSerializer} instead - */ -public class DefaultSerializer implements ZBSerializer { - int index = 0; - private byte[] payload; - - /** - * @param payload the byte array that will used for storing the serialiazed data - * @param index the first empty byte where data will be written - * @deprecated From version 0.7.0 please use the {@link ByteArrayOutputStreamSerializer} instead - */ - public DefaultSerializer(byte[] payload, int index) { - this.payload = payload; - this.index = index; - } - - public void appendBoolean(Boolean data) { - index += Integers.writeBooleanObject(payload, index, data); - } - - public void appendByte(Byte data) { - index += Integers.writeByteObject(payload, index, data); - } - - public void appendInteger(Integer data) { - index += Integers.writeIntObject(payload, index, data); - } - - public void appendLong(Long data) { - index += Integers.writeLongObject(payload, index, data); - } - - public void appendString(String str) { - final byte[] raw = str.getBytes(); - if (raw.length > 255) { - throw new IllegalArgumentException("Given string '" + str + "' is too long - maximum String size is 255."); - } - - payload[index] = (byte) (raw.length & 0xFF); - System.arraycopy(raw, 0, payload, index + 1, raw.length); - index += raw.length + 1; - } - - public void appendZigBeeType(Object data, ZigBeeType type) { - if (data == null) { - throw new NullPointerException("You can not append null data to a stream"); - } - switch (type) { - case Boolean: - appendBoolean((Boolean) data); - break; - case Data8bit: - case SignedInteger8bit: - case Bitmap8bit: - case UnsignedInteger8bit: - case Enumeration8bit: - final Number b = (Number) data; - append_byte(b.byteValue()); - break; - case Data16bit: - case SignedInteger16bit: - case Bitmap16bit: - case UnsignedInteger16bit: - case Enumeration16bit: - final Number s = (Number) data; - append_short(s.shortValue()); - break; - case Data24bit: - case SignedInteger24bit: - case Bitmap24bit: - case UnsignedInteger24bit: - new IllegalArgumentException( - "No reader defined by this " + ZBDeserializer.class.getName() + - " for " + type.toString() + " (" + type.getId() + ")" - ); - break; - case Data32bit: - case SignedInteger32bit: - case Bitmap32bit: - case UnsignedInteger32bit: - if (type == ZigBeeType.UnsignedInteger32bit) { - final Long l = (Long) data; - append_int(l.intValue()); - } else { - final Integer i = (Integer) data; - append_int(i.intValue()); - } - break; - case CharacterString: - case OctectString: { - final String str = (String) data; - append_byte((byte) (str.length() & (0xFF))); - appendString(str); - } - break; - case LongCharacterString: - case LongOctectString: { - final String str = (String) data; - append_short((short) (str.length() & (0xFFFF))); - appendString(str); - } - break; - default: - throw new IllegalArgumentException( - "No reader defined by this " + ZBDeserializer.class.getName() + - " for " + type.toString() + " (" + type.getId() + ")" - ); - } - } - - public void appendObject(Object data) { - index += Integers.writeObject(payload, index, data); - } - - public void appendShort(Short data) { - index += Integers.writeShortObject(payload, index, data); - } - - public void append_boolean(boolean data) { - index += Integers.writeBoolean(payload, index, data); - } - - public void append_byte(byte data) { - index += Integers.writeByte(payload, index, data); - } - - public void append_int(int data) { - index += Integers.writeInt(payload, index, data); - } - - public void append_int24bit(int data) { - index += Integers.writeInt24bit(payload, index, data); - } - - public void append_long(long data) { - index += Integers.writeLong(payload, index, data); - } - - public void append_short(short data) { - index += Integers.writeShort(payload, index, data); - } - - public byte[] getPayload() { - byte[] copy = new byte[index]; - System.arraycopy(payload, 0, copy, 0, copy.length); - return copy; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/EmptyPayloadCommand.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/EmptyPayloadCommand.java deleted file mode 100644 index 072f1f8e225bc..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/EmptyPayloadCommand.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.core; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Command; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class EmptyPayloadCommand implements Command { - - private byte id; - private byte[] manufacturerId; - private boolean isClientServerDirection; - private boolean isClusterSpecific; - private boolean isManufacturerExtension; - private byte[] allowedResponseIds; - protected byte[] payload = null; - protected int freeIdxPayload = 0; - - - public EmptyPayloadCommand() { - } - - public byte[] getAllowedResponseId() { - return allowedResponseIds; - } - - protected EmptyPayloadCommand setAllowedResponseId(byte[] allowedResponseIds) { - this.allowedResponseIds = allowedResponseIds; - return this; - } - - public byte getHeaderCommandId() { - return id; - } - - public EmptyPayloadCommand setId(byte id) { - this.id = id; - return this; - } - - public byte[] getManufacturerId() { - return manufacturerId; - } - - protected EmptyPayloadCommand setManufacturerId(byte[] manufacturerId) { - this.manufacturerId = manufacturerId; - return this; - } - - public boolean isClientServerDirection() { - return isClientServerDirection; - } - - public EmptyPayloadCommand setClientServerDirection(boolean isClientServerDirection) { - this.isClientServerDirection = isClientServerDirection; - return this; - } - - public boolean isClusterSpecific() { - return isClusterSpecific; - } - - public EmptyPayloadCommand setClusterSpecific(boolean isClusterSpecific) { - this.isClusterSpecific = isClusterSpecific; - return this; - } - - public boolean isManufacturerExtension() { - return isManufacturerExtension; - } - - public EmptyPayloadCommand setManufacturerExtension(boolean isManufacturerExtension) { - this.isManufacturerExtension = isManufacturerExtension; - return this; - } - - public byte[] getPayload() { - if (payload == null) { - payload = new byte[0]; - } - return payload; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/ReporterBase.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/ReporterBase.java deleted file mode 100644 index 8fcd775e22236..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/ReporterBase.java +++ /dev/null @@ -1,231 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.core; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.*; -import org.bubblecloud.zigbee.network.ClusterFilter; -import org.bubblecloud.zigbee.network.ClusterListener; -import org.bubblecloud.zigbee.network.ClusterMessage; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.network.impl.ZigBeeNetworkManagerException; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.AttributeReport; -import org.bubblecloud.zigbee.api.cluster.impl.global.reporting.ReportAttributesCommand; - -import java.util.ArrayList; -import java.util.Dictionary; -import java.util.Hashtable; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.6.0 - */ -public abstract class ReporterBase implements Reporter { - - private final Logger log = LoggerFactory.getLogger(ReporterBase.class); - - protected final ArrayList listeners = new ArrayList(); - protected final ReportListenerNotifier bridge = new ReportListenerNotifier(); - protected final ZigBeeEndpoint device; - protected final ZCLCluster cluster; - - @Override - public Attribute getAttribute() { - return attribute; - } - - protected final Attribute attribute; - - protected int max = Reporter.DEFAULT_MAX_REPORTING_INTERVAL; - protected int min = Reporter.DEFAULT_MIN_REPORTING_INTERVAL; - - protected class ReportListenerNotifier implements ClusterListener { - - public void handleCluster(ZigBeeEndpoint endpoint, ClusterMessage c) { - try { - if (c.getId() != cluster.getId()) return; - ResponseImpl response = new ResponseImpl(c, cluster.getId()); - AttributeReport[] reports = new ReportAttributesCommand(response).getAttributeReports(); - Dictionary event = new Hashtable(); - for (int i = 0; i < reports.length; i++) { - event.put( - cluster.getAttribute(reports[i].getAttributeId()), - reports[i].getAttributeData() - ); - } - ArrayList localCopy; - synchronized (listeners) { - localCopy = new ArrayList(listeners); - } - log.debug("Notifying {} ReportListener", localCopy.size()); - for (ReportListener reportListner : localCopy) { - try { - log.debug("Notifying {}:{}", reportListner.getClass().getName(), reportListner); - reportListner.receivedReport(endpoint.getEndpointId(), cluster.getId(), event); - } catch (Exception e) { - log.error("Error while notifying {}:{} caused by {}", new Object[]{ - reportListner.getClass().getName(), reportListner, e.getStackTrace() - }); - } - } - - } catch (ZigBeeClusterException e) { - e.printStackTrace(); - } - } - - public ClusterFilter getClusterFilter() { - return SubscriptionClusterFilter.FILTER; - } - - public void setClusterFilter(ClusterFilter filter) { - } - - } - - public ReporterBase(final ZigBeeEndpoint zb, final ZCLCluster c, final Attribute attrib) { - device = zb; - cluster = c; - attribute = attrib; - } - - private boolean doBindToDevice() { - try { - return device.bindToLocal(cluster.getId()); - } catch (ZigBeeNetworkManagerException e) { - log.debug("Unable to bind to device {} on cluster {}", device, cluster.getId()); - log.error("Binding failed", e); - return false; - } - } - - private boolean doUnbindToDevice() { - try { - return device.unbindFromLocal(cluster.getId()); - } catch (ZigBeeNetworkManagerException e) { - log.debug("Unable to bind to device {} on cluster {}", device, cluster.getId()); - log.error("Binding failed", e); - return false; - } - } - - protected abstract boolean doConfigureServer() throws ZigBeeClusterException; - - public boolean addReportListener(ReportListener listener) { - synchronized (listeners) { - if (listeners.size() == 0) { - if (!doBindToDevice()) { - return false; - } - try { - doConfigureServer(); - } catch (ZigBeeClusterException e) { - log.error("Unable to configure server for Reporting", e); - return false; - } - device.addClusterListener(bridge); - } - listeners.add(listener); - } - return true; - } - - public void clear() { - if (doUnbindToDevice() == true) { - synchronized (listeners) { - listeners.clear(); - } - } - } - - public int getMaximumReportingInterval() { - // TODO Auto-generated method stub - return 0; - } - - public int getMinimumReportingInterval() { - // TODO Auto-generated method stub - return 0; - } - - public boolean removeReportListener(ReportListener listener) { - synchronized (listeners) { - if (listeners.size() == 1) { - if (!doUnbindToDevice()) { - return false; - } - //TODO Change the configuration only if there were no subscriber - try { - doConfigureServer(); - } catch (ZigBeeClusterException e) { - log.error("Unable to configure server for Reporting", e); - return false; - } - device.removeClusterListener(bridge); - } - listeners.remove(listener); - } - return true; - } - - public int setMaximumReportingInterval(int value) { - //TODO Check the real value - max = value; - return max; - } - - public int setMinimumReportingInterval(int value) { - min = value; - return min; - } - - public int getReportListenersCount() { - synchronized (listeners) { - return listeners.size(); - } - } - - public boolean isActive() { - synchronized (listeners) { - return listeners.size() == 0; - } - } - - public boolean updateConfiguration() { - try { - if (isActive()) { - return doConfigureServer(); - } else { - return true; - } - } catch (Exception e) { - log.error("Unable to update Report configuration", e); - return false; - } - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/ReporterImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/ReporterImpl.java deleted file mode 100644 index 1000efb3aea01..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/ReporterImpl.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.core; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.*; -import org.bubblecloud.zigbee.network.ClusterMessage; -import org.bubblecloud.zigbee.network.impl.ZigBeeNetworkManagerException; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.AttributeReportingConfigurationRecord; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.AttributeStatusRecord; -import org.bubblecloud.zigbee.api.cluster.impl.ClusterMessageImpl; -import org.bubblecloud.zigbee.api.cluster.impl.global.reporting.AttributeReportingConfigurationRecordImpl; -import org.bubblecloud.zigbee.api.cluster.impl.global.reporting.ConfigureReportingCommand; -import org.bubblecloud.zigbee.api.cluster.impl.global.reporting.ConfigureReportingResponseImpl; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class ReporterImpl extends ReporterBase implements Reporter { - - private final Logger log = LoggerFactory.getLogger(ReporterImpl.class); - - public ReporterImpl(final ZigBeeEndpoint zb, final ZCLCluster c, final Attribute attrib) { - super(zb, c, attrib); - } - - protected boolean doConfigureServer() throws ZigBeeClusterException { - log.info( - "Subscribing to discrete attribute {} ( {} ) with the following parameter min = {}, max = {} ", - new Object[]{attribute.getName(), attribute.getId(), min, max} - ); - - AttributeReportingConfigurationRecordImpl config = new AttributeReportingConfigurationRecordImpl( - attribute, 0x00, max, min, null, max - ); - ConfigureReportingCommand cmd = new ConfigureReportingCommand( - new AttributeReportingConfigurationRecord[]{config} - ); - - final ZCLFrame frame = new ZCLFrame(cmd, true); - final ClusterMessageImpl input = new ClusterMessageImpl(cluster.getId(), frame); - ClusterMessage clusterMessage = null; - try { - clusterMessage = device.invoke(input); - final ConfigureReportingResponseImpl response = new ConfigureReportingResponseImpl( - new ResponseImpl(clusterMessage, clusterMessage.getId()), new Attribute[]{attribute} - ); - final AttributeStatusRecord results = response.getAttributeStatusRecord()[0]; - if (results.getStatus() != 0) { - throw new ZigBeeClusterException("ConfigureReporting answered with a Failed status: " + Status.getStatus(results.getStatus())); - } - } catch (ZigBeeNetworkManagerException e) { - throw new ZigBeeClusterException(e); - } - - return true; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/ResponseImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/ResponseImpl.java deleted file mode 100644 index 38fa25bc0eb5d..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/ResponseImpl.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.core; - -import org.bubblecloud.zigbee.util.ByteUtils; - -import org.bubblecloud.zigbee.network.ClusterMessage; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLHeader; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.DefaultResponse; -import org.bubblecloud.zigbee.api.cluster.impl.global.DefaultResponseImpl; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ResponseImpl implements Response { - - protected ZCLHeader header; - private byte[] payload; - - public ResponseImpl(ClusterMessage clusterMessage, short expectedClusterId) throws ZigBeeClusterException { - if (expectedClusterId != clusterMessage.getId()) { - throw new ZigBeeClusterException("Expected Response for cluster Id: " + expectedClusterId + " but received message for cluster Id: " + clusterMessage.getId()); - } - ZCLFrame frame = new ZCLFrame(clusterMessage); - header = frame.getHeader(); - payload = frame.getPayload(); - } - - public ResponseImpl(Response response) { - header = response.getZCLHeader(); - payload = response.getPayload(); - } - - public byte getHeaderCommandId() { - return header.getCommandId(); - } - - public byte[] getManufacturerId() { - return header.getManufacturerId(); - } - - public boolean isClientServerDirection() { - return header.getFramecontrol().isClientServerDirection(); - } - - public boolean isClusterSpecific() { - return header.getFramecontrol().isClusterSpecificCommand(); - } - - public boolean isManufacturerExtension() { - return header.getFramecontrol().isManufacturerExtension(); - } - - public boolean isDefaultResponseEnabled() { - return header.getFramecontrol().isDefaultResponseEnabled(); - } - - public ZCLHeader getZCLHeader() { - return header; - } - - public byte[] getPayload() { - return payload; - } - - public static String toString(Response r) { - return - "[ ZCL Header: " + ByteUtils.toBase16(r.getZCLHeader().toByte()) - + ", ZCL Payload: " + ByteUtils.toBase16(r.getPayload()) - + "]"; - } - - public String toString() { - return toString(this); - } - - public static void checkSpecificCommandFrame(Response response, byte expectedCommandId) throws ZigBeeClusterException { - byte commandId = response.getHeaderCommandId(); - if (commandId != expectedCommandId) { - if (commandId == DefaultResponse.ID) { - DefaultResponse defaultResponse = new DefaultResponseImpl(response); - throw new ZigBeeClusterException( - "Expected SpecificCommandFrame (" + expectedCommandId + ") but received a DefaultResponse" - + "\nSTATUS:" + defaultResponse.getStatus() + " CMD:" + defaultResponse.getCommandId() - , response); - } - throw new ZigBeeClusterException( - "Expected SpecificCommandFrame (" + expectedCommandId + ") but Received:" - + commandId + " ZCLFrame was " + toString(response), - response - ); - } - - } - - public static void checkGeneralCommandFrame(Response response, byte expectedCommandId) throws ZigBeeClusterException { - if (response.getZCLHeader().getFramecontrol().isClusterSpecificCommand()) { - throw new ZigBeeClusterException( - "Received response is not a General Command Frame !"); - } - - byte commandId = response.getHeaderCommandId(); - if (commandId != expectedCommandId) { - if (commandId == DefaultResponse.ID) { - DefaultResponse defaultResponse = new DefaultResponseImpl(response); - throw new ZigBeeClusterException( - "Expected GeneralCommandFrame (" + expectedCommandId + ") but received a DefaultResponse" - + "\nSTATUS:" + defaultResponse.getStatus() + " CMD:" + defaultResponse.getCommandId() - , response); - } - throw new ZigBeeClusterException( - "Expected GeneralCommandFrame (" + expectedCommandId + ") but received:" + commandId - , response); - } - - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/SubscriptionClusterFilter.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/SubscriptionClusterFilter.java deleted file mode 100644 index 91e6f832240ac..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/SubscriptionClusterFilter.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.core; - -import org.bubblecloud.zigbee.network.ClusterMessage; -import org.bubblecloud.zigbee.network.ClusterFilter; -import org.bubblecloud.zigbee.api.cluster.impl.global.reporting.ReportAttributesCommand; - -/** - * This class should filter out all the ZigBee cluster that do not belong to the
- * {@link ReportAttributesCommand} type, by checking the cluster data itself.
- *
- * NOTE:to use this class the {@link #FILTER} constant should be used - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.3.0 - */ -public class SubscriptionClusterFilter implements ClusterFilter { - - /** - * Singelton instance of the filter - */ - public final static SubscriptionClusterFilter FILTER = new SubscriptionClusterFilter(); - - private SubscriptionClusterFilter() { - } - - public boolean match(ClusterMessage clusterMessage) { - ZCLFrame frame = new ZCLFrame(clusterMessage); - return frame.getHeader().getCommandId() == ReportAttributesCommand.ID - && !frame.getHeader().getFramecontrol().isClusterSpecificCommand(); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/ZCLClusterBase.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/ZCLClusterBase.java deleted file mode 100644 index 5b5d9a31b2063..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/ZCLClusterBase.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.core; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.*; -import org.bubblecloud.zigbee.network.ClusterMessage; -import org.bubblecloud.zigbee.network.impl.ZigBeeNetworkManagerException; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.api.cluster.impl.ClusterMessageImpl; - -import java.util.ArrayList; -import java.util.HashMap; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public abstract class ZCLClusterBase implements ZCLCluster { - - final public static Logger logger = LoggerFactory.getLogger(ZCLClusterBase.class); - - private ZigBeeEndpoint zbDevice; - private boolean isDefaultResponseEnabled; - private HashMap attributes; - - public ZCLClusterBase(ZigBeeEndpoint zbDevice) { - this.zbDevice = zbDevice; - } - - public abstract short getId(); - - public abstract String getName(); - - public abstract Attribute[] getStandardAttributes(); - - protected ZigBeeEndpoint getZigBeeEndpoint() { - return zbDevice; - } - - public void enableDefaultResponse() { - isDefaultResponseEnabled = true; - } - - public boolean isDefaultResponseEnabled() { - return isDefaultResponseEnabled; - } - - public Attribute getAttribute(int id) { - if (attributes == null) { - attributes = new HashMap(); - Attribute[] list = getAvailableAttributes(); - for (int i = 0; i < list.length; i++) { - attributes.put(list[i].getId(), list[i]); - } - } - - return attributes.get(id); - } - - public Attribute[] getAvailableAttributes() { - //TODO use Discovery Attribute command to find the real attribute - return getStandardAttributes(); - } - - public int getManufacturerId() { - return -1; - } - - public Response invoke(Command cmd) throws ZigBeeClusterException { - return invoke(cmd, !isDefaultResponseEnabled); - } - - public Response invoke(Command cmd, boolean suppressResponse) throws ZigBeeClusterException { - ZCLFrame inFrame = new ZCLFrame(cmd, isDefaultResponseEnabled); - ClusterMessage input = new ClusterMessageImpl(getId(), inFrame); - logger.info("Sending {} command to {} (#{}).", cmd.getClass().getSimpleName(), zbDevice.getEndpointId(), - zbDevice.getNetworkAddress()); - if (suppressResponse) { - try { - zbDevice.send(input); - return null; - } catch (ZigBeeNetworkManagerException e) { - throw new ZigBeeClusterException(e); - } - } else { - ClusterMessage clusterMessage; - try { - clusterMessage = zbDevice.invoke(input); - Response response = new ResponseImpl(clusterMessage, getId()); - logger.debug("Received response {} to request {}", response, inFrame); - return response; - } catch (ZigBeeNetworkManagerException e) { - throw new ZigBeeClusterException(e); - } - } - } - - public Reporter[] getAttributeReporters() { - final ArrayList actives = new ArrayList(); - final Attribute[] attributes = getAvailableAttributes(); - for (int i = 0; i < attributes.length; i++) { - final Reporter reporter = attributes[i].getReporter(); - if (reporter != null) { - actives.add(reporter); - } - } - return actives.toArray(new Reporter[]{}); - } - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/ZCLFrame.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/ZCLFrame.java deleted file mode 100644 index 7e1c034ab5d0b..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/ZCLFrame.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.core; - -import org.bubblecloud.zigbee.network.ClusterMessage; -import org.bubblecloud.zigbee.util.ByteUtils; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Command; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZCLFrame { - - private ZCLHeaderImpl header; - private byte[] payload; - private byte[] frame; - - public ZCLFrame(ClusterMessage clusterMessage) { - byte[] frame = clusterMessage.getClusterMsg(); - header = new ZCLHeaderImpl(frame); - - int srcPos = header.size(); - int lenght = frame.length - header.size(); - payload = new byte[lenght]; - System.arraycopy(frame, srcPos, payload, 0, lenght); - } - - public ZCLFrame(Command cmd, boolean isEnableddefaultResponse) { - header = new ZCLHeaderImpl(cmd, isEnableddefaultResponse); - payload = cmd.getPayload(); - frame = createFrame(); - } - - public ZCLHeaderImpl getHeader() { - return header; - } - - public byte[] getPayload() { - return payload; - } - - private byte[] createFrame() { - byte[] frame = new byte[header.size() + payload.length]; - System.arraycopy(header.toByte(), 0, frame, 0, header.size()); - System.arraycopy(payload, 0, frame, header.size(), payload.length); - return frame; - } - - public byte[] toByte() { - return frame; - } - - public int size() { - return toByte().length; - } - - - public String toString() { - return - "[ ZCL Header: " + ByteUtils.toBase16(getHeader().toByte()) - + ", ZCL Payload: " + ByteUtils.toBase16(getPayload()) - + "]"; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/ZCLFrameControlImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/ZCLFrameControlImpl.java deleted file mode 100644 index c23275f2c7ace..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/ZCLFrameControlImpl.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.core; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Command; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLFrameControl; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.8.0 - */ -public class ZCLFrameControlImpl implements ZCLFrameControl { - public static final byte NULL_BYTE = 0x00; //0b0000_0000 - - public static final byte FRAME_TYPE_MASK = (byte) 0x03; //0b0000_0011 - public static final byte MANUFACTURER_MASK = 0x04; //0b0000_0100 - public static final byte DIRECTION_MASK = 0x08; //0b0000_1000 - public static final byte RESPONSE_TYPE_MASK = 0x10; //0b0001_0000 - - public static final byte CLUSTER_COMMAND = 0x01; //0b0000_0001 - public static final byte MANUFACTURER_EXT = 0x04; //0b0000_0100 - public static final byte SERVER_CLIENT_DIRECTION = 0x08; //0b0001_1000 - public static final byte DISABLE_DEFAULT_RESPONSE = 0x10; //0b0001_0000 - - private boolean isClusterSpecificCommand; - private boolean isManufacturerExtension; - private boolean isClientServerDirection; - private boolean isDefaultResponseEnabled; - private byte frameControl; - - public ZCLFrameControlImpl(Command cmd, boolean isDefaultResponseEnabled) { - - byte frameType = cmd.isClusterSpecific() ? CLUSTER_COMMAND : NULL_BYTE; - byte manufacturerBit = cmd.isManufacturerExtension() ? MANUFACTURER_EXT : NULL_BYTE; - byte directionBit = cmd.isClientServerDirection() ? NULL_BYTE : SERVER_CLIENT_DIRECTION; - byte defaultResponse = isDefaultResponseEnabled ? NULL_BYTE : DISABLE_DEFAULT_RESPONSE; - - isClusterSpecificCommand = cmd.isClusterSpecific(); - isManufacturerExtension = cmd.isManufacturerExtension(); - isClientServerDirection = cmd.isClientServerDirection(); - this.isDefaultResponseEnabled = isDefaultResponseEnabled; - - frameControl = (byte) (frameType | manufacturerBit | directionBit | defaultResponse); - } - - - public ZCLFrameControlImpl(byte frameControl) { - this.frameControl = frameControl; - - byte frameType = (byte) (frameControl & FRAME_TYPE_MASK); - byte manufacturerBit = (byte) (frameControl & MANUFACTURER_MASK); - byte directionBit = (byte) (frameControl & DIRECTION_MASK); - byte defaultResponse = (byte) (frameControl & RESPONSE_TYPE_MASK); - - isClusterSpecificCommand = (frameType & CLUSTER_COMMAND) > 0; - - isManufacturerExtension = (manufacturerBit & MANUFACTURER_EXT) > 0; - - isClientServerDirection = !((directionBit & SERVER_CLIENT_DIRECTION) > 0); - - isDefaultResponseEnabled = !((defaultResponse & DISABLE_DEFAULT_RESPONSE) > 0); - } - - public boolean isClusterSpecificCommand() { - return isClusterSpecificCommand; - } - - public boolean isManufacturerExtension() { - return isManufacturerExtension; - } - - public boolean isClientServerDirection() { - return isClientServerDirection; - } - - public boolean isDefaultResponseEnabled() { - return isDefaultResponseEnabled; - } - - public byte toByte() { - return frameControl; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/ZCLHeaderImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/ZCLHeaderImpl.java deleted file mode 100644 index 50a3dadc300c3..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/ZCLHeaderImpl.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.core; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Command; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZCLHeader; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Manlio Bacco - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.8.0 - */ -public class ZCLHeaderImpl implements ZCLHeader { - - private ZCLFrameControlImpl frameControl; - private byte[] manufacturerId; - private byte transactionId; - private byte commandId; - - private Command cmd; - private byte[] header; - private byte[] frame; - - public ZCLHeaderImpl(Command cmd, boolean isDefaultResponseEnabled) { - - this.cmd = cmd; - - frameControl = new ZCLFrameControlImpl(cmd, isDefaultResponseEnabled); - manufacturerId = cmd.getManufacturerId(); - transactionId = ZCLLayer.getTransactionId(); - commandId = cmd.getHeaderCommandId(); - - header = createHeader(); - } - - private byte[] createHeader() { - byte[] newHeader; - if (cmd.isManufacturerExtension()) { - newHeader = new byte[5]; - newHeader[0] = frameControl.toByte(); - newHeader[1] = manufacturerId[0]; - newHeader[2] = manufacturerId[1]; - newHeader[3] = transactionId; - newHeader[4] = commandId; - } else { - newHeader = new byte[3]; - newHeader[0] = frameControl.toByte(); - newHeader[1] = transactionId; - newHeader[2] = commandId; - } - return newHeader; - } - - public ZCLHeaderImpl(byte[] frame) { - this.frame = frame; - frameControl = new ZCLFrameControlImpl(frame[0]); - header = copyHeader(frameControl.isManufacturerExtension()); - } - - private byte[] copyHeader(boolean extendedHeader) { - byte[] resultHeader; - if (extendedHeader) { - resultHeader = new byte[5]; - System.arraycopy(frame, 0, resultHeader, 0, 5); - manufacturerId = new byte[2]; - manufacturerId[0] = resultHeader[1]; - manufacturerId[1] = resultHeader[2]; - transactionId = resultHeader[3]; - commandId = resultHeader[4]; - } else { - resultHeader = new byte[3]; - System.arraycopy(frame, 0, resultHeader, 0, 3); - transactionId = resultHeader[1]; - commandId = resultHeader[2]; - } - return resultHeader; - } - - - /* (non-Javadoc) - * @see it.cnr.isti.zigbee.zcl.library.impl.core.ZCLHeaderInterface#getFramecontrol() - */ - public ZCLFrameControlImpl getFramecontrol() { - return frameControl; - } - - /* (non-Javadoc) - * @see it.cnr.isti.zigbee.zcl.library.impl.core.ZCLHeaderInterface#getManufacturerId() - */ - public byte[] getManufacturerId() { - return manufacturerId; - } - - /* (non-Javadoc) - * @see it.cnr.isti.zigbee.zcl.library.impl.core.ZCLHeaderInterface#getTransactionId() - */ - public byte getTransactionId() { - return transactionId; - } - - /* (non-Javadoc) - * @see it.cnr.isti.zigbee.zcl.library.impl.core.ZCLHeaderInterface#getCommandId() - */ - public byte getCommandId() { - return commandId; - } - - - public byte[] toByte() { - return header; - } - - public int size() { - return toByte().length; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/ZCLLayer.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/ZCLLayer.java deleted file mode 100644 index 0f2701cb47d14..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/core/ZCLLayer.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.core; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZCLLayer { - - static int transactionId; - - public synchronized static byte getTransactionId() { - return (byte) transactionId++; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/event/CurrentLevelBridgeListeners.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/event/CurrentLevelBridgeListeners.java deleted file mode 100644 index fb53bcc932bc1..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/event/CurrentLevelBridgeListeners.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.event; - -import org.bubblecloud.zigbee.api.cluster.Cluster; -import org.bubblecloud.zigbee.api.cluster.general.event.CurrentLevelEvent; -import org.bubblecloud.zigbee.api.cluster.general.event.CurrentLevelListener; -import org.bubblecloud.zigbee.api.ReportingConfiguration; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.AnalogReporter; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ReportListener; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; - -import java.util.ArrayList; -import java.util.Dictionary; -import java.util.List; - -/** - * Default implementation of the delegator class that handles the eventing of the {@link CurrentLevelListener} - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.6.0 - */ -public class CurrentLevelBridgeListeners implements ReportListener { - - private class CurrentLevelEventImpl implements CurrentLevelEvent { - - private final Cluster source; - private final int event; - - public CurrentLevelEventImpl(Cluster cluster, Integer value) { - source = cluster; - event = value.intValue(); - } - - public int getEvent() { - return event; - } - - public Cluster getSource() { - return source; - } - } - - private final Attribute bridged; - private final ArrayList listeners = new ArrayList(); - private final Cluster cluster; - private final ReportingConfiguration configuration; - - public CurrentLevelBridgeListeners(final ReportingConfiguration conf, final Attribute attribute, final Cluster c) { - bridged = attribute; - cluster = c; - configuration = conf; - } - - public void receivedReport(final String endPointId, final short clusterId, - final Dictionary reports) { - if (reports.get(bridged) == null) { - return; - } - synchronized (listeners) { - for (CurrentLevelListener listener : listeners) { - listener.changedCurrentLevel(new CurrentLevelEventImpl(cluster, (Integer) reports.get(bridged))); - } - } - } - - public List getListeners() { - return listeners; - } - - public boolean subscribe(CurrentLevelListener listener) { - synchronized (listeners) { - if (listeners.size() == 0) { - AnalogReporter subscription = (AnalogReporter) bridged.getReporter(); - if (configuration.getReportingOverwrite() || subscription.isActive() == false) { - subscription.setMaximumReportingInterval(configuration.getReportingMaximum()); - subscription.setMinimumReportingInterval(configuration.getReportingMinimum()); - subscription.setReportableChange(configuration.getReportingChange()); - subscription.updateConfiguration(); - } - if (subscription.addReportListener(this) == false) { - return false; - } - } - return listeners.add(listener); - } - } - - public boolean unsubscribe(CurrentLevelListener listener) { - synchronized (listeners) { - listeners.remove(listener); - if (listeners.size() == 0) { - Reporter reporter = bridged.getReporter(); - if (reporter.getReportListenersCount() == 1) { - reporter.clear(); - } - } - } - return true; - } -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/event/MeasuredValueBridgeListeners.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/event/MeasuredValueBridgeListeners.java deleted file mode 100644 index b760efbade455..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/event/MeasuredValueBridgeListeners.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.event; - -import org.bubblecloud.zigbee.api.cluster.Cluster; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.event.MeasuredValueEvent; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.event.MeasuredValueListener; -import org.bubblecloud.zigbee.api.ReportingConfiguration; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.AnalogReporter; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ReportListener; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; - -import java.util.ArrayList; -import java.util.Dictionary; -import java.util.List; - -/** - * Default implementation of the delegator class that handles the eventing of the {@link MeasuredValueListener} - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.6.0 - */ -public class MeasuredValueBridgeListeners implements ReportListener { - - private class MeasuredValueEventImpl implements MeasuredValueEvent { - - private final Cluster source; - private final int event; - - public MeasuredValueEventImpl(Cluster cluster, Integer value) { - source = cluster; - event = value.intValue(); - } - - public int getEvent() { - return event; - } - - public Cluster getSource() { - return source; - } - } - - private final Attribute bridged; - private final ArrayList listeners = new ArrayList(); - private final Cluster cluster; - private final ReportingConfiguration configuration; - - public MeasuredValueBridgeListeners(final ReportingConfiguration conf, final Attribute attribute, final Cluster c) { - bridged = attribute; - cluster = c; - configuration = conf; - } - - public void receivedReport(final String endPointId, final short clusterId, - final Dictionary reports) { - if (reports.get(bridged) == null) { - return; - } - synchronized (listeners) { - for (MeasuredValueListener listener : listeners) { - listener.changedMeasuredValue(new MeasuredValueEventImpl(cluster, (Integer) reports.get(bridged))); - } - } - } - - public List getListeners() { - return listeners; - } - - public boolean subscribe(MeasuredValueListener listener) { - synchronized (listeners) { - if (listeners.size() == 0) { - AnalogReporter subscription = (AnalogReporter) bridged.getReporter(); - if (configuration.getReportingOverwrite() || subscription.isActive() == false) { - subscription.setMaximumReportingInterval(configuration.getReportingMaximum()); - subscription.setMinimumReportingInterval(configuration.getReportingMinimum()); - subscription.setReportableChange(configuration.getReportingChange()); - subscription.updateConfiguration(); - } - if (subscription.addReportListener(this) == false) { - return false; - } - } - return listeners.add(listener); - } - } - - public boolean unsubscribe(MeasuredValueListener listener) { - synchronized (listeners) { - listeners.remove(listener); - if (listeners.size() == 0) { - Reporter reporter = bridged.getReporter(); - if (reporter.getReportListenersCount() == 1) { - reporter.clear(); - } - } - } - return true; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/event/OccupancyBridgeListeners.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/event/OccupancyBridgeListeners.java deleted file mode 100644 index 6e41b9ab00400..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/event/OccupancyBridgeListeners.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.event; - -import org.bubblecloud.zigbee.api.cluster.Cluster; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.event.OccupancyEvent; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.event.OccupancyListener; -import org.bubblecloud.zigbee.api.ReportingConfiguration; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ReportListener; - -import java.util.ArrayList; -import java.util.Dictionary; -import java.util.List; - -/** - * Default implementation of the delegator class that handles the eventing of the {@link OccupancyListener} - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.6.0 - */ -public class OccupancyBridgeListeners implements ReportListener { - - private class OccupancyEventImpl implements OccupancyEvent { - - private final Cluster source; - private final int event; - - public OccupancyEventImpl(Cluster cluster, Integer value) { - source = cluster; - event = value; - } - - public int getEvent() { - return event; - } - - public Cluster getSource() { - return source; - } - } - - private final Attribute bridged; - private final ArrayList listeners = new ArrayList(); - private final Cluster cluster; - private final ReportingConfiguration configuration; - - public OccupancyBridgeListeners(final ReportingConfiguration conf, final Attribute attribute, final Cluster c) { - bridged = attribute; - cluster = c; - configuration = conf; - } - - public void receivedReport(final String endPointId, final short clusterId, Dictionary reports) { - if (reports.get(bridged) == null) { - return; - } - synchronized (listeners) { - for (OccupancyListener listener : listeners) { - listener.changedOccupancy(new OccupancyEventImpl(cluster, (Integer) reports.get(bridged))); - } - } - } - - public List getListeners() { - return listeners; - } - - public boolean subscribe(OccupancyListener listener) { - synchronized (listeners) { - if (listeners.size() == 0) { - Reporter reporter = bridged.getReporter(); - if (configuration.getReportingOverwrite() || reporter.isActive() == false) { - reporter.setMaximumReportingInterval(configuration.getReportingMaximum()); - reporter.setMinimumReportingInterval(configuration.getReportingMinimum()); - reporter.updateConfiguration(); - } - if (reporter.addReportListener(this) == false) { - return false; - } - } - return listeners.add(listener); - } - } - - public boolean unsubscribe(OccupancyListener listener) { - synchronized (listeners) { - listeners.remove(listener); - if (listeners.size() == 0) { - Reporter reporter = bridged.getReporter(); - if (reporter.getReportListenersCount() == 1) { - reporter.clear(); - } - } - } - return true; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/event/OnOffBridgeListeners.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/event/OnOffBridgeListeners.java deleted file mode 100644 index 285a5a5f6ae54..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/event/OnOffBridgeListeners.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.event; - -import org.bubblecloud.zigbee.api.cluster.Cluster; -import org.bubblecloud.zigbee.api.cluster.general.event.OnOffEvent; -import org.bubblecloud.zigbee.api.cluster.general.event.OnOffListener; -import org.bubblecloud.zigbee.api.ReportingConfiguration; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ReportListener; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; - -import java.util.ArrayList; -import java.util.Dictionary; -import java.util.List; - -/** - * Default implementation of the delegator class that handles the eventing of the {@link OnOffListener} - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.6.0 - */ -public class OnOffBridgeListeners implements ReportListener { - - private class OnOffEventImpl implements OnOffEvent { - - private final Cluster source; - private final boolean event; - - public OnOffEventImpl(Cluster cluster, Boolean value) { - source = cluster; - event = value; - } - - public boolean getEvent() { - return event; - } - - public Cluster getSource() { - return source; - } - } - - private final Attribute bridged; - private final ArrayList listeners = new ArrayList(); - private final Cluster cluster; - private final ReportingConfiguration configuration; - - public OnOffBridgeListeners(final ReportingConfiguration conf, final Attribute attribute, final Cluster c) { - bridged = attribute; - cluster = c; - configuration = conf; - } - - public void receivedReport(final String endPointId, final short clusterId, - Dictionary reports) { - if (reports.get(bridged) == null) { - return; - } - synchronized (listeners) { - for (OnOffListener listener : listeners) { - listener.changedOnOff(new OnOffEventImpl(cluster, (Boolean) reports.get(bridged))); - } - } - } - - public List getListeners() { - return listeners; - } - - public boolean subscribe(OnOffListener listener) { - synchronized (listeners) { - if (listeners.size() == 0) { - Reporter reporter = bridged.getReporter(); - if (configuration.getReportingOverwrite() || reporter.isActive() == false) { - reporter.setMaximumReportingInterval(configuration.getReportingMaximum()); - reporter.setMinimumReportingInterval(configuration.getReportingMinimum()); - reporter.updateConfiguration(); - } - if (reporter.addReportListener(this) == false) { - return false; - } - } - return listeners.add(listener); - } - } - - public boolean unsubscribe(OnOffListener listener) { - synchronized (listeners) { - listeners.remove(listener); - if (listeners.size() == 0) { - Reporter reporter = bridged.getReporter(); - if (reporter.getReportListenersCount() == 1) { - reporter.clear(); - } - } - } - return true; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/event/PresentValueBridgeListeners.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/event/PresentValueBridgeListeners.java deleted file mode 100755 index be904c6d5d64b..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/event/PresentValueBridgeListeners.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - Copyright 2013-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.event; - -import org.bubblecloud.zigbee.api.cluster.Cluster; -import org.bubblecloud.zigbee.api.cluster.general.event.PresentValueEvent; -import org.bubblecloud.zigbee.api.cluster.general.event.PresentValueListener; -import org.bubblecloud.zigbee.api.ReportingConfiguration; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ReportListener; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; - -import java.util.ArrayList; -import java.util.Dictionary; -import java.util.List; - -/** - * @author Han Alink - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.7.0 - */ -public class PresentValueBridgeListeners implements ReportListener { - - private class PresentValueEventImpl implements PresentValueEvent { - - private final Cluster source; - private final boolean event; - - public PresentValueEventImpl(Cluster cluster, Boolean value) { - source = cluster; - event = value; - } - - public boolean getEvent() { - return event; - } - - public Cluster getSource() { - return source; - } - } - - private final Attribute bridged; - private final ArrayList listeners = new ArrayList(); - private final Cluster cluster; - private final ReportingConfiguration configuration; - - public PresentValueBridgeListeners(final ReportingConfiguration conf, final Attribute attribute, final Cluster c) { - bridged = attribute; - cluster = c; - configuration = conf; - } - - public void receivedReport(final String endPointId, final short clusterId, Dictionary reports) { - if (reports.get(bridged) == null) { - return; - } - synchronized (listeners) { - for (PresentValueListener listener : listeners) { - listener.changedPresentValue(new PresentValueEventImpl(cluster, (Boolean) reports.get(bridged))); - } - } - } - - public List getListeners() { - return listeners; - } - - public boolean subscribe(PresentValueListener listener) { - synchronized (listeners) { - if (listeners.size() == 0) { - Reporter reporter = bridged.getReporter(); - if (configuration.getReportingOverwrite() || reporter.isActive() == false) { - reporter.setMaximumReportingInterval(configuration.getReportingMaximum()); - reporter.setMinimumReportingInterval(configuration.getReportingMinimum()); - reporter.updateConfiguration(); - } - if (reporter.addReportListener(this) == false) { - return false; - } - } - return listeners.add(listener); - } - } - - public boolean unsubscribe(PresentValueListener listener) { - synchronized (listeners) { - listeners.remove(listener); - if (listeners.size() == 0) { - Reporter reporter = bridged.getReporter(); - if (reporter.getReportListenersCount() == 1) { - reporter.clear(); - } - } - } - return true; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/event/ToleranceBridgeListeners.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/event/ToleranceBridgeListeners.java deleted file mode 100644 index 41f5e6d4b1a80..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/event/ToleranceBridgeListeners.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.event; - -import org.bubblecloud.zigbee.api.cluster.Cluster; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.AnalogReporter; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.event.ToleranceEvent; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.event.ToleranceListener; -import org.bubblecloud.zigbee.api.ReportingConfiguration; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ReportListener; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Reporter; - -import java.util.ArrayList; -import java.util.Dictionary; -import java.util.List; - -/** - * Default implementation of the delegator class that handles the eventing of the {@link ToleranceListener} - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.6.0 - */ -public class ToleranceBridgeListeners implements ReportListener { - - private class ToleranceEventImpl implements ToleranceEvent { - - private final Cluster source; - private final int event; - - public ToleranceEventImpl(Cluster cluster, Integer value) { - source = cluster; - event = value.intValue(); - } - - public int getEvent() { - return event; - } - - public Cluster getSource() { - return source; - } - } - - private final Attribute bridged; - private final ArrayList listeners = new ArrayList(); - private final Cluster cluster; - private final ReportingConfiguration configuration; - - public ToleranceBridgeListeners(final ReportingConfiguration conf, final Attribute attribute, final Cluster c) { - bridged = attribute; - cluster = c; - configuration = conf; - } - - public void receivedReport(final String endPointId, final short clusterId, Dictionary reports) { - if (reports.get(bridged) == null) { - return; - } - synchronized (listeners) { - for (ToleranceListener listener : listeners) { - listener.changedTolerance(new ToleranceEventImpl(cluster, (Integer) reports.get(bridged))); - } - } - } - - public List getListeners() { - return listeners; - } - - public boolean subscribe(ToleranceListener listener) { - synchronized (listeners) { - if (listeners.size() == 0) { - AnalogReporter subscription = (AnalogReporter) bridged.getReporter(); - if (configuration.getReportingOverwrite() || subscription.isActive() == false) { - subscription.setMaximumReportingInterval(configuration.getReportingMaximum()); - subscription.setMinimumReportingInterval(configuration.getReportingMinimum()); - subscription.setReportableChange(configuration.getReportingChange()); - subscription.updateConfiguration(); - } - if (subscription.addReportListener(this) == false) { - return false; - } - } - return listeners.add(listener); - } - } - - public boolean unsubscribe(ToleranceListener listener) { - synchronized (listeners) { - listeners.remove(listener); - if (listeners.size() == 0) { - Reporter reporter = bridged.getReporter(); - if (reporter.getReportListenersCount() == 1) { - reporter.clear(); - } - } - } - return true; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/AlarmsCluster.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/AlarmsCluster.java deleted file mode 100644 index 64cea72e6ebbf..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/AlarmsCluster.java +++ /dev/null @@ -1,215 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general; - -import org.bubblecloud.zigbee.network.ClusterFilter; -import org.bubblecloud.zigbee.network.ClusterListener; -import org.bubblecloud.zigbee.network.ClusterMessage; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.network.impl.ZigBeeNetworkManagerException; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.Alarms; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.alarms.AlarmListener; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.alarms.AlarmResponse; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.Attributes; -import org.bubblecloud.zigbee.api.cluster.impl.core.AttributeImpl; -import org.bubblecloud.zigbee.api.cluster.impl.core.EmptyPayloadCommand; -import org.bubblecloud.zigbee.api.cluster.impl.core.ResponseImpl; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLClusterBase; -import org.bubblecloud.zigbee.api.cluster.impl.general.alarms.AlarmResponseImpl; -import org.bubblecloud.zigbee.api.cluster.impl.general.alarms.AlarmsClusterFilter; -import org.bubblecloud.zigbee.api.cluster.impl.general.alarms.GetAlarmResponseImpl; -import org.bubblecloud.zigbee.api.cluster.impl.general.alarms.ResetAlarmCommand; -import org.bubblecloud.zigbee.api.cluster.impl.global.DefaultResponseImpl; - -import java.util.ArrayList; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class AlarmsCluster extends ZCLClusterBase implements Alarms { - - private final Logger log = LoggerFactory.getLogger(AlarmsCluster.class); - - private final AttributeImpl alarmCount; - - private final Attribute[] attributes; - - private final ArrayList listeners = new ArrayList(); - - private AlarmsListenerNotifier bridge; - - private static final EmptyPayloadCommand RESET_ALL_ALARMS = new EmptyPayloadCommand() - .setId(Alarms.RESET_ALL_ALARMS_ID) - .setClientServerDirection(true) - .setClusterSpecific(true) - .setManufacturerExtension(false); - - private static final EmptyPayloadCommand GET_ALARM = new EmptyPayloadCommand() - .setId(Alarms.GET_ALARM_ID) - .setClientServerDirection(true) - .setClusterSpecific(true) - .setManufacturerExtension(false); - - private static final EmptyPayloadCommand RESET_ALARM_LOG = new EmptyPayloadCommand() - .setId(Alarms.RESET_ALARM_LOG_ID) - .setClientServerDirection(true) - .setClusterSpecific(true) - .setManufacturerExtension(false); - - - private class AlarmsListenerNotifier implements ClusterListener { - - public void handleCluster(ZigBeeEndpoint endpoint, ClusterMessage c) { - try { - ResponseImpl response = new ResponseImpl(c, ID); - AlarmResponse alarm = new AlarmResponseImpl(response); - ArrayList localCopy; - synchronized (listeners) { - localCopy = new ArrayList(listeners); - } - log.debug("Notifying {} AlarmListener", localCopy.size()); - for (AlarmListener alarmListner : localCopy) { - try { - log.debug("Notifying {}:{}", alarmListner.getClass().getName(), alarmListner); - alarmListner.alarm(alarm.getAllarmCode(), alarm.getClusterID()); - } catch (Exception e) { - log.error("Error while notifying {}:{} caused by {}", new Object[]{ - alarmListner.getClass().getName(), alarmListner, e.getStackTrace() - }); - } - } - - } catch (ZigBeeClusterException e) { - e.printStackTrace(); - } - } - - public ClusterFilter getClusterFilter() { - return AlarmsClusterFilter.FILTER; - } - - public void setClusterFilter(ClusterFilter filter) { - } - - } - - public AlarmsCluster(ZigBeeEndpoint zbDevice) { - super(zbDevice); - alarmCount = new AttributeImpl(zbDevice, this, Attributes.ALLARM_COUNT); - attributes = new AttributeImpl[]{alarmCount}; - bridge = new AlarmsListenerNotifier(); - } - - public short getId() { - return Alarms.ID; - } - - public String getName() { - return Alarms.NAME; - } - - public Attribute[] getStandardAttributes() { - return attributes; - } - - public Attribute getAttributeAlarmCount() { - return alarmCount; - } - - public boolean addAlarmListerner(AlarmListener listener) { - synchronized (listeners) { - if (listeners.size() == 0) { - try { - getZigBeeEndpoint().bindToLocal(ID); - } catch (ZigBeeNetworkManagerException e) { - log.error("Unable to bind to device for Alarms reporting", e); - return false; - } - if (getZigBeeEndpoint().addClusterListener(bridge) == false) { - log.error("Unable to register the cluster listener for Alarms reporting"); - return false; - } - } - listeners.add(listener); - return true; - } - } - - public boolean removeAlarmListerner(AlarmListener listener) { - synchronized (listeners) { - boolean removed = listeners.remove(listener); - if (listeners.size() == 0 && removed) { - try { - getZigBeeEndpoint().unbindFromLocal(ID); - } catch (ZigBeeNetworkManagerException e) { - log.error("Unable to unbind to device for Alarms reporting", e); - return false; - } - if (getZigBeeEndpoint().removeClusterListener(bridge) == false) { - log.error("Unable to unregister the cluster listener for Alarms reporting"); - return false; - } - } - return removed; - } - } - - public Response getAlarm() throws ZigBeeClusterException { - enableDefaultResponse(); - Response response = invoke(GET_ALARM); - if (response.getZCLHeader().getFramecontrol().isClusterSpecificCommand()) { - return new GetAlarmResponseImpl(response); - } else { - return new DefaultResponseImpl(response); - } - } - - public Response resetAlarm(int clusterId, int attributeId) throws ZigBeeClusterException { - enableDefaultResponse(); - ResetAlarmCommand resetAlarmCmd = new ResetAlarmCommand((byte) clusterId, (short) attributeId); - Response response = invoke(resetAlarmCmd); - return new DefaultResponseImpl(response); - } - - public Response resetAlarmLog() throws ZigBeeClusterException { - enableDefaultResponse(); - Response response = invoke(RESET_ALARM_LOG); - return new DefaultResponseImpl(response); - } - - public Response resetAllAlarms() throws ZigBeeClusterException { - enableDefaultResponse(); - Response response = invoke(RESET_ALL_ALARMS); - return new DefaultResponseImpl(response); - } - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/AnalogInputCluster.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/AnalogInputCluster.java deleted file mode 100644 index 476627847a828..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/AnalogInputCluster.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.AnalogInput; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.Attributes; -import org.bubblecloud.zigbee.api.cluster.impl.core.AttributeImpl; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLClusterBase; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; - -public class AnalogInputCluster extends ZCLClusterBase implements AnalogInput { - - - - - - private final AttributeImpl description; - private final AttributeImpl maxPresentValue; - private final AttributeImpl minPresentValue; - private final AttributeImpl outOfService; - private final AttributeImpl presentValue; - private final AttributeImpl reliability; - private final AttributeImpl resolution; - private final AttributeImpl statusFlags; - private final AttributeImpl engineeringUnits; - private final AttributeImpl applicationType; - - private final Attribute[] attributes; - - public AnalogInputCluster(ZigBeeEndpoint zbDevice){ - super(zbDevice); - - description = new AttributeImpl(zbDevice,this, Attributes.DESCRIPTION); - maxPresentValue = new AttributeImpl(zbDevice,this,Attributes.MAX_PRESENT_VALUE); - minPresentValue = new AttributeImpl(zbDevice,this,Attributes.MIN_PRESENT_VALUE); - outOfService = new AttributeImpl(zbDevice,this,Attributes.OUT_OF_SERVICE); - presentValue = new AttributeImpl(zbDevice,this,Attributes.PRESENT_VALUE); - reliability = new AttributeImpl(zbDevice,this,Attributes.RELIABILITY); - resolution = new AttributeImpl(zbDevice,this,Attributes.RESOLUTION); - statusFlags = new AttributeImpl(zbDevice,this,Attributes.STATUS_FLAGS); - engineeringUnits = new AttributeImpl(zbDevice,this,Attributes.ENGINEERING_UNITS); - applicationType = new AttributeImpl(zbDevice,this,Attributes.APPLICATION_TYPE); - - - attributes = new AttributeImpl[]{description,maxPresentValue,minPresentValue,outOfService, - presentValue,reliability,resolution,statusFlags,engineeringUnits,applicationType - }; - } - - @Override - public short getId() { - return AnalogInput.ID; - } - - @Override - public String getName() { - return AnalogInput.NAME; - } - - @Override - public Attribute[] getStandardAttributes() { - return attributes; - } - - - - public Attribute getAttributeDescription() { - return description; - } - - public Attribute getAttributeMaxPresentValue() { - return maxPresentValue; - } - - public Attribute getAttributeMinPresentValue() { - return minPresentValue; - } - - public Attribute getAttributeOutOfService() { - return outOfService; - } - - public Attribute getAttributePresentValue() { - return presentValue; - } - - public Attribute getAttributeReliability() { - return reliability; - } - - public Attribute getAttributeResolution() { - return resolution; - } - public Attribute getAttributeStatusFlags() { - return statusFlags; - } - - - public Attribute getAttributeEngineeringUnits() { - return engineeringUnits; - } - - public Attribute getAttributeApplicationType() { - return applicationType; - } - - - - - - - - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/BasicCluster.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/BasicCluster.java deleted file mode 100644 index c3aefe64c6ed7..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/BasicCluster.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general; - - -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.Basic; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.DefaultResponse; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.Attributes; -import org.bubblecloud.zigbee.api.cluster.impl.core.AttributeImpl; -import org.bubblecloud.zigbee.api.cluster.impl.core.EmptyPayloadCommand; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLClusterBase; -import org.bubblecloud.zigbee.api.cluster.impl.global.DefaultResponseImpl; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class BasicCluster extends ZCLClusterBase implements Basic { - - private final AttributeImpl zclVersion; - private final AttributeImpl applicationVersion; - private final AttributeImpl stackVersion; - private final AttributeImpl hwVersion; - private final AttributeImpl manufacturerName; - private final AttributeImpl modelIdentifier; - private final AttributeImpl dateCode; - private final AttributeImpl powerSource; - - private final AttributeImpl locationDescription; - private final AttributeImpl physicalEnvironment; - private final AttributeImpl deviceEnabled; - private final AttributeImpl alarmMask; - private final AttributeImpl disableLocalConfig; - - private final Attribute[] attributes; - - public BasicCluster(ZigBeeEndpoint zbDevice) { - super(zbDevice); - zclVersion = new AttributeImpl(zbDevice, this, Attributes.ZCL_VERSION); - applicationVersion = new AttributeImpl(zbDevice, this, Attributes.APPLICATION_VERSION); - stackVersion = new AttributeImpl(zbDevice, this, Attributes.STACK_VERSION); - hwVersion = new AttributeImpl(zbDevice, this, Attributes.HW_VERSION); - manufacturerName = new AttributeImpl(zbDevice, this, Attributes.MANUFACTURER_NAME); - modelIdentifier = new AttributeImpl(zbDevice, this, Attributes.MODEL_IDENTIFIER); - dateCode = new AttributeImpl(zbDevice, this, Attributes.DATE_CODE); - powerSource = new AttributeImpl(zbDevice, this, Attributes.POWER_SOURCE); - locationDescription = new AttributeImpl(zbDevice, this, Attributes.LOCATION_DESCRIPTION); - physicalEnvironment = new AttributeImpl(zbDevice, this, Attributes.PHYSICAL_ENVIRONMENT); - deviceEnabled = new AttributeImpl(zbDevice, this, Attributes.DEVICE_ENABLED); - alarmMask = new AttributeImpl(zbDevice, this, Attributes.ALARM_MASK); - disableLocalConfig = new AttributeImpl(zbDevice, this, Attributes.DISABLE_LOCAL_CONFIG); - attributes = new AttributeImpl[]{zclVersion, applicationVersion, stackVersion, - hwVersion, manufacturerName, modelIdentifier, dateCode, powerSource, - locationDescription, physicalEnvironment, deviceEnabled, alarmMask, disableLocalConfig}; - } - - private static EmptyPayloadCommand CMD_RESET_TO_FACTORY_DEFAULT = new EmptyPayloadCommand() - .setId(Basic.RESET_TO_FACTORY_DEFAULT_ID) - .setClientServerDirection(true) - .setClusterSpecific(true) - .setManufacturerExtension(false); - - @Override - public short getId() { - return Basic.ID; - } - - @Override - public String getName() { - return Basic.NAME; - } - - @Override - public Attribute[] getStandardAttributes() { - return attributes; - } - - public Attribute getAttributeAlarmMask() { - return alarmMask; - } - - public Attribute getAttributeApplicationVersion() { - return applicationVersion; - } - - public Attribute getAttributeDateCode() { - return dateCode; - } - - public Attribute getAttributeDeviceEnabled() { - return deviceEnabled; - } - - public Attribute getAttributeHWVersion() { - return hwVersion; - } - - public Attribute getAttributeLocationDescription() { - return locationDescription; - } - - public Attribute getAttributeManufacturerName() { - return manufacturerName; - } - - public Attribute getAttributeModelIdentifier() { - return modelIdentifier; - } - - public Attribute getAttributePhysicalEnvironment() { - return physicalEnvironment; - } - - public Attribute getAttributeStackVersion() { - return stackVersion; - } - - public Attribute getAttributeZCLVersion() { - return zclVersion; - } - - public Attribute getPowerSource() { - return powerSource; - } - - public Attribute getAttributeDisableLocalConfig() { - return disableLocalConfig; - } - - public DefaultResponse resetToFactoryDefault() throws ZigBeeClusterException { - enableDefaultResponse(); - Response response = invoke(CMD_RESET_TO_FACTORY_DEFAULT); - return new DefaultResponseImpl(response); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/BinaryInputCluster.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/BinaryInputCluster.java deleted file mode 100755 index d5e256862f942..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/BinaryInputCluster.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - Copyright 2013-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -package org.bubblecloud.zigbee.api.cluster.impl.general; - -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.BinaryInput; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.Attributes; -import org.bubblecloud.zigbee.api.cluster.impl.core.AttributeImpl; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLClusterBase; - -/** - * @author Han Alink - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.8.0 - */ -public class BinaryInputCluster extends ZCLClusterBase implements BinaryInput { - - private final Attribute presentValue; - private final Attribute outOfService; - private final Attribute statusFlags; - - private final Attribute[] attributes; - - private final Attribute applicationType; - private final Attribute reliability; - private final Attribute polarity; - private final Attribute inactiveText; - private final Attribute description; - private final Attribute activeText; - - public BinaryInputCluster(ZigBeeEndpoint zbDevice) { - super(zbDevice); - presentValue = new AttributeImpl(zbDevice, this, Attributes.PRESENT_VALUE); - outOfService = new AttributeImpl(zbDevice, this, Attributes.OUT_OF_SERVICE); - statusFlags = new AttributeImpl(zbDevice, this, Attributes.STATUS_FLAGS); - - applicationType = new AttributeImpl(zbDevice, this, Attributes.APPLICATION_TYPE); - reliability = new AttributeImpl(zbDevice, this, Attributes.RELIABILITY); - polarity = new AttributeImpl(zbDevice, this, Attributes.POLARITY); - inactiveText = new AttributeImpl(zbDevice, this, Attributes.INACTIVE_TEXT); - description = new AttributeImpl(zbDevice, this, Attributes.DESCRIPTION); - activeText = new AttributeImpl(zbDevice, this, Attributes.ACTIVE_TEXT); - - attributes = new Attribute[]{ - presentValue, outOfService, statusFlags, applicationType, reliability, polarity, inactiveText, - description, activeText - }; - } - - @Override - public short getId() { - return BinaryInput.ID; - } - - @Override - public String getName() { - return BinaryInput.NAME; - } - - @Override - public Attribute[] getStandardAttributes() { - return attributes; - } - - public Attribute getAttributePresentValue() { - return presentValue; - } - - public Attribute getAttributeOutOfService() { - return outOfService; - } - - public Attribute getAttributeStatusFlags() { - return statusFlags; - } - - public Attribute getAttributeDescription() { - return description; - } - - public Attribute getAttributeInactiveText() { - return inactiveText; - } - - public Attribute getAttributePolarity() { - return polarity; - } - - public Attribute getAttributeReliability() { - return reliability; - } - - public Attribute getAttributeApplicationType() { - return applicationType; - } - - public Attribute getAttributeActiveText() { - return activeText; - } -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/ColorControlCluster.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/ColorControlCluster.java deleted file mode 100644 index b7db42ffa23c5..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/ColorControlCluster.java +++ /dev/null @@ -1,525 +0,0 @@ -/* - Copyright 2012-2012 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.general; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.core.AbstractCommand; -import org.bubblecloud.zigbee.api.cluster.impl.core.ByteArrayOutputStreamSerializer; -import org.bubblecloud.zigbee.api.cluster.impl.global.DefaultResponseImpl; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.lighting.ColorControl; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.Attributes; -import org.bubblecloud.zigbee.api.cluster.impl.core.AttributeImpl; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLClusterBase; - -/** - * @author Manlio Bacco - * @author Tommi S.E. Laukkanen - */ -public class ColorControlCluster extends ZCLClusterBase implements ColorControl { - - private final AttributeImpl currentHue; - private final AttributeImpl currentSaturation; - private final AttributeImpl remainingTime; - private final AttributeImpl currentX; - private final AttributeImpl currentY; - private final AttributeImpl driftCompensation; - private final AttributeImpl compensationText; - private final AttributeImpl colorTemperature; - private final AttributeImpl colorMode; - - // defined primaries information - private final AttributeImpl numberOfPrimaries; - private final AttributeImpl primary1X; - private final AttributeImpl primary1Y; - private final AttributeImpl primary1Intensity; - private final AttributeImpl primary2X; - private final AttributeImpl primary2Y; - private final AttributeImpl primary2Intensity; - private final AttributeImpl primary3X; - private final AttributeImpl primary3Y; - private final AttributeImpl primary3Intensity; - - // additional defined primaries information - private final AttributeImpl primary4X; - private final AttributeImpl primary4Y; - private final AttributeImpl primary4Intensity; - private final AttributeImpl primary5X; - private final AttributeImpl primary5Y; - private final AttributeImpl primary5Intensity; - private final AttributeImpl primary6X; - private final AttributeImpl primary6Y; - private final AttributeImpl primary6Intensity; - - // defined color point settings - private final AttributeImpl whitePointX; - private final AttributeImpl whitePointY; - private final AttributeImpl colorPointRX; - private final AttributeImpl colorPointRY; - private final AttributeImpl colorPointRIntensity; - private final AttributeImpl colorPointGX; - private final AttributeImpl colorPointGY; - private final AttributeImpl colorPointGIntensity; - private final AttributeImpl colorPointBX; - private final AttributeImpl colorPointBY; - private final AttributeImpl colorPointBIntensity; - - private final Attribute[] attributes; - - public ColorControlCluster(ZigBeeEndpoint zbDevice) { - - super(zbDevice); - - currentHue = new AttributeImpl(zbDevice, this, Attributes.CURRENT_HUE); - currentSaturation = new AttributeImpl(zbDevice, this, Attributes.CURRENT_SATURATION); - remainingTime = new AttributeImpl(zbDevice, this, Attributes.REMAINING_TIME_COLOR_CONTROL); - currentX = new AttributeImpl(zbDevice, this, Attributes.CURRENT_X); - currentY = new AttributeImpl(zbDevice, this, Attributes.CURRENT_Y); - driftCompensation = new AttributeImpl(zbDevice, this, Attributes.DRIFT_COMPENSATION); - compensationText = new AttributeImpl(zbDevice, this, Attributes.COMPENSATION_TEXT); - colorTemperature = new AttributeImpl(zbDevice, this, Attributes.COLOR_TEMPERATURE); - colorMode = new AttributeImpl(zbDevice, this, Attributes.COLOR_MODE); - numberOfPrimaries = new AttributeImpl(zbDevice, this, Attributes.NUMBER_OF_PRIMARIES); - primary1X = new AttributeImpl(zbDevice, this, Attributes.PRIMARY_1_X); - primary1Y = new AttributeImpl(zbDevice, this, Attributes.PRIMARY_1_Y); - primary1Intensity = new AttributeImpl(zbDevice, this, Attributes.PRIMARY_1_INTENSITY); - primary2X = new AttributeImpl(zbDevice, this, Attributes.PRIMARY_2_X); - primary2Y = new AttributeImpl(zbDevice, this, Attributes.PRIMARY_2_Y); - primary2Intensity = new AttributeImpl(zbDevice, this, Attributes.PRIMARY_2_INTENSITY); - primary3X = new AttributeImpl(zbDevice, this, Attributes.PRIMARY_3_X); - primary3Y = new AttributeImpl(zbDevice, this, Attributes.PRIMARY_3_Y); - primary3Intensity = new AttributeImpl(zbDevice, this, Attributes.PRIMARY_3_INTENSITY); - primary4X = new AttributeImpl(zbDevice, this, Attributes.PRIMARY_4_X); - primary4Y = new AttributeImpl(zbDevice, this, Attributes.PRIMARY_4_Y); - primary4Intensity = new AttributeImpl(zbDevice, this, Attributes.PRIMARY_4_INTENSITY); - primary5X = new AttributeImpl(zbDevice, this, Attributes.PRIMARY_5_X); - primary5Y = new AttributeImpl(zbDevice, this, Attributes.PRIMARY_5_Y); - primary5Intensity = new AttributeImpl(zbDevice, this, Attributes.PRIMARY_5_INTENSITY); - primary6X = new AttributeImpl(zbDevice, this, Attributes.PRIMARY_6_X); - primary6Y = new AttributeImpl(zbDevice, this, Attributes.PRIMARY_6_Y); - primary6Intensity = new AttributeImpl(zbDevice, this, Attributes.PRIMARY_6_INTENSITY); - whitePointX = new AttributeImpl(zbDevice, this, Attributes.WHITE_POINT_X); - whitePointY = new AttributeImpl(zbDevice, this, Attributes.WHITE_POINT_Y); - colorPointRX = new AttributeImpl(zbDevice, this, Attributes.COLOR_POINT_RX); - colorPointRY = new AttributeImpl(zbDevice, this, Attributes.COLOR_POINT_RY); - colorPointRIntensity = new AttributeImpl(zbDevice, this, Attributes.COLOR_POINT_R_INTENSITY); - colorPointGX = new AttributeImpl(zbDevice, this, Attributes.COLOR_POINT_GX); - colorPointGY = new AttributeImpl(zbDevice, this, Attributes.COLOR_POINT_GY); - colorPointGIntensity = new AttributeImpl(zbDevice, this, Attributes.COLOR_POINT_G_INTENSITY); - colorPointBX = new AttributeImpl(zbDevice, this, Attributes.COLOR_POINT_BX); - colorPointBY = new AttributeImpl(zbDevice, this, Attributes.COLOR_POINT_BY); - colorPointBIntensity = new AttributeImpl(zbDevice, this, Attributes.COLOR_POINT_B_INTENSITY); - - attributes = new AttributeImpl[]{currentHue, currentSaturation, remainingTime, currentX, currentY, driftCompensation, compensationText, - colorTemperature, colorMode, numberOfPrimaries, primary1X, primary1Y, primary1Intensity, primary2X, primary2Y, primary2Intensity, - primary3X, primary3Y, primary3Intensity, primary4X, primary4Y, primary4Intensity, primary5X, primary5Y, primary5Intensity, - primary6X, primary6Y, primary6Intensity, whitePointX, whitePointY, colorPointRX, colorPointRY, colorPointRIntensity, colorPointGX, - colorPointGY, colorPointGIntensity, colorPointBX, colorPointBY, colorPointBIntensity}; - } - - public Attribute getAttributeCurrentHue() { - return currentHue; - } - - public Attribute getAttributeCurrentSaturation() { - return currentSaturation; - } - - public Attribute getAttributeRemainingTime() { - return remainingTime; - } - - public Attribute getAttributeCurrentX() { - return currentX; - } - - public Attribute getAttributeCurrentY() { - return currentY; - } - - public Attribute getAttributeDriftCompensation() { - return driftCompensation; - } - - public Attribute getAttributeCompensationText() { - return compensationText; - } - - public Attribute getAttributeColorTemperature() { - return colorTemperature; - } - - public Attribute getAttributeColorMode() { - return colorMode; - } - - public Attribute getAttributeNumberOfPrimaries() { - return numberOfPrimaries; - } - - public Attribute getAttributePrimary1X() { - return primary1X; - } - - public Attribute getAttributePrimary1Y() { - return primary1Y; - } - - public Attribute getAttributePrimary1Intensity() { - return primary1Intensity; - } - - public Attribute getAttributePrimary2X() { - return primary2X; - } - - public Attribute getAttributePrimary2Y() { - return primary2Y; - } - - public Attribute getAttributePrimary2Intensity() { - return primary2Intensity; - } - - public Attribute getAttributePrimary3X() { - return primary3X; - } - - public Attribute getAttributePrimary3Y() { - return primary3Y; - } - - public Attribute getAttributePrimary3Intensity() { - return primary3Intensity; - } - - public Attribute getAttributePrimary4X() { - return primary4X; - } - - public Attribute getAttributePrimary4Y() { - return primary4Y; - } - - public Attribute getAttributePrimary4Intensity() { - return primary4Intensity; - } - - public Attribute getAttributePrimary5X() { - return primary5X; - } - - public Attribute getAttributePrimary5Y() { - return primary5Y; - } - - public Attribute getAttributePrimary5Intensity() { - return primary5Intensity; - } - - public Attribute getAttributePrimary6X() { - return primary6X; - } - - public Attribute getAttributePrimary6Y() { - return primary6Y; - } - - public Attribute getAttributePrimary6Intensity() { - return primary6Intensity; - } - - public Attribute getAttributeWhitePointX() { - return whitePointX; - } - - public Attribute getAttributeWhitePointY() { - return whitePointY; - } - - public Attribute getAttributeColorPointRX() { - return colorPointRX; - } - - public Attribute getAttributeColorPointRY() { - return colorPointRY; - } - - public Attribute getAttributeColorPointRIntensity() { - return colorPointRIntensity; - } - - public Attribute getAttributeColorPointGX() { - return colorPointGX; - } - - public Attribute getAttributeColorPointGY() { - return colorPointGY; - } - - public Attribute getAttributeColorPointGIntensity() { - return colorPointGIntensity; - } - - public Attribute getAttributeColorPointBX() { - return colorPointBX; - } - - public Attribute getAttributeColorPointBY() { - return colorPointBY; - } - - public Attribute getAttributeColorPointBIntensity() { - return colorPointBIntensity; - } - - @Override - public short getId() { - return ColorControl.ID; - } - - @Override - public String getName() { - return ColorControl.NAME; - } - - @Override - public Attribute[] getStandardAttributes() { - return attributes; - } - - @Override - public Response moveToHue(int hue, int direction, int transitionTime) throws ZigBeeClusterException { - enableDefaultResponse(); - final MoveToHueCommand command = new MoveToHueCommand(hue, direction, transitionTime); - final Response response = invoke(command); - return new DefaultResponseImpl(response); - } - - private class MoveToHueCommand extends AbstractCommand { - public MoveToHueCommand(int hue, int direction, int transitionTime) { - super(ColorControl.MOVE_TO_HUE_ID); - payload = new byte[4]; - ByteArrayOutputStreamSerializer serializer = new ByteArrayOutputStreamSerializer(); - serializer.append_byte((byte) hue); - serializer.append_byte((byte) direction); - serializer.append_short((short) transitionTime); - payload = serializer.getPayload(); - } - } - - @Override - public Response moveHue(int moveMode, int rate) throws ZigBeeClusterException { - enableDefaultResponse(); - final MoveHueCommand command = new MoveHueCommand(moveMode, rate); - final Response response = invoke(command); - return new DefaultResponseImpl(response); - } - - private class MoveHueCommand extends AbstractCommand { - public MoveHueCommand(int moveMode, int rate) { - super(ColorControl.MOVE_HUE_ID); - payload = new byte[2]; - ByteArrayOutputStreamSerializer serializer = new ByteArrayOutputStreamSerializer(); - serializer.append_byte((byte) moveMode); - serializer.append_byte((byte) rate); - payload = serializer.getPayload(); - } - } - - @Override - public Response stepHue(int stepMode, int stepSize, int transtionTime) throws ZigBeeClusterException { - enableDefaultResponse(); - final StepHueCommand command = new StepHueCommand(stepMode, stepSize, transtionTime); - final Response response = invoke(command); - return new DefaultResponseImpl(response); - } - - private class StepHueCommand extends AbstractCommand { - public StepHueCommand(int stepMode, int stepSize, int transtionTime) { - super(ColorControl.STEP_HUE_ID); - payload = new byte[3]; - ByteArrayOutputStreamSerializer serializer = new ByteArrayOutputStreamSerializer(); - serializer.append_byte((byte) stepMode); - serializer.append_byte((byte) stepSize); - serializer.append_byte((byte) transtionTime); - } - } - - @Override - public Response movetoSaturation(int saturation, int transitionTime) throws ZigBeeClusterException { - enableDefaultResponse(); - final MoveToSaturationCommand command = new MoveToSaturationCommand(saturation, transitionTime); - final Response response = invoke(command); - return new DefaultResponseImpl(response); - } - - private class MoveToSaturationCommand extends AbstractCommand { - public MoveToSaturationCommand(int saturation, int transitionTime) { - super(ColorControl.MOVE_TO_SATURATION_ID); - payload = new byte[3]; - ByteArrayOutputStreamSerializer serializer = new ByteArrayOutputStreamSerializer(); - serializer.append_byte((byte) saturation); - serializer.append_short((short) transitionTime); - payload = serializer.getPayload(); - } - } - - @Override - public Response moveSaturation(int moveMode, int rate) throws ZigBeeClusterException { - enableDefaultResponse(); - final MoveSaturationCommand command = new MoveSaturationCommand(moveMode, rate); - final Response response = invoke(command); - return new DefaultResponseImpl(response); - } - - private class MoveSaturationCommand extends AbstractCommand { - public MoveSaturationCommand(int moveMode, int rate) { - super(ColorControl.MOVE_SATURATION_ID); - payload = new byte[2]; - ByteArrayOutputStreamSerializer serializer = new ByteArrayOutputStreamSerializer(); - serializer.append_byte((byte) moveMode); - serializer.append_byte((byte) rate); - payload = serializer.getPayload(); - } - } - - @Override - public Response stepSaturation(int stepMode, int stepSize, - int transitionTime) throws ZigBeeClusterException { - enableDefaultResponse(); - final StepSaturationCommand command = new StepSaturationCommand(stepMode, stepSize, transitionTime); - final Response response = invoke(command); - return new DefaultResponseImpl(response); - } - - private class StepSaturationCommand extends AbstractCommand { - public StepSaturationCommand(int stepMode, int stepSize, int transtionTime) { - super(ColorControl.STEP_SATURATION_ID); - payload = new byte[3]; - ByteArrayOutputStreamSerializer serializer = new ByteArrayOutputStreamSerializer(); - serializer.append_byte((byte) stepMode); - serializer.append_byte((byte) stepSize); - serializer.append_byte((byte) transtionTime); - } - } - - @Override - public Response moveToHueAndSaturation(int hue, int saturation, - int transitionTime) throws ZigBeeClusterException { - enableDefaultResponse(); - final MoveToHueAndSaturationCommand command = new MoveToHueAndSaturationCommand(hue, saturation, transitionTime); - final Response response = invoke(command); - return new DefaultResponseImpl(response); - } - - private class MoveToHueAndSaturationCommand extends AbstractCommand { - public MoveToHueAndSaturationCommand(int hue, int saturation, int transtionTime) { - super(ColorControl.MOVE_TO_HUE_AND_SATURATION_ID); - payload = new byte[4]; - ByteArrayOutputStreamSerializer serializer = new ByteArrayOutputStreamSerializer(); - serializer.append_byte((byte) hue); - serializer.append_byte((byte) saturation); - serializer.append_short((short) transtionTime); - } - } - - @Override - public Response moveToColor(int colorX, int colorY, int transitionTime) throws ZigBeeClusterException { - enableDefaultResponse(); - final MoveToColorCommand command = new MoveToColorCommand(colorX, colorY, transitionTime); - final Response response = invoke(command); - return new DefaultResponseImpl(response); - } - - private class MoveToColorCommand extends AbstractCommand { - public MoveToColorCommand(int colorX, int colorY, int transitionTime) { - super(ColorControl.MOVE_TO_COLOR_ID); - payload = new byte[6]; - ByteArrayOutputStreamSerializer serializer = new ByteArrayOutputStreamSerializer(); - serializer.append_short((short) colorX); - serializer.append_short((short) colorY); - serializer.append_short((short) transitionTime); - payload = serializer.getPayload(); - } - } - - @Override - public Response moveColor(int rateX, int rateY) throws ZigBeeClusterException { - enableDefaultResponse(); - final MoveColorCommand command = new MoveColorCommand(rateX, rateY); - final Response response = invoke(command); - return new DefaultResponseImpl(response); - } - - private class MoveColorCommand extends AbstractCommand { - public MoveColorCommand(int rateX, int rateY) { - super(ColorControl.MOVE_COLOR_ID); - payload = new byte[4]; - ByteArrayOutputStreamSerializer serializer = new ByteArrayOutputStreamSerializer(); - serializer.append_short((short) rateX); - serializer.append_short((short) rateY); - payload = serializer.getPayload(); - } - } - - @Override - public Response stepColor(int stepX, int stepY, int transitionTime) throws ZigBeeClusterException { - enableDefaultResponse(); - final StepColorCommand command = new StepColorCommand(stepX, stepY, transitionTime); - final Response response = invoke(command); - return new DefaultResponseImpl(response); - } - - private class StepColorCommand extends AbstractCommand { - public StepColorCommand(int stepX, int stepY, int transitionTime) { - super(ColorControl.STEP_COLOR_ID); - payload = new byte[6]; - ByteArrayOutputStreamSerializer serializer = new ByteArrayOutputStreamSerializer(); - serializer.append_short((short) stepX); - serializer.append_short((short) stepY); - serializer.append_short((short) transitionTime); - payload = serializer.getPayload(); - } - } - - @Override - public Response moveToColorTemperature(int colorTemperature, int transitionTime) throws ZigBeeClusterException { - enableDefaultResponse(); - final MoveToColorTemperatureCommand command = new MoveToColorTemperatureCommand(colorTemperature, transitionTime); - final Response response = invoke(command); - return new DefaultResponseImpl(response); - } - - private class MoveToColorTemperatureCommand extends AbstractCommand { - public MoveToColorTemperatureCommand(int colorTemperature, int transitionTime) { - super(ColorControl.MOVE_TO_COLOR_TEMPERATURE_ID); - payload = new byte[4]; - ByteArrayOutputStreamSerializer serializer = new ByteArrayOutputStreamSerializer(); - serializer.append_short((short) colorTemperature); - serializer.append_short((short) transitionTime); - payload = serializer.getPayload(); - } - } -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/CommissioningCluster.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/CommissioningCluster.java deleted file mode 100755 index ea6e217c34c90..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/CommissioningCluster.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - Copyright 2013-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -package org.bubblecloud.zigbee.api.cluster.impl.general; - -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.Commissioning; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.commissioning.ResetStartupPayload; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.commissioning.RestartDevicePayload; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLClusterBase; - -/** - * PLACEHOLDER TO IMPLEMENT - * - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.8.0 - */ -public class CommissioningCluster extends ZCLClusterBase implements Commissioning { - - public CommissioningCluster(ZigBeeEndpoint zbDevice) { - super(zbDevice); - // TODO Auto-generated constructor stub - } - - public Attribute getAttributeShortAddress() { - // TODO Auto-generated method stub - return null; - } - - public Attribute getAttributeExtendedPanID() { - // TODO Auto-generated method stub - return null; - } - - public Attribute getAttributePanID() { - // TODO Auto-generated method stub - return null; - } - - public Attribute getAttributeChannelMask() { - // TODO Auto-generated method stub - return null; - } - - public Attribute getAttributeProtocolVersion() { - // TODO Auto-generated method stub - return null; - } - - public Attribute getAttributeStackProfile() { - // TODO Auto-generated method stub - return null; - } - - public Attribute getAttributeStartupControl() { - // TODO Auto-generated method stub - return null; - } - - public Attribute getAttributeTrustCenterAddress() { - // TODO Auto-generated method stub - return null; - } - - public Attribute getAttributeTrustCenterMasterKey() { - // TODO Auto-generated method stub - return null; - } - - public Attribute getAttributeNetworkKey() { - // TODO Auto-generated method stub - return null; - } - - public Attribute getAttributeUseInsecureJoin() { - // TODO Auto-generated method stub - return null; - } - - public Attribute getAttributePreconfiguredLinkKey() { - // TODO Auto-generated method stub - return null; - } - - public Attribute getAttributeNetworkKeySeqNum() { - // TODO Auto-generated method stub - return null; - } - - public Attribute getAttributeNetworkKeyType() { - // TODO Auto-generated method stub - return null; - } - - public Attribute getAttributeNetworkManagerAddress() { - // TODO Auto-generated method stub - return null; - } - - public Attribute getAttributeScanAttempts() { - // TODO Auto-generated method stub - return null; - } - - public Attribute getAttributeTimeBetweenScans() { - // TODO Auto-generated method stub - return null; - } - - public Attribute getAttributeRejoinInterval() { - // TODO Auto-generated method stub - return null; - } - - public Attribute getAttributeMaxRejoinInterval() { - // TODO Auto-generated method stub - return null; - } - - public Attribute getAttributeIndirectPollRate() { - // TODO Auto-generated method stub - return null; - } - - public Attribute getAttributeParentRetryThreshold() { - // TODO Auto-generated method stub - return null; - } - - public Attribute getAttributeConcentratorFlag() { - // TODO Auto-generated method stub - return null; - } - - public Attribute getAttributeConcentratorRadius() { - // TODO Auto-generated method stub - return null; - } - - public Attribute getAttributeConcentratorDiscoveryTime() { - // TODO Auto-generated method stub - return null; - } - - public Response restartDevice(RestartDevicePayload payload) - throws ZigBeeClusterException { - // TODO Auto-generated method stub - return null; - } - - public Response saveStartupParameters(int index) - throws ZigBeeClusterException { - // TODO Auto-generated method stub - return null; - } - - public Response restoreStartupParameters(int index) - throws ZigBeeClusterException { - // TODO Auto-generated method stub - return null; - } - - public Response resetStartupParameters(ResetStartupPayload payload) - throws ZigBeeClusterException { - // TODO Auto-generated method stub - return null; - } - - @Override - public short getId() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public String getName() { - // TODO Auto-generated method stub - return null; - } - - @Override - public Attribute[] getStandardAttributes() { - // TODO Auto-generated method stub - return null; - } - - -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/DeviceTemperatureConfigurationCluster.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/DeviceTemperatureConfigurationCluster.java deleted file mode 100644 index a3b5e8c5d02be..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/DeviceTemperatureConfigurationCluster.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general; - -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.DeviceTemperatureConfiguration; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.Attributes; -import org.bubblecloud.zigbee.api.cluster.impl.core.AttributeImpl; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLClusterBase; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class DeviceTemperatureConfigurationCluster extends ZCLClusterBase - implements DeviceTemperatureConfiguration { - - private final AttributeImpl currentTemperature; - private final AttributeImpl minTempExperienced; - private final AttributeImpl maxTempExperienced; - private final AttributeImpl overTempTotalDwell; - private final AttributeImpl deviceTempAlarmMask; - private final AttributeImpl lowTempThreshold; - private final AttributeImpl highTempThreshold; - private final AttributeImpl lowTempDwellTripPoint; - private final AttributeImpl highTempDwellTripPoint; - - private final Attribute[] attributes; - - public DeviceTemperatureConfigurationCluster(ZigBeeEndpoint zbDevice) { - super(zbDevice); - - currentTemperature = new AttributeImpl(zbDevice, this, Attributes.CURRENT_TEMPERATURE); - minTempExperienced = new AttributeImpl(zbDevice, this, Attributes.MIN_TEMP_EXPERIENCED); - maxTempExperienced = new AttributeImpl(zbDevice, this, Attributes.MAX_TEMP_EXPERIENCED); - overTempTotalDwell = new AttributeImpl(zbDevice, this, Attributes.OVER_TEMP_TOTAL_DWELL); - deviceTempAlarmMask = new AttributeImpl(zbDevice, this, Attributes.DEVICE_TEMP_ALARM_MASK); - lowTempThreshold = new AttributeImpl(zbDevice, this, Attributes.LOW_TEMP_THRESHOLD); - highTempThreshold = new AttributeImpl(zbDevice, this, Attributes.HIGH_TEMP_THRESHOLD); - lowTempDwellTripPoint = new AttributeImpl(zbDevice, this, Attributes.LOW_TEMP_DWELL_TRIP_POINT); - highTempDwellTripPoint = new AttributeImpl(zbDevice, this, Attributes.HIGH_TEMP_DWELL_TRIP_POINT); - - attributes = new AttributeImpl[]{currentTemperature, minTempExperienced, - maxTempExperienced, overTempTotalDwell, deviceTempAlarmMask, - lowTempThreshold, highTempThreshold, lowTempDwellTripPoint, - highTempDwellTripPoint}; - } - - @Override - public short getId() { - return DeviceTemperatureConfiguration.ID; - } - - @Override - public String getName() { - return DeviceTemperatureConfiguration.NAME; - } - - @Override - public Attribute[] getStandardAttributes() { - return attributes; - } - - public Attribute getAttributeCurrentTemperature() { - return currentTemperature; - } - - public Attribute getAttributeDeviceTempAlarmMask() { - return deviceTempAlarmMask; - } - - public Attribute getAttributeHighTempDwellTripPoint() { - return highTempDwellTripPoint; - } - - public Attribute getAttributeHighTempThreshold() { - return highTempThreshold; - } - - public Attribute getAttributeLowTempDwellTripPoint() { - return lowTempDwellTripPoint; - } - - public Attribute getAttributeLowTempThreshold() { - return lowTempThreshold; - } - - public Attribute getAttributeMaxTempExperienced() { - return maxTempExperienced; - } - - public Attribute getAttributeMinTempExperienced() { - return minTempExperienced; - } - - public Attribute getAttributeOverTempTotalDwell() { - return overTempTotalDwell; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/DoorLockCluster.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/DoorLockCluster.java deleted file mode 100644 index 5dd1a267f9e9b..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/DoorLockCluster.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general; - -import org.bubblecloud.zigbee.api.cluster.impl.api.closures.DoorLock; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.Attributes; -import org.bubblecloud.zigbee.api.cluster.impl.core.AttributeImpl; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLClusterBase; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; - - -public class DoorLockCluster extends ZCLClusterBase implements DoorLock { - - - - private static AttributeImpl description; - private final Attribute[] attributes; - - public DoorLockCluster(ZigBeeEndpoint zbDevice){ - super(zbDevice); - - - - description = new AttributeImpl(zbDevice,this, Attributes.DESCRIPTION); - - attributes = new AttributeImpl[]{description}; - } - - - - @Override - public short getId() { - return DoorLock.ID; - } - - @Override - public String getName() { - return DoorLock.NAME; - } - - @Override - public Attribute[] getStandardAttributes() { - return attributes; - } - - - - public Attribute getAttributeDescription() { - return description; - } - - - - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/FanControlCluster.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/FanControlCluster.java deleted file mode 100644 index 5c6df111ff845..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/FanControlCluster.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general; - -import org.bubblecloud.zigbee.api.cluster.impl.api.HVAC.FanControl; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.Attributes; -import org.bubblecloud.zigbee.api.cluster.impl.core.AttributeImpl; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLClusterBase; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; - - -public class FanControlCluster extends ZCLClusterBase implements FanControl { - - - - private static AttributeImpl description; - private final Attribute[] attributes; - - public FanControlCluster(ZigBeeEndpoint zbDevice){ - super(zbDevice); - - - - description = new AttributeImpl(zbDevice,this, Attributes.DESCRIPTION); - - attributes = new AttributeImpl[]{description}; - } - - - - @Override - public short getId() { - return FanControl.ID; - } - - @Override - public String getName() { - return FanControl.NAME; - } - - @Override - public Attribute[] getStandardAttributes() { - return attributes; - } - - - - public Attribute getAttributeDescription() { - return description; - } - - - - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/FlowMeasurementCluster.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/FlowMeasurementCluster.java deleted file mode 100644 index 6c4e7568bcb75..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/FlowMeasurementCluster.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.measureament_sensing.FlowMeasurement; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.Attributes; -import org.bubblecloud.zigbee.api.cluster.impl.core.AttributeImpl; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLClusterBase; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; - -public class FlowMeasurementCluster extends ZCLClusterBase implements FlowMeasurement { - - - - private static AttributeImpl description; - private final Attribute[] attributes; - - public FlowMeasurementCluster(ZigBeeEndpoint zbDevice){ - super(zbDevice); - - - - description = new AttributeImpl(zbDevice,this, Attributes.DESCRIPTION); - - attributes = new AttributeImpl[]{description}; - } - - - - @Override - public short getId() { - return FlowMeasurement.ID; - } - - @Override - public String getName() { - return FlowMeasurement.NAME; - } - - @Override - public Attribute[] getStandardAttributes() { - return attributes; - } - - - - public Attribute getAttributeDescription() { - return description; - } - - - - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/GroupsCluster.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/GroupsCluster.java deleted file mode 100644 index 64a26faeb9735..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/GroupsCluster.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general; - -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.Groups; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.Attributes; -import org.bubblecloud.zigbee.api.cluster.impl.core.AttributeImpl; -import org.bubblecloud.zigbee.api.cluster.impl.core.EmptyPayloadCommand; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLClusterBase; -import org.bubblecloud.zigbee.api.cluster.impl.general.groups.AddGroupCommand; -import org.bubblecloud.zigbee.api.cluster.impl.general.groups.AddGroupIfIdentyfingCommand; -import org.bubblecloud.zigbee.api.cluster.impl.general.groups.AddGroupResponseImpl; -import org.bubblecloud.zigbee.api.cluster.impl.general.groups.GetGroupMembershipCommand; -import org.bubblecloud.zigbee.api.cluster.impl.general.groups.GetGroupMembershipResponseImpl; -import org.bubblecloud.zigbee.api.cluster.impl.general.groups.RemoveGroupCommand; -import org.bubblecloud.zigbee.api.cluster.impl.general.groups.RemoveGroupResponseImpl; -import org.bubblecloud.zigbee.api.cluster.impl.general.groups.ViewGroupCommand; -import org.bubblecloud.zigbee.api.cluster.impl.general.groups.ViewGroupResponseImpl; -import org.bubblecloud.zigbee.api.cluster.impl.global.DefaultResponseImpl; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class GroupsCluster extends ZCLClusterBase implements Groups { - - private final AttributeImpl nameSupport; - - private final Attribute[] attributes; - - private static EmptyPayloadCommand CMD_REMOVE_ALL_GROUP = new EmptyPayloadCommand() - .setId(Groups.REMOVE_ALL_GROUP_ID) - .setClientServerDirection(true) - .setClusterSpecific(true) - .setManufacturerExtension(false); - - - public GroupsCluster(ZigBeeEndpoint zbDevice) { - super(zbDevice); - nameSupport = new AttributeImpl(zbDevice, this, Attributes.NAME_SUPPORT_GROUPS); - attributes = new AttributeImpl[]{nameSupport}; - } - - @Override - public short getId() { - return Groups.ID; - } - - @Override - public String getName() { - return Groups.NAME; - } - - @Override - public Attribute[] getStandardAttributes() { - return attributes; - } - - public Response addGroup(int groupId, String name) throws ZigBeeClusterException { - enableDefaultResponse(); - AddGroupCommand addGroupCmd = new AddGroupCommand(groupId, name); - Response response = invoke(addGroupCmd); - return new AddGroupResponseImpl(response); - } - - public Response addGroupIfIdentifying(int groupId, String name) throws ZigBeeClusterException { - enableDefaultResponse(); - AddGroupIfIdentyfingCommand addGroupIfIdCMD = new AddGroupIfIdentyfingCommand(groupId, name); - Response response = invoke(addGroupIfIdCMD); - return new DefaultResponseImpl(response); - } - - public Attribute getAttributeNameSupport() { - return nameSupport; - } - - public Response getGroupMembership(int[] groupList) throws ZigBeeClusterException { - enableDefaultResponse(); - GetGroupMembershipCommand getGroupMemCmd = new GetGroupMembershipCommand(groupList); - Response response = invoke(getGroupMemCmd); - return new GetGroupMembershipResponseImpl(response); - } - - public Response removeAllGroup() throws ZigBeeClusterException { - enableDefaultResponse(); - Response response = invoke(CMD_REMOVE_ALL_GROUP); - return new DefaultResponseImpl(response); - } - - public Response removeGroup(int groupId) throws ZigBeeClusterException { - RemoveGroupCommand removeGroupCmd = new RemoveGroupCommand(groupId); - Response response = invoke(removeGroupCmd); - return new RemoveGroupResponseImpl(response); - } - - public Response viewGroup(int groupId) throws ZigBeeClusterException { - ViewGroupCommand viewGroupCmd = new ViewGroupCommand(groupId); - Response response = invoke(viewGroupCmd); - return new ViewGroupResponseImpl(response); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/IdentifyCluster.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/IdentifyCluster.java deleted file mode 100644 index 3704d7daf14b1..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/IdentifyCluster.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general; - -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.Identify; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.Attributes; -import org.bubblecloud.zigbee.api.cluster.impl.core.AttributeImpl; -import org.bubblecloud.zigbee.api.cluster.impl.core.EmptyPayloadCommand; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLClusterBase; -import org.bubblecloud.zigbee.api.cluster.impl.general.identify.IdentifyCommand; -import org.bubblecloud.zigbee.api.cluster.impl.general.identify.IdentifyQueryResponseImpl; -import org.bubblecloud.zigbee.api.cluster.impl.global.DefaultResponseImpl; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class IdentifyCluster extends ZCLClusterBase implements Identify { - - private final AttributeImpl identifyTime; - - private final Attribute[] attributes; - - private static EmptyPayloadCommand CMD_IDENTIFY_QUERY = new EmptyPayloadCommand() - .setId(Identify.IDENTIFY_QUERY_ID) - .setClientServerDirection(true) - .setClusterSpecific(true) - .setManufacturerExtension(false); - - public IdentifyCluster(ZigBeeEndpoint zbDevice) { - super(zbDevice); - identifyTime = new AttributeImpl(zbDevice, this, Attributes.IDENTIFY_TIME); - attributes = new AttributeImpl[]{identifyTime}; - } - - @Override - public short getId() { - return Identify.ID; - } - - @Override - public String getName() { - return Identify.NAME; - } - - @Override - public Attribute[] getStandardAttributes() { - return attributes; - } - - public Attribute getAttributeIdentifyTime() { - return identifyTime; - } - - public Response identify(int time) throws ZigBeeClusterException { - enableDefaultResponse(); - IdentifyCommand identifyCmd = new IdentifyCommand(time); - Response response = invoke(identifyCmd); - return new DefaultResponseImpl(response); - } - - public Response identifyQuery() throws ZigBeeClusterException { - Response response = invoke(CMD_IDENTIFY_QUERY); - return new IdentifyQueryResponseImpl(response); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/IlluminanceLevelSensingCluster.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/IlluminanceLevelSensingCluster.java deleted file mode 100644 index f96b8099d19e5..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/IlluminanceLevelSensingCluster.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.measureament_sensing.IlluminanceLevelSensing; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.Attributes; -import org.bubblecloud.zigbee.api.cluster.impl.core.AttributeImpl; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLClusterBase; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; - -public class IlluminanceLevelSensingCluster extends ZCLClusterBase implements IlluminanceLevelSensing { - - - - private static AttributeImpl description; - private final Attribute[] attributes; - - public IlluminanceLevelSensingCluster(ZigBeeEndpoint zbDevice){ - super(zbDevice); - - - - description = new AttributeImpl(zbDevice,this, Attributes.DESCRIPTION); - attributes = new AttributeImpl[]{description}; - } - - - - @Override - public short getId() { - return IlluminanceLevelSensing.ID; - } - - @Override - public String getName() { - return IlluminanceLevelSensing.NAME; - } - - @Override - public Attribute[] getStandardAttributes() { - return attributes; - } - - - - public Attribute getAttributeDescription() { - return description; - } - - - - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/LevelControlCluster.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/LevelControlCluster.java deleted file mode 100644 index 3349c2e2e2853..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/LevelControlCluster.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general; - -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.LevelControl; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.Attributes; -import org.bubblecloud.zigbee.api.cluster.impl.core.AttributeImpl; -import org.bubblecloud.zigbee.api.cluster.impl.core.EmptyPayloadCommand; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLClusterBase; -import org.bubblecloud.zigbee.api.cluster.impl.general.level_control.MoveCommand; -import org.bubblecloud.zigbee.api.cluster.impl.general.level_control.MoveToLevelCommand; -import org.bubblecloud.zigbee.api.cluster.impl.general.level_control.StepCommand; -import org.bubblecloud.zigbee.api.cluster.impl.global.DefaultResponseImpl; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class LevelControlCluster extends ZCLClusterBase implements LevelControl { - - - private final AttributeImpl currentLevel; - private final AttributeImpl remainingTime; - private final AttributeImpl onOffTransactionTime; - private final AttributeImpl onLevel; - - private final Attribute[] attributes; - - private static EmptyPayloadCommand CMD_STOP = new EmptyPayloadCommand() - .setId(LevelControl.STOP_ID) - .setClientServerDirection(true) - .setClusterSpecific(true) - .setManufacturerExtension(false); - - private static EmptyPayloadCommand CMD_STOP_WITH_ONOFF = new EmptyPayloadCommand() - .setId(LevelControl.STOP_WITH_ONOFF_ID) - .setClientServerDirection(true) - .setClusterSpecific(true) - .setManufacturerExtension(false); - - - public LevelControlCluster(ZigBeeEndpoint zbDevice) { - super(zbDevice); - currentLevel = new AttributeImpl(zbDevice, this, Attributes.CURRENT_LEVEL); - remainingTime = new AttributeImpl(zbDevice, this, Attributes.REMAINING_TIME); - onOffTransactionTime = new AttributeImpl(zbDevice, this, Attributes.ON_OFF_TRANSITION_TIME); - onLevel = new AttributeImpl(zbDevice, this, Attributes.ON_LEVEL); - attributes = new AttributeImpl[]{currentLevel, remainingTime, onOffTransactionTime, onLevel}; - } - - @Override - public short getId() { - return LevelControl.ID; - } - - @Override - public String getName() { - return LevelControl.NAME; - } - - @Override - public Attribute[] getStandardAttributes() { - return attributes; - } - - public Attribute getAttributeCurrentLevel() { - return currentLevel; - } - - public Attribute getAttributeOnLevel() { - return onLevel; - } - - public Attribute getAttributeOnOffTransitionTime() { - return onOffTransactionTime; - } - - public Attribute getAttributeRemainingTime() { - return remainingTime; - } - - public Response move(byte mode, short rate) throws ZigBeeClusterException { - enableDefaultResponse(); - MoveCommand moveCmd = new MoveCommand(mode, rate); - Response response = invoke(moveCmd); - return new DefaultResponseImpl(response); - } - - public Response moveWithOnOff(byte mode, short rate) throws ZigBeeClusterException { - enableDefaultResponse(); - MoveCommand moveCmd = new MoveCommand(mode, rate, true); - Response response = invoke(moveCmd); - return new DefaultResponseImpl(response); - } - - public Response moveToLevel(short level, int time) throws ZigBeeClusterException { - enableDefaultResponse(); - MoveToLevelCommand moveToLevCmd = new MoveToLevelCommand(level, time); - Response response = invoke(moveToLevCmd); - return new DefaultResponseImpl(response); - } - - public Response moveToLevelWithOnOff(short level, int time) throws ZigBeeClusterException { - enableDefaultResponse(); - MoveToLevelCommand moveToLevCmd = new MoveToLevelCommand(level, time, true); - Response response = invoke(moveToLevCmd); - return new DefaultResponseImpl(response); - } - - public Response step(byte mode, short step, int time) throws ZigBeeClusterException { - enableDefaultResponse(); - StepCommand stepCmd = new StepCommand(mode, step, time); - Response response = invoke(stepCmd); - return new DefaultResponseImpl(response); - } - - public Response stepWithOnOff(byte mode, short step, int time) throws ZigBeeClusterException { - enableDefaultResponse(); - StepCommand stepCmd = new StepCommand(mode, step, time, true); - Response response = invoke(stepCmd); - return new DefaultResponseImpl(response); - } - - public Response stop() throws ZigBeeClusterException { - enableDefaultResponse(); - Response response = invoke(CMD_STOP); - return new DefaultResponseImpl(response); - } - - public Response stopWithOnOff() throws ZigBeeClusterException { - enableDefaultResponse(); - Response response = invoke(CMD_STOP_WITH_ONOFF); - return new DefaultResponseImpl(response); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/MeteringCluster.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/MeteringCluster.java deleted file mode 100644 index f09b26bebb7ae..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/MeteringCluster.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.smart_energy.Metering; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.Attributes; -import org.bubblecloud.zigbee.api.cluster.impl.core.AttributeImpl; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLClusterBase; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; - -public class MeteringCluster extends ZCLClusterBase implements Metering { - - - - private static AttributeImpl description; - private final Attribute[] attributes; - - public MeteringCluster(ZigBeeEndpoint zbDevice){ - super(zbDevice); - - - - description = new AttributeImpl(zbDevice,this, Attributes.DESCRIPTION); - - attributes = new AttributeImpl[]{description}; - } - - - - @Override - public short getId() { - return Metering.ID; - } - - @Override - public String getName() { - return Metering.NAME; - } - - @Override - public Attribute[] getStandardAttributes() { - return attributes; - } - - - - public Attribute getAttributeDescription() { - return description; - } - - - - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/OnOffCluster.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/OnOffCluster.java deleted file mode 100644 index 79f215a26b41c..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/OnOffCluster.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general; - -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.OnOff; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.DefaultResponse; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.Attributes; -import org.bubblecloud.zigbee.api.cluster.impl.core.AttributeImpl; -import org.bubblecloud.zigbee.api.cluster.impl.core.EmptyPayloadCommand; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLClusterBase; -import org.bubblecloud.zigbee.api.cluster.impl.global.DefaultResponseImpl; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class OnOffCluster extends ZCLClusterBase implements OnOff { - - private final AttributeImpl onOff; - - private final Attribute[] attributes; - - private static EmptyPayloadCommand CMD_ON = new EmptyPayloadCommand() - .setId(OnOff.ON_ID) - .setClientServerDirection(true) - .setClusterSpecific(true) - .setManufacturerExtension(false); - - private static EmptyPayloadCommand CMD_OFF = new EmptyPayloadCommand() - .setId(OnOff.OFF_ID) - .setClientServerDirection(true) - .setClusterSpecific(true) - .setManufacturerExtension(false); - - private static EmptyPayloadCommand CMD_TOGGLE = new EmptyPayloadCommand() - .setId(OnOff.TOGGLE_ID) - .setClientServerDirection(true) - .setClusterSpecific(true) - .setManufacturerExtension(false); - - - public OnOffCluster(ZigBeeEndpoint zbDevice) { - super(zbDevice); - onOff = new AttributeImpl(zbDevice, this, Attributes.ON_OFF); - attributes = new AttributeImpl[]{onOff}; - } - - @Override - public short getId() { - return OnOff.ID; - } - - @Override - public String getName() { - return OnOff.NAME; - } - - @Override - public Attribute[] getStandardAttributes() { - return attributes; - } - - public Attribute getAttributeOnOff() { - return onOff; - } - - public DefaultResponse off() throws ZigBeeClusterException { - enableDefaultResponse(); - Response response = invoke(CMD_OFF); - return new DefaultResponseImpl(response); - } - - public DefaultResponse on() throws ZigBeeClusterException { - enableDefaultResponse(); - Response response = invoke(CMD_ON); - return new DefaultResponseImpl(response); - } - - public DefaultResponse toggle() throws ZigBeeClusterException { - enableDefaultResponse(); - Response response = invoke(CMD_TOGGLE); - return new DefaultResponseImpl(response); - - } - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/OnOffSwitchConfigurationCluster.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/OnOffSwitchConfigurationCluster.java deleted file mode 100644 index 84a15edf7561d..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/OnOffSwitchConfigurationCluster.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general; - -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.OnOffSwitchConfiguration; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.Attributes; -import org.bubblecloud.zigbee.api.cluster.impl.core.AttributeImpl; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLClusterBase; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class OnOffSwitchConfigurationCluster extends ZCLClusterBase implements OnOffSwitchConfiguration { - - private final AttributeImpl switchType; - private final AttributeImpl switchAction; - - private final Attribute[] attributes; - - public OnOffSwitchConfigurationCluster(ZigBeeEndpoint zbDevice) { - super(zbDevice); - switchType = new AttributeImpl(zbDevice, this, Attributes.SWITCH_TYPE); - switchAction = new AttributeImpl(zbDevice, this, Attributes.SWITCH_ACTIONS); - attributes = new Attribute[]{switchType, switchAction}; - } - - @Override - public short getId() { - return OnOffSwitchConfiguration.ID; - } - - @Override - public String getName() { - return OnOffSwitchConfiguration.NAME; - } - - @Override - public Attribute[] getStandardAttributes() { - return attributes; - } - - public Attribute getAttributeSwitchActions() { - return switchAction; - } - - public Attribute getAttributeSwitchType() { - return switchType; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/PowerConfigurationCluster.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/PowerConfigurationCluster.java deleted file mode 100644 index 672db07c8e3a8..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/PowerConfigurationCluster.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general; - -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.PowerConfiguration; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.Attributes; -import org.bubblecloud.zigbee.api.cluster.impl.core.AttributeImpl; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLClusterBase; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class PowerConfigurationCluster extends ZCLClusterBase implements - PowerConfiguration { - - private final AttributeImpl mainsVoltage; - private final AttributeImpl mainsFrequency; - private final AttributeImpl mainsAlarmMask; - private final AttributeImpl mainsVoltageMinThreshold; - private final AttributeImpl mainsVoltageMaxThreshol; - private final AttributeImpl mainsVoltageDwellTripPoint; - private final AttributeImpl batteryVoltage; - private final AttributeImpl batteryManufaturer; - private final AttributeImpl batterySize; - private final AttributeImpl batteryAHrRating; - private final AttributeImpl batteryQuantity; - private final AttributeImpl batteryRatedVoltage; - private final AttributeImpl batteryAlarmMask; - private final AttributeImpl batteryVoltageMinThreshold; - - private final Attribute[] attributes; - - public PowerConfigurationCluster(ZigBeeEndpoint zbDevice) { - super(zbDevice); - mainsVoltage = new AttributeImpl(zbDevice, this, Attributes.MAINS_VOLTAGE); - mainsFrequency = new AttributeImpl(zbDevice, this, Attributes.MAINS_FREQUENCY); - mainsAlarmMask = new AttributeImpl(zbDevice, this, Attributes.MAINS_ALARM_MASK); - mainsVoltageMinThreshold = new AttributeImpl(zbDevice, this, Attributes.MAINS_VOLTAGE_MIN_THRESHOLD); - mainsVoltageMaxThreshol = new AttributeImpl(zbDevice, this, Attributes.MAINS_VOLTAGE_MAX_THRESHOLD); - mainsVoltageDwellTripPoint = new AttributeImpl(zbDevice, this, Attributes.MAINS_VOLTAGE_DWELL_TRIP_POINT); - batteryVoltage = new AttributeImpl(zbDevice, this, Attributes.BATTERY_VOLTAGE); - batteryManufaturer = new AttributeImpl(zbDevice, this, Attributes.BATTERY_MANUFACTURER); - batterySize = new AttributeImpl(zbDevice, this, Attributes.BATTERY_SIZE); - batteryAHrRating = new AttributeImpl(zbDevice, this, Attributes.BATTERY_AHr_RATING); - batteryQuantity = new AttributeImpl(zbDevice, this, Attributes.BATTERY_QUANTITY); - batteryRatedVoltage = new AttributeImpl(zbDevice, this, Attributes.BATTERY_RATED_VOLTAGE); - batteryAlarmMask = new AttributeImpl(zbDevice, this, Attributes.BATTERY_ALARM_MASK); - batteryVoltageMinThreshold = new AttributeImpl(zbDevice, this, Attributes.BATTERY_VOLTAGE_MIN_THRESHOLD); - - attributes = new AttributeImpl[]{mainsVoltage, mainsFrequency, mainsAlarmMask, - mainsVoltageMinThreshold, mainsVoltageMaxThreshol, mainsVoltageDwellTripPoint, - batteryVoltage, batteryManufaturer, batterySize, batteryAHrRating, - batteryQuantity, batteryRatedVoltage, batteryAlarmMask, batteryVoltageMinThreshold}; - } - - @Override - public short getId() { - return PowerConfiguration.ID; - } - - @Override - public String getName() { - return PowerConfiguration.NAME; - } - - @Override - public Attribute[] getStandardAttributes() { - return attributes; - } - - public Attribute getAttributeBatteryAHrRating() { - return batteryAHrRating; - } - - public Attribute getAttributeBatteryAlarmMask() { - return batteryAlarmMask; - } - - public Attribute getAttributeBatteryManufacturer() { - return batteryManufaturer; - } - - public Attribute getAttributeBatteryQuantity() { - return batteryQuantity; - } - - public Attribute getAttributeBatteryRatedVoltage() { - return batteryRatedVoltage; - } - - public Attribute getAttributeBatterySize() { - return batterySize; - } - - public Attribute getAttributeBatteryVoltage() { - return batteryVoltage; - } - - public Attribute getAttributeBatteryVoltageMinThreshold() { - return batteryVoltageMinThreshold; - } - - public Attribute getAttributeMainsAlarmMask() { - return mainsAlarmMask; - } - - public Attribute getAttributeMainsDwellTripPoint() { - return mainsVoltageDwellTripPoint; - } - - public Attribute getAttributeMainsFrequency() { - return mainsFrequency; - } - - public Attribute getAttributeMainsVoltage() { - return mainsVoltage; - } - - public Attribute getAttributeMainsVoltageMaxThreshold() { - return mainsVoltageMaxThreshol; - } - - public Attribute getAttributeMainsVoltageMinThreshold() { - return mainsVoltageMinThreshold; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/PressureMeasurementCluster.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/PressureMeasurementCluster.java deleted file mode 100644 index 0307a1eba0215..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/PressureMeasurementCluster.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.measureament_sensing.PressureMeasurement; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.Attributes; -import org.bubblecloud.zigbee.api.cluster.impl.core.AttributeImpl; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLClusterBase; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; - -public class PressureMeasurementCluster extends ZCLClusterBase implements PressureMeasurement { - - - private static AttributeImpl description; - private final Attribute[] attributes; - - public PressureMeasurementCluster(ZigBeeEndpoint zbDevice){ - super(zbDevice); - - - - description = new AttributeImpl(zbDevice,this, Attributes.DESCRIPTION); - - attributes = new AttributeImpl[]{description}; - } - - - - @Override - public short getId() { - return PressureMeasurement.ID; - } - - @Override - public String getName() { - return PressureMeasurement.NAME; - } - - @Override - public Attribute[] getStandardAttributes() { - return attributes; - } - - - - public Attribute getAttributeDescription() { - return description; - } - - - - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/PumpConfigurationAndControlCluster.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/PumpConfigurationAndControlCluster.java deleted file mode 100644 index 2b5bd3fb640b4..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/PumpConfigurationAndControlCluster.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general; - -import org.bubblecloud.zigbee.api.cluster.impl.api.HVAC.PumpConfigurationAndControl; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.Attributes; -import org.bubblecloud.zigbee.api.cluster.impl.core.AttributeImpl; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLClusterBase; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; - -public class PumpConfigurationAndControlCluster extends ZCLClusterBase implements PumpConfigurationAndControl { - - - - private static AttributeImpl description; - private final Attribute[] attributes; - - public PumpConfigurationAndControlCluster(ZigBeeEndpoint zbDevice){ - super(zbDevice); - - - - description = new AttributeImpl(zbDevice,this, Attributes.DESCRIPTION); - - attributes = new AttributeImpl[]{description}; - } - - - - @Override - public short getId() { - return PumpConfigurationAndControl.ID; - } - - @Override - public String getName() { - return PumpConfigurationAndControl.NAME; - } - - @Override - public Attribute[] getStandardAttributes() { - return attributes; - } - - - - public Attribute getAttributeDescription() { - return description; - } - - - - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/RSSILocationCluster.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/RSSILocationCluster.java deleted file mode 100755 index 66ddb0b2a13d5..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/RSSILocationCluster.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - Copyright 2013-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general; - -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.RSSILocation; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLClusterBase; - -/** - * NOTE: THIS CLASS IS ONLY A PLACEHOLDER THE INTERFACE IS WRONG - * - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.8.0 - */ -public class RSSILocationCluster extends ZCLClusterBase implements RSSILocation { - - public RSSILocationCluster(ZigBeeEndpoint zbDevice) { - super(zbDevice); - // TODO Auto-generated constructor stub - } - - @Override - public short getId() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public String getName() { - // TODO Auto-generated method stub - return null; - } - - @Override - public Attribute[] getStandardAttributes() { - // TODO Auto-generated method stub - return null; - } - - //TODO Generate this class - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/ScenesCluster.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/ScenesCluster.java deleted file mode 100644 index 6dbca0d0dfb20..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/ScenesCluster.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general; - -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.Scenes; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.scenes.AddScenePayload; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.Attributes; -import org.bubblecloud.zigbee.api.cluster.impl.core.AttributeImpl; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLClusterBase; -import org.bubblecloud.zigbee.api.cluster.impl.general.scenes.AddSceneCommand; -import org.bubblecloud.zigbee.api.cluster.impl.general.scenes.AddSceneResponseImpl; -import org.bubblecloud.zigbee.api.cluster.impl.general.scenes.GetSceneMembershipCommand; -import org.bubblecloud.zigbee.api.cluster.impl.general.scenes.GetSceneMembershipResponseImpl; -import org.bubblecloud.zigbee.api.cluster.impl.general.scenes.RecallSceneCommand; -import org.bubblecloud.zigbee.api.cluster.impl.general.scenes.RemoveAllScenesCommand; -import org.bubblecloud.zigbee.api.cluster.impl.general.scenes.RemoveAllScenesResponseImpl; -import org.bubblecloud.zigbee.api.cluster.impl.general.scenes.RemoveSceneCommand; -import org.bubblecloud.zigbee.api.cluster.impl.general.scenes.RemoveSceneResponseImpl; -import org.bubblecloud.zigbee.api.cluster.impl.general.scenes.StoreSceneCommand; -import org.bubblecloud.zigbee.api.cluster.impl.general.scenes.StoreSceneResponseImpl; -import org.bubblecloud.zigbee.api.cluster.impl.general.scenes.ViewSceneCommand; -import org.bubblecloud.zigbee.api.cluster.impl.general.scenes.ViewSceneResponseImpl; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ScenesCluster extends ZCLClusterBase implements Scenes { - - private final AttributeImpl sceneCount; - private final AttributeImpl currentScene; - //TODO Implement current group - //private final AttributeImpl currentGroup; - private final AttributeImpl sceneValid; - private final AttributeImpl nameSupport; - private final AttributeImpl lastConfiguredBy; - - private final Attribute[] attributes; - - public ScenesCluster(ZigBeeEndpoint zbDevice) { - super(zbDevice); - sceneCount = new AttributeImpl(zbDevice, this, Attributes.SCENE_COUNT); - currentScene = new AttributeImpl(zbDevice, this, Attributes.CURRENT_SCENE); - //TODO currentGroup = new AttributeImpl(device,this,AttributeDescriptor.CURRENT_GROUP) - sceneValid = new AttributeImpl(zbDevice, this, Attributes.SCENE_VALID); - nameSupport = new AttributeImpl(zbDevice, this, Attributes.NAME_SUPPORT_SCENES); - lastConfiguredBy = new AttributeImpl(zbDevice, this, Attributes.LAST_CONFIGURED_BY); - - attributes = new AttributeImpl[]{sceneCount, currentScene, //TODO currentGroup, - sceneValid, nameSupport, lastConfiguredBy}; - } - - @Override - public short getId() { - return Scenes.ID; - } - - @Override - public String getName() { - return Scenes.NAME; - } - - @Override - public Attribute[] getStandardAttributes() { - return attributes; - } - - public Response addScene(AddScenePayload scenepayload) throws ZigBeeClusterException { - AddSceneCommand addSceneCmd = new AddSceneCommand(scenepayload); - Response response = invoke(addSceneCmd); - return new AddSceneResponseImpl(response); - } - - public Attribute getAttributeCurrentGroup() { - return null; //TODO return currentGroup; - } - - public Attribute getAttributeCurrentScene() { - return currentScene; - } - - public Attribute getAttributeLastConfiguredBy() { - return lastConfiguredBy; - } - - public Attribute getAttributeNameSupport() { - return nameSupport; - } - - public Attribute getAttributeSceneCount() { - return sceneCount; - } - - public Attribute getAttributeSceneValid() { - return sceneValid; - } - - public Response getSceneMembership(int groupId) throws ZigBeeClusterException { - GetSceneMembershipCommand getSceneMemCmd = new GetSceneMembershipCommand(groupId); - Response response = invoke(getSceneMemCmd); - return new GetSceneMembershipResponseImpl(response); - } - - public void recallScene(int groupId, short sceneId) throws ZigBeeClusterException { - RecallSceneCommand recallSceneCmd = new RecallSceneCommand(groupId, sceneId); - invoke(recallSceneCmd); - } - - public Response removeAllScenes(int groupId) throws ZigBeeClusterException { - RemoveAllScenesCommand removeAllScenes = new RemoveAllScenesCommand(groupId); - Response response = invoke(removeAllScenes); - return new RemoveAllScenesResponseImpl(response); - - } - - public Response removeScene(int groupId, short sceneId) throws ZigBeeClusterException { - RemoveSceneCommand removeSceneCmd = new RemoveSceneCommand(groupId, sceneId); - Response response = invoke(removeSceneCmd); - return new RemoveSceneResponseImpl(response); - } - - public Response storeScene(int groupId, short sceneId) throws ZigBeeClusterException { - StoreSceneCommand storeSceneCmd = new StoreSceneCommand(groupId, sceneId); - Response response = invoke(storeSceneCmd); - return new StoreSceneResponseImpl(response); - } - - public Response viewScene(int groupId, short sceneId) throws ZigBeeClusterException { - ViewSceneCommand viewSceneCmd = new ViewSceneCommand(groupId, sceneId); - Response response = invoke(viewSceneCmd); - return new ViewSceneResponseImpl(response); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/ShadeConfigurationCluster.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/ShadeConfigurationCluster.java deleted file mode 100644 index e8cf26db38b01..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/ShadeConfigurationCluster.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general; - -import org.bubblecloud.zigbee.api.cluster.impl.api.closures.ShadeConfiguration; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.Attributes; -import org.bubblecloud.zigbee.api.cluster.impl.core.AttributeImpl; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLClusterBase; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; - - -public class ShadeConfigurationCluster extends ZCLClusterBase implements ShadeConfiguration { - - - - private static AttributeImpl description; - private final Attribute[] attributes; - - public ShadeConfigurationCluster(ZigBeeEndpoint zbDevice){ - super(zbDevice); - - - - description = new AttributeImpl(zbDevice,this, Attributes.DESCRIPTION); - - attributes = new AttributeImpl[]{description}; - } - - - - @Override - public short getId() { - return ShadeConfiguration.ID; - } - - @Override - public String getName() { - return ShadeConfiguration.NAME; - } - - @Override - public Attribute[] getStandardAttributes() { - return attributes; - } - - - - public Attribute getAttributeDescription() { - return description; - } - - - - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/ThermostatCluster.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/ThermostatCluster.java deleted file mode 100644 index d8fd3c11b6e61..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/ThermostatCluster.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general; - -import org.bubblecloud.zigbee.api.cluster.impl.api.HVAC.Thermostat; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.Attributes; -import org.bubblecloud.zigbee.api.cluster.impl.core.AttributeImpl; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLClusterBase; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; - -public class ThermostatCluster extends ZCLClusterBase implements Thermostat { - - - - private static AttributeImpl description; - private final Attribute[] attributes; - - public ThermostatCluster(ZigBeeEndpoint zbDevice){ - super(zbDevice); - - - - description = new AttributeImpl(zbDevice,this, Attributes.DESCRIPTION); - - attributes = new AttributeImpl[]{description}; - } - - - - @Override - public short getId() { - return Thermostat.ID; - } - - @Override - public String getName() { - return Thermostat.NAME; - } - - @Override - public Attribute[] getStandardAttributes() { - return attributes; - } - - - - public Attribute getAttributeDescription() { - return description; - } - - - - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/ThermostatUserInterfaceConfigurationCluster.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/ThermostatUserInterfaceConfigurationCluster.java deleted file mode 100644 index c5974782562d4..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/ThermostatUserInterfaceConfigurationCluster.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general; - -import org.bubblecloud.zigbee.api.cluster.impl.api.HVAC.ThermostatUserInterfaceConfiguration; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.Attributes; -import org.bubblecloud.zigbee.api.cluster.impl.core.AttributeImpl; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLClusterBase; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; - -public class ThermostatUserInterfaceConfigurationCluster extends ZCLClusterBase implements ThermostatUserInterfaceConfiguration { - - - - private static AttributeImpl description; - private final Attribute[] attributes; - - public ThermostatUserInterfaceConfigurationCluster(ZigBeeEndpoint zbDevice){ - super(zbDevice); - - - - description = new AttributeImpl(zbDevice,this, Attributes.DESCRIPTION); - - attributes = new AttributeImpl[]{description}; - } - - - - @Override - public short getId() { - return ThermostatUserInterfaceConfiguration.ID; - } - - @Override - public String getName() { - return ThermostatUserInterfaceConfiguration.NAME; - } - - @Override - public Attribute[] getStandardAttributes() { - return attributes; - } - - - - public Attribute getAttributeDescription() { - return description; - } - - - - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/TimeCluster.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/TimeCluster.java deleted file mode 100644 index 1c0ba68e196bd..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/TimeCluster.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general; - -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.Time; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.Attributes; -import org.bubblecloud.zigbee.api.cluster.impl.core.AttributeImpl; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLClusterBase; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class TimeCluster extends ZCLClusterBase implements Time { - - - private final AttributeImpl time; - private final AttributeImpl timeStatus; - - private final Attribute[] attributes; - - public TimeCluster(ZigBeeEndpoint zbDevice) { - super(zbDevice); - time = new AttributeImpl(zbDevice, this, Attributes.TIME); - timeStatus = new AttributeImpl(zbDevice, this, Attributes.TIME_STATUS); - attributes = new Attribute[]{time, timeStatus}; - } - - @Override - public short getId() { - return Time.ID; - } - - @Override - public String getName() { - return Time.NAME; - } - - @Override - public Attribute[] getStandardAttributes() { - return attributes; - } - - public Attribute getAttributeTime() { - return time; - } - - public Attribute getAttributeTimeStatus() { - return timeStatus; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/WindowCoveringCluster.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/WindowCoveringCluster.java deleted file mode 100644 index b7f3c933b3322..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/WindowCoveringCluster.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general; - -import org.bubblecloud.zigbee.api.cluster.impl.api.closures.WindowCovering; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.Attributes; -import org.bubblecloud.zigbee.api.cluster.impl.core.AttributeImpl; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLClusterBase; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; - -public class WindowCoveringCluster extends ZCLClusterBase implements WindowCovering { - - - - private static AttributeImpl description; - private final Attribute[] attributes; - - public WindowCoveringCluster(ZigBeeEndpoint zbDevice){ - super(zbDevice); - - - - description = new AttributeImpl(zbDevice,this, Attributes.DESCRIPTION); - - attributes = new AttributeImpl[]{description}; - } - - - - @Override - public short getId() { - return WindowCovering.ID; - } - - @Override - public String getName() { - return WindowCovering.NAME; - } - - @Override - public Attribute[] getStandardAttributes() { - return attributes; - } - - - - public Attribute getAttributeDescription() { - return description; - } - - - - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/alarms/AlarmResponseImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/alarms/AlarmResponseImpl.java deleted file mode 100644 index 352836cebb875..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/alarms/AlarmResponseImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general.alarms; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.alarms.AlarmResponse; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.core.ResponseImpl; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class AlarmResponseImpl extends ResponseImpl implements AlarmResponse { - - private byte alarmCode; - private short clusterIdentifier; - - public AlarmResponseImpl(Response response) throws ZigBeeClusterException { - super(response); - ResponseImpl.checkSpecificCommandFrame(response, ID); - - ZBDeserializer deserializer = new DefaultDeserializer(getPayload(), 0); - alarmCode = deserializer.read_byte(); - clusterIdentifier = deserializer.read_short(); - } - - public int getAllarmCode() { - return alarmCode; - } - - public int getClusterID() { - return clusterIdentifier; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/alarms/AlarmsClusterFilter.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/alarms/AlarmsClusterFilter.java deleted file mode 100644 index 884c0419aedc3..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/alarms/AlarmsClusterFilter.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general.alarms; - -import org.bubblecloud.zigbee.network.ClusterMessage; -import org.bubblecloud.zigbee.network.ClusterFilter; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.Alarms; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.alarms.AlarmResponse; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLFrame; - -/** - * This class should filter out all the ZigBee cluster that do not belong to the
- * {@link AlarmResponse} type from the {@link Alarms} cluster, by checking the data itself.
- *
- * NOTE:to use this class the {@link #FILTER} constant should be used - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.4.0 - */ -public class AlarmsClusterFilter implements ClusterFilter { - - /** - * Singelton instance of the filter - */ - public final static AlarmsClusterFilter FILTER = new AlarmsClusterFilter(); - - private AlarmsClusterFilter() { - - } - - public boolean match(ClusterMessage clusterMessage) { - if (clusterMessage.getId() != Alarms.ID) return false; - - ZCLFrame frame = new ZCLFrame(clusterMessage); - return frame.getHeader().getCommandId() == AlarmResponse.ID - && frame.getHeader().getFramecontrol().isClusterSpecificCommand(); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/alarms/GetAlarmResponseImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/alarms/GetAlarmResponseImpl.java deleted file mode 100644 index 4ff5375edef8c..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/alarms/GetAlarmResponseImpl.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general.alarms; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.alarms.GetAlarmResponse; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.core.ResponseImpl; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class GetAlarmResponseImpl extends ResponseImpl implements GetAlarmResponse { - - private Status status; - private byte alarmCode; - private short clusterIdentifier; - private long timestamp; - - public GetAlarmResponseImpl(Response response) throws ZigBeeClusterException { - super(response); - ResponseImpl.checkGeneralCommandFrame(response, ID); - - ZBDeserializer deserializer = new DefaultDeserializer(getPayload(), 0); - status = Status.getStatus(deserializer.read_byte()); - if (Status.SUCCESS == status) { - alarmCode = deserializer.read_byte(); - clusterIdentifier = deserializer.read_short(); - timestamp = deserializer.read_int(); - } - } - - public int getAllarmCode() { - return alarmCode; - } - - public int getClusterID() { - return clusterIdentifier; - } - - public Status getStatus() { - return status; - } - - public long getTimestamp() { - return timestamp; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/alarms/ResetAlarmCommand.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/alarms/ResetAlarmCommand.java deleted file mode 100644 index f2c84c93e24ba..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/alarms/ResetAlarmCommand.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general.alarms; - -import org.bubblecloud.zigbee.api.cluster.impl.api.general.Alarms; -import org.bubblecloud.zigbee.api.cluster.impl.core.AbstractCommand; -import org.bubblecloud.zigbee.api.cluster.impl.core.ByteArrayOutputStreamSerializer; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ResetAlarmCommand extends AbstractCommand { - - private byte clusterId; - private short attributeId; - - public ResetAlarmCommand(byte cid, short aid) { - super(Alarms.RESET_ALARM_ID); - this.clusterId = cid; - this.attributeId = aid; - } - - public byte[] getPayload() { - if (payload == null) { - ByteArrayOutputStreamSerializer serializer = new ByteArrayOutputStreamSerializer(); - serializer.append_byte(clusterId); - serializer.append_short(attributeId); - payload = serializer.getPayload(); - } - return payload; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/commissioning/ResetStartupParametersResponseImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/commissioning/ResetStartupParametersResponseImpl.java deleted file mode 100644 index 8b4ced642df8b..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/commissioning/ResetStartupParametersResponseImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.general.commissioning; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.commissioning.ResetStartupParametersResponse; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.core.ResponseImpl; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.8.0 - */ -public class ResetStartupParametersResponseImpl extends ResponseImpl implements ResetStartupParametersResponse { - - private byte status; - - public ResetStartupParametersResponseImpl(Response response) throws ZigBeeClusterException { - - super(response); - ResponseImpl.checkGeneralCommandFrame(response, ID); - - ZBDeserializer deserializer = new DefaultDeserializer(getPayload(), 0); - status = deserializer.read_byte(); - } - - public Status getStatus() { - - return Status.getStatus(status); - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/commissioning/RestartDeviceResponseImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/commissioning/RestartDeviceResponseImpl.java deleted file mode 100644 index d7006d8cc3037..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/commissioning/RestartDeviceResponseImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.general.commissioning; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.commissioning.RestartDeviceResponse; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.core.ResponseImpl; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.8.0 - */ -public class RestartDeviceResponseImpl extends ResponseImpl implements RestartDeviceResponse { - - private byte status; - - public RestartDeviceResponseImpl(Response response) throws ZigBeeClusterException { - - super(response); - ResponseImpl.checkGeneralCommandFrame(response, ID); - - ZBDeserializer deserializer = new DefaultDeserializer(getPayload(), 0); - status = deserializer.read_byte(); - } - - public Status getStatus() { - - return Status.getStatus(status); - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/commissioning/RestoreStartupParametersResponseImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/commissioning/RestoreStartupParametersResponseImpl.java deleted file mode 100644 index 0878fee41c47c..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/commissioning/RestoreStartupParametersResponseImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.general.commissioning; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.commissioning.RestoreStartupParametersResponse; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.core.ResponseImpl; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.8.0 - */ -public class RestoreStartupParametersResponseImpl extends ResponseImpl implements RestoreStartupParametersResponse { - - private byte status; - - public RestoreStartupParametersResponseImpl(Response response) throws ZigBeeClusterException { - - super(response); - ResponseImpl.checkGeneralCommandFrame(response, ID); - - ZBDeserializer deserializer = new DefaultDeserializer(getPayload(), 0); - status = deserializer.read_byte(); - } - - public Status getStatus() { - - return Status.getStatus(status); - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/commissioning/SaveStartupParametersResponseImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/commissioning/SaveStartupParametersResponseImpl.java deleted file mode 100644 index 96c1dfd729adc..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/commissioning/SaveStartupParametersResponseImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.general.commissioning; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.commissioning.SaveStartupParametersResponse; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.core.ResponseImpl; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.8.0 - */ -public class SaveStartupParametersResponseImpl extends ResponseImpl implements SaveStartupParametersResponse { - - private byte status; - - public SaveStartupParametersResponseImpl(Response response) throws ZigBeeClusterException { - - super(response); - ResponseImpl.checkGeneralCommandFrame(response, ID); - - ZBDeserializer deserializer = new DefaultDeserializer(getPayload(), 0); - status = deserializer.read_byte(); - } - - public Status getStatus() { - - return Status.getStatus(status); - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/groups/AddGroupCommand.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/groups/AddGroupCommand.java deleted file mode 100644 index 28d55bb28236d..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/groups/AddGroupCommand.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general.groups; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBSerializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeType; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.Groups; -import org.bubblecloud.zigbee.api.cluster.impl.core.AbstractCommand; -import org.bubblecloud.zigbee.api.cluster.impl.core.ByteArrayOutputStreamSerializer; - - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class AddGroupCommand extends AbstractCommand { - - private int groupId; - private String name; - - public AddGroupCommand(int groupId, String name) { - super(Groups.ADD_GROUP_ID); - this.groupId = groupId; - this.name = name; - } - - public byte[] getPayload() { - if (payload == null) { - ZBSerializer serializer = new ByteArrayOutputStreamSerializer(); - serializer.append_short((short) groupId); - serializer.appendZigBeeType(name, ZigBeeType.CharacterString); - payload = serializer.getPayload(); - } - return payload; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/groups/AddGroupIfIdentyfingCommand.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/groups/AddGroupIfIdentyfingCommand.java deleted file mode 100644 index 62b25377cbb3a..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/groups/AddGroupIfIdentyfingCommand.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general.groups; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBSerializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeType; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.Groups; -import org.bubblecloud.zigbee.api.cluster.impl.core.AbstractCommand; -import org.bubblecloud.zigbee.api.cluster.impl.core.ByteArrayOutputStreamSerializer; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class AddGroupIfIdentyfingCommand extends AbstractCommand { - - private int groupId; - private String name; - - public AddGroupIfIdentyfingCommand(int groupId, String name) { - super(Groups.ADD_GROUP_IF_IDENTIFYING_ID); - this.groupId = groupId; - this.name = name; - } - - public byte[] getPayload() { - if (payload == null) { - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - ZBSerializer serializer = new ByteArrayOutputStreamSerializer(bos); - serializer.append_short((short) groupId); - serializer.appendZigBeeType(name, ZigBeeType.CharacterString); - payload = serializer.getPayload(); - try { - bos.close(); - } catch (IOException ignored) { - } - } - return payload; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/groups/AddGroupResponseImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/groups/AddGroupResponseImpl.java deleted file mode 100644 index 11991f6f96eb8..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/groups/AddGroupResponseImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general.groups; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.groups.AddGroupResponse; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.core.ResponseImpl; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class AddGroupResponseImpl extends ResponseImpl implements - AddGroupResponse { - - private int groupId; - private byte status; - - - public AddGroupResponseImpl(Response response) throws ZigBeeClusterException { - super(response); - ResponseImpl.checkSpecificCommandFrame(response, AddGroupResponse.ID); - ZBDeserializer deserializer = new DefaultDeserializer(getPayload(), 0); - status = deserializer.read_byte(); - groupId = deserializer.read_uint16bit(); - } - - public int getGroupId() { - return groupId; - } - - public Status getStatus() { - return Status.getStatus(status); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/groups/GetGroupMembershipCommand.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/groups/GetGroupMembershipCommand.java deleted file mode 100644 index 721dc0c108373..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/groups/GetGroupMembershipCommand.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general.groups; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBSerializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.Groups; -import org.bubblecloud.zigbee.api.cluster.impl.core.AbstractCommand; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultSerializer; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class GetGroupMembershipCommand extends AbstractCommand { - - private int[] groupList; - - public GetGroupMembershipCommand(int[] groupList) { - super(Groups.GET_GROUP_MEMBERSHIP_ID); - this.groupList = groupList; - } - - public byte[] getPayload() { - if (payload == null) { - payload = new byte[groupList.length * 2 + 1]; - ZBSerializer serializer = new DefaultSerializer(payload, 0); - serializer.append_byte((byte) groupList.length); - for (int i = 0; i < groupList.length; i++) { - serializer.append_short((short) groupList[i]); - } - } - return payload; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/groups/GetGroupMembershipResponseImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/groups/GetGroupMembershipResponseImpl.java deleted file mode 100644 index 335e321818441..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/groups/GetGroupMembershipResponseImpl.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general.groups; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.groups.GetGroupMembershipResponse; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.core.ResponseImpl; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class GetGroupMembershipResponseImpl extends ResponseImpl implements GetGroupMembershipResponse { - - private short capacity; - private int[] groupList; - - - public GetGroupMembershipResponseImpl(Response response) throws ZigBeeClusterException { - super(response); - ResponseImpl.checkSpecificCommandFrame(response, GetGroupMembershipResponse.ID); - ZBDeserializer deserializer = new DefaultDeserializer(getPayload(), 0); - capacity = (short) deserializer.read_uint8bit(); - int count = deserializer.read_uint8bit(); - groupList = new int[count]; - for (int i = 0; i < count; i++) { - groupList[i] = deserializer.read_uint16bit(); - } - } - - public short getCapacity() { - return capacity; - } - - public int[] getGroupList() { - return groupList; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/groups/RemoveGroupCommand.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/groups/RemoveGroupCommand.java deleted file mode 100644 index 0cdaa8aee315e..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/groups/RemoveGroupCommand.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general.groups; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBSerializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.Groups; -import org.bubblecloud.zigbee.api.cluster.impl.core.AbstractCommand; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultSerializer; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class RemoveGroupCommand extends AbstractCommand { - - private int groupId; - - public RemoveGroupCommand(int groupId) { - super(Groups.REMOVE_GROUP_ID); - this.groupId = groupId; - } - - public byte[] getPayload() { - if (payload == null) { - payload = new byte[2]; - ZBSerializer serializer = new DefaultSerializer(payload, 0); - serializer.append_short((short) groupId); - } - return payload; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/groups/RemoveGroupResponseImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/groups/RemoveGroupResponseImpl.java deleted file mode 100644 index 736659a2216be..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/groups/RemoveGroupResponseImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general.groups; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.groups.RemoveGroupResponse; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.core.ResponseImpl; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class RemoveGroupResponseImpl extends ResponseImpl implements RemoveGroupResponse { - - private byte status; - private int groupId; - - public RemoveGroupResponseImpl(Response response) throws ZigBeeClusterException { - super(response); - ResponseImpl.checkSpecificCommandFrame(response, RemoveGroupResponse.ID); - ZBDeserializer deserializer = new DefaultDeserializer(getPayload(), 0); - status = deserializer.read_byte(); - groupId = deserializer.read_short(); - } - - public int getGroupId() { - return groupId; - } - - public Status getStatus() { - return Status.getStatus(status); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/groups/ViewGroupCommand.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/groups/ViewGroupCommand.java deleted file mode 100644 index c0aa2850bc1fa..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/groups/ViewGroupCommand.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general.groups; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBSerializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.Groups; -import org.bubblecloud.zigbee.api.cluster.impl.core.AbstractCommand; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultSerializer; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ViewGroupCommand extends AbstractCommand { - - private int groupId; - - public ViewGroupCommand(int groupId) { - super(Groups.VIEW_GROUP_ID); - this.groupId = groupId; - } - - public byte[] getPayload() { - if (payload == null) { - payload = new byte[2]; - ZBSerializer serializer = new DefaultSerializer(payload, 0); - serializer.append_short((short) groupId); - } - return payload; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/groups/ViewGroupResponseImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/groups/ViewGroupResponseImpl.java deleted file mode 100644 index 7617f6cd316b3..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/groups/ViewGroupResponseImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general.groups; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeType; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.groups.ViewGroupResponse; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.core.ResponseImpl; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ViewGroupResponseImpl extends ResponseImpl implements - ViewGroupResponse { - - private int groupId; - private String groupName; - private byte status; - - - public ViewGroupResponseImpl(Response response) throws ZigBeeClusterException { - super(response); - ResponseImpl.checkSpecificCommandFrame(response, ViewGroupResponse.ID); - ZBDeserializer deserializer = new DefaultDeserializer(getPayload(), 0); - status = deserializer.read_byte(); - groupId = deserializer.read_short(); - if (deserializer.endOfStream()) { - groupName = null; - } else { - groupName = (String) deserializer.readZigBeeType(ZigBeeType.CharacterString); - } - } - - public int getGroupId() { - return groupId; - } - - public String getGroupName() { - return groupName; - } - - public Status getStatus() { - return Status.getStatus(status); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/identify/IdentifyCommand.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/identify/IdentifyCommand.java deleted file mode 100644 index 6660a2c53c2da..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/identify/IdentifyCommand.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general.identify; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBSerializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.Identify; -import org.bubblecloud.zigbee.api.cluster.impl.core.AbstractCommand; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultSerializer; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class IdentifyCommand extends AbstractCommand { - - private int time; - - public IdentifyCommand(int time) { - super(Identify.IDENTIFY_ID); - this.time = time; - } - - public byte[] getPayload() { - if (payload == null) { - payload = new byte[2]; - ZBSerializer serializer = new DefaultSerializer(payload, 0); - serializer.append_short((short) time); - } - return payload; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/identify/IdentifyQueryResponseImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/identify/IdentifyQueryResponseImpl.java deleted file mode 100644 index ca9bdc1f83b92..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/identify/IdentifyQueryResponseImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general.identify; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.identify.IdentifyQueryResponse; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.core.ResponseImpl; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class IdentifyQueryResponseImpl extends ResponseImpl implements IdentifyQueryResponse { - - private int timeOut; - - public IdentifyQueryResponseImpl(Response response) throws ZigBeeClusterException { - super(response); - - ZBDeserializer deserializer = new DefaultDeserializer(getPayload(), 0); - timeOut = deserializer.read_short(); - } - - public int getTimeout() { - return timeOut; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/level_control/MoveCommand.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/level_control/MoveCommand.java deleted file mode 100644 index a591d012adffe..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/level_control/MoveCommand.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general.level_control; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBSerializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.LevelControl; -import org.bubblecloud.zigbee.api.cluster.impl.core.AbstractCommand; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultSerializer; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class MoveCommand extends AbstractCommand { - - private byte mode; - private short rate; - - - public MoveCommand(byte mode, short rate) { - this(mode, rate, false); - } - - public MoveCommand(byte mode, short rate, boolean hasOnOff) { - super(LevelControl.MOVE_ID); - if (hasOnOff) { - setId(LevelControl.MOVE_TO_LEVEL_WITH_ONOFF_ID); - } - this.mode = mode; - this.rate = rate; - } - - public byte[] getPayload() { - if (payload == null) { - payload = new byte[3]; - ZBSerializer serializer = new DefaultSerializer(payload, 0); - serializer.append_byte((byte) mode); - serializer.append_short((short) rate); - } - return payload; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/level_control/MoveToLevelCommand.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/level_control/MoveToLevelCommand.java deleted file mode 100644 index 6e984541fbb7f..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/level_control/MoveToLevelCommand.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general.level_control; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBSerializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.LevelControl; -import org.bubblecloud.zigbee.api.cluster.impl.core.AbstractCommand; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultSerializer; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class MoveToLevelCommand extends AbstractCommand { - - private short level; - private int time; - - public MoveToLevelCommand(short level, int time) { - this(level, time, false); - } - - public MoveToLevelCommand(short level, int time, boolean hasOnOff) { - super(LevelControl.MOVE_TO_LEVEL_ID); - if (hasOnOff) { - setId(LevelControl.MOVE_TO_LEVEL_WITH_ONOFF_ID); - } - this.level = level; - this.time = time; - } - - public byte[] getPayload() { - if (payload == null) { - payload = new byte[3]; - ZBSerializer serializer = new DefaultSerializer(payload, 0); - serializer.append_byte((byte) level); - serializer.append_short((short) time); - } - return payload; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/level_control/StepCommand.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/level_control/StepCommand.java deleted file mode 100644 index 4a00797c8b423..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/level_control/StepCommand.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general.level_control; - -import org.bubblecloud.zigbee.api.cluster.impl.api.general.LevelControl; -import org.bubblecloud.zigbee.api.cluster.impl.core.AbstractCommand; -import org.bubblecloud.zigbee.api.cluster.impl.core.ByteArrayOutputStreamSerializer; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class StepCommand extends AbstractCommand { - - private byte mode; - private short step; - private int time; - - public StepCommand(byte mode, short step, int time) { - this(mode, step, time, false); - } - - public StepCommand(byte mode, short step, int time, boolean hasOnOff) { - super(LevelControl.STEP_ID); - if (hasOnOff) { - setId(LevelControl.STEP_WITH_ONOFF_ID); - } - this.mode = mode; - this.step = step; - this.time = time; - } - - public byte[] getPayload() { - if (payload == null) { - ByteArrayOutputStreamSerializer serializer = new ByteArrayOutputStreamSerializer(); - serializer.append_byte((byte) mode); - serializer.append_byte((byte) step); - serializer.append_short((short) time); - payload = serializer.getPayload(); - } - return payload; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/AddSceneCommand.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/AddSceneCommand.java deleted file mode 100644 index 0718b772c3110..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/AddSceneCommand.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general.scenes; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBSerializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.Scenes; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.scenes.AddScenePayload; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.scenes.ExtensionFieldSetAddScene; -import org.bubblecloud.zigbee.api.cluster.impl.core.AbstractCommand; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultSerializer; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class AddSceneCommand extends AbstractCommand { - - private AddScenePayload scenePayload; - - - public AddSceneCommand(AddScenePayload scenePayload) { - super(Scenes.ADD_SCENE); - this.scenePayload = scenePayload; - } - - public byte[] getPayload() { - if (payload == null) { - int length; - length = 5 + scenePayload.getSceneName().length(); - - for (int i = 0; i < scenePayload.getExtensionFieldSet().length; i++) { - length = length + scenePayload.getExtensionFieldSet()[i].getLength(); - } - payload = new byte[length]; - ZBSerializer serializer = new DefaultSerializer(payload, 0); - serializer.append_short((short) scenePayload.getGroupId()); - serializer.append_byte((byte) scenePayload.getSceneId()); - serializer.append_short((short) scenePayload.getTransitionTime()); - //TODO use the serializer.appendObject(Object, ZigBeeType) - serializer.appendObject(scenePayload.getSceneName()); - ExtensionFieldSetAddScene[] extensionFielSet = scenePayload.getExtensionFieldSet(); - - for (int i = 0; i < extensionFielSet.length; i++) { - int clusterId = extensionFielSet[i].getClusterId(); - serializer.append_short((short) clusterId); - serializer.append_byte((byte) extensionFielSet[i].getAttributes(clusterId).length); - for (int j = 0; j < extensionFielSet[i].getAttributes(clusterId).length; j++) { - Attribute attribute = extensionFielSet[i].getAttributes(clusterId)[j]; - Object value = extensionFielSet[i].getValue(attribute); - serializer.append_short((short) attribute.getId()); - //TODO use the serializer.appendObject(Object, ZigBeeType) - serializer.appendObject(value); - } - } - } - return payload; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/AddScenePayloadImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/AddScenePayloadImpl.java deleted file mode 100644 index 100ef3ac1a54b..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/AddScenePayloadImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general.scenes; - -import org.bubblecloud.zigbee.api.cluster.impl.api.general.scenes.AddScenePayload; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.scenes.ExtensionFieldSetAddScene; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class AddScenePayloadImpl implements AddScenePayload { - - private ExtensionFieldSetAddScene[] extensionFielSet; - private int groupId; - private short sceneId; - private String sceneName; - private int transitionTime; - - public AddScenePayloadImpl(int groupId, short sceneId, String sceneName, - int transitiotime, ExtensionFieldSetAddScene[] extensionFielSet) { - this.groupId = groupId; - this.sceneId = sceneId; - this.sceneName = sceneName; - this.transitionTime = transitiotime; - this.extensionFielSet = extensionFielSet; - } - - public ExtensionFieldSetAddScene[] getExtensionFieldSet() { - return extensionFielSet; - } - - public int getGroupId() { - return groupId; - } - - public short getSceneId() { - return sceneId; - } - - public String getSceneName() { - return sceneName; - } - - public int getTransitionTime() { - return transitionTime; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/AddSceneResponseImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/AddSceneResponseImpl.java deleted file mode 100644 index c5c4e658ad7ef..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/AddSceneResponseImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general.scenes; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.scenes.AddSceneResponse; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.core.ResponseImpl; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class AddSceneResponseImpl extends ResponseImpl implements AddSceneResponse { - - private byte status; - private int groupId; - private short sceneId; - - public AddSceneResponseImpl(Response response) throws ZigBeeClusterException { - super(response); - ResponseImpl.checkSpecificCommandFrame(response, AddSceneResponse.ID); - ZBDeserializer deserializer = new DefaultDeserializer(getPayload(), 0); - status = deserializer.read_byte(); - groupId = deserializer.read_short(); - sceneId = deserializer.read_byte(); - } - - public int getGroupId() { - return groupId; - } - - public short getSceneId() { - return sceneId; - } - - public Status getStatus() { - return Status.getStatus(status); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/ExtensionFieldSetAddSceneImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/ExtensionFieldSetAddSceneImpl.java deleted file mode 100644 index 47aba9357eca8..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/ExtensionFieldSetAddSceneImpl.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general.scenes; - -import java.util.Enumeration; -import java.util.Hashtable; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.scenes.ExtensionFieldSetAddScene; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ExtensionFieldSetAddSceneImpl implements ExtensionFieldSetAddScene { - - - private int clusterId; - private Attribute[] attributes; - Hashtable set; - Attribute attribute; - ZBDeserializer deserializer; - boolean endSet; - - - public boolean endSet() { - return endSet; - } - - public ExtensionFieldSetAddSceneImpl(int clusterId) { - this.clusterId = clusterId; - } - - public void setAttribute(Attribute attribute, Object value) { - set.put(attribute, value); - } - - - public Attribute[] getAttributes(int clusterId) { - Enumeration attribute = set.keys(); - int i = 0; - while (attribute.hasMoreElements()) { - attributes[i] = attribute.nextElement(); - i++; - } - return attributes; - } - - public int getClusterId() { - return clusterId; - } - - public Object getValue(Attribute attributeId) { - return set.get(attributeId); - } - - - public int getLength() { - int length = 5; // 4 for ClusterId e 1 for length? - for (int i = 0; i < attributes.length; i++) { - length = length + 4 + attributes[i].getZigBeeType().getLength(); - } - return length; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/ExtensionFieldSetViewResponseImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/ExtensionFieldSetViewResponseImpl.java deleted file mode 100644 index 376d233194cad..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/ExtensionFieldSetViewResponseImpl.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general.scenes; - - -import java.util.Enumeration; -import java.util.Hashtable; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.scenes.ExtensionFieldSetViewResponse; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ExtensionFieldSetViewResponseImpl implements - ExtensionFieldSetViewResponse { - - - private int clusterId; - private int[] attributes; - Hashtable set; - int attribute; - ZBDeserializer deserializer; - boolean endSet; - - public ExtensionFieldSetViewResponseImpl(ZBDeserializer deserializer) { - this.deserializer = deserializer; - clusterId = deserializer.read_int(); - int length = deserializer.read_byte(); - endSet = true; - for (int i = 0; i < length; i++) { - int attributeId = deserializer.read_short(); - //TODO use the deserializer.readZigBeeType(ZigBeeType) - Object value = deserializer.readObject(Object.class); - //TODO: create Attribute and get ZigBee type from attribute - if (value == null) endSet = false; - set.put(attributeId, value); - } - return; - //TODO complete deserializer for extensionFieldSet - } - - public boolean endSet() { - return endSet; - } - - - public int[] getAttributes(int clusterId) { - Enumeration attribute = set.keys(); - int i = 0; - while (attribute.hasMoreElements()) { - attributes[i] = attribute.nextElement(); - i++; - } - return attributes; - } - - public int getClusterId() { - return clusterId; - } - - public Object getValue(int attributeId) { - return set.get(attributeId); - } - - -} - - diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/GetSceneMembershipCommand.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/GetSceneMembershipCommand.java deleted file mode 100644 index 1bd886d3a919f..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/GetSceneMembershipCommand.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general.scenes; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBSerializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.Scenes; -import org.bubblecloud.zigbee.api.cluster.impl.core.AbstractCommand; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultSerializer; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class GetSceneMembershipCommand extends AbstractCommand { - - private int groupId; - - public GetSceneMembershipCommand(int groupId) { - super(Scenes.GET_SCENE_MEMBERSHIP); - this.groupId = groupId; - } - - public byte[] getPayload() { - if (payload == null) { - payload = new byte[2]; - ZBSerializer serializer = new DefaultSerializer(payload, 0); - serializer.append_short((short) groupId); - } - return payload; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/GetSceneMembershipResponseImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/GetSceneMembershipResponseImpl.java deleted file mode 100644 index e61de60643152..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/GetSceneMembershipResponseImpl.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general.scenes; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.scenes.GetSceneMembershipResponse; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.core.ResponseImpl; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class GetSceneMembershipResponseImpl extends ResponseImpl implements - GetSceneMembershipResponse { - - private byte status; - private short capacity; - private int groupId; - private short[] sceneList; - - - public GetSceneMembershipResponseImpl(Response response) throws ZigBeeClusterException { - super(response); - ResponseImpl.checkSpecificCommandFrame(response, GetSceneMembershipResponse.ID); - ZBDeserializer deserializer = new DefaultDeserializer(getPayload(), 0); - status = deserializer.read_byte(); - capacity = deserializer.read_byte(); - groupId = deserializer.read_short(); - int count = deserializer.read_byte(); - for (int i = 0; i < count; i++) { - sceneList[i] = deserializer.read_byte(); - } - } - - - public short getCapacity() { - return capacity; - } - - public int getGroupId() { - return groupId; - } - - public short[] getSceneList() { - return sceneList; - } - - public Status getStatus() { - return Status.getStatus(status); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/RecallSceneCommand.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/RecallSceneCommand.java deleted file mode 100644 index a5edcebeedd24..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/RecallSceneCommand.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general.scenes; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBSerializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.Scenes; -import org.bubblecloud.zigbee.api.cluster.impl.core.AbstractCommand; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultSerializer; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class RecallSceneCommand extends AbstractCommand { - - private int groupId; - private short sceneId; - - - public RecallSceneCommand(int groupId, short sceneId) { - super(Scenes.RECALL_SCENE); - this.groupId = groupId; - this.sceneId = sceneId; - } - - public byte[] getPayload() { - if (payload == null) { - payload = new byte[3]; - ZBSerializer serializer = new DefaultSerializer(payload, 0); - serializer.append_short((short) groupId); - serializer.append_byte((byte) sceneId); - } - return payload; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/RemoveAllScenesCommand.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/RemoveAllScenesCommand.java deleted file mode 100644 index e345ebae50b6b..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/RemoveAllScenesCommand.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general.scenes; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBSerializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.Scenes; -import org.bubblecloud.zigbee.api.cluster.impl.core.AbstractCommand; -import org.bubblecloud.zigbee.api.cluster.impl.core.ByteArrayOutputStreamSerializer; - -/** - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.7.1 - */ -public class RemoveAllScenesCommand extends AbstractCommand { - - private int groupId; - - public RemoveAllScenesCommand(int groupId) { - super(Scenes.REMOVE_ALL_SCENES); - } - - public byte[] getPayload() { - if (payload == null) { - ZBSerializer serializer = new ByteArrayOutputStreamSerializer(); - serializer.append_short((short) groupId); - payload = serializer.getPayload(); - } - return payload; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/RemoveAllScenesResponseImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/RemoveAllScenesResponseImpl.java deleted file mode 100644 index ad32b5b76fc78..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/RemoveAllScenesResponseImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general.scenes; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.scenes.RemoveAllScenesResponse; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.core.ResponseImpl; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class RemoveAllScenesResponseImpl extends ResponseImpl implements - RemoveAllScenesResponse { - - private byte status; - private int groupId; - - public RemoveAllScenesResponseImpl(Response response) throws ZigBeeClusterException { - super(response); - ResponseImpl.checkSpecificCommandFrame(response, RemoveAllScenesResponse.ID); - ZBDeserializer deserializer = new DefaultDeserializer(getPayload(), 0); - status = deserializer.read_byte(); - groupId = deserializer.read_short(); - } - - public int getGroupId() { - return groupId; - } - - public Status getStatus() { - return Status.getStatus(status); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/RemoveSceneCommand.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/RemoveSceneCommand.java deleted file mode 100644 index 0c7ff866e1678..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/RemoveSceneCommand.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general.scenes; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBSerializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.Scenes; -import org.bubblecloud.zigbee.api.cluster.impl.core.AbstractCommand; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultSerializer; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class RemoveSceneCommand extends AbstractCommand { - - private int groupId; - private short sceneId; - - public RemoveSceneCommand(int groupId, short sceneId) { - super(Scenes.REMOVE_ALL_SCENES); - } - - public byte[] getPayload() { - if (payload == null) { - payload = new byte[3]; - ZBSerializer serializer = new DefaultSerializer(payload, 0); - serializer.append_short((short) groupId); - serializer.append_byte((byte) sceneId); - } - return payload; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/RemoveSceneResponseImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/RemoveSceneResponseImpl.java deleted file mode 100644 index 12bae5ff0bb01..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/RemoveSceneResponseImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general.scenes; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.scenes.RemoveSceneResponse; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.core.ResponseImpl; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class RemoveSceneResponseImpl extends ResponseImpl implements - RemoveSceneResponse { - - private int groupId; - private short sceneId; - private byte status; - - public RemoveSceneResponseImpl(Response response) throws ZigBeeClusterException { - super(response); - ResponseImpl.checkSpecificCommandFrame(response, RemoveSceneResponse.ID); - ZBDeserializer deserializer = new DefaultDeserializer(getPayload(), 0); - status = deserializer.read_byte(); - groupId = deserializer.read_short(); - sceneId = deserializer.read_byte(); - } - - public int getGroupId() { - return groupId; - } - - public short getSceneId() { - return sceneId; - } - - public Status getStatus() { - return Status.getStatus(status); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/StoreSceneCommand.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/StoreSceneCommand.java deleted file mode 100644 index bf26c4fc38341..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/StoreSceneCommand.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general.scenes; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBSerializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.Scenes; -import org.bubblecloud.zigbee.api.cluster.impl.core.AbstractCommand; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultSerializer; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class StoreSceneCommand extends AbstractCommand { - - private int groupId; - private short sceneId; - - public StoreSceneCommand(int groupId, short sceneId) { - super(Scenes.STORE_SCENE); - } - - public byte[] getPayload() { - if (payload == null) { - payload = new byte[3]; - ZBSerializer serializer = new DefaultSerializer(payload, 0); - serializer.append_short((short) groupId); - serializer.append_byte((byte) sceneId); - } - return payload; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/StoreSceneResponseImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/StoreSceneResponseImpl.java deleted file mode 100644 index ba29964f2908a..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/StoreSceneResponseImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general.scenes; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.scenes.RemoveSceneResponse; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.scenes.StoreSceneResponse; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.core.ResponseImpl; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class StoreSceneResponseImpl extends ResponseImpl implements - StoreSceneResponse { - - private int groupId; - private short sceneId; - private byte status; - - public StoreSceneResponseImpl(Response response) throws ZigBeeClusterException { - super(response); - ResponseImpl.checkSpecificCommandFrame(response, RemoveSceneResponse.ID); - ZBDeserializer deserializer = new DefaultDeserializer(getPayload(), 0); - status = deserializer.read_byte(); - groupId = deserializer.read_short(); - sceneId = deserializer.read_byte(); - } - - public int getGroupId() { - return groupId; - } - - public short getSceneId() { - return sceneId; - } - - public Status getStatus() { - return Status.getStatus(status); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/ViewSceneCommand.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/ViewSceneCommand.java deleted file mode 100644 index 423e13be66818..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/ViewSceneCommand.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general.scenes; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBSerializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.Scenes; -import org.bubblecloud.zigbee.api.cluster.impl.core.AbstractCommand; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultSerializer; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ViewSceneCommand extends AbstractCommand { - - private int groupId; - private short sceneId; - - public ViewSceneCommand(int groupId, short sceneId) { - super(Scenes.STORE_SCENE); - } - - public byte[] getPayload() { - if (payload == null) { - payload = new byte[3]; - ZBSerializer serializer = new DefaultSerializer(payload, 0); - serializer.append_short((short) groupId); - serializer.append_byte((byte) sceneId); - } - return payload; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/ViewSceneResponseImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/ViewSceneResponseImpl.java deleted file mode 100644 index daebbd9a3da64..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/general/scenes/ViewSceneResponseImpl.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.general.scenes; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.scenes.ExtensionFieldSetViewResponse; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.scenes.RemoveSceneResponse; -import org.bubblecloud.zigbee.api.cluster.impl.api.general.scenes.ViewSceneResponse; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.core.ResponseImpl; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ViewSceneResponseImpl extends ResponseImpl implements - ViewSceneResponse { - - private ExtensionFieldSetViewResponse[] extensionfield; - private int groupId; - private short sceneId; - private String sceneName; - private byte status; - private int transitionTime; - - public ViewSceneResponseImpl(Response response) throws ZigBeeClusterException { - super(response); - ResponseImpl.checkSpecificCommandFrame(response, RemoveSceneResponse.ID); - ZBDeserializer deserializer = new DefaultDeserializer(getPayload(), 0); - status = deserializer.read_byte(); - groupId = deserializer.read_short(); - sceneId = deserializer.read_byte(); - transitionTime = deserializer.read_short(); - //TODO check variable length - //TODO use the deserializer.readZigBeeType(ZigBeeType) - sceneName = (String) deserializer.readObject(String.class); - // TODO read extensionFieldSet - int i = 0; - boolean cond = true; //extensionfield end - while (cond) { - extensionfield[i] = new ExtensionFieldSetViewResponseImpl(deserializer); - i = i + 1; - cond = extensionfield[i].endSet(); - } - } - - public ExtensionFieldSetViewResponse[] getExstensionFieldSet() { - return extensionfield; - } - - public int getGroupId() { - return groupId; - } - - public short getSceneId() { - return sceneId; - } - - public String getSceneName() { - return sceneName; - } - - public Status getStatus() { - return Status.getStatus(status); - } - - public int getTransitionTime() { - return transitionTime; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/DefaultResponseImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/DefaultResponseImpl.java deleted file mode 100644 index c2dd54a14c2bf..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/DefaultResponseImpl.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.global; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.DefaultResponse; -import org.bubblecloud.zigbee.api.cluster.impl.core.ResponseImpl; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class DefaultResponseImpl extends ResponseImpl implements DefaultResponse { - - private byte commandId; - private byte status; - - public DefaultResponseImpl(Response response) throws ZigBeeClusterException { - super(response); - ResponseImpl.checkGeneralCommandFrame(response, DefaultResponse.ID); - commandId = getPayload()[0]; - status = getPayload()[1]; - } - - public byte getCommandId() { - return commandId; - } - - public Status getStatus() { - return Status.getStatus(status); - } - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/read/ReadAttributeCommand.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/read/ReadAttributeCommand.java deleted file mode 100644 index fcb23c766bf62..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/read/ReadAttributeCommand.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.global.read; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBSerializer; -import org.bubblecloud.zigbee.api.cluster.impl.core.AbstractCommand; -import org.bubblecloud.zigbee.api.cluster.impl.core.ByteArrayOutputStreamSerializer; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ReadAttributeCommand extends AbstractCommand { - - private static final Logger logger = LoggerFactory.getLogger(ReadAttributeCommand.class); - - private static byte ID = 0x00; - - private int[] attributeIds; - - public ReadAttributeCommand(int[] attributeIds) { - super(ID, false); - this.attributeIds = attributeIds; - } - - public byte[] getPayload() { - if (payload == null) { - logger.debug("Creating Payload for command"); - ZBSerializer serializer = new ByteArrayOutputStreamSerializer(); - for (int i = 0; i < attributeIds.length; i++) { - serializer.append_short((short) attributeIds[i]); - } - payload = serializer.getPayload(); - } - return payload; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/read/ReadAttributeStatusImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/read/ReadAttributeStatusImpl.java deleted file mode 100644 index 17460feba0c4f..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/read/ReadAttributeStatusImpl.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.global.read; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeType; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.ReadAttributesStatus; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.AttributeDescriptor; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ReadAttributeStatusImpl implements ReadAttributesStatus { - - private byte status; - - private int attributeId; - - private byte dataType; - - @SuppressWarnings("unchecked") - private Class clazz; - - private Object data; - - public ReadAttributeStatusImpl( - AttributeDescriptor descriptor, ZBDeserializer deserializer) { - - attributeId = deserializer.read_short(); - status = deserializer.read_byte(); - if (Status.getStatus(status).equals(Status.SUCCESS)) { - dataType = deserializer.read_byte(); - final ZigBeeType type = ZigBeeType.getType(dataType); - clazz = type.getJavaClass(); - data = deserializer.readZigBeeType(type); - } - - // TODO Attribute Check - // indeed the order could be different, so we should receive all the list - // and in any case we could also avoid to throw an Exception - - } - - public Object getAttributeData() { - return data; - } - - public byte getAttributeDataType() { - return dataType; - } - - public int getAttributeId() { - return attributeId; - } - - public byte getStatus() { - return status; - } - - @SuppressWarnings("unchecked") - public Class getDataClass() { - return clazz; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/read/ReadAttributesResponseImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/read/ReadAttributesResponseImpl.java deleted file mode 100644 index 28841c88bf5ea..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/read/ReadAttributesResponseImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.global.read; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.ReadAttributesResponse; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.ReadAttributesStatus; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.AttributeDescriptor; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.core.ResponseImpl; - - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class ReadAttributesResponseImpl extends ResponseImpl implements ReadAttributesResponse { - - private ReadAttributesStatus[] attributes; - - public ReadAttributesResponseImpl(Response response, AttributeDescriptor[] descriptors) throws ZigBeeClusterException { - super(response); - ResponseImpl.checkGeneralCommandFrame(response, ReadAttributesResponse.ID); - attributes = new ReadAttributesStatus[descriptors.length]; - byte[] msg = getPayload(); - ZBDeserializer deserializer = new DefaultDeserializer(msg, 0); - for (int i = 0; i < descriptors.length; i++) { - attributes[i] = new ReadAttributeStatusImpl(descriptors[i], deserializer); - } - } - - public ReadAttributesStatus[] getReadAttributeStatus() { - return attributes; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/reporting/AttributeReportImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/reporting/AttributeReportImpl.java deleted file mode 100644 index 59f3e00a4acaf..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/reporting/AttributeReportImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.global.reporting; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeType; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.AttributeReport; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.2.0 - */ -public class AttributeReportImpl implements AttributeReport { - - private short attributeId; - private Object value; - private final ZigBeeType type; - - public AttributeReportImpl(ZBDeserializer deserializer) { - attributeId = deserializer.read_short(); - byte dataType = deserializer.read_byte(); - ; - type = ZigBeeType.getType(dataType); - value = deserializer.readZigBeeType(type); - } - - public Object getAttributeData() { - return value; - } - - public ZigBeeType getAttributeDataType() { - return type; - } - - public int getAttributeId() { - return attributeId; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/reporting/AttributeReportingConfigurationRecordImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/reporting/AttributeReportingConfigurationRecordImpl.java deleted file mode 100644 index 95bd9007667c9..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/reporting/AttributeReportingConfigurationRecordImpl.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.global.reporting; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeType; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.AttributeReportingConfigurationRecord; - - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class AttributeReportingConfigurationRecordImpl implements - AttributeReportingConfigurationRecord { - - private Attribute attribute; - private int direction; - private int maximumReportinInterval; - private int minimumReportingInterval; - private Object reportableChange; - private int timeoutPeriod; - - - public AttributeReportingConfigurationRecordImpl(Attribute attribute, int direction) { - this.attribute = attribute; - this.direction = direction; - } - - public AttributeReportingConfigurationRecordImpl(Attribute attribute, int direction, - int maximumReportinInterval, int minimumReportingInterval, Object reportableChange, - int timeoutPeriod) { - - this.attribute = attribute; - this.direction = direction; - this.maximumReportinInterval = maximumReportinInterval; - this.minimumReportingInterval = minimumReportingInterval; - this.reportableChange = reportableChange; - this.timeoutPeriod = timeoutPeriod; - } - - public ZigBeeType getAttributeDataType() { - return attribute.getZigBeeType(); - } - - public int getAttributeId() { - return attribute.getId(); - } - - public int getDiretion() { - return direction; - } - - public int getMaximumReportinInterval() { - return maximumReportinInterval; - } - - public int getMinimumReportingInterval() { - return minimumReportingInterval; - } - - public Object getReportableChange() { - return reportableChange; - } - - public int getTimeoutPeriod() { - return timeoutPeriod; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/reporting/AttributeStatusRecordImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/reporting/AttributeStatusRecordImpl.java deleted file mode 100644 index 7adfd0d55e7bb..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/reporting/AttributeStatusRecordImpl.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.global.reporting; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.AttributeStatusRecord; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.AttributeDescriptor; - - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Alessandro Giari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class AttributeStatusRecordImpl implements AttributeStatusRecord { - - private byte status; - private int direction; - private int attributeId; - - - protected AttributeStatusRecordImpl(byte status, int direction, int attributeId) { - super(); - this.status = status; - this.direction = direction; - this.attributeId = attributeId; - } - - public AttributeStatusRecordImpl(AttributeDescriptor attrib, ZBDeserializer deserializer) - throws ZigBeeClusterException { - - status = deserializer.read_byte(); - direction = deserializer.read_byte(); - attributeId = deserializer.read_short(); - if (attributeId != attrib.getId()) { - throw new ZigBeeClusterException( - "attributeId read from the data doesn't match the expected value " + attributeId + " != " + attrib.getId() - ); - } - - } - - public AttributeStatusRecordImpl(Attribute attrib, ZBDeserializer deserializer) - throws ZigBeeClusterException { - - status = deserializer.read_byte(); - if (status != 0) { - return; - } - direction = deserializer.read_byte(); - attributeId = deserializer.read_short(); - if (attributeId != attrib.getId()) { - throw new ZigBeeClusterException( - "attributeId read from the data doesn't match the expected value " + attributeId + " != " + attrib.getId() - ); - } - - } - - - public byte getStatus() { - return status; - } - - public int getDirection() { - return direction; - } - - public int getAttributeId() { - return attributeId; - } - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/reporting/ConfigureReportingCommand.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/reporting/ConfigureReportingCommand.java deleted file mode 100644 index cadb9ac12934a..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/reporting/ConfigureReportingCommand.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.global.reporting; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBSerializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeType; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.AttributeReportingConfigurationRecord; -import org.bubblecloud.zigbee.api.cluster.impl.core.AbstractCommand; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultSerializer; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class ConfigureReportingCommand extends AbstractCommand { - - private static final Logger logger = LoggerFactory.getLogger(ConfigureReportingCommand.class); - - private static byte ID = 0x06; - - private AttributeReportingConfigurationRecord[] attributerecord; - - public ConfigureReportingCommand(AttributeReportingConfigurationRecord[] attributerecord) { - super(ID, false); - this.attributerecord = attributerecord; - } - - public byte[] getPayload() { - if (payload == null) { - logger.debug("Creating Payload for command"); - int length = 0; - for (int i = 0; i < attributerecord.length; i++) { - if (attributerecord[i].getDiretion() == 1) { - //CASE OF ATTRIBUTE CONFIGURATION SENT TO CLIENT - //Size of: Direction + Attribute Id + Timeout - length += 1 + 2 + 2; - } else if (attributerecord[i].getAttributeDataType().isAnalog() == false) { - //CASE OF ATTRIBUTE CONFIGURATION SENT TO SERVER OF A DISCRETE ATTRIBUTE - //Size of: Direction + Attribute Id + Data Type + Minimum + Maxium - length += 1 + 2 + 1 + 2 + 2; - } else { - //CASE OF ATTRIBUTE CONFIGURATION SENT TO SERVER OF A ANALOG ATTRIBUTE - //Size of: Direction + Attribute Id + Data Type + Minimum + Maxium + Change - final int valueSize = attributerecord[i].getAttributeDataType().getLength(); - length += 1 + 2 + 1 + 2 + 2 + valueSize; - } - } - payload = new byte[length]; - ZBSerializer serializer = new DefaultSerializer(payload, 0); - - for (int i = 0; i < attributerecord.length; i++) { - if (attributerecord[i].getDiretion() == 1) { - //CASE OF ATTRIBUTE CONFIGURATION SENT TO CLIENT - //Size of: Direction + Attribute Id + Timeout - serializer.append_byte((byte) attributerecord[i].getDiretion()); - serializer.append_short((short) attributerecord[i].getAttributeId()); - serializer.append_short((short) attributerecord[i].getTimeoutPeriod()); - } else if (attributerecord[i].getAttributeDataType().isAnalog() == false) { - //CASE OF ATTRIBUTE CONFIGURATION SENT TO SERVER OF A DISCRETE ATTRIBUTE - //Size of: Direction + Attribute Id + Data Type + Minimum + Maxium - serializer.append_byte((byte) attributerecord[i].getDiretion()); - serializer.append_short((short) attributerecord[i].getAttributeId()); - serializer.append_byte((byte) attributerecord[i].getAttributeDataType().getId()); - serializer.append_short((short) attributerecord[i].getMinimumReportingInterval()); - serializer.append_short((short) attributerecord[i].getMaximumReportinInterval()); - } else { - //CASE OF ATTRIBUTE CONFIGURATION SENT TO SERVER OF A ANALOG ATTRIBUTE - //Size of: Direction + Attribute Id + Data Type + Minimum + Maxium + Change - serializer.append_byte((byte) attributerecord[i].getDiretion()); - serializer.append_short((short) attributerecord[i].getAttributeId()); - final ZigBeeType type = attributerecord[i].getAttributeDataType(); - serializer.append_byte((byte) type.getId()); - serializer.append_short((short) attributerecord[i].getMinimumReportingInterval()); - serializer.append_short((short) attributerecord[i].getMaximumReportinInterval()); - serializer.appendZigBeeType(attributerecord[i].getReportableChange(), type); - } - } - } - return payload; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/reporting/ConfigureReportingResponseImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/reporting/ConfigureReportingResponseImpl.java deleted file mode 100644 index 5e4e90bfa3783..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/reporting/ConfigureReportingResponseImpl.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.global.reporting; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.AttributeStatusRecord; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.ConfigureReportingResponse; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.AttributeDescriptor; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.core.ResponseImpl; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Alessandro Giari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class ConfigureReportingResponseImpl extends ResponseImpl implements ConfigureReportingResponse { - - private AttributeStatusRecord[] attributes; - - public ConfigureReportingResponseImpl(Response response, AttributeDescriptor[] descriptors) throws ZigBeeClusterException { - - super(response); - ResponseImpl.checkGeneralCommandFrame(response, ConfigureReportingResponse.ID); - attributes = new AttributeStatusRecord[descriptors.length]; - ZBDeserializer deserializer = new DefaultDeserializer(getPayload(), 0); - for (int i = 0; i < descriptors.length; i++) { - attributes[i] = new AttributeStatusRecordImpl(descriptors[i], deserializer); - } - } - - public ConfigureReportingResponseImpl(Response response, Attribute[] attribs) throws ZigBeeClusterException { - - super(response); - ResponseImpl.checkGeneralCommandFrame(response, ConfigureReportingResponse.ID); - attributes = new AttributeStatusRecord[attribs.length]; - final byte[] msg = getPayload(); - if (msg.length == 1) { //ALL SUCCESS so attribute status field record are omitted - if (msg[0] != 0) { - //TODO Throw exception - } - for (int i = 0; i < attribs.length; i++) { - //TODO Check for direction - attributes[i] = new AttributeStatusRecordImpl((byte) 0, 0, attribs[i].getId()); - } - } else { //SOME FAILED so we have parse the payload normally - ZBDeserializer deserializer = new DefaultDeserializer(getPayload(), 0); - for (int i = 0; i < attribs.length; i++) { - attributes[i] = new AttributeStatusRecordImpl(attribs[i], deserializer); - } - } - } - - public AttributeStatusRecord[] getAttributeStatusRecord() { - return attributes; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/reporting/ReportAttributesCommand.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/reporting/ReportAttributesCommand.java deleted file mode 100644 index 1797bd26ee7e9..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/reporting/ReportAttributesCommand.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.global.reporting; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.AttributeReport; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.core.ResponseImpl; - -import java.util.ArrayList; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.2.0 - */ -public class ReportAttributesCommand extends ResponseImpl { - - private static final Logger logger = LoggerFactory.getLogger(ReportAttributesCommand.class); - - public static final byte ID = 0x0A; - - private AttributeReport[] attributesReport; - - public ReportAttributesCommand(ResponseImpl response) throws ZigBeeClusterException { - super(response); - ResponseImpl.checkGeneralCommandFrame(response, ReportAttributesCommand.ID); - - byte[] msg = getPayload(); - ZBDeserializer deserializer = new DefaultDeserializer(msg, 0); - ArrayList attributes = new ArrayList(); - for (int i = 0; deserializer.getPosition() < msg.length; i++) { - attributes.add(new AttributeReportImpl(deserializer)); - } - - attributesReport = attributes.toArray(new AttributeReport[]{}); - } - - public AttributeReport[] getAttributeReports() { - return attributesReport; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/write/WriteAttributeCommand.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/write/WriteAttributeCommand.java deleted file mode 100644 index 7ee9c2102d094..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/write/WriteAttributeCommand.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.global.write; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBSerializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeType; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.WriteAttributeRecord; -import org.bubblecloud.zigbee.api.cluster.impl.core.AbstractCommand; -import org.bubblecloud.zigbee.api.cluster.impl.core.ByteArrayOutputStreamSerializer; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class WriteAttributeCommand extends AbstractCommand { - private static byte ID = 0x02; - - private WriteAttributeRecord[] attributeRecord; - - public WriteAttributeCommand(WriteAttributeRecord[] attributerecord) { - super(ID, false); - this.attributeRecord = attributerecord; - } - - public byte[] getPayload() { - if (payload == null) { - ZBSerializer serializer = new ByteArrayOutputStreamSerializer(); - - for (int i = 0; i < attributeRecord.length; i++) { - serializer.append_short((short) attributeRecord[i].getAttributeId()); - final ZigBeeType type = attributeRecord[i].getAttributeDataType(); - serializer.append_byte((byte) type.getId()); - serializer.appendZigBeeType(attributeRecord[i].getAttributeData(), type); - } - payload = serializer.getPayload(); - } - return payload; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/write/WriteAttributeRecordImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/write/WriteAttributeRecordImpl.java deleted file mode 100644 index 5f299995fce01..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/write/WriteAttributeRecordImpl.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.global.write; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeType; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.WriteAttributeRecord; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class WriteAttributeRecordImpl implements WriteAttributeRecord { - - private Attribute attribute; - private Object value; - - public WriteAttributeRecordImpl(Attribute attribute, Object value) { - this.attribute = attribute; - this.value = value; - } - - public Object getAttributeData() { - return value; - } - - public ZigBeeType getAttributeDataType() { - return attribute.getZigBeeType(); - } - - public int getAttributeId() { - return attribute.getId(); - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/write/WriteAttributeStatusImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/write/WriteAttributeStatusImpl.java deleted file mode 100644 index 0c71a00d07116..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/write/WriteAttributeStatusImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.global.write; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.WriteAttributesStatus; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.AttributeDescriptor; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class WriteAttributeStatusImpl implements WriteAttributesStatus { - - private byte status; - private int attributeId; - - - public WriteAttributeStatusImpl(AttributeDescriptor descriptor, ZBDeserializer deserializer) { - - status = deserializer.read_byte(); - attributeId = deserializer.read_short(); - // TODO Attribute Check - // indeed the order could be different, so we should receive all the list - // and in any case we could also avoid to throw an Exception - } - - public WriteAttributeStatusImpl(AttributeDescriptor attributeDescriptor) { - status = (byte) Status.SUCCESS.id; - attributeId = attributeDescriptor.getId(); - } - - public int getAttributeId() { - return attributeId; - } - - public byte getStatus() { - return status; - } - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/write/WriteAttributesResponseImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/write/WriteAttributesResponseImpl.java deleted file mode 100644 index 657945a2b7b31..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/global/write/WriteAttributesResponseImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.global.write; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.WriteAttributesResponse; -import org.bubblecloud.zigbee.api.cluster.impl.api.global.WriteAttributesStatus; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.AttributeDescriptor; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.core.ResponseImpl; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class WriteAttributesResponseImpl extends ResponseImpl implements - WriteAttributesResponse { - - private WriteAttributesStatus[] attributes; - - public WriteAttributesResponseImpl(Response response, AttributeDescriptor[] descriptors) throws ZigBeeClusterException { - super(response); - ResponseImpl.checkGeneralCommandFrame(response, WriteAttributesResponse.ID); - attributes = new WriteAttributesStatus[descriptors.length]; - if (getPayload().length == 1 && getPayload()[0] == Status.SUCCESS.id) { - for (int i = 0; i < descriptors.length; i++) { - attributes[i] = new WriteAttributeStatusImpl(descriptors[i]); - } - } else { - ZBDeserializer deserializer = new DefaultDeserializer(getPayload(), 0); - for (int i = 0; i < descriptors.length; i++) { - attributes[i] = new WriteAttributeStatusImpl(descriptors[i], deserializer); - } - } - } - - public WriteAttributesStatus[] getWriteAttributesStatus() { - return attributes; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/measureament_sensing/IlluminanceMeasurementCluster.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/measureament_sensing/IlluminanceMeasurementCluster.java deleted file mode 100644 index 2f0fdfb9100bb..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/measureament_sensing/IlluminanceMeasurementCluster.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.measureament_sensing; - -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.measureament_sensing.IlluminanceMeasurement; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.Attributes; -import org.bubblecloud.zigbee.api.cluster.impl.core.AttributeImpl; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLClusterBase; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision: 42 $ ($LastChangedDate: 2010-09-23 14:21:48 +0200 (Thu, 23 Sep 2010) $) - * @since 0.8.0 - */ -public class IlluminanceMeasurementCluster extends ZCLClusterBase implements IlluminanceMeasurement { - - private final AttributeImpl measuredValue; - private final AttributeImpl minMeasuredValue; - private final AttributeImpl maxMeasuredValue; - private final AttributeImpl tolerance; - private final AttributeImpl lightSensorType; - - private final Attribute[] attributes; - - public IlluminanceMeasurementCluster(ZigBeeEndpoint zbDevice) { - - super(zbDevice); - measuredValue = new AttributeImpl(zbDevice, this, Attributes.MEASURED_VALUE_UNSIGNED_16_BIT); - minMeasuredValue = new AttributeImpl(zbDevice, this, Attributes.MIN_MEASURED_VALUE_UNSIGNED_16_BIT); - maxMeasuredValue = new AttributeImpl(zbDevice, this, Attributes.MAX_MEASURED_VALUE_UNSIGNED_16_BIT); - tolerance = new AttributeImpl(zbDevice, this, Attributes.TOLERANCE); - lightSensorType = new AttributeImpl(zbDevice, this, Attributes.LIGHT_SENSOR_TYPE); - - attributes = new AttributeImpl[]{measuredValue, minMeasuredValue, maxMeasuredValue, tolerance, lightSensorType}; - } - - public Attribute getMeasuredValue() { - - return measuredValue; - } - - public Attribute getMinMeasuredValue() { - - return minMeasuredValue; - } - - public Attribute getMaxMeasuredValue() { - - return maxMeasuredValue; - } - - public Attribute getTolerance() { - - return tolerance; - } - - public Attribute getLightSensorType() { - - return lightSensorType; - } - - @Override - public short getId() { - - return IlluminanceMeasurement.ID; - } - - @Override - public String getName() { - - return IlluminanceMeasurement.NAME; - } - - @Override - public Attribute[] getStandardAttributes() { - - return attributes; - } -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/measureament_sensing/OccupancySensingCluster.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/measureament_sensing/OccupancySensingCluster.java deleted file mode 100644 index ad83015b0f505..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/measureament_sensing/OccupancySensingCluster.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.measureament_sensing; - -import org.bubblecloud.zigbee.api.cluster.impl.api.measureament_sensing.OccupancySensing; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.Attributes; -import org.bubblecloud.zigbee.api.cluster.impl.core.AttributeImpl; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLClusterBase; - -/** - * Implementation of the {@link org.bubblecloud.zigbee.api.cluster.impl.api.measureament_sensing.OccupancySensing} interface - * - * @author Stefano "Kismet" Lenzi - * @author Manlio Bacco - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.4.0 - */ -public class OccupancySensingCluster extends ZCLClusterBase implements OccupancySensing { - - private final AttributeImpl occupancy; - private final AttributeImpl occupancySensorType; - private final AttributeImpl pirOccupiedToUnoccupiedDelay; - private final AttributeImpl pirUnoccupiedToOccupiedDelay; - private final AttributeImpl pirUnoccupiedToOccupiedThreshold; - private final AttributeImpl ultraSonicOccupiedToUnoccupiedDelay; - private final AttributeImpl ultraSonicUnoccupiedToOccupiedDelay; - private final AttributeImpl ultrasonicUnoccupiedToOccupiedThreshold; - - private final Attribute[] attributes; - - public OccupancySensingCluster(ZigBeeEndpoint zbDevice) { - super(zbDevice); - occupancy = new AttributeImpl(zbDevice, this, Attributes.OCCUPANCY); - occupancySensorType = new AttributeImpl(zbDevice, this, Attributes.OCCUPANCY_SENSOR_TYPE); - pirOccupiedToUnoccupiedDelay = new AttributeImpl(zbDevice, this, Attributes.PIR_OCCUPIED_TO_UNOCCUPIED_DELAY); - pirUnoccupiedToOccupiedDelay = new AttributeImpl(zbDevice, this, Attributes.PIR_UNOCCUPIED_TO_OCCUPIED_DELAY); - ultraSonicOccupiedToUnoccupiedDelay = new AttributeImpl(zbDevice, this, Attributes.ULTRA_SONIC_OCCUPIED_TO_UNOCCUPIED_DELAY); - ultraSonicUnoccupiedToOccupiedDelay = new AttributeImpl(zbDevice, this, Attributes.ULTRA_SONIC_UNOCCUPIED_TO_OCCUPIED_DELAY); - pirUnoccupiedToOccupiedThreshold = new AttributeImpl(zbDevice, this, Attributes.PIR_UNOCCUPIED_TO_OCCUPIED_THRESHOLD); - ultrasonicUnoccupiedToOccupiedThreshold = new AttributeImpl(zbDevice, this, Attributes.ULTRASONIC_UNOCCUPIED_TO_OCCUPIED_THRESHOLD); - - attributes = new AttributeImpl[]{occupancy, occupancySensorType, pirOccupiedToUnoccupiedDelay, - pirUnoccupiedToOccupiedDelay, ultraSonicOccupiedToUnoccupiedDelay, ultraSonicUnoccupiedToOccupiedDelay, - pirUnoccupiedToOccupiedThreshold, ultrasonicUnoccupiedToOccupiedThreshold}; - } - - @Override - public short getId() { - return OccupancySensing.ID; - } - - @Override - public String getName() { - return OccupancySensing.NAME; - } - - @Override - public Attribute[] getStandardAttributes() { - return attributes; - } - - public Attribute getAttributeOccupancy() { - return occupancy; - } - - public Attribute getAttributeOccupancySensorType() { - return occupancySensorType; - } - - public Attribute getAttributePIROccupiedToUnoccupiedDelay() { - return pirOccupiedToUnoccupiedDelay; - } - - public Attribute getAttributePIRUnoccupiedToOccupiedDelay() { - return pirUnoccupiedToOccupiedDelay; - } - - public Attribute getAttributeUltraSonicOccupiedToUnoccupiedDelay() { - return ultraSonicOccupiedToUnoccupiedDelay; - } - - public Attribute getAttributeUltraSonicUnoccupiedToOccupiedDelay() { - return ultraSonicUnoccupiedToOccupiedDelay; - } - - public Attribute getAttributePIRUnoccupiedToOccupiedThreshold() { - return pirUnoccupiedToOccupiedThreshold; - } - - public Attribute getAttributeUltrasonicUnoccupiedToOccupiedThreshold() { - return ultrasonicUnoccupiedToOccupiedThreshold; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/measureament_sensing/RelativeHumidityMeasurementCluster.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/measureament_sensing/RelativeHumidityMeasurementCluster.java deleted file mode 100644 index 745fc244ae7fc..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/measureament_sensing/RelativeHumidityMeasurementCluster.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.measureament_sensing; - -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.measureament_sensing.RelativeHumidityMeasurement; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.Attributes; -import org.bubblecloud.zigbee.api.cluster.impl.core.AttributeImpl; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLClusterBase; - -/** - * Implementation of the {@link RelativeHumidityMeasurement} interface - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.4.0 - */ -public class RelativeHumidityMeasurementCluster extends ZCLClusterBase implements RelativeHumidityMeasurement { - - private final AttributeImpl measuredValue; - private final AttributeImpl minMeasuredValue; - private final AttributeImpl maxMeasuredValue; - private final AttributeImpl tolerance; - - private final Attribute[] attributes; - - public RelativeHumidityMeasurementCluster(ZigBeeEndpoint zbDevice) { - super(zbDevice); - measuredValue = new AttributeImpl(zbDevice, this, Attributes.MEASURED_VALUE_UNSIGNED_16_BIT); - minMeasuredValue = new AttributeImpl(zbDevice, this, Attributes.MIN_MEASURED_VALUE_UNSIGNED_16_BIT); - maxMeasuredValue = new AttributeImpl(zbDevice, this, Attributes.MAX_MEASURED_VALUE_UNSIGNED_16_BIT); - tolerance = new AttributeImpl(zbDevice, this, Attributes.TOLERANCE); - attributes = new AttributeImpl[]{measuredValue, minMeasuredValue, maxMeasuredValue, tolerance}; - } - - @Override - public short getId() { - return ID; - } - - @Override - public String getName() { - return NAME; - } - - @Override - public Attribute[] getStandardAttributes() { - return attributes; - } - - public Attribute getAttributeMaxMeasuredValue() { - return maxMeasuredValue; - } - - public Attribute getAttributeMeasuredValue() { - return measuredValue; - } - - public Attribute getAttributeMinMeasuredValue() { - return minMeasuredValue; - } - - public Attribute getAttributeTolerance() { - return tolerance; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/measureament_sensing/TemperatureMeasurementCluster.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/measureament_sensing/TemperatureMeasurementCluster.java deleted file mode 100644 index 306c8455a45f5..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/measureament_sensing/TemperatureMeasurementCluster.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.measureament_sensing; - -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.measureament_sensing.TemperatureMeasurement; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.Attributes; -import org.bubblecloud.zigbee.api.cluster.impl.core.AttributeImpl; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLClusterBase; - -/** - * Implementation of the {@link TemperatureMeasurement} interface - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.4.0 - */ -public class TemperatureMeasurementCluster extends ZCLClusterBase implements TemperatureMeasurement { - - private final AttributeImpl measuredValue; - private final AttributeImpl minMeasuredValue; - private final AttributeImpl maxMeasuredValue; - private final AttributeImpl tolerance; - - private final Attribute[] attributes; - - public TemperatureMeasurementCluster(ZigBeeEndpoint zbDevice) { - super(zbDevice); - measuredValue = new AttributeImpl(zbDevice, this, Attributes.MEASURED_VALUE_SIGNED_16_BIT); - minMeasuredValue = new AttributeImpl(zbDevice, this, Attributes.MIN_MEASURED_VALUE_SIGNED_16_BIT); - maxMeasuredValue = new AttributeImpl(zbDevice, this, Attributes.MAX_MEASURED_VALUE_SIGNED_16_BIT); - tolerance = new AttributeImpl(zbDevice, this, Attributes.TOLERANCE); - - attributes = new AttributeImpl[]{measuredValue, minMeasuredValue, maxMeasuredValue, tolerance}; - } - - @Override - public short getId() { - return ID; - } - - @Override - public String getName() { - return NAME; - } - - @Override - public Attribute[] getStandardAttributes() { - return attributes; - } - - public Attribute getAttributeMaxMeasuredValue() { - return maxMeasuredValue; - } - - public Attribute getAttributeMeasuredValue() { - return measuredValue; - } - - public Attribute getAttributeMinMeasuredValue() { - return minMeasuredValue; - } - - public Attribute getAttributeTolerance() { - return tolerance; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/protocol_interfaces/GenericTunnelCluster.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/protocol_interfaces/GenericTunnelCluster.java deleted file mode 100755 index ff7fc56973dbc..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/protocol_interfaces/GenericTunnelCluster.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - Copyright 2013-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.impl.protocol_interfaces; - -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.protocol_interfaces.GenericTunnel; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLClusterBase; - -/** - * NOTE: THIS CLASS IS ONLY A PLACEHOLDER THE INTERFACE IS WRONG - * - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.8.0 - */ -public class GenericTunnelCluster extends ZCLClusterBase implements GenericTunnel { - - public GenericTunnelCluster(ZigBeeEndpoint zbDevice) { - super(zbDevice); - // TODO Auto-generated constructor stub - } - - @Override - public short getId() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public String getName() { - // TODO Auto-generated method stub - return null; - } - - @Override - public Attribute[] getStandardAttributes() { - // TODO Auto-generated method stub - return null; - } - - //TODO Generate this class - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/IASACECluster.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/IASACECluster.java deleted file mode 100644 index 72d75370b111e..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/IASACECluster.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.security_safety; - -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.IASACE; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_ace.BypassPayload; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_ace.ZoneTable; -import org.bubblecloud.zigbee.api.cluster.impl.core.AttributeImpl; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLClusterBase; -import org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_ace.ArmCommand; -import org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_ace.ArmResponseImpl; -import org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_ace.BypassCommand; -import org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_ace.EmergencyCommand; -import org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_ace.FireCommand; -import org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_ace.PanicCommand; -import org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_ace.ZoneIDMapCommand; -import org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_ace.ZoneIDMapResponseImpl; -import org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_ace.ZoneInformationCommand; -import org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_ace.ZoneInformationResponseImpl; -import org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_ace.ZoneTableImpl; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.8.0 - */ -public class IASACECluster extends ZCLClusterBase implements IASACE { - - private ZoneTable zoneTable; - private final Attribute[] attributes; - - private final Logger log = LoggerFactory.getLogger(IASACECluster.class); - - public IASACECluster(ZigBeeEndpoint zbDevice) { - - super(zbDevice); - zoneTable = new ZoneTableImpl(); - attributes = new AttributeImpl[]{}; - } - - public Response arm(byte armMode) throws ZigBeeClusterException { - ArmCommand cmd = new ArmCommand(armMode); - Response response = invoke(cmd, false); - return new ArmResponseImpl(response); - } - - public void bypass(BypassPayload payload) throws ZigBeeClusterException { - BypassCommand cmd = new BypassCommand(payload); - invoke(cmd); - } - - public void emergency() throws ZigBeeClusterException { - EmergencyCommand cmd = new EmergencyCommand(); - invoke(cmd); - } - - public void fire() throws ZigBeeClusterException { - FireCommand cmd = new FireCommand(); - invoke(cmd); - } - - public void panic() throws ZigBeeClusterException { - PanicCommand cmd = new PanicCommand(); - invoke(cmd); - } - - public Response getZoneIdMap() throws ZigBeeClusterException { - ZoneIDMapCommand cmd = new ZoneIDMapCommand(); - Response response = invoke(cmd); - return new ZoneIDMapResponseImpl(response); - } - - public Response getZoneInformation(int zoneID) throws ZigBeeClusterException { - ZoneInformationCommand cmd = new ZoneInformationCommand(zoneID); - Response response = invoke(cmd); - return new ZoneInformationResponseImpl(response); - } - - @Override - public short getId() { - return IASACE.ID; - } - - @Override - public String getName() { - return IASACE.NAME; - } - - @Override - public Attribute[] getStandardAttributes() { - return attributes; - } -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/IASWDCluster.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/IASWDCluster.java deleted file mode 100644 index 243c75ac24f89..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/IASWDCluster.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.security_safety; - -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.IASWD; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_wd.SquawkPayload; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_wd.StartWarningPayload; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.Attributes; -import org.bubblecloud.zigbee.api.cluster.impl.core.AttributeImpl; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLClusterBase; -import org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_wd.SquawkCommand; -import org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_wd.StartWarningCommand; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.8.0 - */ -public class IASWDCluster extends ZCLClusterBase implements IASWD { - - private final AttributeImpl maxDuration; - private final Attribute[] attributes; - - private final Logger log = LoggerFactory.getLogger(IASWDCluster.class); - - public IASWDCluster(ZigBeeEndpoint zbDevice) { - super(zbDevice); - maxDuration = new AttributeImpl(zbDevice, this, Attributes.MAX_DURATION); - attributes = new AttributeImpl[]{maxDuration}; - } - - public Attribute getAttributeMaxDuration() { - return maxDuration; - } - - public void startWarning(StartWarningPayload payload) throws ZigBeeClusterException { - StartWarningCommand startwarningcmd = new StartWarningCommand(payload); - invoke(startwarningcmd); - } - - public void squawk(SquawkPayload payload) throws ZigBeeClusterException { - SquawkCommand squawkcmd = new SquawkCommand(payload); - invoke(squawkcmd); - } - - @Override - public short getId() { - return IASWD.ID; - } - - @Override - public String getName() { - return IASWD.NAME; - } - - @Override - public Attribute[] getStandardAttributes() { - return attributes; - } -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/IASZoneCluster.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/IASZoneCluster.java deleted file mode 100644 index 479afa2d4fdb3..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/IASZoneCluster.java +++ /dev/null @@ -1,212 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.security_safety; - -import org.bubblecloud.zigbee.network.ClusterFilter; -import org.bubblecloud.zigbee.network.ClusterListener; -import org.bubblecloud.zigbee.network.ClusterMessage; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.network.impl.ZigBeeNetworkManagerException; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.IASZone; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_zone.ZoneEnrollRequestPayload; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_zone.ZoneEnrollResponse; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_zone.ZoneStatusChangeNotificationListener; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_zone.ZoneStatusChangeNotificationPayload; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_zone.ZoneStatusChangeNotificationResponse; -import org.bubblecloud.zigbee.api.cluster.impl.attribute.Attributes; -import org.bubblecloud.zigbee.api.cluster.impl.core.AttributeImpl; -import org.bubblecloud.zigbee.api.cluster.impl.core.ResponseImpl; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLClusterBase; -import org.bubblecloud.zigbee.api.cluster.impl.global.DefaultResponseImpl; -import org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_zone.IAS_ZoneZoneStatusChangeNotificationFilter; -import org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_zone.ZoneEnrollRequestCommand; -import org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_zone.ZoneEnrollResponseImpl; -import org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_zone.ZoneStatusChangeNotificationCommand; -import org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_zone.ZoneStatusChangeNotificationResponseImpl; - -import java.util.ArrayList; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.8.0 - */ -public class IASZoneCluster extends ZCLClusterBase implements IASZone { - - private final AttributeImpl attributeZoneState; - private final AttributeImpl attributeZoneType; - private final AttributeImpl attributeZoneStatus; - private final AttributeImpl attributeIASCIEAddress; - - private final ArrayList listeners = new ArrayList(); - private ZoneStatusChangeNotificationListenerNotifier bridge; - - private final Attribute[] attributes; - - private final Logger log = LoggerFactory.getLogger(IASZoneCluster.class); - - public IASZoneCluster(ZigBeeEndpoint zbDevice) { - - super(zbDevice); - - attributeZoneState = new AttributeImpl(zbDevice, this, Attributes.ZONE_STATE); - attributeZoneType = new AttributeImpl(zbDevice, this, Attributes.ZONE_TYPE); - attributeZoneStatus = new AttributeImpl(zbDevice, this, Attributes.ZONE_STATUS); - attributeIASCIEAddress = new AttributeImpl(zbDevice, this, Attributes.IAS_CIE_ADDRESS); - - attributes = new AttributeImpl[]{attributeZoneState, attributeZoneType, attributeZoneStatus, attributeIASCIEAddress}; - - bridge = new ZoneStatusChangeNotificationListenerNotifier(); - } - - public Attribute getAttributeZoneState() { - - return attributeZoneState; - } - - public Attribute getAttributeZoneType() { - - return attributeZoneType; - } - - public Attribute getAttributeZoneStatus() { - - return attributeZoneStatus; - } - - public Attribute getAttributeIASCIEAddress() { - - return attributeIASCIEAddress; - } - - @Override - public short getId() { - - return IASZone.ID; - } - - @Override - public String getName() { - - return IASZone.NAME; - } - - @Override - public Attribute[] getStandardAttributes() { - - return attributes; - } - - public Response zoneStatusChangeNotification(ZoneStatusChangeNotificationPayload payload) throws ZigBeeClusterException { - - enableDefaultResponse(); - ZoneStatusChangeNotificationCommand zscnc = new ZoneStatusChangeNotificationCommand(payload); - Response response = invoke(zscnc); - return new DefaultResponseImpl(response); - } - - public ZoneEnrollResponse zoneEnrollRequest(ZoneEnrollRequestPayload payload) throws ZigBeeClusterException { - - ZoneEnrollRequestCommand zoneEnrCmd = new ZoneEnrollRequestCommand(payload); - Response response = invoke(zoneEnrCmd, false); - return new ZoneEnrollResponseImpl(response); - } - - public boolean addZoneStatusChangeNotificationListener(ZoneStatusChangeNotificationListener listener) { - synchronized (listeners) { - if (listeners.size() == 0) { - try { - getZigBeeEndpoint().bindToLocal(ID); - } catch (ZigBeeNetworkManagerException e) { - log.error("Unable to bind to device for IASZone reporting", e); - return false; - } - if (getZigBeeEndpoint().addClusterListener(bridge) == false) { - log.error("Unable to register the cluster listener for IASZone reporting"); - return false; - } - } - listeners.add(listener); - return true; - } - } - - public boolean removeZoneStatusChangeNotificationListener(ZoneStatusChangeNotificationListener listener) { - synchronized (listeners) { - boolean removed = listeners.remove(listener); - if (listeners.size() == 0 && removed) { - try { - getZigBeeEndpoint().unbindFromLocal(ID); - } catch (ZigBeeNetworkManagerException e) { - log.error("Unable to unbind to device for IASZone reporting", e); - return false; - } - if (getZigBeeEndpoint().removeClusterListener(bridge) == false) { - log.error("Unable to unregister the cluster listener for IASZone reporting"); - return false; - } - } - return removed; - } - } - - private class ZoneStatusChangeNotificationListenerNotifier implements ClusterListener { - - public void setClusterFilter(ClusterFilter filter) { - } - - public ClusterFilter getClusterFilter() { - return IAS_ZoneZoneStatusChangeNotificationFilter.FILTER; - } - - public void handleCluster(ZigBeeEndpoint endpoint, ClusterMessage c) { - try { - ResponseImpl response = new ResponseImpl(c, ID); - ZoneStatusChangeNotificationResponse zscnr = new ZoneStatusChangeNotificationResponseImpl(response); - ArrayList localCopy; - synchronized (listeners) { - localCopy = new ArrayList(listeners); - } - log.debug("Notifying {} ZoneStatusChangeNotificationListener", localCopy.size()); - for (ZoneStatusChangeNotificationListener alarmListner : localCopy) { - try { - log.debug("Notifying {}:{}", alarmListner.getClass().getName(), alarmListner); - alarmListner.zoneStatusChangeNotification(zscnr.getZoneStatus()); - } catch (Exception e) { - log.error("Error while notifying {}:{} caused by {}", new Object[]{ - alarmListner.getClass().getName(), alarmListner, e.getStackTrace() - }); - } - } - - } catch (ZigBeeClusterException e) { - e.printStackTrace(); - } - } - } -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/ArmCommand.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/ArmCommand.java deleted file mode 100644 index 5e944358adcab..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/ArmCommand.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_ace; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBSerializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.IASACE; -import org.bubblecloud.zigbee.api.cluster.impl.core.AbstractCommand; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultSerializer; - -public class ArmCommand extends AbstractCommand { - - private byte armMode; - - public ArmCommand(byte armMode) { - super(IASACE.ARM); - this.armMode = armMode; - } - - public byte[] getPayload() { - if (payload == null) { - payload = new byte[1]; - ZBSerializer serializer = new DefaultSerializer(payload, 0); - serializer.appendByte(armMode); - } - return payload; - } -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/ArmResponseImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/ArmResponseImpl.java deleted file mode 100644 index d315c57c7130b..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/ArmResponseImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_ace; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_ace.ArmResponse; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.core.ResponseImpl; - -public class ArmResponseImpl extends ResponseImpl implements ArmResponse { - - private byte armNotification; - - public ArmResponseImpl(Response response) throws ZigBeeClusterException { - super(response); - - ResponseImpl.checkSpecificCommandFrame(response, ID); - - ZBDeserializer deserializer = new DefaultDeserializer(getPayload(), 0); - armNotification = deserializer.read_byte(); - } - - public byte getArmNotification() { - return armNotification; - } -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/BypassCommand.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/BypassCommand.java deleted file mode 100644 index 9d72a7cfd7f0e..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/BypassCommand.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_ace; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBSerializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.IASACE; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_ace.BypassPayload; -import org.bubblecloud.zigbee.api.cluster.impl.core.AbstractCommand; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultSerializer; - -public class BypassCommand extends AbstractCommand { - - private BypassPayload bypassPayload; - - public BypassCommand(BypassPayload bypassPayload) { - super(IASACE.BYPASS); - this.bypassPayload = bypassPayload; - } - - public byte[] getPayload() { - if (payload == null) { - int length = 4 + bypassPayload.getNumberOfZones() * 4; - - payload = new byte[length]; - ZBSerializer serializer = new DefaultSerializer(payload, 0); - serializer.append_int(bypassPayload.getNumberOfZones()); - for (int i = 0; i < bypassPayload.getNumberOfZones(); i++) { - serializer.append_int(bypassPayload.getZonesID()[i]); - } - } - return payload; - } -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/BypassPayloadImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/BypassPayloadImpl.java deleted file mode 100644 index 29012cbfc7b2a..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/BypassPayloadImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_ace; - -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_ace.BypassPayload; - -public class BypassPayloadImpl implements BypassPayload { - - public int numberOfZones; - public int[] zonesID; - - public BypassPayloadImpl(int numberOfZones, int[] zonesID) { - this.numberOfZones = numberOfZones; - this.zonesID = zonesID; - } - - public int getNumberOfZones() { - return numberOfZones; - } - - public int[] getZonesID() { - return zonesID; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/EmergencyCommand.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/EmergencyCommand.java deleted file mode 100644 index 857bb8782af7a..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/EmergencyCommand.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_ace; - -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.IASACE; -import org.bubblecloud.zigbee.api.cluster.impl.core.AbstractCommand; - -public class EmergencyCommand extends AbstractCommand { - - public EmergencyCommand() { - super(IASACE.EMERGENCY); - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/FireCommand.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/FireCommand.java deleted file mode 100644 index e71cd89cb6115..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/FireCommand.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_ace; - -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.IASACE; -import org.bubblecloud.zigbee.api.cluster.impl.core.AbstractCommand; - -public class FireCommand extends AbstractCommand { - - public FireCommand() { - super(IASACE.FIRE); - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/PanicCommand.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/PanicCommand.java deleted file mode 100644 index 89a1f340a6185..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/PanicCommand.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_ace; - -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.IASACE; -import org.bubblecloud.zigbee.api.cluster.impl.core.AbstractCommand; - -public class PanicCommand extends AbstractCommand { - - public PanicCommand() { - super(IASACE.PANIC); - } -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/ZoneIDMapCommand.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/ZoneIDMapCommand.java deleted file mode 100644 index 204e71f1edccb..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/ZoneIDMapCommand.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_ace; - -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.IASACE; -import org.bubblecloud.zigbee.api.cluster.impl.core.AbstractCommand; - -public class ZoneIDMapCommand extends AbstractCommand { - - public ZoneIDMapCommand() { - super(IASACE.GET_ZONE_ID_MAP); - } -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/ZoneIDMapResponseImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/ZoneIDMapResponseImpl.java deleted file mode 100644 index 82e0e4f27a28b..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/ZoneIDMapResponseImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_ace; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_ace.ZoneIDMapResponse; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_ace.ZoneTable; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_ace.ZoneTable.Zone; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.core.ResponseImpl; - -public class ZoneIDMapResponseImpl extends ResponseImpl implements ZoneIDMapResponse { - - private ZoneTable zonesID; - - public ZoneIDMapResponseImpl(Response response) throws ZigBeeClusterException { - super(response); - - ResponseImpl.checkSpecificCommandFrame(response, ID); - - ZBDeserializer deserializer = new DefaultDeserializer(getPayload(), 0); - - zonesID = new ZoneTableImpl(); - for (int i = 0; i < 16; i++) - zonesID.addZone(new Short(deserializer.read_short()), null, null); - } - - public Zone[] getZonesID() { - Zone[] zones = new Zone[zonesID.getZoneTable().length]; - for (int i = 0; i < zonesID.getZoneTable().length; i++) - zones[i] = zonesID.getZoneTable()[i]; - - return zones; - } -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/ZoneInformationCommand.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/ZoneInformationCommand.java deleted file mode 100644 index cef351fa67d96..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/ZoneInformationCommand.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_ace; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBSerializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.IASACE; -import org.bubblecloud.zigbee.api.cluster.impl.core.AbstractCommand; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultSerializer; - -public class ZoneInformationCommand extends AbstractCommand { - - public int zoneID; - - public ZoneInformationCommand(int zoneID) { - super(IASACE.GET_ZONE_INFORMATION); - this.zoneID = zoneID; - } - - public byte[] getPayload() { - if (payload == null) { - payload = new byte[4]; - ZBSerializer serializer = new DefaultSerializer(payload, 0); - serializer.append_int(zoneID); - } - return payload; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/ZoneInformationResponseImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/ZoneInformationResponseImpl.java deleted file mode 100644 index 800123dcb2cf4..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/ZoneInformationResponseImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_ace; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_ace.ZoneInformationResponse; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.core.ResponseImpl; - -public class ZoneInformationResponseImpl extends ResponseImpl implements ZoneInformationResponse { - - private int zoneID; - private short zoneType; - private String IEEEaddress; - - public ZoneInformationResponseImpl(Response response) throws ZigBeeClusterException { - super(response); - - ResponseImpl.checkSpecificCommandFrame(response, ID); - - ZBDeserializer deserializer = new DefaultDeserializer(getPayload(), 0); - zoneID = deserializer.read_int(); - zoneType = deserializer.readShort(); - IEEEaddress = deserializer.readString(); - } - - public int getZoneID() { - return zoneID; - } - - public short getZoneType() { - return zoneType; - } - - public String getIEEEAddress() { - return IEEEaddress; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/ZoneTableImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/ZoneTableImpl.java deleted file mode 100644 index 94daadd956021..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_ace/ZoneTableImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_ace; - -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_ace.ZoneTable; - -public class ZoneTableImpl implements ZoneTable { - - private Zone[] zoneTable; - - public ZoneTableImpl() { - zoneTable = new Zone[256]; - } - - public Zone[] getZoneTable() { - return zoneTable; - } - - public void addZone(Short zoneID, Short zoneType, String zoneAddress) { - for (int i = 0; i < zoneTable.length; i++) { - if (zoneTable[i] == null) - zoneTable[i] = new Zone(zoneID, zoneType, zoneAddress); - } - } - - public void removeZone(Short zoneID) { - for (int i = 0; i < zoneTable.length; i++) { - Zone zone = zoneTable[i]; - if (zone.getZoneID().equals(zoneID)) { - zoneTable[i] = null; - break; - } - } - } -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_wd/SquawkCommand.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_wd/SquawkCommand.java deleted file mode 100644 index 6362012b85665..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_wd/SquawkCommand.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_wd; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBSerializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.IASWD; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_wd.SquawkPayload; -import org.bubblecloud.zigbee.api.cluster.impl.core.AbstractCommand; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultSerializer; - -public class SquawkCommand extends AbstractCommand { - - private SquawkPayload squawkPayload; - - public SquawkCommand(SquawkPayload payload) { - super(IASWD.SQUAWK); - this.squawkPayload = payload; - } - - public byte[] getPayload() { - if (payload == null) { - payload = new byte[6]; - ZBSerializer serializer = new DefaultSerializer(payload, 0); - serializer.append_short((short) squawkPayload.getSquawkLevel()); - serializer.append_short((short) squawkPayload.getSquawkMode()); - serializer.append_short((byte) squawkPayload.getStrobe()); - } - return payload; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_wd/SquawkPayloadImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_wd/SquawkPayloadImpl.java deleted file mode 100644 index 76697e9e8b01d..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_wd/SquawkPayloadImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_wd; - -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_wd.SquawkPayload; - -public class SquawkPayloadImpl implements SquawkPayload { - - private short squawkMode, squawkLevel, strobe; - - public SquawkPayloadImpl(short squawkMode, short squawkLevel, short strobe) { - - this.squawkMode = squawkMode; - this.strobe = strobe; - this.squawkLevel = squawkLevel; - } - - public short getSquawkMode() { - return squawkMode; - } - - public short getSquawkLevel() { - return squawkLevel; - } - - public short getStrobe() { - return strobe; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_wd/StartWarningCommand.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_wd/StartWarningCommand.java deleted file mode 100644 index e7e2f93a2b1dd..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_wd/StartWarningCommand.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_wd; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBSerializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.IASWD; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_wd.StartWarningPayload; -import org.bubblecloud.zigbee.api.cluster.impl.core.AbstractCommand; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultSerializer; - -public class StartWarningCommand extends AbstractCommand { - - private StartWarningPayload startWarningPayload; - - public StartWarningCommand(StartWarningPayload payload) { - super(IASWD.START_WARNING); - this.startWarningPayload = payload; - } - - public byte[] getPayload() { - if (payload == null) { - payload = new byte[8]; - ZBSerializer serializer = new DefaultSerializer(payload, 0); - serializer.append_short(startWarningPayload.getStrobe()); - serializer.append_short(startWarningPayload.getWarningMode()); - serializer.append_int(startWarningPayload.getWarningDuration()); - } - return payload; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_wd/StartWarningPayloadImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_wd/StartWarningPayloadImpl.java deleted file mode 100644 index 27de8f5fb193a..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_wd/StartWarningPayloadImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_wd; - -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_wd.StartWarningPayload; - -public class StartWarningPayloadImpl implements StartWarningPayload { - - private short warningMode, strobe; - private int warningDuration; - - public StartWarningPayloadImpl(short warningMode, short strobe, int warningDuration) { - - this.warningMode = warningMode; - this.strobe = strobe; - this.warningDuration = warningDuration; - } - - public short getWarningMode() { - return warningMode; - } - - public short getStrobe() { - return strobe; - } - - public int getWarningDuration() { - return warningDuration; - } -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_zone/IAS_ZoneZoneStatusChangeNotificationFilter.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_zone/IAS_ZoneZoneStatusChangeNotificationFilter.java deleted file mode 100644 index 6d9f72694eb4b..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_zone/IAS_ZoneZoneStatusChangeNotificationFilter.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_zone; - -import org.bubblecloud.zigbee.network.ClusterMessage; -import org.bubblecloud.zigbee.network.ClusterFilter; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.IASZone; -import org.bubblecloud.zigbee.api.cluster.impl.core.ZCLFrame; - -public class IAS_ZoneZoneStatusChangeNotificationFilter implements ClusterFilter { - - public final static IAS_ZoneZoneStatusChangeNotificationFilter FILTER = new IAS_ZoneZoneStatusChangeNotificationFilter(); - - private IAS_ZoneZoneStatusChangeNotificationFilter() { - - } - - public boolean match(ClusterMessage clusterMessage) { - if (clusterMessage.getId() != IASZone.ID) return false; - - ZCLFrame frame = new ZCLFrame(clusterMessage); - return frame.getHeader().getCommandId() == IASZone.ZONE_STATUS_CHANGE_NOTIFICATION_ID - && frame.getHeader().getFramecontrol().isClusterSpecificCommand(); - } -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_zone/ZoneEnrollRequestCommand.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_zone/ZoneEnrollRequestCommand.java deleted file mode 100644 index b1bb89668f6ce..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_zone/ZoneEnrollRequestCommand.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_zone; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBSerializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.IASZone; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_zone.ZoneEnrollRequestPayload; -import org.bubblecloud.zigbee.api.cluster.impl.core.AbstractCommand; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultSerializer; - -public class ZoneEnrollRequestCommand extends AbstractCommand { - - private ZoneEnrollRequestPayload cmdPayload; - - public ZoneEnrollRequestCommand(ZoneEnrollRequestPayload cmdPayload) { - super(IASZone.ZONE_ENROLL_REQUEST_ID); - this.cmdPayload = cmdPayload; - } - - public byte[] getPayload() { - if (payload == null) { - payload = new byte[6]; - ZBSerializer serializer = new DefaultSerializer(payload, 0); - serializer.append_short(cmdPayload.getZoneType()); - serializer.append_int(cmdPayload.getManufacturerCode()); - } - - return payload; - } -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_zone/ZoneEnrollRequestPayloadImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_zone/ZoneEnrollRequestPayloadImpl.java deleted file mode 100644 index be2cc113ad01c..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_zone/ZoneEnrollRequestPayloadImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_zone; - -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_zone.ZoneEnrollRequestPayload; - -public class ZoneEnrollRequestPayloadImpl implements ZoneEnrollRequestPayload { - - private short zoneType; - private int manufacturerCode; - - public ZoneEnrollRequestPayloadImpl(short zoneType, int manufacturerCode) { - this.zoneType = zoneType; - this.manufacturerCode = manufacturerCode; - } - - public short getZoneType() { - return zoneType; - } - - public int getManufacturerCode() { - return manufacturerCode; - } -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_zone/ZoneEnrollResponseImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_zone/ZoneEnrollResponseImpl.java deleted file mode 100644 index dd59e1b7869d0..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_zone/ZoneEnrollResponseImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_zone; - -import org.bubblecloud.zigbee.network.ClusterMessage; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeClusterException; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZigBeeType; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_zone.ZoneEnrollResponse; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.core.ResponseImpl; - -public class ZoneEnrollResponseImpl extends ResponseImpl implements ZoneEnrollResponse { - - private int enrollResponseCode; - private int zoneID; - - public ZoneEnrollResponseImpl(Response response) throws ZigBeeClusterException { - - super(response); - - //ResponseImpl.checkGeneralCommandFrame(response, ZoneEnrollResponse.PROFILE_ID_HOME_AUTOMATION); - ZBDeserializer deserializer = new DefaultDeserializer(getPayload(), 0); - enrollResponseCode = (Integer) deserializer.readZigBeeType(ZigBeeType.Enumeration8bit); - zoneID = (Integer) deserializer.readZigBeeType(ZigBeeType.UnsignedInteger8bit); - } - - public ZoneEnrollResponseImpl(ClusterMessage clusterMessage, short expectedClusterId) throws ZigBeeClusterException { - - super(clusterMessage, expectedClusterId); - - //ResponseImpl.checkGeneralCommandFrame(response, ZoneEnrollResponse.PROFILE_ID_HOME_AUTOMATION); - ZBDeserializer deserializer = new DefaultDeserializer(getPayload(), 0); - enrollResponseCode = (Integer) deserializer.readZigBeeType(ZigBeeType.Enumeration8bit); - zoneID = (Integer) deserializer.readZigBeeType(ZigBeeType.UnsignedInteger8bit); - } - - public int getEnrollResponseCode() { - - return enrollResponseCode; - } - - public int getZoneID() { - - return zoneID; - } -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_zone/ZoneStatusChangeNotificationCommand.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_zone/ZoneStatusChangeNotificationCommand.java deleted file mode 100644 index 2672a700ccad1..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_zone/ZoneStatusChangeNotificationCommand.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_zone; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBSerializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.IASZone; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_zone.ZoneStatusChangeNotificationPayload; -import org.bubblecloud.zigbee.api.cluster.impl.core.AbstractCommand; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultSerializer; - -public class ZoneStatusChangeNotificationCommand extends AbstractCommand { - - private ZoneStatusChangeNotificationPayload cmdPayload; - - public ZoneStatusChangeNotificationCommand(ZoneStatusChangeNotificationPayload cmdPayload) { - super(IASZone.ZONE_STATUS_CHANGE_NOTIFICATION_ID); - this.cmdPayload = cmdPayload; - } - - public byte[] getPayload() { - if (payload == null) { - payload = new byte[3]; - ZBSerializer serializer = new DefaultSerializer(payload, 0); - serializer.append_short(cmdPayload.getZoneStatus()); - serializer.append_byte(cmdPayload.getExtendedStatus()); - } - - return payload; - } -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_zone/ZoneStatusChangeNotificationPayloadImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_zone/ZoneStatusChangeNotificationPayloadImpl.java deleted file mode 100644 index f6af0654dd8b8..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_zone/ZoneStatusChangeNotificationPayloadImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_zone; - -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_zone.ZoneStatusChangeNotificationPayload; - -public class ZoneStatusChangeNotificationPayloadImpl implements ZoneStatusChangeNotificationPayload { - - private short zoneStatus; - private byte extendedStatus; - - public ZoneStatusChangeNotificationPayloadImpl(ZoneStatusChangeNotificationPayload payload) { - - this.zoneStatus = payload.getZoneStatus(); - this.extendedStatus = payload.getExtendedStatus(); - } - - public short getZoneStatus() { - return zoneStatus; - } - - public byte getExtendedStatus() { - return extendedStatus; - } -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_zone/ZoneStatusChangeNotificationResponseImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_zone/ZoneStatusChangeNotificationResponseImpl.java deleted file mode 100644 index e72b9616da412..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/impl/security_safety/ias_zone/ZoneStatusChangeNotificationResponseImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.impl.security_safety.ias_zone; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.ZBDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_zone.ZoneStatusChangeNotificationResponse; -import org.bubblecloud.zigbee.api.cluster.impl.core.DefaultDeserializer; -import org.bubblecloud.zigbee.api.cluster.impl.core.ResponseImpl; - -public class ZoneStatusChangeNotificationResponseImpl extends ResponseImpl implements ZoneStatusChangeNotificationResponse { - - private short zoneStatus; - private byte extendedStatus; - - public ZoneStatusChangeNotificationResponseImpl(Response response) { - super(response); - - ZBDeserializer deserializer = new DefaultDeserializer(getPayload(), 0); - zoneStatus = deserializer.read_short(); - extendedStatus = deserializer.read_byte(); - } - - public short getZoneStatus() { - return zoneStatus; - } - - public byte getExtendedStatus() { - return extendedStatus; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/IlluminanceMeasurement.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/IlluminanceMeasurement.java deleted file mode 100644 index f7b2440463f86..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/IlluminanceMeasurement.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.measureament_sensing; - -import org.bubblecloud.zigbee.api.cluster.Cluster; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.event.MeasuredValueListener; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.event.ToleranceListener; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.7.0 - */ -public interface IlluminanceMeasurement extends Cluster { - - public Attribute getMeasuredValue(); - - public Attribute getMinMeasuredValue(); - - public Attribute getMaxMeasuredValue(); - - public Attribute getTolerance(); - - public Attribute getLightSensorType(); - - public boolean subscribe(MeasuredValueListener tl); - - public boolean unsubscribe(MeasuredValueListener tl); - - public boolean subscribe(ToleranceListener tl); - - public boolean unsubscribe(ToleranceListener tl); - - //public boolean subscribe(LightSensorTypeListener tl); - - //public boolean unsubscribe(LightSensorTypeListener tl); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/OccupancySensing.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/OccupancySensing.java deleted file mode 100644 index b890c3fc22e25..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/OccupancySensing.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.measureament_sensing; - -import org.bubblecloud.zigbee.api.cluster.Cluster; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.event.OccupancyListener; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; - -/** - * This class represent the Occupancy sensing Cluster as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * - * @author Stefano "Kismet" Lenzi - * @author Manlio Bacco - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface OccupancySensing extends Cluster { - - public Attribute getOccupancy(); - - /** - * @param listener The {@link OccupancyListener} to subscribe for events - * @since 0.2.0 - */ - public void subscribe(OccupancyListener listener); - - /** - * @param listener The {@link OccupancyListener} to unsubscribe - * @since 0.2.0 - */ - public void unsubscribe(OccupancyListener listener); - - public Attribute getOccupancySensorType(); - - public Attribute getPIROccupiedToUnoccupiedDelay(); - - public Attribute getPIRUnoccupiedToOccupiedDelay(); - - /** - * @since 0.7.0 - */ - public Attribute getPIRUnoccupiedToOccupiedThreshold(); - - public Attribute getUltraSonicOccupiedToUnoccupiedDelay(); - - public Attribute getUltraSonicUnoccupiedToOccupiedDelay(); - - /** - * @since 0.7.0 - */ - public Attribute getUltraSonicUnoccupiedToOccupiedThreshold(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/RelativeHumidityMeasurement.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/RelativeHumidityMeasurement.java deleted file mode 100644 index c0f7cb6d37440..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/RelativeHumidityMeasurement.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.measureament_sensing; - -import org.bubblecloud.zigbee.api.cluster.Cluster; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.event.MeasuredValueListener; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.event.ToleranceListener; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; - -/** - * This interface simplify the use of the cluster by avoiding the check of error messages and flow control. - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.4.0 - */ -public interface RelativeHumidityMeasurement extends Cluster { - - public Attribute getMeasuredValue(); - - public Attribute getMinMeasuredValue(); - - public Attribute getMaxMeasuredValue(); - - public Attribute getTolerance(); - - /** - * @param tl The {@link ToleranceListener} to subscribe for events - * @since 0.6.0 - */ - public boolean subscribe(ToleranceListener tl); - - /** - * @param tl The {@link ToleranceListener} to unsubscribe - * @since 0.6.0 - */ - public boolean unsubscribe(ToleranceListener tl); - - /** - * @param mvl The {@link MeasuredValueListener} to subscribe for events - * @since 0.6.0 - */ - public boolean subscribe(MeasuredValueListener mvl); - - /** - * @param mvl The {@link MeasuredValueListener} to unsubscribe - * @since 0.6.0 - */ - public boolean unsubscribe(MeasuredValueListener mvl); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/TemperatureMeasurement.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/TemperatureMeasurement.java deleted file mode 100644 index de655883064a8..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/TemperatureMeasurement.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.measureament_sensing; - -import org.bubblecloud.zigbee.api.cluster.Cluster; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.event.MeasuredValueListener; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.event.ToleranceListener; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public interface TemperatureMeasurement extends Cluster { - - public Attribute getMeasuredValue(); - - public Attribute getMinMeasuredValue(); - - public Attribute getMaxMeasuredValue(); - - public Attribute getTolerance(); - - /** - * @param tl The {@link ToleranceListener} to subscribe for events - * @since 0.6.0 - */ - public boolean subscribe(ToleranceListener tl); - - /** - * @param tl The {@link ToleranceListener} to unsubscribe - * @since 0.6.0 - */ - public boolean unsubscribe(ToleranceListener tl); - - /** - * @param mvl The {@link MeasuredValueListener} to subscribe for events - * @since 0.6.0 - */ - public boolean subscribe(MeasuredValueListener mvl); - - /** - * @param mvl The {@link MeasuredValueListener} to unsubscribe - * @since 0.6.0 - */ - public boolean unsubscribe(MeasuredValueListener mvl); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/event/LightSensorTypeEvent.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/event/LightSensorTypeEvent.java deleted file mode 100644 index 145ee3953c3ac..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/event/LightSensorTypeEvent.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.measureament_sensing.event; - -import org.bubblecloud.zigbee.api.cluster.Cluster; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.7.0 - */ -public interface LightSensorTypeEvent { - - public int getEvent(); - - public Cluster getSource(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/event/LightSensorTypeListener.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/event/LightSensorTypeListener.java deleted file mode 100644 index 5cabd50403c89..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/event/LightSensorTypeListener.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.measureament_sensing.event; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.7.0 - */ -public interface LightSensorTypeListener { - - public void changedLightSensorType(LightSensorTypeEvent event); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/event/MeasuredValueEvent.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/event/MeasuredValueEvent.java deleted file mode 100644 index 4ca4574270faa..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/event/MeasuredValueEvent.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.measureament_sensing.event; - -import org.bubblecloud.zigbee.api.cluster.Cluster; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.6.0 - */ -public interface MeasuredValueEvent { - - public int getEvent(); - - public Cluster getSource(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/event/MeasuredValueListener.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/event/MeasuredValueListener.java deleted file mode 100644 index 5b1a4781c92d4..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/event/MeasuredValueListener.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.measureament_sensing.event; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.6.0 - */ -public interface MeasuredValueListener { - - public void changedMeasuredValue(MeasuredValueEvent event); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/event/OccupancyEvent.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/event/OccupancyEvent.java deleted file mode 100644 index 21d0146314e6c..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/event/OccupancyEvent.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.measureament_sensing.event; - -import org.bubblecloud.zigbee.api.cluster.Cluster; - - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.2.0 - */ -public interface OccupancyEvent { - - public int getEvent(); - - public Cluster getSource(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/event/OccupancyListener.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/event/OccupancyListener.java deleted file mode 100644 index 0294d27a276f4..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/event/OccupancyListener.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.measureament_sensing.event; - - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.2.0 - */ -public interface OccupancyListener { - - public void changedOccupancy(OccupancyEvent event); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/event/ToleranceEvent.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/event/ToleranceEvent.java deleted file mode 100644 index 0ac24e4dedcd3..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/event/ToleranceEvent.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.measureament_sensing.event; - -import org.bubblecloud.zigbee.api.cluster.Cluster; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.6.0 - */ -public interface ToleranceEvent { - - public int getEvent(); - - public Cluster getSource(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/event/ToleranceListener.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/event/ToleranceListener.java deleted file mode 100644 index 36db00c449223..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/measureament_sensing/event/ToleranceListener.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.measureament_sensing.event; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.6.0 - */ -public interface ToleranceListener { - - public void changedTolerance(ToleranceEvent event); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/protocol_interfaces/AdvertiseProtocolAddressListener.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/protocol_interfaces/AdvertiseProtocolAddressListener.java deleted file mode 100755 index d2920d8d607ed..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/protocol_interfaces/AdvertiseProtocolAddressListener.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - Copyright 2013-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.protocol_interfaces; - - -/** - * @author Stefano "Kismet" Lenzi - ISTI-CNR - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public interface AdvertiseProtocolAddressListener { - - public void protocolAddressChanged(String protocolAddress); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/protocol_interfaces/GenericTunnel.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/protocol_interfaces/GenericTunnel.java deleted file mode 100755 index 2933780f6d1e6..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/protocol_interfaces/GenericTunnel.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - Copyright 2013-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.protocol_interfaces; - -import org.bubblecloud.zigbee.api.cluster.Cluster; - -/** - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.7.0 - */ -public interface GenericTunnel extends Cluster { - - public int getMaximumIncomingTransferSize(); - - public int getMaximumOutgoingTransferSize(); - - public int getProtocolAddress(); - - public void setProtocolAddress(int address); - - public MatchProtocolAddressResponse matchProtocolAddress(String protocolAddress); - - public boolean addAdvertiseProtocolAddressListener(AdvertiseProtocolAddressListener listener); - - public boolean removeAdvertiseProtocolAddressListener(AdvertiseProtocolAddressListener listener); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/protocol_interfaces/MatchProtocolAddressResponse.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/protocol_interfaces/MatchProtocolAddressResponse.java deleted file mode 100755 index 93f1181fe33e1..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/protocol_interfaces/MatchProtocolAddressResponse.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - Copyright 2013-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.cluster.protocol_interfaces; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; - - -/** - * @author Stefano "Kismet" Lenzi - ISTI-CNR - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public interface MatchProtocolAddressResponse extends Response { - - public long getIEEEAddress(); - - public String getProtocolAddress(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/security_safety/IASACE.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/security_safety/IASACE.java deleted file mode 100644 index c408371227e7b..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/security_safety/IASACE.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.security_safety; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.Cluster; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_ace.BypassPayload; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_ace.ZoneIDMapResponse; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_ace.ZoneInformationResponse; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.7.0 - */ -public interface IASACE extends Cluster { - - public Response arm(byte armMode) throws ZigBeeDeviceException; - - public void bypass(BypassPayload payload) throws ZigBeeDeviceException; - - public void emergency() throws ZigBeeDeviceException; - - public void fire() throws ZigBeeDeviceException; - - public void panic() throws ZigBeeDeviceException; - - public ZoneIDMapResponse getZoneIdMap() throws ZigBeeDeviceException; - - public ZoneInformationResponse getZoneInformation(int zoneID) throws ZigBeeDeviceException; -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/security_safety/IASWD.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/security_safety/IASWD.java deleted file mode 100644 index d6a42ecd612b4..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/security_safety/IASWD.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.security_safety; - -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.Cluster; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_wd.SquawkPayload; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_wd.StartWarningPayload; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Manlio Bacco - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public interface IASWD extends Cluster { - - public Attribute getMaxDuration(); - - public void startWarning(StartWarningPayload payload) throws ZigBeeDeviceException; - - public void squawk(SquawkPayload payload) throws ZigBeeDeviceException; -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/security_safety/IASZone.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/security_safety/IASZone.java deleted file mode 100644 index d2ec2b1ade3dd..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/cluster/security_safety/IASZone.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.cluster.security_safety; - -import org.bubblecloud.zigbee.api.cluster.Cluster; -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Attribute; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Response; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_zone.ZoneEnrollRequestPayload; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_zone.ZoneEnrollResponse; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_zone.ZoneStatusChangeNotificationListener; -import org.bubblecloud.zigbee.api.cluster.impl.api.security_safety.ias_zone.ZoneStatusChangeNotificationPayload; - -/** - * @author Stefano "Kismet" Lenzi - * @author Manlio Bacco - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public interface IASZone extends Cluster { - - public Attribute getZoneState(); - - public Attribute getZoneType(); - - public Attribute getZoneStatus(); - - public Attribute getIASCIEAddress(); - - public ZoneEnrollResponse zoneEnrollRequest(ZoneEnrollRequestPayload payload) throws ZigBeeDeviceException; - - /** - * @since 0.7.0 - */ - public Response zoneStatusChangeNotification(ZoneStatusChangeNotificationPayload payload) throws ZigBeeDeviceException; - - public boolean addZoneStatusChangeNotificationListener(ZoneStatusChangeNotificationListener listener); - - public boolean removeZoneStatusChangeNotificationListener(ZoneStatusChangeNotificationListener listener); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/generic/LevelControlSwitch.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/generic/LevelControlSwitch.java deleted file mode 100644 index 366e3c849402d..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/generic/LevelControlSwitch.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.device.generic; - -import org.bubblecloud.zigbee.api.ZigBeeApiConstants; -import org.bubblecloud.zigbee.api.Device; -import org.bubblecloud.zigbee.api.cluster.general.OnOffSwitchConfiguration; -import org.bubblecloud.zigbee.util.ArraysUtil; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public interface LevelControlSwitch extends Device { - - public static final int DEVICE_ID = 0x0001; - public static final String NAME = "Level Control Switch"; - - - public static final int[] MANDATORY = ArraysUtil.append(Device.MANDATORY, new int[]{ - ZigBeeApiConstants.CLUSTER_ID_ON_OFF_SWITCH_CONFIGURATION - }); - public static final int[] OPTIONAL = Device.OPTIONAL; - public static final int[] STANDARD = ArraysUtil.append(MANDATORY, OPTIONAL); - public static final int[] CUSTOM = {}; - - - /** - * Access method for the Mandatory cluster: {@link OnOffSwitchConfiguration} - * - * @return the {@link OnOffSwitchConfiguration} cluster object - */ - public OnOffSwitchConfiguration getOnOffSwitchConfiguration(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/generic/MainsPowerOutlet.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/generic/MainsPowerOutlet.java deleted file mode 100644 index 0e1cb63dfd34b..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/generic/MainsPowerOutlet.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.device.generic; - -import org.bubblecloud.zigbee.api.ZigBeeApiConstants; -import org.bubblecloud.zigbee.api.Device; -import org.bubblecloud.zigbee.api.cluster.general.Groups; -import org.bubblecloud.zigbee.api.cluster.general.OnOff; -import org.bubblecloud.zigbee.api.cluster.general.OnOffSwitchConfiguration; -import org.bubblecloud.zigbee.api.cluster.general.Scenes; -import org.bubblecloud.zigbee.util.ArraysUtil; - -/** - * @author Manlio Bacco - * @author Stefano "Kismet" Lenzi ISTI-CNR - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.7.0 - */ -public interface MainsPowerOutlet extends Device { - - public static final int DEVICE_ID = 0x0009; - public static final String NAME = "Mains Power Outlet"; - public static final int[] MANDATORY = ArraysUtil.append(Device.MANDATORY, new int[]{ - ZigBeeApiConstants.CLUSTER_ID_ON_OFF, ZigBeeApiConstants.CLUSTER_ID_SCENES, ZigBeeApiConstants.CLUSTER_ID_GROUPS - }); - public static final int[] OPTIONAL = Device.OPTIONAL; - public static final int[] STANDARD = ArraysUtil.append(MANDATORY, OPTIONAL); - public static final int[] CUSTOM = {}; - - - /** - * Access method for the Mandatory cluster: {@link OnOffSwitchConfiguration} - * - * @return the {@link OnOffSwitchConfiguration} cluster object - */ - public OnOff getOnOff(); - - public Scenes getScenes(); - - public Groups getGroups(); -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/generic/OnOffOutput.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/generic/OnOffOutput.java deleted file mode 100644 index ea324a165a229..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/generic/OnOffOutput.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.device.generic; - -import org.bubblecloud.zigbee.api.ZigBeeApiConstants; -import org.bubblecloud.zigbee.api.Device; -import org.bubblecloud.zigbee.api.cluster.general.Groups; -import org.bubblecloud.zigbee.api.cluster.general.OnOff; -import org.bubblecloud.zigbee.api.cluster.general.Scenes; -import org.bubblecloud.zigbee.util.ArraysUtil; - - -/** - * This class represent the On/Off Output Cluster as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.2.0 - */ -public interface OnOffOutput extends Device { - - public static final int DEVICE_ID = 0x0002; - public static final String NAME = "On/Off Output"; - - public static final int[] MANDATORY = ArraysUtil.append(Device.MANDATORY, new int[]{ - ZigBeeApiConstants.CLUSTER_ID_BASIC, ZigBeeApiConstants.CLUSTER_ID_IDENTIFY, ZigBeeApiConstants.CLUSTER_ID_ON_OFF, ZigBeeApiConstants.CLUSTER_ID_GROUPS, ZigBeeApiConstants.CLUSTER_ID_SCENES - }); - public static final int[] OPTIONAL = Device.OPTIONAL; - public static final int[] STANDARD = ArraysUtil.append(MANDATORY, OPTIONAL); - public static final int[] CUSTOM = {}; - - /** - * Access method for the Mandatory cluster: {@link OnOff} - * - * @return the {@link OnOff} cluster object - */ - public OnOff getOnOff(); - - /** - * Access method for the Mandatory cluster: {@link Scenes} - * - * @return the {@link Scenes} cluster object - */ - public Scenes getScenes(); - - /** - * Access method for the Mandatory cluster: {@link Groups} - * - * @return the {@link Groups} cluster object - */ - public Groups getGroups(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/generic/OnOffSwitch.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/generic/OnOffSwitch.java deleted file mode 100644 index f4678dbc81bb9..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/generic/OnOffSwitch.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.device.generic; - -import org.bubblecloud.zigbee.api.ZigBeeApiConstants; -import org.bubblecloud.zigbee.api.Device; -import org.bubblecloud.zigbee.api.cluster.general.OnOffSwitchConfiguration; -import org.bubblecloud.zigbee.util.ArraysUtil; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface OnOffSwitch extends Device { - - public static final int DEVICE_ID = 0x0000; - public static final String NAME = "OnOff Switch"; - public static final int[] MANDATORY = Device.MANDATORY; - public static final int[] OPTIONAL = ArraysUtil.append(Device.OPTIONAL, new int[]{ - ZigBeeApiConstants.CLUSTER_ID_ON_OFF_SWITCH_CONFIGURATION - }); - public static final int[] STANDARD = ArraysUtil.append(MANDATORY, OPTIONAL); - public static final int[] CUSTOM = {}; - - - /** - * Access method for the Mandatory cluster: {@link OnOffSwitchConfiguration} - * - * @return the {@link OnOffSwitchConfiguration} cluster object - */ - public OnOffSwitchConfiguration getOnOffSwitchConfiguration(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/generic/SimpleSensor.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/generic/SimpleSensor.java deleted file mode 100755 index 1c19137b9e966..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/generic/SimpleSensor.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Copyright 2013-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.device.generic; - - -import org.bubblecloud.zigbee.api.Device; -import org.bubblecloud.zigbee.api.ZigBeeApiConstants; -import org.bubblecloud.zigbee.api.cluster.general.BinaryInput; -import org.bubblecloud.zigbee.util.ArraysUtil; - - -/** - * @author Han Alink - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.7.0 - */ -public interface SimpleSensor extends Device { - - public static final int DEVICE_ID = 0x000C; - public static final String NAME = "Simple Sensor"; - public static final int[] MANDATORY = ArraysUtil.append(Device.MANDATORY, new int[]{ZigBeeApiConstants.CLUSTER_ID_BINARY_INPUT}); - public static final int[] OPTIONAL = Device.OPTIONAL; - public static final int[] STANDARD = ArraysUtil.append(MANDATORY, OPTIONAL); - public static final int[] CUSTOM = {}; - - /** - * Access method for the Mandatory cluster: {@link BinaryInput} - * - * @return the {@link BinaryInput} cluster object - */ - public BinaryInput getBinaryInput(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/hvac/Pump.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/hvac/Pump.java deleted file mode 100644 index 7a68cd3eb8ecc..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/hvac/Pump.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.device.hvac; - -import org.bubblecloud.zigbee.api.ZigBeeApiConstants; -import org.bubblecloud.zigbee.api.Device; -import org.bubblecloud.zigbee.api.cluster.general.Alarms; -import org.bubblecloud.zigbee.api.cluster.general.Groups; -import org.bubblecloud.zigbee.api.cluster.general.LevelControl; -import org.bubblecloud.zigbee.api.cluster.general.OnOff; -import org.bubblecloud.zigbee.api.cluster.general.Scenes; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.TemperatureMeasurement; -import org.bubblecloud.zigbee.util.ArraysUtil; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.7.0 - */ -public interface Pump extends Device { - - public static final int DEVICE_ID = 0x0303; - public static final String NAME = "Pump"; - - public static final int[] MANDATORY = ArraysUtil.append(Device.MANDATORY, new int[]{ - /* TODO ZigBeeApiConstants.CLUSTER_ID_PUMP_CONFIGURATION_AND_CONTROL, */ZigBeeApiConstants.CLUSTER_ID_ON_OFF, ZigBeeApiConstants.CLUSTER_ID_SCENES, ZigBeeApiConstants.CLUSTER_ID_GROUPS - }); - - public static final int[] OPTIONAL = ArraysUtil.append(Device.OPTIONAL, new int[]{ - ZigBeeApiConstants.CLUSTER_ID_LEVEL_CONTROL, ZigBeeApiConstants.CLUSTER_ID_ALARMS, ZigBeeApiConstants.CLUSTER_ID_TEMPERATURE_MEASUREMENT, /* TODO ZigBeeApiConstants.CLUSTER_ID_PRESSURE_MEASUREMENT, ZigBeeApiConstants.FLOW_MEASUREMENT*/ - }); - - public static final int[] STANDARD = ArraysUtil.append(MANDATORY, OPTIONAL); - public static final int[] CUSTOM = {}; - - /** - * Access method for the Mandatory cluster: {@link TemperatureMeasurement} - * - * @return the {@link TemperatureMeasurement} cluster object - */ - public OnOff getOnOff(); - - public Scenes getScenes(); - - public Groups getGroups(); - - public LevelControl getLevelControl(); - - public Alarms getAlarms(); - - public TemperatureMeasurement getTemperatureMeasurement(); - - //public CLUSTER_ID_PUMP_CONFIGURATION_AND_CONTROL getPUMP_CONFIGURATION_AND_CONTROL(); - - //public CLUSTER_ID_PRESSURE_MEASUREMENT getPRESSURE_MEASUREMENT(); - - //public FLOW_MEASUREMENT getFLOW_MEASUREMENT(); -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/hvac/TemperatureSensor.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/hvac/TemperatureSensor.java deleted file mode 100644 index 0e03ef594d9cd..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/hvac/TemperatureSensor.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.device.hvac; - -import org.bubblecloud.zigbee.api.ZigBeeApiConstants; -import org.bubblecloud.zigbee.api.Device; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.TemperatureMeasurement; -import org.bubblecloud.zigbee.util.ArraysUtil; - -/** - * This class represent the On/off Light Cluster as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.6.0 - */ -public interface TemperatureSensor extends Device { - - public static final int DEVICE_ID = 0x0302; - public static final String NAME = "Temperature Sensor"; - - public static final int[] MANDATORY = ArraysUtil.append(Device.MANDATORY, new int[]{ - ZigBeeApiConstants.CLUSTER_ID_TEMPERATURE_MEASUREMENT - }); - - public static final int[] OPTIONAL = ArraysUtil.append(Device.OPTIONAL, new int[]{ - }); - - public static final int[] STANDARD = ArraysUtil.append(MANDATORY, OPTIONAL); - public static final int[] CUSTOM = {}; - - /** - * Access method for the Mandatory cluster: {@link TemperatureMeasurement} - * - * @return the {@link TemperatureMeasurement} cluster object - */ - public TemperatureMeasurement getTemperatureMeasurement(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/ColorDimmableLightDevice.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/ColorDimmableLightDevice.java deleted file mode 100644 index ce3b95626f45e..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/ColorDimmableLightDevice.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.device.impl; - -import org.bubblecloud.zigbee.api.ZigBeeApiConstants; -import org.bubblecloud.zigbee.ZigBeeApiContext; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.OccupancySensing; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.*; -import org.bubblecloud.zigbee.api.cluster.general.Groups; -import org.bubblecloud.zigbee.api.cluster.general.LevelControl; -import org.bubblecloud.zigbee.api.cluster.general.OnOff; -import org.bubblecloud.zigbee.api.cluster.general.Scenes; -import org.bubblecloud.zigbee.api.cluster.general.ColorControl; -import org.bubblecloud.zigbee.api.device.lighting.ColorDimmableLight; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.7.0 - */ -public class ColorDimmableLightDevice extends DeviceBase implements ColorDimmableLight { - - private OnOff onOff; - private Scenes scenes; - private Groups groups; - private LevelControl levelControl; - private OccupancySensing occupancySensing; - private ColorControl colorControl; - - public ColorDimmableLightDevice(ZigBeeApiContext ctx, ZigBeeEndpoint zbDevice) throws ZigBeeDeviceException { - - super(ctx, zbDevice); - - onOff = (OnOff) getCluster(ZigBeeApiConstants.CLUSTER_ID_ON_OFF); - scenes = (Scenes) getCluster(ZigBeeApiConstants.CLUSTER_ID_SCENES); - groups = (Groups) getCluster(ZigBeeApiConstants.CLUSTER_ID_GROUPS); - levelControl = (LevelControl) getCluster(ZigBeeApiConstants.DEVICE_ID_LEVEL_CONTROL); - occupancySensing = (OccupancySensing) getCluster(ZigBeeApiConstants.CLUSTER_ID_OCCUPANCY_SENSING); - colorControl = (ColorControl) getCluster(ZigBeeApiConstants.CLUSTER_ID_COLOR_CONTROL); - } - - final static DeviceDescription DEVICE_DESCRIPTOR = new AbstractDeviceDescription() { - - public int[] getCustomClusters() { - return ColorDimmableLight.CUSTOM; - } - - public int[] getMandatoryCluster() { - return ColorDimmableLight.MANDATORY; - } - - public int[] getOptionalCluster() { - return ColorDimmableLight.OPTIONAL; - } - - public int[] getStandardClusters() { - return ColorDimmableLight.STANDARD; - } - }; - - public OnOff getOnOff() { - return onOff; - } - - public Scenes getScenes() { - return scenes; - } - - public Groups getGroups() { - return groups; - } - - public LevelControl getLevelControl() { - return levelControl; - } - - public OccupancySensing getOccupacySensing() { - return occupancySensing; - } - - public ColorControl getColorControl() { - return colorControl; - } - - @Override - public String getDeviceType() { - return ColorDimmableLight.NAME; - } - - @Override - public DeviceDescription getDescription() { - return DEVICE_DESCRIPTOR; - } -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/DimmableLightDevice.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/DimmableLightDevice.java deleted file mode 100644 index 7a77d0f9aa820..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/DimmableLightDevice.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.device.impl; - -import org.bubblecloud.zigbee.api.ZigBeeApiConstants; -import org.bubblecloud.zigbee.ZigBeeApiContext; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.OccupancySensing; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.*; -import org.bubblecloud.zigbee.api.cluster.general.Groups; -import org.bubblecloud.zigbee.api.cluster.general.LevelControl; -import org.bubblecloud.zigbee.api.cluster.general.OnOff; -import org.bubblecloud.zigbee.api.cluster.general.Scenes; -import org.bubblecloud.zigbee.api.device.lighting.DimmableLight; -import org.bubblecloud.zigbee.api.DeviceBase; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class DimmableLightDevice extends DeviceBase implements DimmableLight { - - private OnOff onOff; - private LevelControl levelControl; - private Scenes scenes; - private Groups groups; - private OccupancySensing occupancySensing; - - public DimmableLightDevice(ZigBeeApiContext ctx, ZigBeeEndpoint zbDevice) throws ZigBeeDeviceException { - super(ctx, zbDevice); - levelControl = (LevelControl) getCluster(ZigBeeApiConstants.CLUSTER_ID_LEVEL_CONTROL); - onOff = (OnOff) getCluster(ZigBeeApiConstants.CLUSTER_ID_ON_OFF); - groups = (Groups) getCluster(ZigBeeApiConstants.CLUSTER_ID_GROUPS); - scenes = (Scenes) getCluster(ZigBeeApiConstants.CLUSTER_ID_SCENES); - occupancySensing = (OccupancySensing) getCluster(ZigBeeApiConstants.CLUSTER_ID_OCCUPANCY_SENSING); - } - - final static DeviceDescription DEVICE_DESCRIPTOR = new AbstractDeviceDescription() { - - public int[] getCustomClusters() { - return DimmableLight.CUSTOM; - } - - public int[] getMandatoryCluster() { - return DimmableLight.MANDATORY; - } - - public int[] getOptionalCluster() { - return DimmableLight.OPTIONAL; - } - - public int[] getStandardClusters() { - return DimmableLight.STANDARD; - } - - }; - - - public DeviceDescription getDescription() { - return DEVICE_DESCRIPTOR; - } - - @Override - public String getDeviceType() { - return DimmableLight.NAME; - } - - public Groups getGroups() { - return groups; - } - - public LevelControl getLevelControl() { - return levelControl; - } - - public OccupancySensing getOccupacySensing() { - return occupancySensing; - } - - public OnOff getOnOff() { - return onOff; - } - - public Scenes getScenes() { - return scenes; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/GenericDevice.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/GenericDevice.java deleted file mode 100644 index 6def01406d9d5..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/GenericDevice.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.device.impl; - -import org.bubblecloud.zigbee.ZigBeeApiContext; -import org.bubblecloud.zigbee.api.DeviceBase; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.AbstractDeviceDescription; -import org.bubblecloud.zigbee.api.DeviceDescription; - -import java.util.ArrayList; - -/** - * This class should be used by the refinment driver when there is no device matching the DeviceId
- * of the service - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Manlio Bacco - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class GenericDevice extends DeviceBase { - - private int[] mandatory; - private int[] optional; - private int[] standard; - private int[] custom; - - public GenericDevice(ZigBeeApiContext ctx, ZigBeeEndpoint zbDevice) throws ZigBeeDeviceException { - super(ctx, zbDevice); - - mandatory = new int[0]; // we don't know the device so we cannot distinuish - optional = new int[0]; - - int[] clusterIDs = zbDevice.getInputClusters(); - ArrayList standardList = new ArrayList(); - ArrayList customList = new ArrayList(); - for (int i = 0; i < clusterIDs.length; i++) { -// if (ZigBeeApiConstants.clusters.containsKey(clusterIDs[i])){ -// standardList.add(clusterIDs[i]); -// } else { -// customList.add(clusterIDs[i]); -// } - } - standard = new int[standardList.size()]; - for (int i = 0; i < standard.length; i++) { - standard[i] = standardList.get(i).intValue(); - } - custom = new int[customList.size()]; - for (int i = 0; i < custom.length; i++) { - custom[i] = customList.get(i).intValue(); - } - - for (int i = 0; i < standard.length; i++) { - addCluster(standard[i]); - } - } - - - final DeviceDescription descriptor = new AbstractDeviceDescription() { - - public int[] getCustomClusters() { - return custom; - } - - public int[] getMandatoryCluster() { - return mandatory; - } - - public int[] getOptionalCluster() { - return optional; - } - - public int[] getStandardClusters() { - return standard; - } - - }; - - @Override - public DeviceDescription getDescription() { - return descriptor; - } - - @Override - public String getDeviceType() { - return "Generic HA Device"; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/IASAncillaryControlEquipmentDevice.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/IASAncillaryControlEquipmentDevice.java deleted file mode 100644 index dad8d90009f77..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/IASAncillaryControlEquipmentDevice.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.device.impl; - -import org.bubblecloud.zigbee.api.ZigBeeApiConstants; -import org.bubblecloud.zigbee.ZigBeeApiContext; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.*; -import org.bubblecloud.zigbee.api.cluster.general.Identify; -import org.bubblecloud.zigbee.api.cluster.security_safety.IASACE; -import org.bubblecloud.zigbee.api.cluster.security_safety.IASZone; -import org.bubblecloud.zigbee.api.device.security_safety.IASAncillaryControlEquipment; -import org.bubblecloud.zigbee.api.DeviceBase; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.7.0 - */ -public class IASAncillaryControlEquipmentDevice extends DeviceBase implements IASAncillaryControlEquipment { - - private Identify identify; - private IASZone iasZone; - private IASACE iasAce; - - public IASAncillaryControlEquipmentDevice(ZigBeeApiContext ctx, ZigBeeEndpoint zbDevice) throws ZigBeeDeviceException { - - super(ctx, zbDevice); - iasAce = (IASACE) getCluster(ZigBeeApiConstants.CLUSTER_ID_IAS_ACE); - iasZone = (IASZone) getCluster(ZigBeeApiConstants.CLUSTER_ID_IAS_ZONE); - identify = (Identify) getCluster(ZigBeeApiConstants.CLUSTER_ID_IDENTIFY); - } - - public IASACE getIASACE() { - return iasAce; - } - - public IASZone getIASZone() { - return iasZone; - } - - /*public Identify getIdentify(){ - return identify; - }*/ - - @Override - public String getDeviceType() { - return IASAncillaryControlEquipment.NAME; - } - - @Override - public DeviceDescription getDescription() { - - return DEVICE_DESCRIPTOR; - } - - final static DeviceDescription DEVICE_DESCRIPTOR = new AbstractDeviceDescription() { - - public int[] getCustomClusters() { - return IASAncillaryControlEquipment.CUSTOM; - } - - public int[] getMandatoryCluster() { - return IASAncillaryControlEquipment.MANDATORY; - } - - public int[] getOptionalCluster() { - return IASAncillaryControlEquipment.OPTIONAL; - } - - public int[] getStandardClusters() { - return IASAncillaryControlEquipment.STANDARD; - } - }; -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/IASControlAndIndicatingEquipmentDevice.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/IASControlAndIndicatingEquipmentDevice.java deleted file mode 100644 index 17ce2fc73dcbf..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/IASControlAndIndicatingEquipmentDevice.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.device.impl; - -import org.bubblecloud.zigbee.api.ZigBeeApiConstants; -import org.bubblecloud.zigbee.ZigBeeApiContext; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.*; -import org.bubblecloud.zigbee.api.cluster.general.Groups; -import org.bubblecloud.zigbee.api.cluster.general.Identify; -import org.bubblecloud.zigbee.api.cluster.general.Scenes; -import org.bubblecloud.zigbee.api.cluster.security_safety.IASACE; -import org.bubblecloud.zigbee.api.cluster.security_safety.IASWD; -import org.bubblecloud.zigbee.api.cluster.security_safety.IASZone; -import org.bubblecloud.zigbee.api.device.security_safety.IASControlAndIndicatingEquipment; -import org.bubblecloud.zigbee.api.DeviceBase; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.7.0 - */ -public class IASControlAndIndicatingEquipmentDevice extends DeviceBase implements IASControlAndIndicatingEquipment { - - private Identify identify; - private IASZone iasZone; - private IASACE iasAce; - private IASWD iasWD; - private Scenes scenes; - private Groups groups; - - public IASControlAndIndicatingEquipmentDevice(ZigBeeApiContext ctx, ZigBeeEndpoint zbDevice) throws ZigBeeDeviceException { - - super(ctx, zbDevice); - - iasAce = (IASACE) getCluster(ZigBeeApiConstants.CLUSTER_ID_IAS_ACE); - iasZone = (IASZone) getCluster(ZigBeeApiConstants.CLUSTER_ID_IAS_ZONE); - identify = (Identify) getCluster(ZigBeeApiConstants.CLUSTER_ID_IDENTIFY); - iasWD = (IASWD) getCluster(ZigBeeApiConstants.CLUSTER_ID_IAS_WD); - scenes = (Scenes) getCluster(ZigBeeApiConstants.CLUSTER_ID_SCENES); - groups = (Groups) getCluster(ZigBeeApiConstants.CLUSTER_ID_GROUPS); - } - - public IASACE getIASACE() { - return iasAce; - } - - public IASZone getIASZone() { - return iasZone; - } - - public IASWD getIASwd() { - return iasWD; - } - - public Scenes getScenes() { - return scenes; - } - - public Groups getGroups() { - return groups; - } - - public Identify getIdentify() { - return identify; - } - - @Override - public String getDeviceType() { - return IASControlAndIndicatingEquipment.NAME; - } - - @Override - public DeviceDescription getDescription() { - - return DEVICE_DESCRIPTOR; - } - - final static DeviceDescription DEVICE_DESCRIPTOR = new AbstractDeviceDescription() { - - public int[] getCustomClusters() { - return IASControlAndIndicatingEquipment.CUSTOM; - } - - public int[] getMandatoryCluster() { - return IASControlAndIndicatingEquipment.MANDATORY; - } - - public int[] getOptionalCluster() { - return IASControlAndIndicatingEquipment.OPTIONAL; - } - - public int[] getStandardClusters() { - return IASControlAndIndicatingEquipment.STANDARD; - } - }; -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/IAS_Warning_Device.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/IAS_Warning_Device.java deleted file mode 100644 index 9ce45d312476e..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/IAS_Warning_Device.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.device.impl; - -import org.bubblecloud.zigbee.api.ZigBeeApiConstants; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.*; -import org.bubblecloud.zigbee.api.cluster.general.Groups; -import org.bubblecloud.zigbee.api.cluster.general.Scenes; -import org.bubblecloud.zigbee.api.cluster.security_safety.IASWD; -import org.bubblecloud.zigbee.api.cluster.security_safety.IASZone; -import org.bubblecloud.zigbee.api.device.security_safety.IAS_Warning; -import org.bubblecloud.zigbee.api.DeviceBase; -import org.bubblecloud.zigbee.ZigBeeApiContext; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.7.0 - */ -public class IAS_Warning_Device extends DeviceBase implements IAS_Warning { - - private IASZone iasZoneCluster; - private IASWD iasWD; - private Scenes scenes; - private Groups groups; - - public IAS_Warning_Device(ZigBeeApiContext ctx, ZigBeeEndpoint zbDevice) throws ZigBeeDeviceException { - - super(ctx, zbDevice); - - iasZoneCluster = (IASZone) getCluster(ZigBeeApiConstants.CLUSTER_ID_IAS_ZONE); - iasWD = (IASWD) getCluster(ZigBeeApiConstants.CLUSTER_ID_IAS_WD); - - scenes = (Scenes) getCluster(ZigBeeApiConstants.CLUSTER_ID_SCENES); - groups = (Groups) getCluster(ZigBeeApiConstants.CLUSTER_ID_GROUPS); - } - - public IASZone getIASZone() { - - return iasZoneCluster; - } - - public IASWD getIASWD() { - - return iasWD; - } - - public Scenes getScenes() { - - return scenes; - } - - public Groups getGroups() { - - return groups; - } - - @Override - public String getDeviceType() { - - return IAS_Warning_Device.NAME; - } - - @Override - public DeviceDescription getDescription() { - - return DEVICE_DESCRIPTOR; - } - - final static DeviceDescription DEVICE_DESCRIPTOR = new AbstractDeviceDescription() { - - public int[] getCustomClusters() { - return IAS_Warning.CUSTOM; - } - - public int[] getMandatoryCluster() { - return IAS_Warning.MANDATORY; - } - - public int[] getOptionalCluster() { - return IAS_Warning.OPTIONAL; - } - - public int[] getStandardClusters() { - return IAS_Warning.STANDARD; - } - }; -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/IAS_ZoneDevice.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/IAS_ZoneDevice.java deleted file mode 100644 index df6b9d018a8cb..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/IAS_ZoneDevice.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.device.impl; - -import org.bubblecloud.zigbee.ZigBeeApiContext; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.*; -import org.bubblecloud.zigbee.api.cluster.security_safety.IASZone; -import org.bubblecloud.zigbee.api.device.security_safety.IAS_Zone; -import org.bubblecloud.zigbee.api.ZigBeeApiConstants; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.7.0 - */ -public class IAS_ZoneDevice extends DeviceBase implements IAS_Zone { - - private IASZone iasZoneCluster; - - public IAS_ZoneDevice(ZigBeeApiContext ctx, ZigBeeEndpoint zbDevice) throws ZigBeeDeviceException { - - super(ctx, zbDevice); - - iasZoneCluster = (IASZone) getCluster(ZigBeeApiConstants.CLUSTER_ID_IAS_ZONE); - } - - public IASZone getIASZone() { - - return iasZoneCluster; - } - - @Override - public String getDeviceType() { - - return IAS_Zone.NAME; - } - - @Override - public DeviceDescription getDescription() { - - return DEVICE_DESCRIPTOR; - } - - final static DeviceDescription DEVICE_DESCRIPTOR = new AbstractDeviceDescription() { - - public int[] getCustomClusters() { - return IAS_Zone.CUSTOM; - } - - public int[] getMandatoryCluster() { - return IAS_Zone.MANDATORY; - } - - public int[] getOptionalCluster() { - return IAS_Zone.OPTIONAL; - } - - public int[] getStandardClusters() { - return IAS_Zone.STANDARD; - } - }; -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/LevelControlSwitchDevice.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/LevelControlSwitchDevice.java deleted file mode 100644 index 75addfc9fbb62..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/LevelControlSwitchDevice.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.device.impl; - -import org.bubblecloud.zigbee.api.ZigBeeApiConstants; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.*; -import org.bubblecloud.zigbee.api.cluster.general.OnOffSwitchConfiguration; -import org.bubblecloud.zigbee.api.device.generic.LevelControlSwitch; -import org.bubblecloud.zigbee.ZigBeeApiContext; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class LevelControlSwitchDevice extends DeviceBase implements LevelControlSwitch { - - private OnOffSwitchConfiguration onOffSwitchConfiguration; - - public LevelControlSwitchDevice(ZigBeeApiContext ctx, ZigBeeEndpoint zbDevice) throws ZigBeeDeviceException { - super(ctx, zbDevice); - onOffSwitchConfiguration = (OnOffSwitchConfiguration) getCluster(ZigBeeApiConstants.CLUSTER_ID_ON_OFF_SWITCH_CONFIGURATION); - } - - final static DeviceDescription DEVICE_DESCRIPTOR = new AbstractDeviceDescription() { - - public int[] getCustomClusters() { - return LevelControlSwitch.CUSTOM; - } - - public int[] getMandatoryCluster() { - return LevelControlSwitch.MANDATORY; - } - - public int[] getOptionalCluster() { - return LevelControlSwitch.OPTIONAL; - } - - public int[] getStandardClusters() { - return LevelControlSwitch.STANDARD; - } - - }; - - @Override - public DeviceDescription getDescription() { - return DEVICE_DESCRIPTOR; - } - - @Override - public String getDeviceType() { - return LevelControlSwitch.NAME; - } - - public OnOffSwitchConfiguration getOnOffSwitchConfiguration() { - return onOffSwitchConfiguration; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/LightSensorDevice.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/LightSensorDevice.java deleted file mode 100644 index 59183d4ae6430..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/LightSensorDevice.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.device.impl; - -import org.bubblecloud.zigbee.api.ZigBeeApiConstants; -import org.bubblecloud.zigbee.ZigBeeApiContext; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.*; -import org.bubblecloud.zigbee.api.cluster.general.Groups; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.IlluminanceMeasurement; -import org.bubblecloud.zigbee.api.device.lighting.LightSensor; -import org.bubblecloud.zigbee.api.DeviceBase; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.7.0 - */ -public class LightSensorDevice extends DeviceBase implements LightSensor { - - private IlluminanceMeasurement illuminanceMeasurement; - private Groups groups; - - public LightSensorDevice(ZigBeeApiContext ctx, ZigBeeEndpoint zbDevice) throws ZigBeeDeviceException { - - super(ctx, zbDevice); - - illuminanceMeasurement = (IlluminanceMeasurement) getCluster(ZigBeeApiConstants.CLUSTER_ID_ILLUMINANCE_MEASUREMENT); - groups = (Groups) getCluster(ZigBeeApiConstants.CLUSTER_ID_GROUPS); - } - - public IlluminanceMeasurement getIlluminanceMeasurement() { - - return illuminanceMeasurement; - } - - @Override - public String getDeviceType() { - - return LightSensor.NAME; - } - - @Override - public DeviceDescription getDescription() { - - return DEVICE_DESCRIPTOR; - } - - final static DeviceDescription DEVICE_DESCRIPTOR = new AbstractDeviceDescription() { - - public int[] getCustomClusters() { - return LightSensor.CUSTOM; - } - - public int[] getMandatoryCluster() { - return LightSensor.MANDATORY; - } - - public int[] getOptionalCluster() { - return LightSensor.OPTIONAL; - } - - public int[] getStandardClusters() { - return LightSensor.STANDARD; - } - - }; - - public Groups getGroups() { - return groups; - } -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/MainsPowerOutletDevice.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/MainsPowerOutletDevice.java deleted file mode 100644 index a5333189040c9..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/MainsPowerOutletDevice.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.device.impl; - -import org.bubblecloud.zigbee.api.ZigBeeApiConstants; -import org.bubblecloud.zigbee.ZigBeeApiContext; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.*; -import org.bubblecloud.zigbee.api.cluster.general.Groups; -import org.bubblecloud.zigbee.api.cluster.general.OnOff; -import org.bubblecloud.zigbee.api.cluster.general.Scenes; -import org.bubblecloud.zigbee.api.device.generic.MainsPowerOutlet; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.7.0 - */ -public class MainsPowerOutletDevice extends DeviceBase implements MainsPowerOutlet { - - private OnOff onOff; - private Scenes scenes; - private Groups groups; - - public MainsPowerOutletDevice(ZigBeeApiContext ctx, ZigBeeEndpoint zbDevice) throws ZigBeeDeviceException { - - super(ctx, zbDevice); - onOff = (OnOff) getCluster(ZigBeeApiConstants.CLUSTER_ID_ON_OFF); - groups = (Groups) getCluster(ZigBeeApiConstants.CLUSTER_ID_GROUPS); - scenes = (Scenes) getCluster(ZigBeeApiConstants.CLUSTER_ID_SCENES); - } - - public OnOff getOnOff() { - - return onOff; - } - - public Scenes getScenes() { - - return scenes; - } - - public Groups getGroups() { - - return groups; - } - - @Override - public String getDeviceType() { - - return MainsPowerOutlet.NAME; - } - - @Override - public DeviceDescription getDescription() { - - return DEVICE_DESCRIPTOR; - } - - final static DeviceDescription DEVICE_DESCRIPTOR = new AbstractDeviceDescription() { - - public int[] getCustomClusters() { - return MainsPowerOutlet.CUSTOM; - } - - public int[] getMandatoryCluster() { - return MainsPowerOutlet.MANDATORY; - } - - public int[] getOptionalCluster() { - return MainsPowerOutlet.OPTIONAL; - } - - public int[] getStandardClusters() { - return MainsPowerOutlet.STANDARD; - } - - }; -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/OccupancySensorDevice.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/OccupancySensorDevice.java deleted file mode 100644 index fd173dc8b2e3e..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/OccupancySensorDevice.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.device.impl; - -import org.bubblecloud.zigbee.api.ZigBeeApiConstants; -import org.bubblecloud.zigbee.ZigBeeApiContext; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.OccupancySensing; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.*; -import org.bubblecloud.zigbee.api.device.lighting.OccupancySensor; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.2.0 - */ -public class OccupancySensorDevice extends DeviceBase implements OccupancySensor { - - private OccupancySensing occupancySensing; - - public OccupancySensorDevice(ZigBeeApiContext ctx, ZigBeeEndpoint zbDevice) throws ZigBeeDeviceException { - super(ctx, zbDevice); - occupancySensing = (OccupancySensing) getCluster(ZigBeeApiConstants.CLUSTER_ID_OCCUPANCY_SENSING); - } - - public OccupancySensing getOccupacySensing() { - return occupancySensing; - } - - - @Override - public String getDeviceType() { - return OccupancySensor.NAME; - } - - final static DeviceDescription DEVICE_DESCRIPTOR = new AbstractDeviceDescription() { - - public int[] getCustomClusters() { - return OccupancySensor.CUSTOM; - } - - public int[] getMandatoryCluster() { - return OccupancySensor.MANDATORY; - } - - public int[] getOptionalCluster() { - return OccupancySensor.OPTIONAL; - } - - public int[] getStandardClusters() { - return OccupancySensor.STANDARD; - } - - }; - - @Override - public DeviceDescription getDescription() { - return DEVICE_DESCRIPTOR; - } - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/OnOffLightDevice.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/OnOffLightDevice.java deleted file mode 100644 index da4994940445f..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/OnOffLightDevice.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.device.impl; - -import org.bubblecloud.zigbee.api.ZigBeeApiConstants; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.OccupancySensing; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.*; -import org.bubblecloud.zigbee.api.cluster.general.Groups; -import org.bubblecloud.zigbee.api.cluster.general.OnOff; -import org.bubblecloud.zigbee.api.cluster.general.Scenes; -import org.bubblecloud.zigbee.api.device.lighting.OnOffLight; -import org.bubblecloud.zigbee.ZigBeeApiContext; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class OnOffLightDevice extends DeviceBase implements OnOffLight { - - private OnOff onOff; - private Scenes scenes; - private Groups groups; - private OccupancySensing occupancySensing; - - public OnOffLightDevice(ZigBeeApiContext ctx, ZigBeeEndpoint zbDevice) throws ZigBeeDeviceException { - super(ctx, zbDevice); - onOff = (OnOff) getCluster(ZigBeeApiConstants.CLUSTER_ID_ON_OFF); - groups = (Groups) getCluster(ZigBeeApiConstants.CLUSTER_ID_GROUPS); - scenes = (Scenes) getCluster(ZigBeeApiConstants.CLUSTER_ID_SCENES); - occupancySensing = (OccupancySensing) getCluster(ZigBeeApiConstants.CLUSTER_ID_OCCUPANCY_SENSING); - } - - - public Groups getGroups() { - return groups; - } - - public OccupancySensing getOccupacySensing() { - return occupancySensing; - } - - public OnOff getOnOff() { - return onOff; - } - - public Scenes getScenes() { - return scenes; - } - - - @Override - public String getDeviceType() { - return OnOffLight.NAME; - } - - final static DeviceDescription DEVICE_DESCRIPTOR = new AbstractDeviceDescription() { - - public int[] getCustomClusters() { - return OnOffLight.CUSTOM; - } - - public int[] getMandatoryCluster() { - return OnOffLight.MANDATORY; - } - - public int[] getOptionalCluster() { - return OnOffLight.OPTIONAL; - } - - public int[] getStandardClusters() { - return OnOffLight.STANDARD; - } - - }; - - @Override - public DeviceDescription getDescription() { - return DEVICE_DESCRIPTOR; - } - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/OnOffLightSwitchDevice.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/OnOffLightSwitchDevice.java deleted file mode 100644 index 88f55365970e0..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/OnOffLightSwitchDevice.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.device.impl; - -import org.bubblecloud.zigbee.ZigBeeApiContext; -import org.bubblecloud.zigbee.api.DeviceBase; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.cluster.general.OnOffSwitchConfiguration; -import org.bubblecloud.zigbee.api.device.generic.OnOffSwitch; -import org.bubblecloud.zigbee.api.device.lighting.OnOffLightSwitch; -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.AbstractDeviceDescription; -import org.bubblecloud.zigbee.api.DeviceDescription; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class OnOffLightSwitchDevice extends DeviceBase implements OnOffLightSwitch { - - private OnOffSwitchConfiguration onOffSwitchConfiguration; - - public OnOffLightSwitchDevice(ZigBeeApiContext ctx, ZigBeeEndpoint zbDevice) throws ZigBeeDeviceException { - super(ctx, zbDevice); - } - - final static DeviceDescription DEVICE_DESCRIPTOR = new AbstractDeviceDescription() { - - public int[] getCustomClusters() { - return OnOffLightSwitch.CUSTOM; - } - - public int[] getMandatoryCluster() { - return OnOffLightSwitch.MANDATORY; - } - - public int[] getOptionalCluster() { - return OnOffLightSwitch.OPTIONAL; - } - - public int[] getStandardClusters() { - return OnOffLightSwitch.STANDARD; - } - - }; - - @Override - public DeviceDescription getDescription() { - return DEVICE_DESCRIPTOR; - } - - @Override - public String getDeviceType() { - return OnOffSwitch.NAME; - } - - public OnOffSwitchConfiguration getOnOffSwitchConfiguration() { - return onOffSwitchConfiguration; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/OnOffOutputDevice.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/OnOffOutputDevice.java deleted file mode 100644 index bb8d435e7858f..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/OnOffOutputDevice.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.device.impl; - -import org.bubblecloud.zigbee.api.ZigBeeApiConstants; -import org.bubblecloud.zigbee.ZigBeeApiContext; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.*; -import org.bubblecloud.zigbee.api.cluster.general.Groups; -import org.bubblecloud.zigbee.api.cluster.general.OnOff; -import org.bubblecloud.zigbee.api.cluster.general.Scenes; -import org.bubblecloud.zigbee.api.device.generic.OnOffOutput; -import org.bubblecloud.zigbee.api.device.lighting.OnOffLight; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.2.0 - */ -public class OnOffOutputDevice extends DeviceBase implements OnOffOutput { - - private OnOff onOff; - private Scenes scenes; - private Groups groups; - - public OnOffOutputDevice(ZigBeeApiContext ctx, ZigBeeEndpoint zbDevice) throws ZigBeeDeviceException { - super(ctx, zbDevice); - onOff = (OnOff) getCluster(ZigBeeApiConstants.CLUSTER_ID_ON_OFF); - groups = (Groups) getCluster(ZigBeeApiConstants.CLUSTER_ID_GROUPS); - scenes = (Scenes) getCluster(ZigBeeApiConstants.CLUSTER_ID_SCENES); - } - - - public Groups getGroups() { - return groups; - } - - public OnOff getOnOff() { - return onOff; - } - - public Scenes getScenes() { - return scenes; - } - - - @Override - public String getDeviceType() { - return OnOffOutput.NAME; - } - - public final static DeviceDescription DEVICE_DESCRIPTOR = new AbstractDeviceDescription() { - - public int[] getCustomClusters() { - return OnOffLight.CUSTOM; - } - - public int[] getMandatoryCluster() { - return OnOffLight.MANDATORY; - } - - public int[] getOptionalCluster() { - return OnOffLight.OPTIONAL; - } - - public int[] getStandardClusters() { - return OnOffLight.STANDARD; - } - - }; - - @Override - public DeviceDescription getDescription() { - return DEVICE_DESCRIPTOR; - } - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/OnOffSwitchDevice.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/OnOffSwitchDevice.java deleted file mode 100644 index 9b995c99626e6..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/OnOffSwitchDevice.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.device.impl; - -import org.bubblecloud.zigbee.ZigBeeApiContext; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.DeviceBase; -import org.bubblecloud.zigbee.api.ZigBeeDeviceException; -import org.bubblecloud.zigbee.api.cluster.general.Identify; -import org.bubblecloud.zigbee.api.cluster.general.OnOffSwitchConfiguration; -import org.bubblecloud.zigbee.api.device.generic.OnOffSwitch; -import org.bubblecloud.zigbee.api.AbstractDeviceDescription; -import org.bubblecloud.zigbee.api.DeviceDescription; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class OnOffSwitchDevice extends DeviceBase implements OnOffSwitch { - - private OnOffSwitchConfiguration onOffSwitchConfiguration; - - public OnOffSwitchDevice(ZigBeeApiContext ctx, ZigBeeEndpoint zbDevice) throws ZigBeeDeviceException { - super(ctx, zbDevice); - } - - final static DeviceDescription DEVICE_DESCRIPTOR = new AbstractDeviceDescription() { - - public int[] getCustomClusters() { - return OnOffSwitch.CUSTOM; - } - - public int[] getMandatoryCluster() { - return OnOffSwitch.MANDATORY; - } - - public int[] getOptionalCluster() { - return OnOffSwitch.OPTIONAL; - } - - public int[] getStandardClusters() { - return OnOffSwitch.STANDARD; - } - - }; - - @Override - public DeviceDescription getDescription() { - return DEVICE_DESCRIPTOR; - } - - @Override - public String getDeviceType() { - return OnOffSwitch.NAME; - } - - public OnOffSwitchConfiguration getOnOffSwitchConfiguration() { - return onOffSwitchConfiguration; - } - - public Identify getIdentify() { - return identify; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/PumpDevice.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/PumpDevice.java deleted file mode 100644 index 178a4624e5dae..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/PumpDevice.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.device.impl; - -import org.bubblecloud.zigbee.api.ZigBeeApiConstants; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.*; -import org.bubblecloud.zigbee.api.cluster.general.Groups; -import org.bubblecloud.zigbee.api.cluster.general.LevelControl; -import org.bubblecloud.zigbee.api.cluster.general.OnOff; -import org.bubblecloud.zigbee.api.cluster.general.Scenes; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.TemperatureMeasurement; -import org.bubblecloud.zigbee.api.device.hvac.Pump; -import org.bubblecloud.zigbee.ZigBeeApiContext; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.7.0 - */ -public class PumpDevice extends DeviceBase implements Pump { - - private OnOff onOffCluster; - private Scenes scenesCluster; - private Groups groupsCluster; - private LevelControl levelControlCluster; - private TemperatureMeasurement temperatureMeasurementCluster; - - public PumpDevice(ZigBeeApiContext ctx, ZigBeeEndpoint zbDevice) throws ZigBeeDeviceException { - super(ctx, zbDevice); - - levelControlCluster = (LevelControl) getCluster(ZigBeeApiConstants.CLUSTER_ID_LEVEL_CONTROL); - onOffCluster = (OnOff) getCluster(ZigBeeApiConstants.CLUSTER_ID_ON_OFF); - scenesCluster = (Scenes) getCluster(ZigBeeApiConstants.CLUSTER_ID_SCENES); - groupsCluster = (Groups) getCluster(ZigBeeApiConstants.CLUSTER_ID_GROUPS); - temperatureMeasurementCluster = (TemperatureMeasurement) getCluster(ZigBeeApiConstants.CLUSTER_ID_TEMPERATURE_MEASUREMENT); - } - - final static DeviceDescription DEVICE_DESCRIPTOR = new AbstractDeviceDescription() { - - public int[] getCustomClusters() { - return Pump.CUSTOM; - } - - public int[] getMandatoryCluster() { - return Pump.MANDATORY; - } - - public int[] getOptionalCluster() { - return Pump.OPTIONAL; - } - - public int[] getStandardClusters() { - return Pump.STANDARD; - } - }; - - @Override - public DeviceDescription getDescription() { - return DEVICE_DESCRIPTOR; - } - - @Override - public String getDeviceType() { - return Pump.NAME; - } - - public OnOff getOnOff() { - return onOffCluster; - } - - public Scenes getScenes() { - return scenesCluster; - } - - public Groups getGroups() { - return groupsCluster; - } - - public LevelControl getLevelControl() { - return levelControlCluster; - } - - public TemperatureMeasurement getTemperatureMeasurement() { - return temperatureMeasurementCluster; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/SimpleSensorDevice.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/SimpleSensorDevice.java deleted file mode 100755 index e856d27770695..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/SimpleSensorDevice.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - Copyright 2013-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.device.impl; - -import org.bubblecloud.zigbee.api.ZigBeeApiConstants; -import org.bubblecloud.zigbee.ZigBeeApiContext; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.*; -import org.bubblecloud.zigbee.api.cluster.general.BinaryInput; -import org.bubblecloud.zigbee.api.device.generic.SimpleSensor; - - -/** - * @author Han Alink - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.7.0 - */ -public class SimpleSensorDevice extends DeviceBase implements SimpleSensor { - - private BinaryInput binaryInput; - - public SimpleSensorDevice(ZigBeeApiContext ctx, ZigBeeEndpoint zbDevice) throws ZigBeeDeviceException { - super(ctx, zbDevice); - binaryInput = (BinaryInput) getCluster(ZigBeeApiConstants.CLUSTER_ID_BINARY_INPUT); - } - - final static DeviceDescription DEVICE_DESCRIPTOR = new AbstractDeviceDescription() { - - public int[] getCustomClusters() { - return SimpleSensor.CUSTOM; - } - - public int[] getMandatoryCluster() { - return SimpleSensor.MANDATORY; - } - - public int[] getOptionalCluster() { - return SimpleSensor.OPTIONAL; - } - - public int[] getStandardClusters() { - return SimpleSensor.STANDARD; - } - - }; - - @Override - public DeviceDescription getDescription() { - return DEVICE_DESCRIPTOR; - } - - @Override - public String getDeviceType() { - return SimpleSensor.NAME; - } - - public BinaryInput getBinaryInput() { - return binaryInput; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/TemperatureSensorDevice.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/TemperatureSensorDevice.java deleted file mode 100644 index 7b3917f525714..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/impl/TemperatureSensorDevice.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.device.impl; - -import org.bubblecloud.zigbee.api.ZigBeeApiConstants; -import org.bubblecloud.zigbee.ZigBeeApiContext; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.api.*; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.TemperatureMeasurement; -import org.bubblecloud.zigbee.api.device.hvac.TemperatureSensor; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.6.0 - */ -public class TemperatureSensorDevice extends DeviceBase implements TemperatureSensor { - - private final TemperatureMeasurement temperature; - - public TemperatureSensorDevice(ZigBeeApiContext ctx, ZigBeeEndpoint zbDevice) throws ZigBeeDeviceException { - super(ctx, zbDevice); - temperature = (TemperatureMeasurement) getCluster(ZigBeeApiConstants.CLUSTER_ID_TEMPERATURE_MEASUREMENT); - } - - public String getDeviceType() { - return TemperatureSensor.NAME; - } - - public TemperatureMeasurement getTemperatureMeasurement() { - return temperature; - } - - final static DeviceDescription DEVICE_DESCRIPTOR = new AbstractDeviceDescription() { - - public int[] getCustomClusters() { - return TemperatureSensor.CUSTOM; - } - - public int[] getMandatoryCluster() { - return TemperatureSensor.MANDATORY; - } - - public int[] getOptionalCluster() { - return TemperatureSensor.OPTIONAL; - } - - public int[] getStandardClusters() { - return TemperatureSensor.STANDARD; - } - - }; - - public DeviceDescription getDescription() { - return DEVICE_DESCRIPTOR; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/lighting/ColorDimmableLight.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/lighting/ColorDimmableLight.java deleted file mode 100644 index 3bb7e7d695b29..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/lighting/ColorDimmableLight.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.device.lighting; - -import org.bubblecloud.zigbee.api.ZigBeeApiConstants; -import org.bubblecloud.zigbee.api.Device; -import org.bubblecloud.zigbee.api.cluster.general.Groups; -import org.bubblecloud.zigbee.api.cluster.general.LevelControl; -import org.bubblecloud.zigbee.api.cluster.general.OnOff; -import org.bubblecloud.zigbee.api.cluster.general.Scenes; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.OccupancySensing; -import org.bubblecloud.zigbee.util.ArraysUtil; -import org.bubblecloud.zigbee.api.cluster.general.ColorControl; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Manlio Bacco - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.7.0 - */ -public interface ColorDimmableLight extends Device { - - public static final int DEVICE_ID = 0x0102; - public static final String NAME = "Color Dimmable Light"; - public static final int[] MANDATORY = ArraysUtil.append(Device.MANDATORY, new int[]{ - ZigBeeApiConstants.CLUSTER_ID_ON_OFF, ZigBeeApiConstants.CLUSTER_ID_LEVEL_CONTROL, ZigBeeApiConstants.CLUSTER_ID_COLOR_CONTROL, ZigBeeApiConstants.CLUSTER_ID_SCENES, ZigBeeApiConstants.CLUSTER_ID_GROUPS - }); - public static final int[] OPTIONAL = ArraysUtil.append(Device.OPTIONAL, new int[]{ - ZigBeeApiConstants.CLUSTER_ID_OCCUPANCY_SENSING - }); - public static final int[] STANDARD = ArraysUtil.append(MANDATORY, OPTIONAL); - public static final int[] CUSTOM = {}; - - /** - * Access method for the Mandatory cluster: {@link OnOff} - * - * @return the {@link OnOff} cluster object - */ - public OnOff getOnOff(); - - /** - * Access method for the Mandatory cluster: {@link Scenes} - * - * @return the {@link Scenes} cluster object - */ - public Scenes getScenes(); - - /** - * Access method for the Mandatory cluster: {@link Groups} - * - * @return the {@link Groups} cluster object - */ - public Groups getGroups(); - - /** - * Access method for the Mandatory cluster: {@link LevelControl} - * - * @return the {@link LevelControl} cluster object - */ - public LevelControl getLevelControl(); - - /** - * Access method for the Optional cluster: {@link org.bubblecloud.zigbee.api.cluster.measureament_sensing.OccupancySensing} - * - * @return the {@link org.bubblecloud.zigbee.api.cluster.measureament_sensing.OccupancySensing} cluster object if implemented by the device, otherwise null - */ - public OccupancySensing getOccupacySensing(); - - /** - * Access method for the Mandatory cluster: {@link ColorControl} - * - * @return the {@link ColorControl} cluster object if implemented by the device, otherwise null - */ - public ColorControl getColorControl(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/lighting/DimmableLight.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/lighting/DimmableLight.java deleted file mode 100644 index 8c3fcfda35f3e..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/lighting/DimmableLight.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.device.lighting; - -import org.bubblecloud.zigbee.api.ZigBeeApiConstants; -import org.bubblecloud.zigbee.api.cluster.general.Groups; -import org.bubblecloud.zigbee.api.cluster.general.LevelControl; -import org.bubblecloud.zigbee.api.cluster.general.OnOff; -import org.bubblecloud.zigbee.api.cluster.general.Scenes; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.OccupancySensing; -import org.bubblecloud.zigbee.util.ArraysUtil; -import org.bubblecloud.zigbee.api.Device; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public interface DimmableLight extends Device { - - public static final int DEVICE_ID = 0x0101; - public static final String NAME = "Dimmable Light"; - public static final int[] MANDATORY = ArraysUtil.append(Device.MANDATORY, new int[]{ - ZigBeeApiConstants.CLUSTER_ID_ON_OFF, ZigBeeApiConstants.CLUSTER_ID_LEVEL_CONTROL, ZigBeeApiConstants.CLUSTER_ID_SCENES, ZigBeeApiConstants.CLUSTER_ID_GROUPS - }); - public static final int[] OPTIONAL = ArraysUtil.append(Device.OPTIONAL, new int[]{ - ZigBeeApiConstants.CLUSTER_ID_OCCUPANCY_SENSING - }); - public static final int[] STANDARD = ArraysUtil.append(MANDATORY, OPTIONAL); - public static final int[] CUSTOM = {}; - - - /** - * Access method for the Mandatory cluster: {@link OnOff} - * - * @return the {@link OnOff} cluster object - */ - public OnOff getOnOff(); - - /** - * Access method for the Mandatory cluster: {@link Scenes} - * - * @return the {@link Scenes} cluster object - */ - public Scenes getScenes(); - - /** - * Access method for the Mandatory cluster: {@link Groups} - * - * @return the {@link Groups} cluster object - */ - public Groups getGroups(); - - /** - * Access method for the Mandatory cluster: {@link LevelControl} - * - * @return the {@link LevelControl} cluster object - */ - public LevelControl getLevelControl(); - - /** - * Access method for the Optional cluster: {@link org.bubblecloud.zigbee.api.cluster.measureament_sensing.OccupancySensing} - * - * @return the {@link org.bubblecloud.zigbee.api.cluster.measureament_sensing.OccupancySensing} cluster object if implemented by the device, otherwise null - */ - public abstract OccupancySensing getOccupacySensing(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/lighting/LightSensor.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/lighting/LightSensor.java deleted file mode 100644 index 8fcd99542371c..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/lighting/LightSensor.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.device.lighting; - -import org.bubblecloud.zigbee.api.ZigBeeApiConstants; -import org.bubblecloud.zigbee.api.Device; -import org.bubblecloud.zigbee.api.cluster.general.Groups; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.IlluminanceMeasurement; -import org.bubblecloud.zigbee.util.ArraysUtil; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.7.0 - */ -public interface LightSensor extends Device { - - public static final int DEVICE_ID = 0x0106; - public static final String NAME = "Light Sensor"; - public static final int[] MANDATORY = ArraysUtil.append(Device.MANDATORY, new int[]{ - ZigBeeApiConstants.CLUSTER_ID_ILLUMINANCE_MEASUREMENT - }); - public static final int[] OPTIONAL = ArraysUtil.append(Device.OPTIONAL, new int[]{ - ZigBeeApiConstants.CLUSTER_ID_GROUPS - }); - public static final int[] STANDARD = ArraysUtil.append(MANDATORY, OPTIONAL); - public static final int[] CUSTOM = {}; - - public IlluminanceMeasurement getIlluminanceMeasurement(); - - public Groups getGroups(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/lighting/OccupancySensor.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/lighting/OccupancySensor.java deleted file mode 100644 index 34b18ad3a0700..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/lighting/OccupancySensor.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.device.lighting; - -import org.bubblecloud.zigbee.api.ZigBeeApiConstants; -import org.bubblecloud.zigbee.api.Device; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.OccupancySensing; -import org.bubblecloud.zigbee.util.ArraysUtil; - - -/** - * This class represent the Occupancy Sensor Cluster as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * - * @author Stefano "Kismet" Lenzi - * @author Manlio Bacco - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.2.0 - */ -public interface OccupancySensor extends Device { - - public static final int DEVICE_ID = 0x0107; - public static final String NAME = "Occupancy Sensor"; - - public static final int[] MANDATORY = ArraysUtil.append(Device.MANDATORY, new int[]{ - ZigBeeApiConstants.CLUSTER_ID_OCCUPANCY_SENSING - }); - public static final int[] OPTIONAL = Device.OPTIONAL; - public static final int[] STANDARD = ArraysUtil.append(MANDATORY, OPTIONAL); - public static final int[] CUSTOM = {}; - - /** - * Access method for the Mandatory cluster: {@link org.bubblecloud.zigbee.api.cluster.measureament_sensing.OccupancySensing} - * - * @return the {@link org.bubblecloud.zigbee.api.cluster.measureament_sensing.OccupancySensing} cluster implemented by the device - */ - public OccupancySensing getOccupacySensing(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/lighting/OnOffLight.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/lighting/OnOffLight.java deleted file mode 100644 index bfb61758f7da9..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/lighting/OnOffLight.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.device.lighting; - -import org.bubblecloud.zigbee.api.ZigBeeApiConstants; -import org.bubblecloud.zigbee.api.Device; -import org.bubblecloud.zigbee.api.cluster.general.Groups; -import org.bubblecloud.zigbee.api.cluster.general.OnOff; -import org.bubblecloud.zigbee.api.cluster.general.Scenes; -import org.bubblecloud.zigbee.api.cluster.measureament_sensing.OccupancySensing; -import org.bubblecloud.zigbee.util.ArraysUtil; - - -/** - * This class represent the On/off Light Cluster as defined by the document:
- * ZigBee Cluster Library public release version 075123r01ZB - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Alessandro Giari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface OnOffLight extends Device { - - public static final int DEVICE_ID = 0x0100; - public static final String NAME = "OnOff Light"; - - public static final int[] MANDATORY = ArraysUtil.append(Device.MANDATORY, new int[]{ - ZigBeeApiConstants.CLUSTER_ID_ON_OFF, ZigBeeApiConstants.CLUSTER_ID_GROUPS, ZigBeeApiConstants.CLUSTER_ID_SCENES - }); - public static final int[] OPTIONAL = ArraysUtil.append(Device.OPTIONAL, new int[]{ - ZigBeeApiConstants.CLUSTER_ID_OCCUPANCY_SENSING - }); - public static final int[] STANDARD = ArraysUtil.append(MANDATORY, OPTIONAL); - public static final int[] CUSTOM = {}; - - /** - * Access method for the Mandatory cluster: {@link OnOff} - * - * @return the {@link OnOff} cluster object - */ - public OnOff getOnOff(); - - /** - * Access method for the Mandatory cluster: {@link Scenes} - * - * @return the {@link Scenes} cluster object - */ - public Scenes getScenes(); - - /** - * Access method for the Mandatory cluster: {@link Groups} - * - * @return the {@link Groups} cluster object - */ - public Groups getGroups(); - - /** - * Access method for the Optional cluster: {@link org.bubblecloud.zigbee.api.cluster.measureament_sensing.OccupancySensing} - * - * @return the {@link org.bubblecloud.zigbee.api.cluster.measureament_sensing.OccupancySensing} cluster object if implemented by the device, otherwise null - */ - public OccupancySensing getOccupacySensing(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/lighting/OnOffLightSwitch.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/lighting/OnOffLightSwitch.java deleted file mode 100644 index a58806115ac6f..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/lighting/OnOffLightSwitch.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.api.device.lighting; - -import org.bubblecloud.zigbee.api.Device; -import org.bubblecloud.zigbee.api.ZigBeeApiConstants; -import org.bubblecloud.zigbee.api.cluster.general.OnOffSwitchConfiguration; -import org.bubblecloud.zigbee.util.ArraysUtil; - - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface OnOffLightSwitch extends Device { - - public static final int DEVICE_ID = 0x0103; - public static final String NAME = "OnOff Switch"; - public static final int[] MANDATORY = ArraysUtil.append(Device.MANDATORY, new int[]{ - ZigBeeApiConstants.CLUSTER_ID_ON_OFF_SWITCH_CONFIGURATION - }); - public static final int[] OPTIONAL = Device.OPTIONAL; - public static final int[] STANDARD = ArraysUtil.append(MANDATORY, OPTIONAL); - public static final int[] CUSTOM = {}; - - - /** - * Access method for the Mandatory cluster: {@link OnOffSwitchConfiguration} - * - * @return the {@link OnOffSwitchConfiguration} cluster object - */ - public OnOffSwitchConfiguration getOnOffSwitchConfiguration(); - -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/security_safety/IASAncillaryControlEquipment.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/security_safety/IASAncillaryControlEquipment.java deleted file mode 100644 index 786a846732843..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/security_safety/IASAncillaryControlEquipment.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.device.security_safety; - -import org.bubblecloud.zigbee.api.ZigBeeApiConstants; -import org.bubblecloud.zigbee.api.Device; -import org.bubblecloud.zigbee.api.cluster.general.Identify; -import org.bubblecloud.zigbee.api.cluster.security_safety.IASACE; -import org.bubblecloud.zigbee.api.cluster.security_safety.IASZone; -import org.bubblecloud.zigbee.util.ArraysUtil; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.8.0 - */ -public interface IASAncillaryControlEquipment extends Device { - - public static final int DEVICE_ID = 0x0401; - public static final String NAME = "IAS Ancillary Control Equipment"; - public static final int[] MANDATORY = ArraysUtil.append(Device.MANDATORY, new int[]{ - ZigBeeApiConstants.CLUSTER_ID_IAS_ZONE, ZigBeeApiConstants.CLUSTER_ID_IDENTIFY, ZigBeeApiConstants.CLUSTER_ID_IAS_ACE - }); - public static final int[] OPTIONAL = Device.OPTIONAL; - public static final int[] STANDARD = ArraysUtil.append(MANDATORY, OPTIONAL); - public static final int[] CUSTOM = {}; - - public IASACE getIASACE(); - - public Identify getIdentify(); - - public IASZone getIASZone(); -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/security_safety/IASControlAndIndicatingEquipment.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/security_safety/IASControlAndIndicatingEquipment.java deleted file mode 100644 index 7fedb26cd7bd9..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/security_safety/IASControlAndIndicatingEquipment.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.device.security_safety; - -import org.bubblecloud.zigbee.api.ZigBeeApiConstants; -import org.bubblecloud.zigbee.api.Device; -import org.bubblecloud.zigbee.api.cluster.general.Groups; -import org.bubblecloud.zigbee.api.cluster.general.Identify; -import org.bubblecloud.zigbee.api.cluster.general.Scenes; -import org.bubblecloud.zigbee.api.cluster.security_safety.IASACE; -import org.bubblecloud.zigbee.api.cluster.security_safety.IASWD; -import org.bubblecloud.zigbee.api.cluster.security_safety.IASZone; -import org.bubblecloud.zigbee.util.ArraysUtil; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.8.0 - */ -public interface IASControlAndIndicatingEquipment extends Device { - - public static final int DEVICE_ID = 0x0400; - public static final String NAME = "IAS Control and Indicating Equipment"; - public static final int[] MANDATORY = ArraysUtil.append(Device.MANDATORY, new int[]{ - ZigBeeApiConstants.CLUSTER_ID_IAS_ZONE, ZigBeeApiConstants.CLUSTER_ID_IDENTIFY, ZigBeeApiConstants.CLUSTER_ID_IAS_ACE, ZigBeeApiConstants.CLUSTER_ID_IAS_WD - }); - public static final int[] OPTIONAL = ArraysUtil.append(Device.OPTIONAL, new int[]{ - ZigBeeApiConstants.CLUSTER_ID_SCENES, ZigBeeApiConstants.CLUSTER_ID_GROUPS - }); - public static final int[] STANDARD = ArraysUtil.append(MANDATORY, OPTIONAL); - public static final int[] CUSTOM = {}; - - public IASACE getIASACE(); - - public Identify getIdentify(); - - public IASZone getIASZone(); - - public IASWD getIASwd(); - - public Scenes getScenes(); - - public Groups getGroups(); -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/security_safety/IAS_Warning.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/security_safety/IAS_Warning.java deleted file mode 100644 index 6bdd4cdeb4e10..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/security_safety/IAS_Warning.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.device.security_safety; - -import org.bubblecloud.zigbee.api.ZigBeeApiConstants; -import org.bubblecloud.zigbee.api.Device; -import org.bubblecloud.zigbee.api.cluster.security_safety.IASWD; -import org.bubblecloud.zigbee.api.cluster.security_safety.IASZone; -import org.bubblecloud.zigbee.util.ArraysUtil; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.8.0 - */ -public interface IAS_Warning { - - public static final int DEVICE_ID = 0x0403; - public static final String NAME = "IAS Warning Device"; - public static final int[] MANDATORY = ArraysUtil.append(Device.MANDATORY, new int[]{ - ZigBeeApiConstants.CLUSTER_ID_IAS_WD, ZigBeeApiConstants.CLUSTER_ID_IAS_ZONE - }); - public static final int[] OPTIONAL = ArraysUtil.append(Device.OPTIONAL, new int[]{ - ZigBeeApiConstants.CLUSTER_ID_SCENES, ZigBeeApiConstants.CLUSTER_ID_GROUPS - }); - public static final int[] STANDARD = ArraysUtil.append(MANDATORY, OPTIONAL); - public static final int[] CUSTOM = {}; - - public IASWD getIASWD(); - - public IASZone getIASZone(); -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/security_safety/IAS_Zone.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/security_safety/IAS_Zone.java deleted file mode 100644 index 7b93ed17a4bfb..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/api/device/security_safety/IAS_Zone.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.api.device.security_safety; - -import org.bubblecloud.zigbee.api.ZigBeeApiConstants; -import org.bubblecloud.zigbee.api.Device; -import org.bubblecloud.zigbee.api.cluster.security_safety.IASZone; -import org.bubblecloud.zigbee.util.ArraysUtil; - -/** - * @author Manlio Bacco - * @version $LastChangedRevision$ ($LastChangedDate$) - * @since 0.8.0 - */ -public interface IAS_Zone extends Device { - - public static final int DEVICE_ID = 0x0402; - public static final String NAME = "IAS Zone"; - public static final int[] MANDATORY = ArraysUtil.append(Device.MANDATORY, new int[]{ - ZigBeeApiConstants.CLUSTER_ID_IAS_ZONE - }); - public static final int[] OPTIONAL = Device.OPTIONAL; - public static final int[] STANDARD = ArraysUtil.append(MANDATORY, OPTIONAL); - public static final int[] CUSTOM = {}; - - public IASZone getIASZone(); -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/AnnounceListener.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/AnnounceListener.java deleted file mode 100644 index 8019053877473..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/AnnounceListener.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network; - -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.ZToolAddress64; - -/** - * @author Stefano "Kismet" Lenzi - ISTI-CNR - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface AnnounceListener { - - /** - * Callback invoked when an Annunce message arrives - * - * @param senderAddress the network address of the node which sent the Annunce message - * @param ieeeAddress the 64-bit address of the node that is the subject of the - * Annunce message - * @param networkAddress the network address assigned to the node that is the subject - * of the Annunce message - * @param capabilitiesBitmask the bitmask identifying the network capibility of the - * node that is the subject of the Annunce message - */ - void announce(ZToolAddress16 senderAddress, ZToolAddress64 ieeeAddress, - ZToolAddress16 networkAddress, int capabilitiesBitmask); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ApplicationFrameworkMessageConsumer.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ApplicationFrameworkMessageConsumer.java deleted file mode 100644 index 9e38b32084799..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ApplicationFrameworkMessageConsumer.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network; - -import org.bubblecloud.zigbee.network.packet.af.AF_INCOMING_MSG; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public interface ApplicationFrameworkMessageConsumer { - - public boolean consume(AF_INCOMING_MSG msg); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ApplicationFrameworkMessageListener.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ApplicationFrameworkMessageListener.java deleted file mode 100644 index e0760c9a7c57a..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ApplicationFrameworkMessageListener.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network; - - -import org.bubblecloud.zigbee.network.packet.af.AF_INCOMING_MSG; - -/** - * This class reppresent the callback invoked by the {@link ZigBeeNetworkManager} whenever a message
- * that belongs to the Application Framework arrives from the ZigBee Network - * - * @author Stefano "Kismet" Lenzi - ISTI-CNR - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface ApplicationFrameworkMessageListener { - - /** - * This method is invoked by the {@link ZigBeeNetworkManager} on all the {@link ApplicationFrameworkMessageListener}
- * when a {@link org.bubblecloud.zigbee.network.packet.af.AF_INCOMING_MSG} command arrive from the ZigBee NIC - * - * @param msg the {@link org.bubblecloud.zigbee.network.packet.af.AF_INCOMING_MSG} arrived that has to be handled - */ - void notify(AF_INCOMING_MSG msg); - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ApplicationFrameworkMessageProducer.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ApplicationFrameworkMessageProducer.java deleted file mode 100644 index ae3c75480ce91..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ApplicationFrameworkMessageProducer.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network; - -/** - * @author
Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public interface ApplicationFrameworkMessageProducer { - - public boolean addAFMessageConsumer(ApplicationFrameworkMessageConsumer consumer); - - public boolean removeAFMessageConsumer(ApplicationFrameworkMessageConsumer consumer); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/AsynchronousCommandListener.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/AsynchronousCommandListener.java deleted file mode 100644 index 03cba1e107bd9..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/AsynchronousCommandListener.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network; - -import org.bubblecloud.zigbee.network.packet.ZToolPacket; - -/** - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface AsynchronousCommandListener { - - void receivedAsynchronousCommand(ZToolPacket packet); - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ClusterFilter.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ClusterFilter.java deleted file mode 100644 index 4fac86ce8cae9..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ClusterFilter.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network; - -/** - * This class represent the filter used by the {@link ZigBeeEndpoint} to identifies
- * if the {@link ClusterListener} has to handle or not the {@link ClusterMessage}.
- * In fact, the {@link ClusterListener#handleCluster(ZigBeeEndpoint, ClusterMessage)} must be invoked
- * if and only if either
- * - the {@link ClusterFilter} returned by {@link ClusterListener#getClusterFilter()} is null, or
- * - the {@link ClusterFilter#match(ClusterMessage)} on the cluster return true - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.4.0 - */ -public interface ClusterFilter { - - /** - * This method is invoked to check if the {@link ZigBeeEndpoint} to check if {@link ClusterMessage}
- * can be handled by the {@link ClusterListener} associated to this {@link ClusterFilter} - * - * @param clusterMessage the {@link ClusterMessage} to match - * @return true if the {@link ClusterMessage} match the {@link ClusterFilter} - */ - boolean match(ClusterMessage clusterMessage); - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ClusterListener.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ClusterListener.java deleted file mode 100644 index ef052e9b1dc84..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ClusterListener.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface ClusterListener { - - /** - * Set the {@link ClusterListener} of this ClusterListener.
- * A null values means no filtering - * - * @param filter the {@link ClusterListener} to associates to this ClusterListener.
- * null to disable the filtering - * @since 0.4.0 - */ - public void setClusterFilter(ClusterFilter filter); - - /** - * Return the {@link ClusterListener} associated to this ClusterListener.
- * A null values means no filtering - * - * @return the {@link ClusterListener} associated to this ClusterListener - * @since 0.4.0 - */ - public ClusterFilter getClusterFilter(); - - /** - * The callback invoked by the ZigBee Base Driver to announce for a new {@link ClusterMessage} - * - * @param endpoint reference to the {@link ZigBeeEndpoint} receiving the {@link ClusterMessage} - * @param clusterMessage reference to the received {@link ClusterMessage} - */ - public void handleCluster(ZigBeeEndpoint endpoint, ClusterMessage clusterMessage); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ClusterMessage.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ClusterMessage.java deleted file mode 100644 index ba8f10e12171b..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ClusterMessage.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface ClusterMessage { - - public short getId(); - - public byte[] getClusterMsg(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/Constants.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/Constants.java deleted file mode 100644 index 7cff27b404da6..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/Constants.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.bubblecloud.zigbee.network; - -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the Liit.cnr.isti.zigbee.apiit.cnr.isti.zigbee.api; - - -/** - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - * - */ -public interface Constants { - - /** - * Constants that contains the value of the Service Persistent Identification (PID) of the
- * service used for configuring the behavior of the ZigBee Base Driver - * - * @since 0.2.0 - */ - public static final String MANAGED_SERVICE_PID = "it.cnr.isti.zigbee.driver.configuration"; - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/EndpointListener.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/EndpointListener.java deleted file mode 100644 index 403c0d9361d30..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/EndpointListener.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.bubblecloud.zigbee.network; - -/** - * Created with IntelliJ IDEA. - * User: tlaukkan - * Date: 12/15/13 - * Time: 8:48 AM - * To change this template use File | Settings | File Templates. - */ -public interface EndpointListener { - - public void endpointAdded(final ZigBeeEndpoint endpoint); - - public void endpointUpdated(final ZigBeeEndpoint endpoint); - - public void endpointRemoved(final ZigBeeEndpoint endpoint); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/NetworkManager.ucls b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/NetworkManager.ucls deleted file mode 100644 index 92b4e7ab52bc2..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/NetworkManager.ucls +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/SynchronousCommandListener.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/SynchronousCommandListener.java deleted file mode 100644 index be532668a65af..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/SynchronousCommandListener.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network; - -import org.bubblecloud.zigbee.network.packet.ZToolPacket; - -/** - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface SynchronousCommandListener { - - public void receivedCommandResponse(ZToolPacket packet); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ZigBeeDiscoveryMonitor.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ZigBeeDiscoveryMonitor.java deleted file mode 100644 index 9b0c0820e7b2a..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ZigBeeDiscoveryMonitor.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.network; - -/** - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.5.1 - */ -public interface ZigBeeDiscoveryMonitor { - - public void browsedNode(ZigBeeNode node); - - public void announcedNode(ZigBeeNode node); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ZigBeeEndpoint.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ZigBeeEndpoint.java deleted file mode 100644 index f0d73158a4e77..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ZigBeeEndpoint.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network; - -import org.bubblecloud.zigbee.network.impl.ZigBeeNetworkManagerException; - - -/** - * This class represent a ZigBee Endpoint. - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface ZigBeeEndpoint { - - /** - * Constant for the ZigBee device match scale, indicating a match with the ProfileId. Value is 1024. - */ - public static final int MATCH_PROFILE_ID = 1024; - - /** - * Constant for the ZigBee device match scale to add when a device match with the ProfileId - * for each of the cluster matching. Value is 1. - */ - public static final int MATCH_CLUSTER_ID = 1; - - /** - * Constant for the ZigBee device match scale, indicating a match with the ProfileId - * and the DeviceId. Value is 4096. - */ - public static final int MATCH_DEVICE_ID = 4096; - - /** - * @return int representing the current network address linked to the node - */ - public int getNetworkAddress(); - - /** - * @return a {@link String} representing the IEEEAddress of the node - */ - public String getIEEEAddress(); - - /** - * @return Address of the EndPoint represented by this object, value ranges from 1 to 240. - */ - public short getEndPointAddress(); - - /** - * @return the profile Id implemented by this EndPoint - */ - public int getProfileId(); - - /** - * @return the device id implemented by this EndPoint - */ - public int getDeviceTypeId(); - - /** - * @return the {@link ZigBeeNode} containing this endpoint - * @since 0.2.0 - */ - public ZigBeeNode getNode(); - - /** - * @return a {@link String} the represent an URI of endpoint. - * @since 0.5.0 - */ - public String getEndpointId(); - - /** - * @return the device version implemented by this endpoint - */ - public short getDeviceVersion(); - - /** - * @return the list of Input Cluster identifies implemented by this EndPoint - */ - public int[] getInputClusters(); - - /** - * @param id the Cluster identifier - * @return true if and only if the EnpPoint implements the given Cluster id
- * as Input Cluster - */ - public boolean providesInputCluster(int id); - - /** - * @return the list of Output Cluster identifies implemented by this EndPoint - */ - public int[] getOutputClusters(); - - /** - * @param id the Cluster identifier - * @return true if and only if the EnpPoint implements the given Cluster id
- * as Output Cluster - */ - public boolean providesOutputCluster(int id); - - /** - * Invoke the given {@link ClusterMessage} (which is supposed to part of the Input Cluster) of this EndPoint,
- * and wait for the a response from. - * - * @param input the {@link ClusterMessage} containing the id of the Cluster to invoke and the cluster message - * @return the {@link ClusterMessage} representing the response received after that the Cluster answer to
- * the request. - */ - public ClusterMessage invoke(ClusterMessage input) throws ZigBeeNetworkManagerException; - - /** - * Send the given {@link ClusterMessage} (which is supposed to be Input Cluster) to this EndPoint,
- * on the contrary than the {@link #invoke(ClusterMessage)} this method doesn't wait for nor requires
- * an answer from the EndPoint- - * - * @param input the {@link ClusterMessage} containing the id of the Cluster to send to the cluster message - */ - public void send(ClusterMessage input) throws ZigBeeNetworkManagerException; - - /** - * This method modify the Binding Table of physical endpoint by adding the following entry: - *

-     * this.getNode().getIEEEAddress(), this.getDeviceTypeId(), clusterId, endpoint.getNode().getIEEEAddress(), endpoint.getDeviceTypeId()
-     * 
- * - * @param endpoint {@link ZigBeeEndpoint} the endpoint that we want to bound to - * @param clusterId the clusterId that we want to bound to - * @return true if and only if the operation succeeded - * @throws org.bubblecloud.zigbee.network.impl.ZigBeeNetworkManagerException - * @since 0.5.0 - */ - public boolean bindTo(ZigBeeEndpoint endpoint, int clusterId) throws ZigBeeNetworkManagerException; - - /** - * This method modify the Binding Table of physical device by removing the entry if exists - *
-     * this.getNode().getIEEEAddress(), this.getDeviceTypeId(), clusterId, device.getNode().getIEEEAddress(), device.getDeviceTypeId()
-     * 
- * - * @param endpoint {@link ZigBeeEndpoint} the device that we want to bound to - * @param clusterId the clusterId that we want to unbound from - * @return true if and only if the operation succeeded - * @throws org.bubblecloud.zigbee.network.impl.ZigBeeNetworkManagerException - * @since 0.5.0 - */ - public boolean unbindFrom(ZigBeeEndpoint endpoint, int clusterId) throws ZigBeeNetworkManagerException; - - /** - * @param clusterId - * @return - * @throws org.bubblecloud.zigbee.network.impl.ZigBeeNetworkManagerException - */ - public boolean bindToLocal(int clusterId) throws ZigBeeNetworkManagerException; - - /** - * @param clusterId - * @return - * @throws org.bubblecloud.zigbee.network.impl.ZigBeeNetworkManagerException - */ - public boolean unbindFromLocal(int clusterId) throws ZigBeeNetworkManagerException; - - /** - * Add a {@link ClusterListener} to this EndPoint. The same instance of a {@link ClusterListener} will
- * registered only once. - * - * @param listener the {@link ClusterListener} to register - * @return true if and only if the {@link ClusterListener} has been registered - */ - public boolean addClusterListener(ClusterListener listener); - - /** - * Remove a {@link ClusterListener} to this EndPoint. - * - * @param listener the {@link ClusterListener} to unregister - * @return true if and only if the {@link ClusterListener} has been unregistered - */ - public boolean removeClusterListener(ClusterListener listener); - -} - diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ZigBeeNetworkManager.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ZigBeeNetworkManager.java deleted file mode 100644 index cde02bc847cbb..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ZigBeeNetworkManager.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network; - -import org.bubblecloud.zigbee.network.model.DriverStatus; -import org.bubblecloud.zigbee.network.model.NetworkMode; -import org.bubblecloud.zigbee.network.packet.af.AF_DATA_CONFIRM; -import org.bubblecloud.zigbee.network.packet.af.AF_DATA_REQUEST; -import org.bubblecloud.zigbee.network.packet.af.AF_REGISTER; -import org.bubblecloud.zigbee.network.packet.af.AF_REGISTER_SRSP; -import org.bubblecloud.zigbee.network.packet.zdo.*; -import org.bubblecloud.zigbee.network.port.ZigBeePort; - -import java.util.HashSet; - -/** - * @author Stefano "Kismet" Lenzi - ISTI-CNR - * @author Manlio Bacco - ISTI-CNR - * @author Chris Hatton - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface ZigBeeNetworkManager { - - public abstract void setZigBeeNodeMode(NetworkMode m); - - public abstract void setZigBeeNetwork(byte ch, short panId); - - public abstract void setPort(ZigBeePort port); - - public abstract void startup(); - - public abstract void shutdown(); - - public abstract ZDO_IEEE_ADDR_RSP sendZDOIEEEAddressRequest(ZDO_IEEE_ADDR_REQ request); - - public abstract ZDO_NODE_DESC_RSP sendZDONodeDescriptionRequest(ZDO_NODE_DESC_REQ request); - - public abstract ZDO_ACTIVE_EP_RSP sendZDOActiveEndPointRequest(ZDO_ACTIVE_EP_REQ request); - - public abstract ZDO_SIMPLE_DESC_RSP sendZDOSimpleDescriptionRequest(ZDO_SIMPLE_DESC_REQ request); - - public abstract boolean addAnnunceListener(AnnounceListener listner); - - public abstract boolean removeAnnunceListener(AnnounceListener listner); - - public abstract AF_REGISTER_SRSP sendAFRegister(AF_REGISTER request); - - public abstract AF_DATA_CONFIRM sendAFDataRequest(AF_DATA_REQUEST request); - - public abstract ZDO_BIND_RSP sendZDOBind(ZDO_BIND_REQ request); - - public abstract ZDO_UNBIND_RSP sendZDOUnbind(ZDO_UNBIND_REQ request); - - public abstract boolean removeAFMessageListener(ApplicationFrameworkMessageListener listner); - - public abstract boolean addAFMessageListner(ApplicationFrameworkMessageListener listner); - - /** - * Send LQI request cluster and wait for its response
- * This method is used for the discovering of {@link ZigBeeEndpoint} - * - * @return the answer to the request or null in case of an error - * @since 0.7.0 - */ - public abstract ZDO_MGMT_LQI_RSP sendLQIRequest(ZDO_MGMT_LQI_REQ request); - - /** - * This method is used for the creation of an virtual device on the dongle
- * Note: a proper {@link addAFMessageListner} has to be register for answering to request coming from the network - * - * @since 0.7.0 - * @deprecated - */ - public abstract void addCustomEndpoint(String endpointNumber, String profileID, String deviceID, String version, String inputClusters, String outputCluster); - - /** - * WARNING: This method may have to wait for the initialization of the ZigBee network
- * thus, it may be quite slow or end up in a deadlock of the application - * - * @return The long representing the IEEE Address of coordinator of the ZigBee network in use, or -1 if and only if the method failed - * @since 0.2.0 - */ - public abstract long getExtendedPanId(); - - /** - * WARNING: This method may have to wait for the initialization of the ZigBee network
- * thus, it may be quite slow or end up in a deadlock of the application - * - * @return The long representing the IEEE Address of ZigBee device in use, or -1 if and only if the method failed - * @since 0.2.0 - */ - public abstract long getIEEEAddress(); - - /** - * WARNING: This method may have to wait for the initialization of the ZigBee network
- * thus, it may be quite slow or end up in a deadlock of the application - * - * @return The panId of ZigBee network configured in use, or -1 if and only if the method failed - * @since 0.2.0 - */ - public abstract int getCurrentPanId(); - - /** - * WARNING: This method may have to wait for the initialization of the ZigBee network
- * thus, it may be quite slow or end up in a deadlock of the application - * - * @return The ZigBee network channel in use, or -1 if and only if the method failed - * @since 0.2.0 - */ - public abstract int getCurrentChannel(); - - /** - * WARNING: This method may have to wait for the initialization of the ZigBee network
- * thus, it may be quite slow or end up in a deadlock of the application - * - * @return The ZStack state of the device, or -1 if and only if the method failed - * @since 0.2.0 - * @deprecated - */ - public abstract int getCurrentState(); - - /** - * WARNING: This method may have to wait for the initialization of the ZigBee network
- * thus, it may be quite slow or end up in a deadlock of the application - * - * @return The int representation of the {@link NetworkMode} in use, or -1 if and only if the method failed - * @since 0.6.0 - */ - public abstract int getZigBeeNodeMode(); - - /** - * @return The current status of the driver - * @see 0.6.0 - */ - public abstract DriverStatus getDriverStatus(); - - HashSet getAnnounceListeners(); -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ZigBeeNode.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ZigBeeNode.java deleted file mode 100644 index 6437790a7736a..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/ZigBeeNode.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network; - -import java.util.Dictionary; - -/** - * This class represent a ZigBee node, it means a physical device that can communicate
- * using the ZigBee protocol.
- * Each physical may contain up 240 endpoints which are represented by the {@link ZigBeeEndpoint}
- * class. Each endpoint is identified by an EndPoint address, but shares iether the:
- * - 64-bit 802.15.4 IEEE Address
- * - 16-bit ZigBee Network Address
- * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @since 0.1.0 - */ -public interface ZigBeeNode { - - /** - * @return int representing the current network address linked to the node - */ - public int getNetworkAddress(); - - /** - * @return a {@link String} representing the IEEEAddress of the node - */ - public String getIEEEAddress(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/discovery/AnnounceListenerImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/discovery/AnnounceListenerImpl.java deleted file mode 100644 index 6b4c839f1a6a3..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/discovery/AnnounceListenerImpl.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.discovery; - -import org.bubblecloud.zigbee.network.ZigBeeNetworkManager; -import org.bubblecloud.zigbee.network.AnnounceListener; -import org.bubblecloud.zigbee.network.model.IEEEAddress; -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.ZToolAddress64; -import org.bubblecloud.zigbee.network.impl.ApplicationFrameworkLayer; -import org.bubblecloud.zigbee.network.impl.ZigBeeNodeImpl; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * NOTE:This class doesn't implement a real {@link Thread}, anyway
- * because it is a {@link org.bubblecloud.zigbee.network.AnnounceListener} a different thread then the application will call - * the {@link #announce(org.bubblecloud.zigbee.network.packet.ZToolAddress16, org.bubblecloud.zigbee.network.packet.ZToolAddress64, org.bubblecloud.zigbee.network.packet.ZToolAddress16, int)} method. - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class AnnounceListenerImpl implements AnnounceListener { - - private final static Logger logger = LoggerFactory.getLogger(AnnounceListenerImpl.class); - - private final ImportingQueue queue; - - private final ZigBeeNetworkManager zigbeeNetworkManager; - - /** - * Created the {@link AnnounceListenerImpl} object and register itself to the {@link org.bubblecloud.zigbee.network.ZigBeeNetworkManager}
- * as {@link ImportingQueue} - * - * @param queue the {@link ImportingQueue} used to add the discovered endpoints - * @param driver the {@link org.bubblecloud.zigbee.network.ZigBeeNetworkManager} to use for subscription - */ - public AnnounceListenerImpl(final ImportingQueue queue, final ZigBeeNetworkManager driver) { - this.queue = queue; - this.zigbeeNetworkManager = driver; - } - - public void announce(final ZToolAddress16 senderAddress, - final ZToolAddress64 ieeeAddress, final ZToolAddress16 destinationAddress, - final int capabilitiesBitmask) { - - logger.info("Device announced Network Address: {} IEEE Address: {}", senderAddress.get16BitValue(), - IEEEAddress.toColonNotation(ieeeAddress.getLong())); - queue.push(senderAddress, ieeeAddress); - final Thread notifyThread = new Thread(new Runnable() { - @Override - public void run() { - ApplicationFrameworkLayer.getAFLayer(zigbeeNetworkManager).getZigBeeNetwork().notifyNodeAnnounced( - new ZigBeeNodeImpl(senderAddress.get16BitValue(), ieeeAddress, - (short) zigbeeNetworkManager.getCurrentPanId())); - } - }); - } - -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/discovery/AssociationNetworkBrowser.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/discovery/AssociationNetworkBrowser.java deleted file mode 100644 index ced0fb81df856..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/discovery/AssociationNetworkBrowser.java +++ /dev/null @@ -1,198 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.discovery; - -import org.bubblecloud.zigbee.network.ZigBeeNetworkManager; -import org.bubblecloud.zigbee.network.impl.ApplicationFrameworkLayer; -import org.bubblecloud.zigbee.network.impl.ZigBeeNetwork; -import org.bubblecloud.zigbee.network.impl.ZigBeeNodeImpl; -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.zdo.ZDO_IEEE_ADDR_REQ; -import org.bubblecloud.zigbee.network.packet.zdo.ZDO_IEEE_ADDR_RSP; -import org.bubblecloud.zigbee.util.Integers; -import org.bubblecloud.zigbee.util.RunnableThread; -import org.bubblecloud.zigbee.util.ThreadUtils; -import org.bubblecloud.zigbee.network.ZigBeeNode; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.ArrayList; -import java.util.HashMap; - - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class AssociationNetworkBrowser extends RunnableThread { - - private static final Logger logger = LoggerFactory.getLogger(AssociationNetworkBrowser.class); - - private static final short COORDINATOR_NWK_ADDRESS = 0; - - private final ImportingQueue queue; - final ZigBeeNetworkManager driver; - - final ArrayList toInspect = new ArrayList(); - final HashMap alreadyInspected = new HashMap(); - private boolean initialNetworkBrowsingComplete = false; - - - private class NetworkAddressNodeItem { - final NetworkAddressNodeItem parent; - final int address; - ZigBeeNodeImpl node = null; - - NetworkAddressNodeItem(NetworkAddressNodeItem parent, int address) { - this.parent = parent; - this.address = address; - } - - public String toString() { - if (parent != null) { - return "<" + parent.address + " / " + parent.node + "," + address + " / " + node + ">"; - } else { - return "< NULL ," + address + " / " + node + ">"; - } - } - } - - public AssociationNetworkBrowser(ImportingQueue queue, ZigBeeNetworkManager driver) { - this.queue = queue; - this.driver = driver; - } - - public boolean isInitialNetworkBrowsingComplete() { - return initialNetworkBrowsingComplete; - } - - public void task() { - final String threadName = Thread.currentThread().getName(); - - logger.trace("{} STARTED Succesfully", threadName); - - while (!isDone()) { - long wakeUpTime = System.currentTimeMillis() + 15 * 60 * 1000; - cleanUpWalkingTree(); - - logger.debug("Inspecting ZigBee network for new nodes."); - toInspect.add(new NetworkAddressNodeItem(null, COORDINATOR_NWK_ADDRESS)); - try { - while (toInspect.size() != 0) { - final NetworkAddressNodeItem inspecting = toInspect.remove(toInspect.size() - 1); - - alreadyInspected.put((int) inspecting.address, inspecting); - logger.trace("Inspecting node #{}.", inspecting.address); - ZDO_IEEE_ADDR_RSP result = driver.sendZDOIEEEAddressRequest( - new ZDO_IEEE_ADDR_REQ((short) inspecting.address, ZDO_IEEE_ADDR_REQ.REQ_TYPE.EXTENDED, (byte) 0) - ); - - if (result == null) { - logger.debug("No answer from #{}.", inspecting.address); - continue; - } else if (result.Status == 0) { - logger.trace( - "Inspection result from #{} with {} associated nodes.", - inspecting.address, result.getAssociatedNodeCount() - ); - inspecting.node = new ZigBeeNodeImpl(inspecting.address, result.getIEEEAddress(), - (short) driver.getCurrentPanId()); - - ZToolAddress16 nwk = new ZToolAddress16( - Integers.getByteAsInteger(inspecting.address, 1), - Integers.getByteAsInteger(inspecting.address, 0) - ); - queue.push(nwk, result.getIEEEAddress()); - - notifyBrowsedNode(inspecting); - } - toInspect.addAll(addChildrenNodesToInspectingQueue(inspecting, result)); - } - - } catch (Exception e) { - e.printStackTrace(); - } - logger.trace("Network browsing completed, waiting until {}", wakeUpTime); - initialNetworkBrowsingComplete = true; - if (!isDone()) ThreadUtils.waitingUntil(wakeUpTime); - } - logger.debug("{} TERMINATED Succesfully", threadName); - } - - - private void cleanUpWalkingTree() { - alreadyInspected.clear(); - toInspect.clear(); - } - - private ArrayList addChildrenNodesToInspectingQueue(NetworkAddressNodeItem inspecting, ZDO_IEEE_ADDR_RSP result) { - int start = 0; - final ArrayList adding = new ArrayList(); - do { - int[] toAdd = result.getAssociatedNodesList(); - for (int i = 0; i < toAdd.length; i++) { - logger.trace("Found node #{} associated to node #{}.", toAdd[i], inspecting.address); - final NetworkAddressNodeItem next = new NetworkAddressNodeItem(inspecting, toAdd[i]); - final NetworkAddressNodeItem found = alreadyInspected.get((int) toAdd[i]); - if (found != null) { - //NOTE Logging this wrong behavior but doing nothing - logger.error( - "BROKEN ZIGBEE UNDERSTANDING (while walking address-tree): " + - "found twice the same node with network address {} ", toAdd[i] - ); - logger.debug("Previus node data was {} while current has parent {}", found, inspecting); - } else { - adding.add(next); - } - } - if (toAdd.length + result.getStartIndex() >= result.getAssociatedNodeCount()) { - //NOTE No more node connected to inspecting - return adding; - } - start += toAdd.length; - - logger.info( - "Node #{} as too many endpoints connected to it received only {} out of {}, " + - "we need to inspect it once more", new Object[]{ - inspecting.address, toAdd.length, result.getAssociatedNodeCount() - }); - result = driver.sendZDOIEEEAddressRequest( - new ZDO_IEEE_ADDR_REQ((short) inspecting.address, ZDO_IEEE_ADDR_REQ.REQ_TYPE.EXTENDED, (byte) start) - ); - if (result == null) { - logger.error("Faild to further inspect connected endpoint to node #{}", inspecting.address); - } - } while (result != null); - - return adding; - } - - private void notifyBrowsedNode(NetworkAddressNodeItem item) { - final ZigBeeNode node = item.node; - - final ZigBeeNetwork network = ApplicationFrameworkLayer.getAFLayer(driver).getZigBeeNetwork(); - network.notifyNodeBrowsed(node); - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/discovery/EndpointBuilder.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/discovery/EndpointBuilder.java deleted file mode 100644 index 4e6e80d8682c0..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/discovery/EndpointBuilder.java +++ /dev/null @@ -1,335 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.discovery; - -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.network.ZigBeeNode; -import org.bubblecloud.zigbee.network.ZigBeeNetworkManager; -import org.bubblecloud.zigbee.network.impl.*; -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.ZToolAddress64; -import org.bubblecloud.zigbee.network.packet.zdo.ZDO_ACTIVE_EP_REQ; -import org.bubblecloud.zigbee.network.packet.zdo.ZDO_ACTIVE_EP_RSP; -import org.bubblecloud.zigbee.util.Stoppable; -import org.bubblecloud.zigbee.util.ThreadUtils; -import org.bubblecloud.zigbee.network.model.IEEEAddress; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.*; -import java.util.Map.Entry; - -/** - * This class implements the {@link Thread} that completes the discovery of the node
- * found either by {@link AssociationNetworkBrowser} or {@link AnnounceListenerImpl} by
- * inspecting the End Point on the node.
- * The inspection of each End Point lead to the creation {@link org.bubblecloud.zigbee.network.ZigBeeEndpoint}.. - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Manlio Bacco - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class EndpointBuilder implements Stoppable { - - private static final Logger logger = LoggerFactory.getLogger(EndpointBuilder.class); - - private final ImportingQueue queue; - private final List failedEndpoints = new ArrayList(); - - private Map failedAttempts = new HashMap(); - private final int maxRetriesFailedEndpoints = 3; - - private Map delayedReattempts = new HashMap(); - private final long delay = 60000; - - private final ZigBeeNetworkManager driver; - private boolean end; - - private long nextInspectionSlot = 0; - private ImportingQueue.ZigBeeNodeAddress dev; - - private class ZigBeeEndpointReference { - ZigBeeNode node; - short endPoint; - - ZigBeeEndpointReference(ZigBeeNode node, short ep) { - super(); - this.node = node; - this.endPoint = ep; - } - } - - public EndpointBuilder(ImportingQueue queue, ZigBeeNetworkManager driver) { - this.queue = queue; - this.driver = driver; - } - - - private ZDO_ACTIVE_EP_RSP doInspectEndpointOfNode(final int nwkAddress, final ZigBeeNode node) { - logger.trace("Listing end points on node #{} to find devices.", nwkAddress); - - int i = 0; - ZDO_ACTIVE_EP_RSP result = null; - - while (i < 1) { - result = driver.sendZDOActiveEndPointRequest(new ZDO_ACTIVE_EP_REQ(nwkAddress)); - - if (result == null) { - final long waiting = 1000; - logger.trace( - "Inspecting device on node {} failed during it {}-nth attempt. " + - "Waiting for {}ms before retrying", - new Object[]{node, i, waiting} - ); - ThreadUtils.waitNonPreemptive(waiting); - i++; - } else { - break; - } - } - - return result; - } - - private boolean inspectEndpointOfNode(final int nwkAddress, final ZigBeeNode node) { - - final ZDO_ACTIVE_EP_RSP result = doInspectEndpointOfNode(nwkAddress, node); - if (result == null) { - logger.warn("ZDO_ACTIVE_EP_REQ FAILED on {}", node); - return false; - } - - short[] endPoints = result.getActiveEndPointList(); - logger.trace("Found {} end points on #{}.", endPoints.length, nwkAddress); - for (int i = 0; i < endPoints.length; i++) { - doCreateZigBeeEndpoint(node, endPoints[i]); - } - - return true; - } - - private void doCreateZigBeeEndpoint(ZigBeeNode node, short ep) { - final ZigBeeNetwork network = ApplicationFrameworkLayer.getAFLayer(driver).getZigBeeNetwork(); - synchronized (network) { - if (network.containsEndpoint(node.getIEEEAddress(), ep)) { - logger.info( - "Skipping device creation for endpoint {} on node {} as it is created.", ep, node - ); - return; - } else { - logger.trace( - "Inspecting node {} / endpoint {}.", - new Object[]{node, ep} - ); - } - - } - try { - ZigBeeEndpointImpl endpoint = new ZigBeeEndpointImpl(driver, node, ep); - if (endpoint.getNode().getNetworkAddress() == 0) { - logger.trace("Sender end point {} found with profile PROFILE_ID_HOME_AUTOMATION: " + endpoint.getProfileId(), endpoint.getEndpointId()); - ApplicationFrameworkLayer.getAFLayer(driver).registerSenderEndPoint( - ep, endpoint.getProfileId(), endpoint.getOutputClusters()); - } - if ( !(endpoint.getNode().getNetworkAddress() == 0 && endpoint.getInputClusters().length == 0) - && !network.addEndpoint(endpoint)) { - logger.error("Failed to add endpoint {} to the network map for node {}", ep, node); - } - } catch (ZigBeeNetworkManagerException e) { - logger.error("Error building the device: {}", node, e); - - ZigBeeEndpointReference last = new ZigBeeEndpointReference(node, ep); - if (!failedAttempts.containsKey(last)) - failedAttempts.put(last, 0); - else if (failedAttempts.get(last) + 1 < maxRetriesFailedEndpoints) - failedAttempts.put(last, failedAttempts.get(last) + 1); - else { - logger.debug("Too many attempts failed, device {}:{} adding delayed of {} ms", new Object[]{node, ep, delay}); - failedEndpoints.remove(last); - delayedReattempts.put(last, delay); - } - } - } - - private void inspectNode(ZToolAddress16 nwkAddress, ZToolAddress64 ieeeAddress) { - int nwk = nwkAddress.get16BitValue(); - final String ieee = IEEEAddress.toString(ieeeAddress.getLong()); - ZigBeeNodeImpl node = null; - boolean isNew = false, correctlyInspected = false; - final ZigBeeNetwork network = ApplicationFrameworkLayer.getAFLayer(driver).getZigBeeNetwork(); - synchronized (network) { - node = network.containsNode(ieee); - if (node == null) { - node = new ZigBeeNodeImpl(nwk, ieeeAddress, (short) driver.getCurrentPanId()); - isNew = true; - network.addNode(node); - logger.debug("Created node object for {} that was not available on the network", node); - } else { - - } - } - if (isNew) { - //logger.info("Inspecting node #{} devices.", nwk); - correctlyInspected = inspectEndpointOfNode(nwk, node); - if (correctlyInspected) { - return; - } else { - // if you don't remove node with devices not yet inspected from network, you won't be able to re-inspect them later - // maybe device is sleeping and you have to wait for a non-sleeping period - logger.debug("Node {} removed from network because attempts to instantiate devices on it are failed", node); - network.removeNode(node); - } - } else { - if (node.getNetworkAddress() != nwk) { //TODO We have to verify this step by means of JUnit - logger.warn( - "The device {} has been found again with a new network address {} ", - node, nwkAddress.get16BitValue() - ); - if (!changedNetworkAddress(node, nwk)) { - /* - * No previous device inspection completed successfully, so we should try to inspect - * the device again - */ - inspectEndpointOfNode(nwk, new ZigBeeNodeImpl(nwk, node.getIEEEAddress(), (short) driver.getCurrentPanId())); - } - node.setNetworkAddress(nwk); - } - for (final ZigBeeEndpoint endpoint : network.getEndPoints(node)) { - network.notifyEndpointUpdated(endpoint); - } - } - } - - /** - * This method updates the network address on all the device belonging the node
- * with the change network address
- * - * @param node {@link org.bubblecloud.zigbee.network.impl.ZigBeeNodeImpl} the old node with the obsoleted network address - * @param nwk the new network address of the node - * @return if at least a device has been updated - * @since 0.6.0 - Revision 74 - */ - private boolean changedNetworkAddress(ZigBeeNodeImpl node, int nwk) { - return false; - } - - boolean inspectingNewEndpoint = false; - private void inspectNewEndpoint() { - nextInspectionSlot = 10 + System.currentTimeMillis(); - final ImportingQueue.ZigBeeNodeAddress dev = queue.pop(); - inspectingNewEndpoint = true; - if (dev == null) { - inspectingNewEndpoint = false; - return; - } - final ZToolAddress16 nwk = dev.getNetworkAddress(); - final ZToolAddress64 ieee = dev.getIEEEAddress(); - logger.debug("Inspecting device {}.", IEEEAddress.toString(ieee.getLong())); - inspectNode(nwk, ieee); - logger.debug("Endpoint inspection completed, next inspection slot in {}", - Math.max(nextInspectionSlot - System.currentTimeMillis(), 0) - ); - inspectingNewEndpoint = false; - } - - private void inspectFailedEndpoint() { - //TODO We should add a statistical history for removing a device when we tried it too many times - logger.info("Trying to register a node extracted from FailedQueue"); - final ZigBeeEndpointReference failed = failedEndpoints.get(0); - nextInspectionSlot = 10 + System.currentTimeMillis(); - doCreateZigBeeEndpoint(failed.node, failed.endPoint); - } - - /** - * @return the number of Node waiting for inspection - * @since 0.6.0 - Revision 71 - */ - public int getPendingNodes() { - return queue.size(); - } - - /** - * @return the number of Node waiting for inspection - * @since 0.6.0 - Revision 71 - */ - public int getPendingEndpoints() { - return failedEndpoints.size(); - } - - public void run() { - logger.trace("{} STARTED Successfully", Thread.currentThread().getName()); - - while (!isEnd()) { - try { - if (!delayedReattempts.isEmpty()) { - Iterator> iterator = delayedReattempts.entrySet().iterator(); - while (iterator.hasNext()) { - Entry endpointReferenceEntry = iterator.next(); - if ((endpointReferenceEntry.getValue() + delay) >= System.currentTimeMillis()) { - failedEndpoints.add(endpointReferenceEntry.getKey()); - logger.debug("EP {} of node {} has been readded to queue for inspection after {} ms", - new Object[]{endpointReferenceEntry.getKey().endPoint, - endpointReferenceEntry.getKey().node, - System.currentTimeMillis() - endpointReferenceEntry.getValue()}); - } - } - } - ThreadUtils.waitingUntil(nextInspectionSlot); - - if (queue.size() > 0 && failedEndpoints.size() > 0) { - double sel = Math.random(); - if (sel > 0.6) { - inspectFailedEndpoint(); - } else { - inspectNewEndpoint(); - } - } else if (queue.size() == 0 && failedEndpoints.size() > 0) { - inspectFailedEndpoint(); - } else if (queue.size() > 0 && failedEndpoints.size() == 0) { - inspectNewEndpoint(); - } else if (queue.size() == 0 && failedEndpoints.size() == 0) { - inspectNewEndpoint(); - } - - } catch (Exception e) { - e.printStackTrace(); - } - } - - logger.trace("{} TERMINATED Successfully", Thread.currentThread().getName()); - } - - public synchronized boolean isEnd() { - return end; - } - - public synchronized void end() { - end = true; - } - - public boolean isReady() { - return queue.isEmpty() && !inspectingNewEndpoint; - } -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/discovery/ImportingQueue.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/discovery/ImportingQueue.java deleted file mode 100644 index c0c3349598fa2..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/discovery/ImportingQueue.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.discovery; - -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.ZToolAddress64; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.ArrayList; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class ImportingQueue { - - private static final Logger logger = LoggerFactory.getLogger(ImportingQueue.class); - private int waitingThread = 0; - private boolean closing = false; - - public class ZigBeeNodeAddress { - - private final ZToolAddress16 networkAddress; - private final ZToolAddress64 ieeeAddress; - - public ZigBeeNodeAddress(final ZToolAddress16 networkAddress, final ZToolAddress64 ieeeAddress) { - this.networkAddress = networkAddress; - this.ieeeAddress = ieeeAddress; - } - - public final ZToolAddress16 getNetworkAddress() { - return networkAddress; - } - - public final ZToolAddress64 getIEEEAddress() { - return ieeeAddress; - } - } - - private final ArrayList addresses = new ArrayList(); - - public void clear() { - synchronized (addresses) { - if (closing) return; - addresses.clear(); - } - } - - public boolean isEmpty() { - synchronized (addresses) { - return addresses.size() == 0; - } - } - - public int size() { - synchronized (addresses) { - return addresses.size(); - } - } - - public void push(ZToolAddress16 nwkAddress, ZToolAddress64 ieeeAddress) { - ZigBeeNodeAddress inserting = new ZigBeeNodeAddress(nwkAddress, ieeeAddress); - logger.trace("Adding {} ({})", nwkAddress, ieeeAddress); - synchronized (addresses) { - if (closing) return; - addresses.add(inserting); - addresses.notify(); - } - logger.trace("Added {} ({})", nwkAddress, ieeeAddress); - } - - public ZigBeeNodeAddress pop() { - ZigBeeNodeAddress result = null; - logger.trace("Removing element"); - synchronized (addresses) { - if (closing) return null; - waitingThread++; - while (addresses.isEmpty()) { - try { - addresses.wait(); - } catch (InterruptedException ignored) { - } - } - waitingThread--; - result = addresses.remove(addresses.size() - 1); - } - if (result != null) { - logger.trace("Removed {} {}", result.networkAddress, result.ieeeAddress); - } else { - logger.trace("Removed null value from the queue it means that queue is closing down"); - } - return result; - } - - public void close() { - do { - synchronized (addresses) { - if (waitingThread <= 0) return; - closing = true; - addresses.add(null); - addresses.notify(); - } - Thread.yield(); - } while (true); - } -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/discovery/LinkQualityIndicatorNetworkBrowser.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/discovery/LinkQualityIndicatorNetworkBrowser.java deleted file mode 100644 index 237ac8ae7aa95..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/discovery/LinkQualityIndicatorNetworkBrowser.java +++ /dev/null @@ -1,275 +0,0 @@ -/* - Copyright 2012-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -package org.bubblecloud.zigbee.network.discovery; - -import org.bubblecloud.zigbee.network.ZigBeeNetworkManager; -import org.bubblecloud.zigbee.network.impl.ZigBeeNetwork; -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.zdo.ZDO_IEEE_ADDR_REQ; -import org.bubblecloud.zigbee.network.packet.zdo.ZDO_IEEE_ADDR_RSP; -import org.bubblecloud.zigbee.network.packet.zdo.ZDO_MGMT_LQI_REQ; -import org.bubblecloud.zigbee.network.packet.zdo.ZDO_MGMT_LQI_RSP; -import org.bubblecloud.zigbee.network.packet.zdo.ZDO_MGMT_LQI_RSP.NeighborLqiListItemClass; -import org.bubblecloud.zigbee.util.Integers; -import org.bubblecloud.zigbee.util.RunnableThread; -import org.bubblecloud.zigbee.util.ThreadUtils; -import org.bubblecloud.zigbee.network.ZigBeeNode; -import org.bubblecloud.zigbee.network.impl.ApplicationFrameworkLayer; -import org.bubblecloud.zigbee.network.impl.ZigBeeNodeImpl; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Manlio Bacco - * @version $LastChangedRevision: 67 $ ($LastChangedDate: 2010-10-01 04:08:24 +0200 (ven, 01 ott 2010) $) - * @since 0.7.0 - */ -public class LinkQualityIndicatorNetworkBrowser extends RunnableThread { - - private static final Logger logger = LoggerFactory.getLogger(LinkQualityIndicatorNetworkBrowser.class); - - private static final short COORDINATOR_NWK_ADDRESS = 0; - private static final short LQI_START_INDEX = 0; - - private final ImportingQueue queue; - final ZigBeeNetworkManager driver; - - final ArrayList toInspect = new ArrayList(); - final HashMap alreadyInspected = new HashMap(); - private List connectedNodesFound = new ArrayList(); - - private class NetworkAddressNodeItem { - final NetworkAddressNodeItem parent; - final short address; - ZigBeeNodeImpl node = null; - - NetworkAddressNodeItem(NetworkAddressNodeItem addressTreeParent, short networkAddress) { - parent = addressTreeParent; - address = networkAddress; - } - - public String toString() { - if (parent != null) { - return "<" + parent.address + " / " + parent.node + "," + address + " / " + node + ">"; - } else { - return "< NULL ," + address + " / " + node + ">"; - } - } - } - - public LinkQualityIndicatorNetworkBrowser(ImportingQueue queue, ZigBeeNetworkManager driver) { - this.queue = queue; - this.driver = driver; - } - - private NetworkAddressNodeItem getIEEEAddress(short nwkAddress) { - - NetworkAddressNodeItem node = new NetworkAddressNodeItem(null, nwkAddress); - - ZDO_IEEE_ADDR_RSP ieee_addr_resp = driver.sendZDOIEEEAddressRequest( - new ZDO_IEEE_ADDR_REQ(nwkAddress, ZDO_IEEE_ADDR_REQ.REQ_TYPE.SINGLE_DEVICE_RESPONSE, (byte) 0) - ); - - if (ieee_addr_resp == null) { - logger.debug("No ZDO_IEEE_ADDR_RSP from #{}", nwkAddress); - return null; - } else { - logger.debug( - "ZDO_IEEE_ADDR_RSP from {} with {} associated", - ieee_addr_resp.getIEEEAddress(), ieee_addr_resp.getAssociatedNodeCount() - ); - - node.node = new ZigBeeNodeImpl(node.address, ieee_addr_resp.getIEEEAddress(), - (short) driver.getCurrentPanId()); - - ZToolAddress16 nwk = new ZToolAddress16( - Integers.getByteAsInteger(node.address, 1), - Integers.getByteAsInteger(node.address, 0) - ); - - if (!alreadyInspected.containsKey((int) node.address)) { - queue.push(nwk, ieee_addr_resp.getIEEEAddress()); - } - announceNode(node); - - return node; - } - } - - private void announceNodes(List nodes) { - - if (nodes != null) - for (int i = 0; i < nodes.size(); i++) - announceNode(nodes.get(i)); - } - - private void announceNode(NetworkAddressNodeItem node) { - - if (node != null) { - notifyBrowsedNode(node); - } - } - - private List lqiRequestToNode(NetworkAddressNodeItem node, int index) { - - if (alreadyInspected.get((int) node.address) == null) { - alreadyInspected.put((int) node.address, node); - - if (index == 0) - connectedNodesFound.clear(); - - ZToolAddress16 nwk16 = new ZToolAddress16( - Integers.getByteAsInteger(node.address, 1), - Integers.getByteAsInteger(node.address, 0) - ); - - logger.debug("ZDO_MGMT_LQI_REQ to {} from index {}", nwk16.get16BitValue(), index); - ZDO_MGMT_LQI_RSP lqi_resp = driver.sendLQIRequest(new ZDO_MGMT_LQI_REQ(nwk16, index)); - - if (lqi_resp == null) { - logger.debug("No LQI answer from #{}", nwk16.get16BitValue()); - return null; - } else { - logger.debug( - "Found {} neighbors on node {}", - lqi_resp.getNeighborLQICount(), node.address); - - NeighborLqiListItemClass[] neighbors = (NeighborLqiListItemClass[]) lqi_resp.getNeighborLqiList(); - - if (neighbors != null) { - for (int i = 0; i < neighbors.length; i++) { - NeighborLqiListItemClass neighbor = (NeighborLqiListItemClass) neighbors[i]; - - logger.debug("Node #{} visible from node #{} with LQI value {}", new Object[]{neighbor.NetworkAddress.get16BitValue(), nwk16.get16BitValue(), neighbor.RxLQI}); - - NetworkAddressNodeItem result = getIEEEAddress((short) neighbor.NetworkAddress.get16BitValue()); - NetworkAddressNodeItem newNode; - if (result != null) { - logger.debug("Node #{} is {}", new Object[]{neighbor.NetworkAddress.get16BitValue(), result.node.getIEEEAddress()}); - newNode = new NetworkAddressNodeItem(node, result.address); - connectedNodesFound.add(newNode); - } else { - newNode = new NetworkAddressNodeItem(node, (short) neighbor.NetworkAddress.get16BitValue()); - connectedNodesFound.add(newNode); - logger.debug("No response to ZDO_IEEE_ADDR_REQ from node {}", neighbor.NetworkAddress.get16BitValue()); - } - } - } - - // NeighborLQICount: neighbors IN THIS RESPONSE - // NeighborLQIEntries: all available neighbors - if (lqi_resp.getNeighborLQIEntries() > (lqi_resp.getNeighborLQICount() + index + 1)) { - logger.debug("ZDO_MGMT_LQI_REQ new request to {} because of too many entries for a single request," + - " restarting from index {}", node.address, lqi_resp.getNeighborLQICount() + index + 1); - lqiRequestToNode(node, lqi_resp.getNeighborLQICount() + index + 1); - } - - return connectedNodesFound; - } - } else { - logger.debug("Node {} inspected few seconds ago, request delayed", node.address); - return null; - } - } - - private void inspectQueue(ArrayList toInspectTemp) { - - for (int i = 0; i < toInspect.size(); i++) { - List children = new ArrayList(); - NetworkAddressNodeItem node = toInspect.get(i); - if (node != null) { - children = lqiRequestToNode(node, LQI_START_INDEX); - if (children != null) { - toInspectTemp.addAll(children); - announceNodes(children); - } - } - } - } - - public void task() { - - final String threadName = Thread.currentThread().getName(); - - logger.trace("{} STARTED Succesfully", threadName); - - while (!isDone()) { - cleanUpWalkingTree(); - - logger.debug("Inspecting ZigBee network for new nodes."); - - try { - NetworkAddressNodeItem coordinator = getIEEEAddress(COORDINATOR_NWK_ADDRESS); - if (coordinator != null) { - - //gt = new GraphThread(); - - List coordinatorChildren = lqiRequestToNode(coordinator, LQI_START_INDEX); - if (coordinatorChildren != null) - toInspect.addAll(coordinatorChildren); - - ArrayList toInspectTemp = new ArrayList(); - - while (!toInspect.isEmpty()) { - inspectQueue(toInspectTemp); - - toInspect.clear(); - if (!toInspectTemp.isEmpty()) - for (int i = 0; i < toInspectTemp.size(); i++) - toInspect.add(toInspectTemp.get(i)); - toInspectTemp.clear(); - } - toInspect.clear(); - } - - long wakeUpTime = System.currentTimeMillis() + 5 * 60 * 1000; - if (!isDone()) ThreadUtils.waitingUntil(wakeUpTime); - logger.info("Network browsing completed, waiting until {}", wakeUpTime); - //gt.run(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - //gt.end(); - logger.trace("{} TERMINATED Succesfully", threadName); - } - - private void cleanUpWalkingTree() { - alreadyInspected.clear(); - toInspect.clear(); - } - - private void notifyBrowsedNode(NetworkAddressNodeItem item) { - final ZigBeeNode child = item.node; - final ZigBeeNetwork network = ApplicationFrameworkLayer.getAFLayer(driver).getZigBeeNetwork(); - network.notifyNodeBrowsed(child); - } -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/discovery/ZigBeeDiscoveryManager.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/discovery/ZigBeeDiscoveryManager.java deleted file mode 100644 index ad9de96ff1208..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/discovery/ZigBeeDiscoveryManager.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -package org.bubblecloud.zigbee.network.discovery; - -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; -import org.bubblecloud.zigbee.network.ApplicationFrameworkMessageListener; -import org.bubblecloud.zigbee.network.ZigBeeNetworkManager; -import org.bubblecloud.zigbee.network.impl.ApplicationFrameworkLayer; -import org.bubblecloud.zigbee.network.impl.ZigBeeNetwork; -import org.bubblecloud.zigbee.network.impl.ZigBeeNodeImpl; -import org.bubblecloud.zigbee.network.model.DiscoveryMode; -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.af.AF_INCOMING_MSG; -import org.bubblecloud.zigbee.network.packet.zdo.ZDO_IEEE_ADDR_REQ; -import org.bubblecloud.zigbee.network.packet.zdo.ZDO_IEEE_ADDR_RSP; -import org.bubblecloud.zigbee.util.Integers; -import org.bubblecloud.zigbee.util.NetworkAddressUtil; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.EnumSet; -import java.util.HashSet; -import java.util.Set; - -/** - * This class is tracks the {@link org.bubblecloud.zigbee.network.ZigBeeNetworkManager} service available
- * and it creates all the resources required by this implementation of the ZigBee Base Driver - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @author Tommi S.E. Laukkanen - */ -public class ZigBeeDiscoveryManager implements ApplicationFrameworkMessageListener { - - private final static Logger logger = LoggerFactory.getLogger(ZigBeeDiscoveryManager.class); - - private ZigBeeNetworkManager networkManager; - - private AnnounceListenerImpl announceListener; - private AssociationNetworkBrowser associationNetworkBrowser = null; - private LinkQualityIndicatorNetworkBrowser linkQualityIndicatorNetworkBrowser = null; - - private EndpointBuilder endpointBuilder; - private final ImportingQueue importingQueue; - - private EnumSet enabledDiscoveries; - - private Set inspectedNetworkAddresses = new HashSet(); - - public ZigBeeDiscoveryManager(ZigBeeNetworkManager networkManager, final EnumSet enabledDiscoveries) { - importingQueue = new ImportingQueue(); - this.networkManager = networkManager; - this.enabledDiscoveries = enabledDiscoveries; - } - - public void startup() { - logger.trace("Setting up all the importer data and threads"); - importingQueue.clear(); - ApplicationFrameworkLayer.getAFLayer(networkManager); - - if (enabledDiscoveries.contains(DiscoveryMode.Announce)) { - announceListener = new AnnounceListenerImpl(importingQueue, networkManager); - networkManager.addAnnunceListener(announceListener); - } else { - logger.trace("ANNOUNCE discovery disabled."); - } - - if (enabledDiscoveries.contains(DiscoveryMode.Addressing)) { - associationNetworkBrowser = new AssociationNetworkBrowser(importingQueue, networkManager); - new Thread(associationNetworkBrowser, "NetworkBrowser[" + networkManager + "]").start(); - } else { - logger.trace("{} discovery disabled.", - AssociationNetworkBrowser.class); - } - - if (enabledDiscoveries.contains(DiscoveryMode.LinkQuality)) { - linkQualityIndicatorNetworkBrowser = new LinkQualityIndicatorNetworkBrowser(importingQueue, networkManager); - new Thread(linkQualityIndicatorNetworkBrowser, "LinkQualityIndicatorNetworkBrowser[" + networkManager + "]").start(); - } else { - logger.trace("{} discovery disabled.", - LinkQualityIndicatorNetworkBrowser.class); - } - - endpointBuilder = new EndpointBuilder(importingQueue, networkManager); - new Thread(endpointBuilder, "EndpointBuilder[" + networkManager + "]").start(); - - networkManager.addAFMessageListner(this); - } - - public void shutdown() { - //logger.info("Driver used left:clean up all the data and closing all the threads"); - - networkManager.removeAnnunceListener(announceListener); - - if (associationNetworkBrowser != null) { - associationNetworkBrowser.end(); - associationNetworkBrowser.interrupt(); - } - if (linkQualityIndicatorNetworkBrowser != null) { - linkQualityIndicatorNetworkBrowser.end(); - linkQualityIndicatorNetworkBrowser.interrupt(); - } - if (endpointBuilder != null) { - endpointBuilder.end(); - } - importingQueue.close(); - } - - - public boolean isInitialNetworkBrowsingComplete() { - return (associationNetworkBrowser == null || associationNetworkBrowser.isInitialNetworkBrowsingComplete()) - && endpointBuilder.isReady(); - } - - @Override - public void notify(AF_INCOMING_MSG msg) { - final int sourceNetworkAddress = msg.getSrcAddr(); - - synchronized (inspectedNetworkAddresses) { - if (!inspectedNetworkAddresses.contains(sourceNetworkAddress)) { - inspectedNetworkAddresses.add(sourceNetworkAddress); - new Thread(new Runnable() { - @Override - public void run() { - inspectNetworkAddress(sourceNetworkAddress); - } - }).start(); - } - } - } - - /** - * Inspect given network address. - * - * @param sourceNetworkAddress the network address to inspect - */ - private synchronized void inspectNetworkAddress(final int sourceNetworkAddress) { - logger.info("Inspecting node based on incoming AF message from network address #{}.", - sourceNetworkAddress); - - final ZDO_IEEE_ADDR_RSP result = networkManager.sendZDOIEEEAddressRequest( - new ZDO_IEEE_ADDR_REQ(sourceNetworkAddress, ZDO_IEEE_ADDR_REQ.REQ_TYPE.SINGLE_DEVICE_RESPONSE, (byte) 0) - ); - - if (result == null) { - logger.info("Node did not respond to ZDO_IEEE_ADDR_REQ #{}", sourceNetworkAddress); - } else if (result.Status == 0) { - logger.info("Node network address #{} resolved to IEEE address {}.", sourceNetworkAddress, result.getIEEEAddress()); - final ZigBeeNodeImpl node = new ZigBeeNodeImpl(sourceNetworkAddress, result.getIEEEAddress(), - (short) networkManager.getCurrentPanId()); - - ZToolAddress16 nwk = new ZToolAddress16( - Integers.getByteAsInteger(sourceNetworkAddress, 1), - Integers.getByteAsInteger(sourceNetworkAddress, 0) - ); - importingQueue.push(nwk, result.getIEEEAddress()); - - final ZigBeeNetwork network = ApplicationFrameworkLayer.getAFLayer(networkManager).getZigBeeNetwork(); - network.notifyNodeBrowsed(node); - } else { - logger.info("Node #{} ZDO_IEEE_ADDR_REQ failed with status {} ", sourceNetworkAddress, - Status.getStatus((byte) result.Status)); - } - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/impl/ApplicationFrameworkLayer.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/impl/ApplicationFrameworkLayer.java deleted file mode 100644 index 643cd21283d9c..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/impl/ApplicationFrameworkLayer.java +++ /dev/null @@ -1,362 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.impl; - -import org.bubblecloud.zigbee.api.ZigBeeApiConstants; -import org.bubblecloud.zigbee.api.cluster.impl.api.core.Status; -import org.bubblecloud.zigbee.network.ClusterMessage; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.network.ZigBeeNetworkManager; -import org.bubblecloud.zigbee.network.packet.af.AF_REGISTER; -import org.bubblecloud.zigbee.network.packet.af.AF_REGISTER_SRSP; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.*; - -/** - * This class is a singelton aimed at share the the Application Framework Layer
- * status of the ZigBee Base Drier among all the {@link org.bubblecloud.zigbee.network.ZigBeeEndpoint} register by it.
- *
- * In particular, this class tracks the Transaction Id and the Active End Point
- * on the hardware providing access to ZigBee Network (currently the Texas Instrument CC2480)
- * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class ApplicationFrameworkLayer { - - private final static Object LOCK = new Object(); - private final static Logger logger = LoggerFactory.getLogger(ApplicationFrameworkLayer.class); - - class SenderIdentifier { - int profileId; - int clusterId; - - public SenderIdentifier(int profileId, int clusterId) { - this.profileId = profileId; - this.clusterId = clusterId; - } - - @Override - public int hashCode() { - return (profileId << 16) + clusterId; - } - - public boolean equals(Object o) { - if (o instanceof SenderIdentifier) { - SenderIdentifier si = (SenderIdentifier) o; - return si.profileId == profileId && si.clusterId == clusterId; - } else { - return false; - } - } - } - - private static ApplicationFrameworkLayer singelton; - - final HashMap sender2EndPoint = new HashMap(); - final HashMap> profile2Cluster = new HashMap>(); - final HashMap endPoint2Transaction = new HashMap(); - - private final ZigBeeNetworkManager driver; - private final ZigBeeNetwork network; - - private byte firstFreeEndPoint; - - - private ApplicationFrameworkLayer(ZigBeeNetworkManager driver) { - this.driver = driver; - firstFreeEndPoint = 1; - network = new ZigBeeNetwork(); - } - - public static ApplicationFrameworkLayer getAFLayer(ZigBeeNetworkManager driver) { - synchronized (LOCK) { - if (singelton == null) { - singelton = new ApplicationFrameworkLayer(driver); - } else if (singelton.driver != driver) { - /* - * It means that the service implementing the driver has been changed - * so we have to create a new ApplicationFrameworkLayer - */ - singelton = new ApplicationFrameworkLayer(driver); - } - return singelton; - } - } - - - public short getSendingEndpoint(ZigBeeEndpoint endpoint, int clusterId) { - SenderIdentifier si = new SenderIdentifier( - ZigBeeApiConstants.PROFILE_ID_HOME_AUTOMATION, (short) clusterId - ); - logger.trace("Looking for a registered enpoint among {}", sender2EndPoint.size()); - synchronized (sender2EndPoint) { - if (sender2EndPoint.containsKey(si)) { - logger.trace("An enpoint already registered for =<{},{}>", si.profileId, si.clusterId); - return sender2EndPoint.get(si); - } else { - logger.info("No endpoint registered for =<{},{}>", si.profileId, si.clusterId); - final byte ep = createEndPoint(si, endpoint.getProfileId()); - return ep; - } - } - } - - public short getSendingEndpoint(ZigBeeEndpoint endpoint, ClusterMessage input) { - return getSendingEndpoint(endpoint, input.getId()); - } - - /** - * Creates default sending end point. - */ - public void createDefaultSendingEndPoint() { - final SenderIdentifier si = new SenderIdentifier( - ZigBeeApiConstants.PROFILE_ID_HOME_AUTOMATION, - (short) ZigBeeApiConstants.CLUSTER_ID_BASIC - ); - final byte endPoint = getFreeEndPoint(); - final List clusterSet = Arrays.asList( - ZigBeeApiConstants.CLUSTER_ID_BASIC, - ZigBeeApiConstants.CLUSTER_ID_POWER_CONFIGURATION, - ZigBeeApiConstants.CLUSTER_ID_DEVICE_TEMPERATURE_CONFIGURATION, - ZigBeeApiConstants.CLUSTER_ID_IDENTIFY, - ZigBeeApiConstants.CLUSTER_ID_GROUPS, - ZigBeeApiConstants.CLUSTER_ID_SCENES, - ZigBeeApiConstants.CLUSTER_ID_ON_OFF, - ZigBeeApiConstants.CLUSTER_ID_ON_OFF_SWITCH_CONFIGURATION , - ZigBeeApiConstants.CLUSTER_ID_LEVEL_CONTROL, - ZigBeeApiConstants.CLUSTER_ID_ALARMS, - ZigBeeApiConstants.CLUSTER_ID_BINARY_INPUT, - ZigBeeApiConstants.CLUSTER_ID_TIME, - ZigBeeApiConstants.CLUSTER_ID_ANALOG_INPUT, - ZigBeeApiConstants.CLUSTER_ID_COMMISSIONING, - ZigBeeApiConstants.CLUSTER_ID_METERING, - ZigBeeApiConstants.CLUSTER_ID_SHADE_CONFIGURATION, - ZigBeeApiConstants.CLUSTER_ID_DOOR_LOCK, - ZigBeeApiConstants.CLUSTER_ID_WINDOW_COVERING, - ZigBeeApiConstants.CLUSTER_ID_PUMP_CONFIGURATION_AND_CONTROL, - ZigBeeApiConstants.CLUSTER_ID_THERMOSTAT, - ZigBeeApiConstants.CLUSTER_ID_FAN_CONTROL, - ZigBeeApiConstants.CLUSTER_ID_THERMOSTAT_USER_INTERFACE_CONFIGURATION, - ZigBeeApiConstants.CLUSTER_ID_COLOR_CONTROL, - ZigBeeApiConstants.CLUSTER_ID_PRESSURE_MEASUREMENT, - ZigBeeApiConstants.CLUSTER_ID_ILLUMINANCE_MEASUREMENT, - ZigBeeApiConstants.CLUSTER_ID_ILLUMINANCE_LEVEL_SENSING, - ZigBeeApiConstants.CLUSTER_ID_TEMPERATURE_MEASUREMENT, - ZigBeeApiConstants.CLUSTER_ID_FLOW_MEASUREMENT, - ZigBeeApiConstants.CLUSTER_ID_RELATIVE_HUMIDITY_MEASUREMENT, - ZigBeeApiConstants.CLUSTER_ID_OCCUPANCY_SENSING, - ZigBeeApiConstants.CLUSTER_ID_IAS_ZONE, - ZigBeeApiConstants.CLUSTER_ID_IAS_ACE, - ZigBeeApiConstants.CLUSTER_ID_IAS_WD - ); - - final int[] clusters = new int[clusterSet.size()]; - if (clusters.length > 33) { - throw new RuntimeException("Too many default clusters."); - } - - int index = 0; - for (final Integer cluster : clusterSet) { - clusters[index] = cluster; - index++; - } - - final AF_REGISTER_SRSP result = driver.sendAFRegister(new AF_REGISTER( - endPoint, si.profileId, (short) 0, (byte) 0, - new int[0], clusters - )); - - if (result.getStatus() != 0) { - // Default end point creation failed probably due to end point already exists. - logger.warn("Default end point creation failed with status: {} ", Status.getStatus((byte) result.getStatus())); - return; - } - - logger.info("Registered default sending endpoint {} with clusters: {}", endPoint, clusters); - registerSenderEndPoint(endPoint, si.profileId, clusters); - } - - private byte createEndPoint(SenderIdentifier si, int receiverProfileId) { - byte endPoint = getFreeEndPoint(); - logger.debug("Registering a new endpoint for <{},{}>", si.profileId, si.clusterId); - - Set clusterSet = collectClusterForProfile(receiverProfileId); - final int[] clusters = new int[clusterSet.size()]; - - int index = 0; - for (final Integer cluster : clusterSet) { - clusters[index] = cluster; - index++; - } - - if (clusters.length > 33) { - logger.warn( - "We found too many cluster to implement for a single endpoint " + - "(maxium is 32), so we are filtering out the extra {}", clusters - ); - /* - * Too many cluster to implement for this profile we must use the first 31 - * plus the cluster that we are trying to create as 32nd value - */ - int[] values = new int[33]; - values[0] = si.clusterId; - for (int i = 1; i < values.length; i++) { - values[i] = clusters[i]; - } - logger.warn("Following the list of filtered cluster that we are going to register: {} ", clusters); - } - AF_REGISTER_SRSP result = null; - int retry = 0; - do { - result = driver.sendAFRegister(new AF_REGISTER( - endPoint, si.profileId, (short) 0, (byte) 0, - new int[0], clusters - )); - //FIX We should retry only when Status != 0xb8 ( Z_APS_DUPLICATE_ENTRY ) - if (result.getStatus() != 0) { - if (retry < 1) { - endPoint = getFreeEndPoint(); - } else { - /* - * //TODO We should provide a workaround for the maximum number of registered EndPoint - * For example, with the CC2480 we could reset the dongle - */ - throw new IllegalStateException("Unable create a new Endpoint. AF_REGISTER command failed with " + result.getStatus() + ":" + result.getErrorMsg()); - } - } else { - break; - } - } while (true); - final int profileId = si.profileId; - - logger.debug("Registered endpoint {} with clusters: {}", endPoint, clusters); - - registerSenderEndPoint(endPoint, profileId, clusters); - return endPoint; - } - - public void registerSenderEndPoint(short endPoint, int profileId, int[] clusters) { - final List list; - synchronized (profile2Cluster) { - if (profile2Cluster.containsKey(profileId)) { - list = profile2Cluster.get(profileId); - } else { - list = new ArrayList(); - profile2Cluster.put(profileId, list); - } - } - synchronized (sender2EndPoint) { - for (int i = 0; i < clusters.length; i++) { - list.add(clusters[i]); - SenderIdentifier adding = new SenderIdentifier(profileId, clusters[i]); - if (sender2EndPoint.containsKey(adding)) { - if (sender2EndPoint.get(adding).equals(endPoint)) { - continue; - } - logger.warn("Overriding a valid endpoint with this {}", adding); - } - logger.debug("Adding <{},{}> to sender2EndPoint hashtable", adding.profileId, adding.clusterId); - sender2EndPoint.put(adding, endPoint); - } - } - } - - private Set collectClusterForProfile(int profileId) { - final HashSet clusters = new HashSet(); - final Collection endpoints = network.getEndpoints(profileId); - logger.debug("Found {} devices belonging to profile {}", endpoints.size(), profileId); - for (ZigBeeEndpoint endpoint : endpoints) { - int[] ids; - ids = endpoint.getInputClusters(); - logger.debug( - "Device {} provides the following cluster as input {}", - endpoint.getEndpointId(), ids - ); - for (int i = 0; i < ids.length; i++) { - clusters.add(ids[i]); - } - ids = endpoint.getOutputClusters(); - logger.debug( - "Device {} provides the following cluster as input {}", - endpoint.getEndpointId(), ids - ); - for (int i = 0; i < ids.length; i++) { - clusters.add(ids[i]); - } - } - - final List implementedCluster = profile2Cluster.get(profileId); - if (implementedCluster != null) { - logger.debug("List of clusters of profile {} already provided by some registered endpoint {}", profileId, - implementedCluster); - clusters.removeAll(implementedCluster); - } else { - logger.debug("No previus clusters registered on any endpoint of the dongle for the profile {}", profileId); - } - - return clusters; - } - - public ZigBeeNetwork getZigBeeNetwork() { - return network; - } - - public byte getNextTransactionId(short endPoint) { - if (!endPoint2Transaction.containsKey(endPoint)) { - endPoint2Transaction.put(endPoint, (byte) 1); - } - byte value = endPoint2Transaction.get(endPoint); - switch (value) { - case 127: { - endPoint2Transaction.put(endPoint, (byte) -128); - return 127; - } - default: { - endPoint2Transaction.put(endPoint, (byte) (value + 1)); - return value; - } - } - } - - private byte getFreeEndPoint() { - switch (firstFreeEndPoint) { - case 127: { - firstFreeEndPoint = -128; - return 127; - } - case -15: { - throw new IllegalStateException("No more end point free"); - } - default: { - firstFreeEndPoint += 1; - return (byte) (firstFreeEndPoint - 1); - } - } - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/impl/ClusterMessageImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/impl/ClusterMessageImpl.java deleted file mode 100644 index 918a7542cedc9..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/impl/ClusterMessageImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.impl; - -import org.bubblecloud.zigbee.network.ClusterMessage; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class ClusterMessageImpl implements ClusterMessage { - - private final byte[] msg; - private final short id; - - - public ClusterMessageImpl(byte[] msg, short id) { - this.msg = msg; - this.id = id; - } - - public byte[] getClusterMsg() { - return msg; - } - - public short getId() { - return id; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/impl/WaitForClusterResponse.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/impl/WaitForClusterResponse.java deleted file mode 100644 index d45f731a63a5e..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/impl/WaitForClusterResponse.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.impl; - -import org.bubblecloud.zigbee.network.ApplicationFrameworkMessageConsumer; -import org.bubblecloud.zigbee.network.ApplicationFrameworkMessageProducer; -import org.bubblecloud.zigbee.network.packet.af.AF_INCOMING_MSG; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * This class register itself as {@link org.bubblecloud.zigbee.network.ApplicationFrameworkMessageConsumer} to the given {@link org.bubblecloud.zigbee.network.ApplicationFrameworkMessageProducer}
- * and it wait for a matching {@link org.bubblecloud.zigbee.network.packet.af.AF_INCOMING_MSG}. As soon as the matching {@link org.bubblecloud.zigbee.network.packet.af.AF_INCOMING_MSG}
- * is received or the timeout expires the the object unregister itself from {@link org.bubblecloud.zigbee.network.ApplicationFrameworkMessageProducer}
- * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class WaitForClusterResponse implements ApplicationFrameworkMessageConsumer { - - private static final Logger logger = LoggerFactory.getLogger(WaitForClusterResponse.class); - - private byte transId; - private short clusterId; - private long timeout = -1; - private AF_INCOMING_MSG response = null; - private ApplicationFrameworkMessageProducer producer; - - private final Thread waiter; - - - /** - * @param timeout the maximum number of milliseconds to wait for. The value -1 means unlimited waiting time. - * @since 0.4.0 - */ - public WaitForClusterResponse(final ApplicationFrameworkMessageProducer producer, final byte transaction, - final short id, final long timeout, final Thread thread) { - - synchronized (this) { - this.producer = producer; - this.producer.addAFMessageConsumer(this); - this.timeout = timeout; - this.waiter = thread; - response = null; - //BUG the CC2480 always send AF_INCOMING_MSG with transaction 0 so we must not use it - transId = transaction; - clusterId = id; - } - } - - /** - * @param timeout the maximum number of milliseconds to wait for. The value -1 means unlimited waiting time. - */ - public WaitForClusterResponse(final ApplicationFrameworkMessageProducer producer, final byte transaction, - final short id, final long timeout) { - - this(producer, transaction, id, timeout, Thread.currentThread()); - } - - public boolean consume(AF_INCOMING_MSG msg) { - //THINK Is the following matching algorithm correct?!?!? - if (msg.getClusterId() != clusterId) { - logger.trace("Unable to consume AF_INCOMING_MSG, because cluster {} != {}", msg.getClusterId(), clusterId); - return false; - } - if (msg.getTransId() != transId) { - logger.trace("Received different transaction {} != {}", msg.getTransId(), transId); - } - logger.trace( - "Consuming message with ClusterId: {} TransactionId: {} for thread {}/{}", - new Object[]{ - msg.getClusterId(), msg.getTransId(), waiter.getName(), waiter.getClass().getName() - } - ); - synchronized (this) { - response = msg; - notify(); - } - //We wait for a cluster at the time - producer.removeAFMessageConsumer(this); - return true; - } - - /** - * Wait until an {@link org.bubblecloud.zigbee.network.packet.af.AF_INCOMING_MSG} arrives from the ZigBee Network. The message
- * has to match the specified parameters and has to arrive before a timout otherwise null
- * will be returned. - * - * @return {@link org.bubblecloud.zigbee.network.packet.af.AF_INCOMING_MSG} that match the filter used with the constructor
- * {@link #WaitForClusterResponse(byte, short)} - */ - public AF_INCOMING_MSG getResponse() { - final long wakeUpTime = System.currentTimeMillis() + timeout; - AF_INCOMING_MSG msg = null; - - synchronized (this) { - while (response == null && (timeout > 0 && wakeUpTime > System.currentTimeMillis())) { - try { - wait(wakeUpTime - System.currentTimeMillis()); - } catch (InterruptedException ignored) { - } - } - msg = response; - response = null; - producer.removeAFMessageConsumer(this); - } - return msg; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/impl/ZigBeeBasedriverTimeOutException.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/impl/ZigBeeBasedriverTimeOutException.java deleted file mode 100755 index 46ae93fc8dea1..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/impl/ZigBeeBasedriverTimeOutException.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - Copyright 2013-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.impl; - -/** - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.6.0 - */ -public class ZigBeeBasedriverTimeOutException extends ZigBeeNetworkManagerException { - - public ZigBeeBasedriverTimeOutException() { - super("Timeout expired before receiving any data"); - } - - public ZigBeeBasedriverTimeOutException(String msg) { - super(msg); - } - - public ZigBeeBasedriverTimeOutException(Throwable ex) { - super(ex); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/impl/ZigBeeEndpointImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/impl/ZigBeeEndpointImpl.java deleted file mode 100644 index c4febbb9c8378..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/impl/ZigBeeEndpointImpl.java +++ /dev/null @@ -1,480 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.impl; - -import org.bubblecloud.zigbee.network.*; -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.af.AF_DATA_CONFIRM; -import org.bubblecloud.zigbee.network.packet.af.AF_DATA_REQUEST; -import org.bubblecloud.zigbee.network.packet.af.AF_INCOMING_MSG; -import org.bubblecloud.zigbee.network.packet.zdo.*; -import org.bubblecloud.zigbee.util.Integers; -import org.bubblecloud.zigbee.util.ThreadUtils; -import org.bubblecloud.zigbee.network.model.IEEEAddress; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.*; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class ZigBeeEndpointImpl implements ZigBeeEndpoint, ApplicationFrameworkMessageListener, ApplicationFrameworkMessageProducer { - - private static final Logger logger = LoggerFactory.getLogger(ZigBeeEndpointImpl.class); - - private static long TIMEOUT; - private static final long DEFAULT_TIMEOUT = 5000; - - private final int[] inputs; - private final int[] outputs; - - private final int deviceId; - private final int profileId; - private final byte deviceVersion; - - private final ZigBeeNode node; - private final short endPoint; - - //private final Properties properties = new Properties(); - private final ZigBeeNetworkManager networkManager; - - private final HashSet boundCluster = new HashSet(); - private final HashSet listeners = new HashSet(); - private final HashSet consumers = new HashSet(); - private String endpointId = null; - - public ZigBeeEndpointImpl(final ZigBeeNetworkManager zigBeeNetworkManager, final ZigBeeNode n, short ep) throws ZigBeeNetworkManagerException { - if (zigBeeNetworkManager == null || n == null) { - logger.error("Creating {} with some nulls parameters {}", new Object[]{ZigBeeEndpoint.class, zigBeeNetworkManager, n, ep}); - throw new NullPointerException("Cannot create a device with a null ZigBeeNetworkManager or a null ZigBeeNode"); - } - networkManager = zigBeeNetworkManager; - endPoint = ep; - - final ZDO_SIMPLE_DESC_RSP result = doRetrieveSimpleDescription(n); - short[] ins = result.getInputClustersList(); - inputs = new int[ins.length]; - for (int i = 0; i < ins.length; i++) { - inputs[i] = ins[i]; - } - Arrays.sort(inputs); - short[] outs = result.getOutputClustersList(); - outputs = new int[outs.length]; - for (int i = 0; i < outs.length; i++) { - outputs[i] = outs[i]; - } - Arrays.sort(outputs); - - deviceId = (int) result.getDeviceId() & 0xFFFF; - profileId = (int) result.getProfileId() & 0xFFFF; - deviceVersion = result.getDeviceVersion(); - - node = n; - - final StringBuffer sb_uuid = new StringBuffer() - .append(node.getIEEEAddress()) - .append("/") - .append(endPoint); - endpointId = sb_uuid.toString(); - - TIMEOUT = DEFAULT_TIMEOUT; - } - - private ZDO_SIMPLE_DESC_RSP doRetrieveSimpleDescription(ZigBeeNode n) throws ZigBeeNetworkManagerException { - //TODO Move into ZigBeeNetworkManager?!?!? - final int nwk = n.getNetworkAddress(); - int i = 0; - ZDO_SIMPLE_DESC_RSP result = null; - - while (i < 3) { - logger.debug("Inspecting node {} / end point {}.", n, endPoint); - - result = networkManager.sendZDOSimpleDescriptionRequest( - new ZDO_SIMPLE_DESC_REQ((short) nwk, endPoint) - ); - if (result == null) { - //long waiting = (long) (Math.random() * (double) Activator.getCurrentConfiguration().getMessageRetryDelay()) - final long waiting = 1000; - ThreadUtils.waitNonPreemptive(waiting); - i++; - logger.debug( - "Inspecting ZigBee EndPoint <{},{}> failed during it {}-th attempts. " + - "Waiting for {}ms before retrying", - new Object[]{nwk, endPoint, i, waiting} - ); - - } else { - break; - } - } - - if (result == null) { - logger.error( - "Unable to receive a ZDO_SIMPLE_DESC_RSP for endpoint {} on node {}", - nwk, endPoint - ); - throw new ZigBeeNetworkManagerException("Unable to receive a ZDO_SIMPLE_DESC_RSP from endpoint"); - } - - return result; - } - - public int getDeviceTypeId() { - return deviceId; - } - - public short getDeviceVersion() { - return deviceVersion; - } - - public String getEndpointId() { - return endpointId; - } - - @Override - public int getNetworkAddress() { - return node.getNetworkAddress(); - } - - @Override - public String getIEEEAddress() { - return node.getIEEEAddress(); - } - - public short getEndPointAddress() { - return endPoint; - } - - public int[] getInputClusters() { - return inputs; - } - - public int[] getOutputClusters() { - return outputs; - } - - public int getProfileId() { - return profileId; - } - - public ZigBeeNode getNode() { - return node; - } - - public void send(ClusterMessage input) throws ZigBeeNetworkManagerException { - synchronized (networkManager) { - final ApplicationFrameworkLayer af = ApplicationFrameworkLayer.getAFLayer(networkManager); - final short sender = af.getSendingEndpoint(this, input); - final byte transaction = af.getNextTransactionId(sender); - final byte[] msg = input.getClusterMsg(); - - //TODO Create radius and options according to the current configuration - AF_DATA_CONFIRM response = networkManager.sendAFDataRequest(new AF_DATA_REQUEST( - (short) node.getNetworkAddress(), (byte) endPoint, sender, input.getId(), - transaction, (byte) 0 /*options*/, (byte) 0 /*radius*/, msg - )); - - if (response == null) { - throw new ZigBeeNetworkManagerException("Unable to send cluster on the ZigBee network due to general error"); - } else if (response.getStatus() != 0) { - throw new ZigBeeNetworkManagerException("Unable to send cluster on the ZigBee network:" + response.getErrorMsg()); - } - } - } - - public ClusterMessage invoke(ClusterMessage input) throws ZigBeeNetworkManagerException { - synchronized (networkManager) { - final ApplicationFrameworkLayer af = ApplicationFrameworkLayer.getAFLayer(networkManager); - final short sender = af.getSendingEndpoint(this, input); - /* - //FIX Removed because transaction is always 0 for the response due to a bug of CC2480 - final byte transaction = af.getNextTransactionId(sender); - the next line is a workaround for the problem - */ - final byte transaction = af.getNextTransactionId(sender); - final byte[] msg = input.getClusterMsg(); - - m_addAFMessageListener(); - - //Registering the waiter before sending the message, so that they will be captured - WaitForClusterResponse waiter = new WaitForClusterResponse( - this, transaction, input.getId(), TIMEOUT - ); - - logger.trace("---> SENDING transaction: " + transaction + " TO: " + node.getNetworkAddress() + " with" - + " byte 0 " + Integers.getByteAsInteger(node.getNetworkAddress(), 0) - + " byte 1 " + Integers.getByteAsInteger(node.getNetworkAddress(), 1) - + " byte 2 " + Integers.getByteAsInteger(node.getNetworkAddress(), 2) - + " byte 3 " + Integers.getByteAsInteger(node.getNetworkAddress(), 3) - + " from end point: " + sender - + " to end point: " + endPoint - ); - //TODO Create radius and options according to the current configuration - AF_DATA_CONFIRM response = networkManager.sendAFDataRequest(new AF_DATA_REQUEST( - node.getNetworkAddress(), endPoint, sender, input.getId(), - transaction, (byte) (0) /*options*/, (byte) 0 /*radius*/, msg - )); - - if (response == null) { - m_removeAFMessageListener(); - throw new ZigBeeNetworkManagerException("Unable to send cluster on the ZigBee network due to general error - is the device sleeping?"); - } else if (response.getStatus() != 0) { - m_removeAFMessageListener(); - final ResponseStatus responseStatus = ResponseStatus.getStatus(Integers.getByteAsInteger(response.getStatus(), 0)); - - /*if (responseStatus == ResponseStatus.Z_MAC_NO_ACK) { - logger.info("Removing unresponsive device: " + getIEEEAddress()); - ApplicationFrameworkLayer.getAFLayer(networkManager).getZigBeeNetwork().removeNode(this.getNode()); - }*/ - - throw new ZigBeeNetworkManagerException("Unable to send cluster on the ZigBee network due to: " - + responseStatus + " (" + response.getErrorMsg() + ")"); - } else { - //FIX Can't be singleton because the invoke method can be invoked by multiple-thread - AF_INCOMING_MSG incoming = waiter.getResponse(); - m_removeAFMessageListener(); - if (incoming == null) { - throw new ZigBeeBasedriverTimeOutException(); - } - ClusterMessage result = new ClusterMessageImpl(incoming.getData(), incoming.getClusterId()); - return result; - } - } - } - - public boolean providesInputCluster(int id) { - for (int i = 0; i < inputs.length; i++) { - if (inputs[i] == id) return true; - } - return false; - } - - public boolean providesOutputCluster(int id) { - for (int i = 0; i < outputs.length; i++) { - if (outputs[i] == id) return true; - } - return false; - } - - public boolean bindTo(ZigBeeEndpoint endpoint, int clusterId) throws ZigBeeNetworkManagerException { - logger.info("Binding from endpoint {} to {} for cluster {}", new Object[]{ - getEndpointId(), endpoint.getEndpointId(), new Integer(clusterId) - }); - - final ZDO_BIND_RSP response = networkManager.sendZDOBind(new ZDO_BIND_REQ( - (short) getNode().getNetworkAddress(), (short) clusterId, - IEEEAddress.fromColonNotation(getNode().getIEEEAddress()), (byte) endPoint, - IEEEAddress.fromColonNotation(endpoint.getNode().getIEEEAddress()), (byte) endpoint.getDeviceTypeId() - )); - if (response == null || response.Status != 0) { - logger.warn("ZDO_BIND_REQ failed due to {}, unable to bind from endpoint {} to {} for cluster {}", new Object[]{ - ResponseStatus.getStatus(response.Status) ,getEndpointId(), endpoint.getEndpointId(), - new Integer(clusterId) - }); - return false; - } - return true; - } - - public boolean unbindFrom(ZigBeeEndpoint endpoint, int clusterId) throws ZigBeeNetworkManagerException { - logger.info("Un-binding from endpoint {} to {} for cluster {}", new Object[]{ - getEndpointId(), endpoint.getEndpointId(), new Integer(clusterId) - }); - - final ZDO_UNBIND_RSP response = networkManager.sendZDOUnbind(new ZDO_UNBIND_REQ( - (short) getNode().getNetworkAddress(), (short) clusterId, - IEEEAddress.fromColonNotation(getNode().getIEEEAddress()), (byte) endPoint, - IEEEAddress.fromColonNotation(endpoint.getNode().getIEEEAddress()), (byte) endpoint.getDeviceTypeId() - )); - if (response == null || response.Status != 0) { - logger.warn("ZDO_BIND_REQ failed, unable to un-bind from endpoint {} to {} for cluster {}", new Object[]{ - getEndpointId(), endpoint.getEndpointId(), new Integer(clusterId) - }); - return false; - } - return true; - } - - - public boolean bindToLocal(int clusterId) throws ZigBeeNetworkManagerException { - if (boundCluster.contains(clusterId)) { - logger.debug("Cluster already bound"); - return true; - } - - short dstEP = ApplicationFrameworkLayer.getAFLayer(networkManager).getSendingEndpoint(this, clusterId); - - logger.info("Binding from endpoint {} to {} for cluster {}", new Object[]{ - getEndpointId(), IEEEAddress.toString(networkManager.getIEEEAddress()) + "/" + dstEP, new Integer(clusterId) - }); - - final ZDO_BIND_RSP response = networkManager.sendZDOBind(new ZDO_BIND_REQ( - (short) getNode().getNetworkAddress(), (short) clusterId, - IEEEAddress.fromColonNotation(getNode().getIEEEAddress()), (byte) endPoint, - networkManager.getIEEEAddress(), (byte) dstEP - )); - if (response == null || response.Status != 0) { - logger.warn("ZDO_BIND_REQ failed due to {}, unable to bind from endpoint {} to {} for cluster {}", new Object[]{ - response==null?"Timeout":ResponseStatus.getStatus(response.Status) ,getEndpointId(), - IEEEAddress.toString(networkManager.getIEEEAddress()) + "/" + dstEP, - new Integer(clusterId) - }); - return false; - } - boundCluster.add(clusterId); - return true; - } - - public boolean unbindFromLocal(int clusterId) throws ZigBeeNetworkManagerException { - logger.info("Unbinding from cluster {} of endpoint {}", clusterId, getEndpointId()); - if (!boundCluster.contains(clusterId)) { - logger.warn("Cluster already unbound"); - return true; - } - - short dstEP = ApplicationFrameworkLayer.getAFLayer(networkManager).getSendingEndpoint(this, clusterId); - - final ZDO_UNBIND_RSP response = networkManager.sendZDOUnbind(new ZDO_UNBIND_REQ( - (short) getNode().getNetworkAddress(), (short) clusterId, - IEEEAddress.fromColonNotation(getNode().getIEEEAddress()), (byte) endPoint, - networkManager.getIEEEAddress(), (byte) dstEP - )); - if (response == null || response.Status != 0) { - logger.warn("ZDO_BIND_REQ failed, unable to unbind"); - return false; - } - boundCluster.remove(clusterId); - return true; - } - - private void m_addAFMessageListener() { - if (listeners.isEmpty() && consumers.size() == 0) { - logger.debug("Registered {} as {}", this, ApplicationFrameworkMessageListener.class.getName()); - networkManager.addAFMessageListner(this); - } else { - logger.debug("Skipped to registered {} as {}", this, ApplicationFrameworkMessageListener.class.getName()); - logger.trace( - "Skipped registration due to: listeners.isEmpty() = {} or consumers.size() = {}", - listeners.isEmpty(), consumers.size() - ); - } - } - - private void m_removeAFMessageListener() { - if (listeners.isEmpty() && consumers.size() == 0) { - logger.debug("Unregistered {} as {}", this, ApplicationFrameworkMessageListener.class.getName()); - networkManager.removeAFMessageListener(this); - } else { - logger.debug("Skipped unregistration of {} as {}", this, ApplicationFrameworkMessageListener.class.getName()); - logger.trace( - "Skipped unregistration due to: listeners.isEmpty() = {} or consumers.size() = {}", - listeners.isEmpty(), consumers.size() - ); - } - } - - public boolean addClusterListener(ClusterListener listener) { - m_addAFMessageListener(); - - return listeners.add(listener); - } - - public boolean removeClusterListener(ClusterListener listener) { - boolean result = listeners.remove(listener); - m_removeAFMessageListener(); - return result; - } - - private void notifyClusterListener(ClusterMessage c) { - ArrayList localCopy; - synchronized (listeners) { - localCopy = new ArrayList(listeners); - } - if (localCopy.size() > 0) { - logger.debug("Notifying {} ClusterListener of {}", localCopy.size(), c.getClusterMsg()); - - for (ClusterListener listner : localCopy) { - try { - final ClusterFilter filter = listner.getClusterFilter(); - if (filter == null) { - listner.handleCluster(this, c); - } else if (filter.match(c) == true) { - listner.handleCluster(this, c); - } - } catch (Throwable t) { - logger.error("Error during dispatching of Cluster <{},{}>", c.getId(), c.getClusterMsg()); - logger.error("Error caused by:", t); - } - } - } - } - - public void notify(AF_INCOMING_MSG msg) { - //THINK Do the notification in a separated Thread? - //THINK Should consume messages only if they were sent from this device?!?! - if (msg.isError()) return; - logger.debug("AF_INCOMING_MSG arrived for {} message is {}", endpointId, msg); - ArrayList localConsumers = null; - synchronized (consumers) { - localConsumers = new ArrayList(consumers); - } - logger.trace("Notifying {} ApplicationFrameworkMessageConsumer", localConsumers.size()); - for (ApplicationFrameworkMessageConsumer consumer : localConsumers) { - if (consumer.consume(msg)) { - logger.trace("AF_INCOMING_MSG Consumed by {}", consumer.getClass().getName()); - return; - } else { - logger.trace("AF_INCOMING_MSG Ignored by {}", consumer.getClass().getName()); - } - } - - if (msg.getSrcAddr() != node.getNetworkAddress()) return; - if (msg.getSrcEndpoint() != endPoint) return; - logger.debug("Notifying cluster listener for received by {}", endpointId); - notifyClusterListener(new ClusterMessageImpl(msg.getData(), msg.getClusterId())); - } - - public boolean addAFMessageConsumer(ApplicationFrameworkMessageConsumer consumer) { - synchronized (consumers) { - return consumers.add(consumer); - } - } - - public boolean removeAFMessageConsumer(ApplicationFrameworkMessageConsumer consumer) { - synchronized (consumers) { - return consumers.remove(consumer); - } - } - - /** - * @since 0.4.0 - */ - public String toString() { - return getEndpointId(); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/impl/ZigBeeException.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/impl/ZigBeeException.java deleted file mode 100644 index 9c5a382cfbdd4..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/impl/ZigBeeException.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.impl; - -/** - * Root exception for all the code related to ZigBee
- * the BaseDriver should use ZibeeBasedriverException by including
- * communication exception as nested Throwable
- *

- * The ZCL bundle should use ZigBeeClusterException
- * and HA Drive should use ZigBeeDeviceException. - * - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class ZigBeeException extends Exception { - - public ZigBeeException(String msg) { - super(msg); - } - - public ZigBeeException(Throwable ex) { - super(ex); - } - - /** - * @since 0.5.0 - */ - public ZigBeeException(String msg, Throwable ex) { - super(msg, ex); - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/impl/ZigBeeNetwork.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/impl/ZigBeeNetwork.java deleted file mode 100644 index 37a726e0ccd7d..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/impl/ZigBeeNetwork.java +++ /dev/null @@ -1,295 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.impl; - -import org.bubblecloud.zigbee.network.EndpointListener; -import org.bubblecloud.zigbee.network.ZigBeeDiscoveryMonitor; -import org.bubblecloud.zigbee.network.ZigBeeEndpoint; -import org.bubblecloud.zigbee.network.ZigBeeNode; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.*; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZigBeeNetwork { - - private static final Logger logger = LoggerFactory.getLogger(ZigBeeNetwork.class); - - private final Hashtable nodes = new Hashtable(); - private final Hashtable> devices = - new Hashtable>(); - - private final HashMap> profiles = - new HashMap>(); - - private final List discoveryMonitors = new ArrayList(); - - private final List endpointListeners = new ArrayList(); - - /** - * NOT IN USE, the Driver does not define a logic for unregister devices
- * This method is require for implementing issues: - *

- * - * @param node - * @return - */ - public synchronized boolean removeNode(ZigBeeNode node) { - final String ieee = node.getIEEEAddress(); - - if (!nodes.containsKey(ieee)) { - return false; - } - HashMap toRemove = devices.get(node); - if (toRemove != null) { - Iterator it = toRemove.values().iterator(); - while (it.hasNext()) { - final ZigBeeEndpoint device = it.next(); - if (device != null) { - notifyEndpointRemoved(device); - it.remove(); - removeEndpointFromProfiles(device); - } - } - } - nodes.remove(ieee); - return true; - } - - public synchronized boolean addNode(ZigBeeNodeImpl node) { - final String ieee = node.getIEEEAddress(); - - if (nodes.containsKey(ieee)) { - logger.debug("Node {} already present on the network", node); - return false; - } - - logger.debug("Adding node {} to the network", node); - nodes.put(ieee, node); - devices.put(node, new HashMap()); - return true; - } - - public synchronized boolean removeEndpoint(ZigBeeEndpoint endpoint) { - - notifyEndpointRemoved(endpoint); - - final String ieee = endpoint.getNode().getIEEEAddress(); - - ZigBeeNode node = null; - node = nodes.get(ieee); - if (node == null) { - logger.error("Trying to remove a device but containing node {} does not exists", node); - return false; - } - - final HashMap endPoints = devices.get(node); - endPoints.remove(endpoint.getEndPointAddress()); - removeEndpointFromProfiles(endpoint); - - return true; - } - - public synchronized boolean addEndpoint(ZigBeeEndpoint endpoint) { - final ZigBeeNode deviceNode = endpoint.getNode(); - final String ieee = deviceNode.getIEEEAddress(); - final short endPoint = endpoint.getEndPointAddress(); - logger.trace("Adding device {} on node {} / end point {}.", endpoint.getDeviceTypeId(), - endpoint.getNode(), endPoint); - final ZigBeeNode node = nodes.get(ieee); - if (node == null) { - logger.debug("No node {} found"); - return false; - } else if (node.getNetworkAddress() != deviceNode.getNetworkAddress()) { - logger.debug("Node ieee collision, stored is {} and new one is {}", node, deviceNode); - return false; - } - - HashMap endPoints = devices.get(node); - if (endPoints.containsKey(endPoint)) { - logger.debug("Endpoint {} on node {} already registered", endPoint, node); - return false; - } - endPoints.put((int) endPoint, endpoint); - - final int profileId = endpoint.getProfileId(); - ArrayList list; - list = profiles.get(profileId); - if (list == null) { - list = new ArrayList(); - profiles.put(profileId, list); - } - list.add(endpoint); - - notifyEndpointAdded(endpoint); - return true; - } - - private synchronized boolean removeEndpointFromProfiles(final ZigBeeEndpoint device) { - - final int profileId = device.getProfileId(); - ArrayList list = profiles.get(profileId); - if (list == null) { - logger.error("Trying to remove a device from a given profile but the profile doesn't exist"); - //XXX It should never happen, we should throw an IllegalStateException - return true; - } - //XXX It following method must always return true, otherwise we should throw an IllegalStateException - if (list.remove(device) == false) { - logger.error("Device to remove not found in the given profile"); - } - - return true; - - } - - - public synchronized Collection getEndpoints(int profileId) { - final ArrayList result = new ArrayList(); - final ArrayList values = profiles.get(profileId); - if (values == null) { - logger.warn("No endpoints found implementing the profile={}", profileId); - } else { - logger.trace("We found {} implementing the profile={}", values.size(), profileId); - result.addAll(values); - } - return result; - } - - public boolean containsEndpoint(String ieee, short endPoint) { - final ZigBeeNode node = nodes.get(ieee); - if (node == null) { - return false; - } - /* - * If node is not null it means that we found the same network node because - * IEEE address must be unique for each network node - */ - final HashMap endPoints = devices.get(node); - if (endPoints == null) { - return false; - } - return endPoints.containsKey(endPoint); - } - - public ZigBeeNodeImpl containsNode(String ieeeAddress) { - return nodes.get(ieeeAddress); - } - - public List getEndPoints(final ZigBeeNode node) { - return new ArrayList(devices.get(node).values()); - } - - /** - * Adds discovery monitor. - * - * @param discoveryMonitor the discovery monitor - */ - public void addDiscoveryMonitor(final ZigBeeDiscoveryMonitor discoveryMonitor) { - synchronized (discoveryMonitors) { - this.discoveryMonitors.add(discoveryMonitor); - } - } - - /** - * Removes discovery monitor. - * - * @param discoveryMonitor the discovery monitor - */ - public void removeDiscoveryMonitor(final ZigBeeDiscoveryMonitor discoveryMonitor) { - synchronized (discoveryMonitors) { - this.discoveryMonitors.remove(discoveryMonitor); - } - } - - /** - * Notifies discovery listeners that node has been browsed. - * - * @param node the node - */ - public void notifyNodeBrowsed(ZigBeeNode node) { - synchronized (discoveryMonitors) { - for (final ZigBeeDiscoveryMonitor discoveryMonitor : discoveryMonitors) { - discoveryMonitor.browsedNode(node); - } - } - } - - /** - * Notifies discovery listeners that node has been browsed. - * - * @param node the node - */ - public void notifyNodeAnnounced(ZigBeeNode node) { - synchronized (discoveryMonitors) { - for (final ZigBeeDiscoveryMonitor discoveryMonitor : discoveryMonitors) { - discoveryMonitor.announcedNode(node); - } - } - } - - public void addEndpointListenerListener(final EndpointListener deviceListener) { - synchronized (endpointListeners) { - endpointListeners.add(deviceListener); - } - } - - public void removeEndpointListener(final EndpointListener deviceListener) { - synchronized (endpointListeners) { - endpointListeners.remove(deviceListener); - } - } - - public void notifyEndpointAdded(final ZigBeeEndpoint endpoint) { - synchronized (endpointListeners) { - for (final EndpointListener endpointListener : endpointListeners) { - endpointListener.endpointAdded(endpoint); - } - } - } - - public void notifyEndpointUpdated(final ZigBeeEndpoint endpoint) { - synchronized (endpointListeners) { - for (final EndpointListener endpointListener : endpointListeners) { - endpointListener.endpointUpdated(endpoint); - } - } - } - - public void notifyEndpointRemoved(final ZigBeeEndpoint endpoint) { - synchronized (endpointListeners) { - for (final EndpointListener endpointListener : endpointListeners) { - endpointListener.endpointRemoved(endpoint); - } - } - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/impl/ZigBeeNetworkManagerException.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/impl/ZigBeeNetworkManagerException.java deleted file mode 100644 index 49b0e9c0bea98..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/impl/ZigBeeNetworkManagerException.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.impl; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZigBeeNetworkManagerException extends ZigBeeException { - - public ZigBeeNetworkManagerException(String msg) { - super(msg); - } - - public ZigBeeNetworkManagerException(Throwable ex) { - super(ex); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/impl/ZigBeeNodeImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/impl/ZigBeeNodeImpl.java deleted file mode 100644 index ce232ca977738..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/impl/ZigBeeNodeImpl.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.impl; - -import org.bubblecloud.zigbee.network.ZigBeeNode; -import org.bubblecloud.zigbee.network.packet.ZToolAddress64; -import org.bubblecloud.zigbee.network.model.IEEEAddress; - -import java.util.Dictionary; -import java.util.Properties; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class ZigBeeNodeImpl implements ZigBeeNode { - - private int nwkAddress; - final private String ieeeAddress; - - /** - * @param nwk - * @param ieee - * @param pan - * @since 0.6.0 - Revision 67 - */ - public ZigBeeNodeImpl(int nwk, String ieee, short pan) { - this.nwkAddress = nwk; - this.ieeeAddress = ieee; - IEEEAddress.fromColonNotation(ieee); //Only for checking the IEEE format - } - - public ZigBeeNodeImpl(int nwk, ZToolAddress64 ieee, short pan) { - this.ieeeAddress = IEEEAddress.toString(ieee.getLong()); - setNetworkAddress(nwk); - } - - public String getIEEEAddress() { - return ieeeAddress; - } - - /** - * @param nwk the new network address - * @since 0.6.0 - Revision 74 - */ - public void setNetworkAddress(int nwk) { - nwkAddress = nwk; - } - - public int getNetworkAddress() { - return nwkAddress; - } - - public String toString() { - return "#" + nwkAddress + " (" + ieeeAddress + ")"; - } - - public boolean equals(Object obj) { - if (obj == this) { - return true; - } else if (obj instanceof ZigBeeNode) { - ZigBeeNode node = (ZigBeeNode) obj; - return nwkAddress == node.getNetworkAddress() && ieeeAddress.equals(node.getIEEEAddress()); - } else { - return false; - } - } - - public int hashCode() { - return ieeeAddress.hashCode(); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/model/DiscoveryMode.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/model/DiscoveryMode.java deleted file mode 100644 index 8d94d7834b64c..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/model/DiscoveryMode.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.bubblecloud.zigbee.network.model; - -import java.util.EnumSet; - -public enum DiscoveryMode { - Announce(1), - Addressing(2), - LinkQuality(4); - - public static final EnumSet ALL = EnumSet.allOf(DiscoveryMode.class); - - public final int bits; - - private DiscoveryMode(int i) { - this.bits = i; - } - - public static int fromEnumSet(EnumSet set) { - int value = 0; - for (DiscoveryMode mode : set) { - value += mode.bits; - } - return value; - } - - public static EnumSet toEnumSet(int mask) { - DiscoveryMode[] modes = DiscoveryMode.values(); - EnumSet value = EnumSet.noneOf(DiscoveryMode.class); - for (int i = 0; i < modes.length; i++) { - if ((modes[i].bits & mask) > 0) { - value.add(modes[i]); - } - } - return value; - } -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/model/DriverStatus.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/model/DriverStatus.java deleted file mode 100644 index b91a49095c394..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/model/DriverStatus.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.model; - -/** - * @author Stefano "Kismet" Lenzi - ISTI-CNR - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.6.0 - */ -public enum DriverStatus { - - /** - * The driver has been created and it will start to initialize all the hardware resources
- * and the ZigBee network (i.e.: it will either join or create a network). - */ - CREATED, - - /** - * The driver has already initialized all the hardware resources, and it is waiting for
- * the hardware to complete the initialization process - */ - HARDWARE_INITIALIZING, - - /** - * The all the hardware resources have been initialized successfully, it will start to
- * initialize the ZigBee network - */ - HARDWARE_READY, - - /** - * The driver has already initialized the ZigBee network, and it is waiting for
- * the completion of process (i.e.: it joined to the network and it is waiting for
- * a network address) - */ - NETWORK_INITIALIZING, - - /** - * The driver successfully joined to or create the ZigBee network - */ - NETWORK_READY, - - /** - * The driver is closed, no resources is in use - */ - CLOSED; -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/model/IEEEAddress.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/model/IEEEAddress.java deleted file mode 100644 index 595c4cc149114..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/model/IEEEAddress.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.model; - -import java.util.StringTokenizer; - -/** - * @author
Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class IEEEAddress { - - public static final long fromColonNotation(String ieee) { - StringTokenizer scanner = new StringTokenizer(ieee, ":"); - long result = 0; - while (scanner.hasMoreTokens()) { - int octect = Integer.parseInt(scanner.nextToken(), 16); - result = (result << 8) + (octect & 0xFF); - } - return result; - } - - public static final String toHex(long ieee) { - String padding = "0000000000000000"; - String hex = Long.toHexString(ieee); - if (hex.length() < 16) { - hex = padding.substring(0, 16 - hex.length()) + hex; - } - return "0x" + hex.toUpperCase(); - } - - public static final String toHexString(long ieee) { - StringBuffer buffer = new StringBuffer(); - String[] parts = new String[8]; - for (int i = 0; i < parts.length; i++) { - parts[i] = Integer.toHexString((int) (ieee & 0xFF)); - ieee = ieee >> 8; - } - - for (int i = parts.length - 1; i > 0; i--) { - switch (parts[i].length()) { - case 1: - buffer.append("0x0").append(parts[i]).append(' '); - break; - case 2: - buffer.append("0x").append(parts[i]).append(' '); - break; - } - } - switch (parts[0].length()) { - case 1: - buffer.append("0x0").append(parts[0]); - break; - case 2: - buffer.append("0x").append(parts[0]); - break; - } - - return buffer.toString(); - } - - public static final String toString(long ieee) { - return toColonNotation(ieee); - } - - public static final String toColonNotation(long ieee) { - String padding = "0000000000000000"; - String hex = Long.toHexString(ieee); - if (hex.length() < 16) { - hex = padding.substring(0, 16 - hex.length()) + hex; - } - hex = hex.toUpperCase(); - String result = hex.substring(0, 2); - for (int i = 1; i <= 7; i++) { - hex = hex.substring(2); - result = result + ":" + hex.substring(0, 2); - } - return result; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/model/NetworkAddress.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/model/NetworkAddress.java deleted file mode 100644 index 1ddf8b1d6fac9..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/model/NetworkAddress.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.model; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class NetworkAddress { - - public static final short fromDecimal(int value) { - return (short) value; - } - - public static final short fromString(String value) { - return Short.decode(value); - } - - - public static final int toDecimal(short nwk) { - if (nwk >= 0) { - return nwk; - } else { - return 0x0000FFFF & nwk; - } - - } - - public static final String toHex(short nwk) { - return toString(nwk); - } - - public static final String toString(short nwk) { - String padding = "0000"; - String hex = Integer.toHexString(nwk); - if (hex.length() > 4) { - hex = hex.substring(hex.length() - 4); - } else { - hex = padding.substring(0, 4 - hex.length()) + hex; - } - return "0x" + hex.toUpperCase(); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/model/NetworkMode.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/model/NetworkMode.java deleted file mode 100644 index 04ec12931b215..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/model/NetworkMode.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.model; - -/** - * @author Stefano "Kismet" Lenzi - ISTI-CNR - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public enum NetworkMode { - - Coordinator, - Router, - EndDevice; - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/model/ProvidedClusterMode.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/model/ProvidedClusterMode.java deleted file mode 100644 index 81795303eaa5a..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/model/ProvidedClusterMode.java +++ /dev/null @@ -1,6 +0,0 @@ -package org.bubblecloud.zigbee.network.model; - -public enum ProvidedClusterMode { - HomeAutomationProfileStrict, - EitherInputAndOutput -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/Checksum.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/Checksum.java deleted file mode 100644 index a36449b9a331e..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/Checksum.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - Copyright 2008-2013 Andrew Rapp, http://code.google.com/p/xbee-api/ - - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet; - -/** - * @author Andrew Rapp - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class Checksum { - - //private final static Logger log = Logger.getLogger(Checksum.class); - - public int checksum = 0; - - /** - * Don't add Checksum byte when computing checksum!! - * - * @param val - */ - public void addByte(int val) { - //checksum+= val; - checksum = checksum ^ val; - } - - /** - * @return - */ - public void compute() { - - // discard values > 1 byte - //checksum = 0xff & checksum; - // perform 2s complement - //checksum = 0xff - checksum; - - //log.debug("computed checksum is " + ByteUtils.formatByte(checksum)); - } - - /** - * First add all relevant bytes, including checksum - * - * @return - */ - public boolean verify() { - checksum = checksum & 0xff; - //log.debug("verify checksum is " + checksum); - return 0xff == checksum; - } - - public int getChecksum() { - return checksum; - } - - /*public static void main(String[] args) { - //83 56 78 24 00 01 02 00 03 ff 85 - Checksum ck = new Checksum(); - - ck.addByte(0x83); - ck.addByte(0x56); - ck.addByte(0x78); - ck.addByte(0x26); - ck.addByte(0x00); - ck.addByte(0x01); - ck.addByte(0x02); - ck.addByte(0x00); - ck.addByte(0x03); - ck.addByte(0xff); - // checksum - ck.addByte(0x83); - - // checksum is 0x83 - //ck.compute(); - ck.verify(); - - System.out.println("checksum is " + ByteUtils.formatByte(ck.getChecksum())); - }*/ -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ErrorPacket.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ErrorPacket.java deleted file mode 100644 index fff0c8837222e..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ErrorPacket.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright 2008-2013 Andrew Rapp, http://code.google.com/p/xbee-api/ - - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet; - -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Andrew Rapp - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ErrorPacket extends ZToolPacket { - - public ErrorPacket() { - super(new DoubleByte(), new int[]{}); - } -} \ No newline at end of file diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ResponseStatus.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ResponseStatus.java deleted file mode 100644 index 02680023e0c8c..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ResponseStatus.java +++ /dev/null @@ -1,148 +0,0 @@ -/** - * Copyright 2013 Tommi S.E. Laukkanen - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.bubblecloud.zigbee.network.packet; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.HashMap; -import java.util.Map; - -/** - * Response statuses. - * - * @author Tommi S.E. Laukkanen - */ -public enum ResponseStatus { - SUCCESS(0x00), - FAILURE(0x01), - INVALIDPARAMETER(0x02), - INVALID_TASK(0x03), - MSG_BUFFER_NOT_AVAIL(0x04), - INVALID_MSG_POINTER(0x05), - INVALID_EVENT_ID(0x06), - INVALID_INTERRUPT_ID(0x07), - NO_TIMER_AVAIL(0x08), - NV_ITEM_UNINIT(0x09), - NV_OPER_FAILED(0x0A), - INVALID_MEM_SIZE(0x0B), - NV_BAD_ITEM_LEN(0x0C), - Z_MEM_ERROR(0x10), - Z_BUFFER_FULL(0x11), - Z_UNSUPPORTED_MODE(0x12), - Z_MAC_MEM_ERROR(0x13), - Z_SAPI_IN_PROGRESS(0x20), - Z_SAPI_TIMEOUT(0x21), - Z_SAPI_INIT(0x22), - ZDP_INVALID_REQTYPE(0x80), - ZDP_DEVICE_NOT_FOUND(0x81), - ZDP_INVALID_EP(0x82), - ZDP_NOT_ACTIVE(0x83), - ZDP_NOT_SUPPORTED(0x84), - ZDP_TIMEOUT(0x85), - ZDP_NO_MATCH(0x86), - ZDP_NO_ENTRY(0x88), - ZDP_NO_DESCRIPTOR(0x89), - ZDP_INSUFFICIENT_SPACE(0x8a), - ZDP_NOT_PERMITTED(0x8b), - ZDP_TABLE_FULL(0x8c), - ZDP_NOT_AUTHORIZED(0x8d), - Z_APS_FAIL(0xb1), - Z_APS_TABLE_FULL(0xb2), - Z_APS_ILLEGAL_REQUEST(0xb3), - Z_APS_INVALID_BINDING(0xb4), - Z_APS_UNSUPPORTED_ATTRIB(0xb5), - Z_APS_NOT_SUPPORTED(0xb6), - Z_APS_NO_ACK(0xb7), - Z_APS_DUPLICATE_ENTRY(0xb8), - Z_APS_NO_BOUND_DEVICE(0xb9), - Z_APS_NOT_ALLOWED(0xba), - Z_APS_NOT_AUTHENTICATED(0xbb), - Z_SEC_NO_KEY(0xa1), - Z_SEC_OLD_FRM_COUNT(0xa2), - Z_SEC_MAX_FRM_COUNT(0xa3), - Z_SEC_CCM_FAIL(0xa4), - Z_NWK_INVALID_PARAM(0xc1), - Z_NWK_INVALID_REQUEST(0xc2), - Z_NWK_NOT_PERMITTED(0xc3), - Z_NWK_STARTUP_FAILURE(0xc4), - Z_NWK_ALREADY_PRESENT(0xc5), - Z_NWK_SYNC_FAILURE(0xc6), - Z_NWK_TABLE_FULL(0xc7), - Z_NWK_UNKNOWN_DEVICE(0xc8), - Z_NWK_UNSUPPORTED_ATTRIBUTE(0xc9), - Z_NWK_NO_NETWORKS(0xca), - Z_NWK_LEAVE_UNCONFIRMED(0xcb), - Z_NWK_NO_ACK(0xcc), - Z_NWK_NO_ROUTE(0xcd), - Z_MAC_BEACON_LOSS(0xe0), - Z_MAC_CHANNEL_ACCESS_FAILURE(0xe1), - Z_MAC_DENIED(0xe2), - Z_MAC_DISABLE_TRX_FAILURE(0xe3), - Z_MAC_FAILED_SECURITY_CHECK(0xe4), - Z_MAC_FRAME_TOO_LONG(0xe5), - Z_MAC_INVALID_GTS(0xe6), - Z_MAC_INVALID_HANDLE(0xe7), - Z_MAC_INVALID_PARAMETER(0xe8), - Z_MAC_NO_ACK(0xe9), - Z_MAC_NO_BEACON(0xea), - Z_MAC_NO_DATA(0xeb), - Z_MAC_NO_SHORT_ADDR(0xec), - Z_MAC_OUT_OF_CAP(0xed), - Z_MAC_PANID_CONFLICT(0xee), - Z_MAC_REALIGNMENT(0xef), - Z_MAC_TRANSACTION_EXPIRED(0xf0), - Z_MAC_TRANSACTION_OVER_FLOW(0xf1), - Z_MAC_TX_ACTIVE(0xf2), - Z_MAC_UN_AVAILABLE_KEY(0xf3), - Z_MAC_UNSUPPORTED_ATTRIBUTE(0xf4), - Z_MAC_UNSUPPORTED(0xf5), - Z_MAC_SRC_MATCH_INVALID_INDEX(0xff); - - /** - * The logger. - */ - private final static Logger logger = LoggerFactory.getLogger(ResponseStatus.class); - - private static Map mapping = new HashMap(); - private int value; - - private ResponseStatus(int value) { - this.value = value; - } - - public int getValue() { - return value; - } - - public static ResponseStatus getStatus(int value) { - if (!mapping.containsKey(value)) { - logger.warn("Unknown status value: " + value); - } - return mapping.get(value); - } - - static { - for (ResponseStatus status : ResponseStatus.values()) { - mapping.put(status.value, status); - } - } - - @Override - public String toString() { - return super.toString() + "(" + value + ")"; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolAddress.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolAddress.java deleted file mode 100644 index 995a1ed538868..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolAddress.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - Copyright 2008-2013 Andrew Rapp, http://code.google.com/p/xbee-api/ - - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet; - -import org.bubblecloud.zigbee.util.ByteUtils; - -/** - * Represents a double byte XBeeApi Address. - * - * @author Andrew Rapp - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public abstract class ZToolAddress { - - - public ZToolAddress() { - - } - - public abstract byte[] getAddress(); - - public String toString() { - return ByteUtils.toBase16(this.getAddress()); - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolAddress16.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolAddress16.java deleted file mode 100644 index 11782664ebca9..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolAddress16.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - Copyright 2008-2013 Andrew Rapp, http://code.google.com/p/xbee-api/ - - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet; - -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * Represents a double byte XBeeApi Address. - * - * @author Andrew Rapp - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZToolAddress16 extends ZToolAddress { - - public static final ZToolAddress16 BROADCAST = new ZToolAddress16(0xFF, 0xFF); - public static final ZToolAddress16 ZNET_BROADCAST = new ZToolAddress16(0xFF, 0xFE); - - private DoubleByte doubleByte = new DoubleByte(); - - /** - * Provide address as msb byte and lsb byte - * - * @param msb - * @param lsb - */ - public ZToolAddress16(int msb, int lsb) { - this.doubleByte.setMsb(msb); - this.doubleByte.setLsb(lsb); - } - - public ZToolAddress16(int[] arr) { - this.doubleByte.setMsb(arr[0]); - this.doubleByte.setLsb(arr[1]); - } - - public ZToolAddress16() { - - } - - public int get16BitValue() { - return this.doubleByte.get16BitValue(); - } - - public int getMsb() { - return this.doubleByte.getMsb(); - } - - public void setMsb(int msb) { - this.doubleByte.setMsb(msb); - } - - public int getLsb() { - return this.doubleByte.getLsb(); - } - - public void setLsb(int lsb) { - this.doubleByte.setLsb(lsb); - } - - public boolean equals(Object o) { - - if (this == o) { - return true; - } else { - try { - ZToolAddress16 addr = (ZToolAddress16) o; - - if (this.getLsb() == addr.getLsb() && this.getMsb() == addr.getMsb()) { - return true; - } else { - return false; - } - } catch (Exception e) { - return false; - } - } - } - - @Override - public byte[] getAddress() { - return new byte[]{(byte) this.doubleByte.getMsb(), (byte) this.doubleByte.getLsb()}; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolAddress64.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolAddress64.java deleted file mode 100644 index 3bbab30c14bfd..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolAddress64.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - Copyright 2008-2013 Andrew Rapp, http://code.google.com/p/xbee-api/ - - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet; - -import org.bubblecloud.zigbee.util.Integers; - -import java.util.Arrays; -import java.util.StringTokenizer; - -/** - * Big Endian container for 64-bit XBee Address - *

- * See device addressing in manual p.32 - * - * @author Andrew Rapp - * @author Alvaro Fides Valero - * @author Stefano Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZToolAddress64 extends ZToolAddress { - - //private final static Logger log = Logger.getLogger(ZToolAddress64.class); - - // broadcast address 0x000000ff - public static final ZToolAddress64 BROADCAST = new ZToolAddress64(new byte[]{0, 0, 0, 0, 0, 0, (byte) 0xff, (byte) 0xff}); - public static final ZToolAddress64 ZNET_COORDINATOR = new ZToolAddress64(new byte[]{0, 0, 0, 0, 0, 0, 0, 0}); - - private byte[] address; - - /** - * Parses an 64-bit XBee address from a string representation - * Must be in the format "## ## ## ## ## ## ## ##" (i.e. don't use 0x prefix) - * - * @param addressStr - */ - public ZToolAddress64(String addressStr) { - StringTokenizer st = new StringTokenizer(addressStr, " "); - - address = new byte[8]; - - for (int i = 0; i < address.length; i++) { - String byteStr = st.nextToken(); - address[i] = (byte) (Integer.parseInt(byteStr, 16) & 0xFF); - - //log.debug("byte is " + ByteUtils.toBase16(address[i]) + " at pos " + i); - } - } - - public ZToolAddress64(long ieee) { - address = new byte[8]; - for (int i = address.length - 1; i >= 0; i--) { - address[i] = (byte) ieee; - ieee = ieee >> 8; - } - } - - /** - * Creates a 64-bit address - * - * @param b1 MSB - * @param b2 - * @param b3 - * @param b4 - * @param b5 - * @param b6 - * @param b7 - * @param b8 LSB - */ - public ZToolAddress64(byte b1, byte b2, byte b3, byte b4, byte b5, byte b6, byte b7, byte b8) { - address = new byte[8]; - - address[0] = b1; - address[1] = b2; - address[2] = b3; - address[3] = b4; - address[4] = b5; - address[5] = b6; - address[6] = b7; - address[7] = b8; - } - - public ZToolAddress64(byte[] address) { - this.address = Arrays.copyOf(address, address.length); - } - - public ZToolAddress64() { - address = new byte[8]; - } - - public void setAddress(byte[] address) { - this.address = Arrays.copyOf(address, address.length); - } - - public boolean equals(Object o) { - if (o == this) { - return true; - } else if (o instanceof ZToolAddress64) { - ZToolAddress64 ieee = (ZToolAddress64) o; - if (ieee.address == this.address) return true; - for (int i = 0; i < this.address.length; i++) { - if (ieee.address[i] != this.address[i]) - return false; - } - return true; - } else { - return false; - } - } - - public long getLong() { - return Integers.longFromInts(address, 0, 7); - } - - @Override - public byte[] getAddress() { - return Arrays.copyOf(address, address.length); - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolCMD.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolCMD.java deleted file mode 100644 index 064172c022eb1..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolCMD.java +++ /dev/null @@ -1,810 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZToolCMD { - /// TI.ZPI2.MESSAGE_ID.AF_DATA_CONFIRM - ///

AF Data confirm. - public static final int AF_DATA_CONFIRM = 0x4480; - /// TI.ZPI2.MESSAGE_ID.AF_DATA_REQUEST - /// This command is used by tester to build and send a data request message - public static final int AF_DATA_REQUEST = 0x2401; - /// TI.ZPI2.MESSAGE_ID.AF_DATA_SRSP - /// Response for AF_DATA_REQUEST - public static final int AF_DATA_SRSP = 0x6401; - /// TI.ZPI2.MESSAGE_ID.AF_INCOMING_MSG - /// Incoming AF data. - public static final int AF_INCOMING_MSG = 0x4481; - /// TI.ZPI2.MESSAGE_ID.AF_REGISTER - /// This command enables the tester to register an application's endpoint description - public static final int AF_REGISTER = 0x2400; - /// TI.ZPI2.MESSAGE_ID.AF_REGISTER_SRSP - /// Response for AF_REGISTER - public static final int AF_REGISTER_SRSP = 0x6400; - /// TI.ZPI2.MESSAGE_ID.APP_MSG - /// Use this message to send raw data to an application. - public static final int APP_MSG = 0x2900; - /// TI.ZPI2.MESSAGE_ID.APP_MSG_RESPONSE - /// Status for APP_MSG - public static final int APP_MSG_RESPONSE = 0x6900; - /// TI.ZPI2.MESSAGE_ID.APP_MSG_RSP - /// Response for APP_MSG - public static final int APP_MSG_RSP = 0x6980; - /// TI.ZPI2.MESSAGE_ID.APP_USER_TEST - /// This command is used by the tester to set the debug threshold level for a particular software component in the target. - public static final int APP_USER_TEST = 0x2901; - /// TI.ZPI2.MESSAGE_ID.APP_USER_TEST_RESPONSE - /// Response for APP_USER_TEST - public static final int APP_USER_TEST_RESPONSE = 0x6901; - /// TI.ZPI2.MESSAGE_ID.APSDE_DATA_CONFIRMATION - /// This message is issued by the target APS to the tester to report the results of a request to transfer a data PDU from a local NHLE (Next Higher Layer Entity) to a single peer NHLE. - public static final int APSDE_DATA_CONFIRMATION = 0x880; - /// TI.ZPI2.MESSAGE_ID.APSME_BIND_RESPONSE - /// Response for APSME_BIND - public static final int APSME_BIND_RESPONSE = 0x1804; - /// TI.ZPI2.MESSAGE_ID.DEBUG_SET_DEBUG_THRESHOLD - /// This command is used by the tester to set the debug threshold level for a particular software component in the target. - public static final int DEBUG_SET_DEBUG_THRESHOLD = 0x2800; - /// TI.ZPI2.MESSAGE_ID.DEBUG_SET_DEBUG_THRESHOLD_RESPONSE - /// Response for SYS_SET_DEBUG_THRESHOLD - public static final int DEBUG_SET_DEBUG_THRESHOLD_RESPONSE = 0x6800; - /// TI.ZPI2.MESSAGE_ID.DEBUG_STRING - /// Debug message sent by device - public static final int DEBUG_STRING = 0x4880; - /// TI.ZPI2.MESSAGE_ID.NLDE_DATA_CONFIRMATION - /// This message is issued by the target NWK to the tester to report the results of a request to transfer a data PDU from a local APS sub-layer entity to a single peer APS sub-layer entity. - public static final int NLDE_DATA_CONFIRMATION = 0x4380; - /// TI.ZPI2.MESSAGE_ID.NLDE_DATA_INDICATION - /// This message is issued by the target NWK to the tester to indicate the transfer of a data PDU from the NWK layer to the local APS sub-layer entity. - public static final int NLDE_DATA_INDICATION = 0x4381; - /// TI.ZPI2.MESSAGE_ID.NLDE_DATA_REQUEST - /// This command enables the tester to request the transfer of data from the local APS sub-layer to a peer APS sublayer entity. - public static final int NLDE_DATA_REQUEST = 0x2301; - /// TI.ZPI2.MESSAGE_ID.NLDE_DATA_RESPONSE - /// Response for NLDE_DATA_REQUEST - public static final int NLDE_DATA_RESPONSE = 0x6301; - /// TI.ZPI2.MESSAGE_ID.NLDE_NWK_INIT - /// This function will initialize the nwk with the NWK_TASKID. - public static final int NLDE_NWK_INIT = 0x4300; - /// TI.ZPI2.MESSAGE_ID.NLME_DIRECTJOIN_REQUEST - /// NLME direct join request used by tester - public static final int NLME_DIRECTJOIN_REQUEST = 0x230b; - /// TI.ZPI2.MESSAGE_ID.NLME_DIRECTJOIN_RESPONSE - /// Response for NLME_DIRECTJOIN_REQUEST - public static final int NLME_DIRECTJOIN_RESPONSE = 0x630b; - /// TI.ZPI2.MESSAGE_ID.NLME_GET_REQUEST - /// This command is used by tester to make a request (on behalf of the next higher layer) to read the value of an attribute from the NWK information base (NIB). - public static final int NLME_GET_REQUEST = 0x2307; - /// TI.ZPI2.MESSAGE_ID.NLME_GET_RESPONSE - /// Response for NLME_GET_REQUEST - public static final int NLME_GET_RESPONSE = 0x6307; - /// TI.ZPI2.MESSAGE_ID.NLME_JOIN_CONFIRMATION - /// This command is issued by the target NWK (to tester) to announce the next higher layer of the results of its request to join itself or another device to a network. - public static final int NLME_JOIN_CONFIRMATION = 0x4383; - /// TI.ZPI2.MESSAGE_ID.NLME_JOIN_INDICATION - /// This message is sent by the target to announce the next higher layer of a remote join request. - public static final int NLME_JOIN_INDICATION = 0x4384; - /// TI.ZPI2.MESSAGE_ID.NLME_JOIN_REQUEST - /// This command is used by tester to make a request (on behalf of the next higher layer) to join the device itself or another device to a network. - public static final int NLME_JOIN_REQUEST = 0x2304; - /// TI.ZPI2.MESSAGE_ID.NLME_JOIN_RESPONSE - /// Response for NLME_JOIN_REQUEST - public static final int NLME_JOIN_RESPONSE = 0x6304; - /// TI.ZPI2.MESSAGE_ID.NLME_LEAVE_CONFIRMATION - /// This message is sent by the target to indicate to the next higher layer that the device itself or another device is leaving the network. - public static final int NLME_LEAVE_CONFIRMATION = 0x4385; - /// TI.ZPI2.MESSAGE_ID.NLME_LEAVE_INDICATION - /// This message is sent by the target to indicate a remote leave request to the next higher layer of a coordinator - public static final int NLME_LEAVE_INDICATION = 0x4386; - /// TI.ZPI2.MESSAGE_ID.NLME_LEAVE_REQUEST - /// This command is used by tester to make a request (on behalf of the next higher layer) that the device itself or another device leave the network. - public static final int NLME_LEAVE_REQUEST = 0x2305; - /// TI.ZPI2.MESSAGE_ID.NLME_LEAVE_RESPONSE - /// Response for NLME_LEAVE_REQUEST - public static final int NLME_LEAVE_RESPONSE = 0x6305; - /// TI.ZPI2.MESSAGE_ID.NLME_NETWORK_FORMATION_CONFIRMATION - /// This message is used by the target NWK to inform the tester of the result of a previous association request command - public static final int NLME_NETWORK_FORMATION_CONFIRMATION = 0x4382; - /// TI.ZPI2.MESSAGE_ID.NLME_NETWORK_FORMATION_REQUEST - /// This command is used by tester to request (on behalf of the next higher layer) that the device be initiated as a coordinator. - public static final int NLME_NETWORK_FORMATION_REQUEST = 0x2302; - /// TI.ZPI2.MESSAGE_ID.NLME_NETWORK_FORMATION_RESPONSE - /// Response for NLME_NETWORK_FORMATION_REQUEST - public static final int NLME_NETWORK_FORMATION_RESPONSE = 0x6302; - /// TI.ZPI2.MESSAGE_ID.NLME_NETWORKDISCOVERY_CONFIRMATION - /// This message is sent by the target to indicate network discovery confirmation - public static final int NLME_NETWORKDISCOVERY_CONFIRMATION = 0x4389; - /// TI.ZPI2.MESSAGE_ID.NLME_NETWORKDISCOVERY_REQUEST - /// NLME Network discovery request used by tester - public static final int NLME_NETWORKDISCOVERY_REQUEST = 0x2309; - /// TI.ZPI2.MESSAGE_ID.NLME_NETWORKDISCOVERY_RESPONSE - /// Response for NLME_NETWORKDISCOVERY_REQUEST - public static final int NLME_NETWORKDISCOVERY_RESPONSE = 0x6309; - /// TI.ZPI2.MESSAGE_ID.NLME_ORPHANJOIN_REQUEST - /// NLME orphan join request used by tester - public static final int NLME_ORPHANJOIN_REQUEST = 0x230c; - /// TI.ZPI2.MESSAGE_ID.NLME_ORPHANJOIN_RESPONSE - /// Response for NLME_ORPHANJOIN_REQUEST - public static final int NLME_ORPHANJOIN_RESPONSE = 0x630c; - /// TI.ZPI2.MESSAGE_ID.NLME_PERMITJOINING_REQUEST - /// This command is used by the tester to define how the next higher layer of a coordinator device would permit devices to join its network for a fixed period. - public static final int NLME_PERMITJOINING_REQUEST = 0x2303; - /// TI.ZPI2.MESSAGE_ID.NLME_PERMITJOINING_RESPONSE - /// Response for NLME_PERMITJOINING_REQUEST - public static final int NLME_PERMITJOINING_RESPONSE = 0x6303; - /// TI.ZPI2.MESSAGE_ID.NLME_POLL_CONFIRMATION - /// This function reports the results of a polling attempt. - public static final int NLME_POLL_CONFIRMATION = 0x4387; - /// TI.ZPI2.MESSAGE_ID.NLME_RESET_REQUEST - /// This command is used by tester to make a request (on behalf of the next higher layer) that the NWK layer perform a reset operation - public static final int NLME_RESET_REQUEST = 0x2306; - /// TI.ZPI2.MESSAGE_ID.NLME_RESET_RESPONSE - /// Response for NLME_RESET_REQUEST - public static final int NLME_RESET_RESPONSE = 0x6306; - /// TI.ZPI2.MESSAGE_ID.NLME_ROUTEDISCOVERY_REQUEST - /// NLME route discovery request used by tester - public static final int NLME_ROUTEDISCOVERY_REQUEST = 0x230a; - /// TI.ZPI2.MESSAGE_ID.NLME_ROUTEDISCOVERY_RESPONSE - /// Response for NLME_ROUTEDISCOVERY_REQUEST - public static final int NLME_ROUTEDISCOVERY_RESPONSE = 0x630a; - /// TI.ZPI2.MESSAGE_ID.NLME_SET_REQUEST - /// This command is used by tester to make a request (on behalf of the next higher layer) to set the value of an attribute in the NWK information base (NIB). - public static final int NLME_SET_REQUEST = 0x2308; - /// TI.ZPI2.MESSAGE_ID.NLME_SET_RESPONSE - /// Response for NLME_SET_REQUEST - public static final int NLME_SET_RESPONSE = 0x6308; - /// TI.ZPI2.MESSAGE_ID.NLME_STARTROUTER_CONFIRMATION - /// This message is sent by the target to the next higher layer of the results of its request to start a router - public static final int NLME_STARTROUTER_CONFIRMATION = 0x438a; - /// TI.ZPI2.MESSAGE_ID.NLME_STARTROUTER_REQUEST - /// NLME Start router request used by tester - public static final int NLME_STARTROUTER_REQUEST = 0x230d; - /// TI.ZPI2.MESSAGE_ID.NLME_STARTROUTER_RESPONSE - /// Response for NLME_STARTROUTER_REQUEST - public static final int NLME_STARTROUTER_RESPONSE = 0x630d; - /// TI.ZPI2.MESSAGE_ID.NLME_SYNC_INDICATION - /// This message is sent by the target to indicate a sync request to the next higher layer of a coordinator - public static final int NLME_SYNC_INDICATION = 0x4388; - /// TI.ZPI2.MESSAGE_ID.NWK_ASSOCIATE_CONFIRMATION - /// This function is used to inform the upper layers of the initiating device whether its request to associate was successful or unsuccessful. - public static final int NWK_ASSOCIATE_CONFIRMATION = 0x2382; - /// TI.ZPI2.MESSAGE_ID.NWK_ASSOCIATE_INDICATION - /// This function is used to indicate the reception of an association request command. - public static final int NWK_ASSOCIATE_INDICATION = 0x2381; - /// TI.ZPI2.MESSAGE_ID.NWK_BEACON_NOTIFY_INDICATION - /// This function is used to send parameters contained within a beacon frame received by the MAC sublayer to the next higher layer. The function also sends a measure of the link quality and the time the beacon was received. - public static final int NWK_BEACON_NOTIFY_INDICATION = 0x2383; - /// TI.ZPI2.MESSAGE_ID.NWK_COMM_STATUS_INDICATION - /// This function reports a comm status error - public static final int NWK_COMM_STATUS_INDICATION = 0x238d; - /// TI.ZPI2.MESSAGE_ID.NWK_DATA_CONFIRMATION - /// This function is used to send the results of a request to transfer a data SPDU (MSDU) from a local SSCS entity to a single peer SSCS entity; or multiple peer SSCS entities. - public static final int NWK_DATA_CONFIRMATION = 0x2384; - /// TI.ZPI2.MESSAGE_ID.NWK_DATA_INDICATION - /// This function indicates the transfer of a data SPDU (MSDU) from the MAC sublayer to the local SSCS entity. - public static final int NWK_DATA_INDICATION = 0x2385; - /// TI.ZPI2.MESSAGE_ID.NWK_DISASSOCIATE_CONFIRMATION - /// This function is sent as the result of a disassociation request. - public static final int NWK_DISASSOCIATE_CONFIRMATION = 0x2387; - /// TI.ZPI2.MESSAGE_ID.NWK_DISASSOCIATE_INDICATION - /// This function is used to indicate the reception of a disassociation notification command. - public static final int NWK_DISASSOCIATE_INDICATION = 0x2386; - /// TI.ZPI2.MESSAGE_ID.NWK_ORPHAN_INDICATION - /// This function allows the MLME to announce the next higher layer of an orphaned device - public static final int NWK_ORPHAN_INDICATION = 0x238a; - /// TI.ZPI2.MESSAGE_ID.NWK_POLL_CONFIRMATION - /// This function reports the results of a polling attempt. - public static final int NWK_POLL_CONFIRMATION = 0x238b; - /// TI.ZPI2.MESSAGE_ID.NWK_PURGE_CONFIRMATION - /// This function reports the results of a purge attempt. - public static final int NWK_PURGE_CONFIRMATION = 0x2390; - /// TI.ZPI2.MESSAGE_ID.NWK_RX_ENABLE_CONFIRMATION - /// This function reports the results of an RX enable attempt. - public static final int NWK_RX_ENABLE_CONFIRMATION = 0x238f; - /// TI.ZPI2.MESSAGE_ID.NWK_SCAN_CONFIRMATION - /// This function reports the results of a channel scan request. - public static final int NWK_SCAN_CONFIRMATION = 0x238c; - /// TI.ZPI2.MESSAGE_ID.NWK_START_CONFIRMATION - /// This function reports the success of the start request. - public static final int NWK_START_CONFIRMATION = 0x238e; - /// TI.ZPI2.MESSAGE_ID.NWK_SYNCHRONIZATION_LOSS_INDICATION - /// This function indicates the loss of synchronization of a network beacon - public static final int NWK_SYNCHRONIZATION_LOSS_INDICATION = 0x2380; - /// TI.ZPI2.MESSAGE_ID.SYS_ADC_READ - /// Stop timer. - public static final int SYS_ADC_READ = 0x210d; - /// TI.ZPI2.MESSAGE_ID.SYS_ADC_READ_SRSP - /// Response for SYS_ADC_READ - public static final int SYS_ADC_READ_SRSP = 0x610d; - /// TI.ZPI2.MESSAGE_ID.SYS_GPIO - /// Configure the accessible GPIO pins - public static final int SYS_GPIO = 0x210e; - /// TI.ZPI2.MESSAGE_ID.SYS_TEST_RF - /// Configure the device RF test modes - public static final int SYS_TEST_RF = 0x4140; - /// TI.ZPI2.MESSAGE_ID.SYS_TEST_LOOPBACK - /// Test the physical interface - public static final int SYS_TEST_LOOPBACK = 0x2141; - /// TI.ZPI2.MESSAGE_ID.SYS_GPIO - /// Response to SYS_GPIO - public static final int SYS_GPIO_SRSP = 0x610e; - /// TI.ZPI2.MESSAGE_ID.SYS_TEST_LOOPBACK - /// Response to SYS_TEST_LOOPBACK - public static final int SYS_TEST_LOOPBACK_SRSP = 0x6141; - /// TI.ZPI2.MESSAGE_ID.SYS_OSAL_NV_READ - /// This command is used by the tester to read a single memory location in the target non-volatile memory. The command accepts an address value and returns the memory value present in the target at that address. - public static final int SYS_OSAL_NV_READ = 0x2108; - /// TI.ZPI2.MESSAGE_ID.SYS_OSAL_NV_READ_SRSP - /// Response for SYS_OSAL_NV_READ - public static final int SYS_OSAL_NV_READ_SRSP = 0x6108; - /// TI.ZPI2.MESSAGE_ID.SYS_OSAL_NV_WRITE - /// This command is used by the tester to write to a particular location in non-volatile memory. The command accepts an address location and a memory value. The memory value is written to the address location in the target. - public static final int SYS_OSAL_NV_WRITE = 0x2109; - /// TI.ZPI2.MESSAGE_ID.SYS_OSAL_NV_WRITE_SRSP - /// Response for SYS_OSAL_NV_WRITE - public static final int SYS_OSAL_NV_WRITE_SRSP = 0x6109; - /// TI.ZPI2.MESSAGE_ID.SYS_OSAL_START_TIMER - /// Start timer. - public static final int SYS_OSAL_START_TIMER = 0x210a; - /// TI.ZPI2.MESSAGE_ID.SYS_OSAL_START_TIMER_SRSP - /// Response for SYS_OSAL_START_TIMER - public static final int SYS_OSAL_START_TIMER_SRSP = 0x610a; - /// TI.ZPI2.MESSAGE_ID.SYS_OSAL_STOP_TIMER - /// Stop timer. - public static final int SYS_OSAL_STOP_TIMER = 0x210b; - /// TI.ZPI2.MESSAGE_ID.SYS_OSAL_STOP_TIMER_SRSP - /// Response for SYS_OSAL_STOP_TIMER - public static final int SYS_OSAL_STOP_TIMER_SRSP = 0x610b; - /// TI.ZPI2.MESSAGE_ID.SYS_OSAL_TIMER_EXPIRED_IND - /// OSAL timer expired - public static final int SYS_OSAL_TIMER_EXPIRED_IND = 0x4181; - /// TI.ZPI2.MESSAGE_ID.SYS_PING - /// This command is used to check for a device - public static final int SYS_PING = 0x2101; - /// TI.ZPI2.MESSAGE_ID.SYS_PING_RESPONSE - /// Response for SYS_PING - public static final int SYS_PING_RESPONSE = 0x6101; - /// TI.ZPI2.MESSAGE_ID.SYS_RANDOM - /// Generate random number. - public static final int SYS_RANDOM = 0x210c; - /// TI.ZPI2.MESSAGE_ID.SYS_RANDOM_SRSP - /// Response for SYS_RANDOM - public static final int SYS_RANDOM_SRSP = 0x610c; - /// TI.ZPI2.MESSAGE_ID.SYS_RESET - /// This command is sent by the tester to the target to reset it - public static final int SYS_RESET = 0x4100; - /// TI.ZPI2.MESSAGE_ID.SYS_RESET_RESPONSE - /// Indicates a device has reset. - public static final int SYS_RESET_RESPONSE = 0x4180; - /// TI.ZPI2.MESSAGE_ID.SYS_RPC_ERROR - /// RPC transport layer error. - public static final int SYS_RPC_ERROR = 0x6000; - /// TI.ZPI2.MESSAGE_ID.SYS_VERSION - /// Ask for the device's version string. - public static final int SYS_VERSION = 0x2102; - /// TI.ZPI2.MESSAGE_ID.SYS_VERSION_RESPONSE - /// Response for SYS_VERSION - public static final int SYS_VERSION_RESPONSE = 0x6102; - /// TI.ZPI2.MESSAGE_ID.USERTEST_REQUEST - /// This message is sent to the target in order to test the functions defined for individual applications (which internally use attributes and cluster IDs from various device descriptions). - public static final int USERTEST_REQUEST = 0xb51; - /// TI.ZPI2.MESSAGE_ID.USERTEST_RESPONSE - /// Response for USERTEST_REQUEST - public static final int USERTEST_RESPONSE = 0x1b51; - /// TI.ZPI2.MESSAGE_ID.UTIL_CALLBACK_SUBSCRIBE - /// This command subscribes/unsubscribes to layer callbacks. - public static final int UTIL_CALLBACK_SUBSCRIBE = 0x2706; - /// TI.ZPI2.MESSAGE_ID.UTIL_CALLBACK_SUBSCRIBE_RESPONSE - /// Response for UTIL_CALLBACK_SUBSCRIBE - public static final int UTIL_CALLBACK_SUBSCRIBE_RESPONSE = 0x6706; - /// TI.ZPI2.MESSAGE_ID.UTIL_GET_DEVICE_INFO - /// This command is used by the tester to read a single memory location in the target non-volatile memory. The command accepts an address value and returns the memory value present in the target at that address. - public static final int UTIL_GET_DEVICE_INFO = 0x2700; - /// TI.ZPI2.MESSAGE_ID.UTIL_GET_DEVICE_INFO_RESPONSE - /// Response for UTIL_GET_DEVICE_INFO - public static final int UTIL_GET_DEVICE_INFO_RESPONSE = 0x6700; - /// TI.ZPI2.MESSAGE_ID.UTIL_GET_NV_INFO - /// Use this message to get the NV information. - public static final int UTIL_GET_NV_INFO = 0x2701; - /// TI.ZPI2.MESSAGE_ID.UTIL_GET_NV_INFO_RESPONSE - /// Response for UTIL_GET_NV_INFO - public static final int UTIL_GET_NV_INFO_RESPONSE = 0x6701; - /// TI.ZPI2.MESSAGE_ID.UTIL_GET_TIME_ALIVE - /// Use this message to get board's time alive. - public static final int UTIL_GET_TIME_ALIVE = 0x2709; - /// TI.ZPI2.MESSAGE_ID.UTIL_GET_TIME_ALIVE_RESPONSE - /// Response for UTIL_GET_TIME_ALIVE - public static final int UTIL_GET_TIME_ALIVE_RESPONSE = 0x6709; - /// TI.ZPI2.MESSAGE_ID.UTIL_KEY_EVENT - /// Sends a key event to the device registered application. The device register application means that the application registered for key events with OnBoard. Not all application support all keys; so you must know what keys the application supports. - public static final int UTIL_KEY_EVENT = 0x2707; - /// TI.ZPI2.MESSAGE_ID.UTIL_KEY_EVENT_RESPONSE - /// Response for UTIL_KEY_EVENT - public static final int UTIL_KEY_EVENT_RESPONSE = 0x6707; - /// TI.ZPI2.MESSAGE_ID.UTIL_LED_CONTROL - /// Use this message to control LEDs on the board. - public static final int UTIL_LED_CONTROL = 0x270a; - /// TI.ZPI2.MESSAGE_ID.UTIL_LED_CONTROL_RESPONSE - /// Response for UTIL_LED_CONTROL - public static final int UTIL_LED_CONTROL_RESPONSE = 0x670a; - /// TI.ZPI2.MESSAGE_ID.UTIL_SET_CHANNELS - /// Use this message to set the channels. - public static final int UTIL_SET_CHANNELS = 0x2703; - /// TI.ZPI2.MESSAGE_ID.UTIL_SET_CHANNELS_RESPONSE - /// Response for UTIL_SET_CHANNELS - public static final int UTIL_SET_CHANNELS_RESPONSE = 0x6703; - /// TI.ZPI2.MESSAGE_ID.UTIL_SET_PANID - /// Use this message to set PANID. - public static final int UTIL_SET_PANID = 0x2702; - /// TI.ZPI2.MESSAGE_ID.UTIL_SET_PANID_RESPONSE - /// Response for UTIL_SET_PANID - public static final int UTIL_SET_PANID_RESPONSE = 0x6702; - /// TI.ZPI2.MESSAGE_ID.UTIL_SET_PRECONFIG_KEY - /// Use this message to set the preconfig key. - public static final int UTIL_SET_PRECONFIG_KEY = 0x2705; - /// TI.ZPI2.MESSAGE_ID.UTIL_SET_PRECONFIG_KEY_RESPONSE - /// Response for UTIL_SET_PRECONFIG_KEY - public static final int UTIL_SET_PRECONFIG_KEY_RESPONSE = 0x6705; - /// TI.ZPI2.MESSAGE_ID.UTIL_SET_SECURITY_LEVEL - /// Use this message to set the security level. - public static final int UTIL_SET_SECURITY_LEVEL = 0x2704; - /// TI.ZPI2.MESSAGE_ID.UTIL_SET_SECURITY_LEVEL_RESPONSE - /// Response for UTIL_SET_SECURITY_LEVEL - public static final int UTIL_SET_SECURITY_LEVEL_RESPONSE = 0x6704; - /// TI.ZPI2.MESSAGE_ID.ZB_ALLOW_BIND - /// Puts the device into the Allow Bind mode (zb_AllowBind). - public static final int ZB_ALLOW_BIND = 0x2602; - /// TI.ZPI2.MESSAGE_ID.ZB_ALLOW_BIND_CONFIRM - /// Response for ZB_ALLOW_BIND - public static final int ZB_ALLOW_BIND_CONFIRM = 0x4682; - /// TI.ZPI2.MESSAGE_ID.ZB_ALLOW_BIND_RSP - /// Response for ZB_ALLOW_BIND - public static final int ZB_ALLOW_BIND_RSP = 0x6602; - /// TI.ZPI2.MESSAGE_ID.ZB_APP_REGISTER_REQUEST - /// This command register the device descriptor - public static final int ZB_APP_REGISTER_REQUEST = 0x260a; - /// TI.ZPI2.MESSAGE_ID.ZB_APP_REGISTER_RSP - /// Response for ZB_APP_REGISTER_REQUEST - public static final int ZB_APP_REGISTER_RSP = 0x660a; - /// TI.ZPI2.MESSAGE_ID.ZB_BIND_CONFIRM - /// Response for ZB_BIND_DEVICE - public static final int ZB_BIND_CONFIRM = 0x4681; - /// TI.ZPI2.MESSAGE_ID.ZB_BIND_DEVICE - /// Create or remove a binding entry (zb_BindDevice). - public static final int ZB_BIND_DEVICE = 0x2601; - /// TI.ZPI2.MESSAGE_ID.ZB_BIND_DEVICE_RSP - /// Response for ZB_BIND_DEVICE - public static final int ZB_BIND_DEVICE_RSP = 0x6601; - /// TI.ZPI2.MESSAGE_ID.ZB_FIND_DEVICE_CONFIRM - /// (zb_FindDeviceConfirm) - public static final int ZB_FIND_DEVICE_CONFIRM = 0x4685; - /// TI.ZPI2.MESSAGE_ID.ZB_FIND_DEVICE_REQUEST - /// Search for a device's short address given its IEEE address. - public static final int ZB_FIND_DEVICE_REQUEST = 0x2607; - /// TI.ZPI2.MESSAGE_ID.ZB_FIND_DEVICE_REQUEST_RSP - /// Response for ZB_FIND_DEVICE_REQUEST - public static final int ZB_FIND_DEVICE_REQUEST_RSP = 0x6607; - /// TI.ZPI2.MESSAGE_ID.ZB_GET_DEVICE_INFO - /// Reads current device infromation. - public static final int ZB_GET_DEVICE_INFO = 0x2606; - /// TI.ZPI2.MESSAGE_ID.ZB_GET_DEVICE_INFO_RSP - /// Response for ZB_GET_DEVICE_INFO - public static final int ZB_GET_DEVICE_INFO_RSP = 0x6606; - /// TI.ZPI2.MESSAGE_ID.ZB_PERMIT_JOINING_REQUEST - /// Enables or disables the joining permissions on the destination device thus controlling the ability of new devices to join the network. - public static final int ZB_PERMIT_JOINING_REQUEST = 0x2608; - /// TI.ZPI2.MESSAGE_ID.ZB_PERMIT_JOINING_REQUEST_RSP - /// Response for ZB_PERMIT_JOINING_REQUEST - public static final int ZB_PERMIT_JOINING_REQUEST_RSP = 0x6608; - /// TI.ZPI2.MESSAGE_ID.ZB_READ_CONFIGURATION - /// Reads a configuration property from nonvolatile memory (zb_ReadConfiguration). - public static final int ZB_READ_CONFIGURATION = 0x2604; - /// TI.ZPI2.MESSAGE_ID.ZB_READ_CONFIGURATION_RSP - /// - /// - public static final int ZB_READ_CONFIGURATION_RSP = 0x6604; - /// TI.ZPI2.MESSAGE_ID.ZB_RECEIVE_DATA_INDICATION - /// (zb_ReceiveDataIndication) - public static final int ZB_RECEIVE_DATA_INDICATION = 0x4687; - /// TI.ZPI2.MESSAGE_ID.ZB_SEND_DATA_CONFIRM - /// Response for ZB_SEND_DATA_REQUEST - public static final int ZB_SEND_DATA_CONFIRM = 0x4683; - /// TI.ZPI2.MESSAGE_ID.ZB_SEND_DATA_REQUEST - /// Send a data packet to another device (zb_SendDataRequest). - public static final int ZB_SEND_DATA_REQUEST = 0x2603; - /// TI.ZPI2.MESSAGE_ID.ZB_SEND_DATA_REQUEST_RSP - /// Response for ZB_SEND_DATA_REQUEST - public static final int ZB_SEND_DATA_REQUEST_RSP = 0x6603; - /// TI.ZPI2.MESSAGE_ID.ZB_START_CONFIRM - /// Response for ZB_START_REQUEST - public static final int ZB_START_CONFIRM = 0x4680; - /// TI.ZPI2.MESSAGE_ID.ZB_START_REQUEST - /// Starts the ZigBee stack (zb_StartRequest). - public static final int ZB_START_REQUEST = 0x2600; - /// TI.ZPI2.MESSAGE_ID.ZB_START_REQUEST_RSP - /// Response for ZB_START_REQUEST - public static final int ZB_START_REQUEST_RSP = 0x6600; - /// TI.ZPI2.MESSAGE_ID.ZB_SYSTEM_RESET - /// Reboot the device (zb_SystemReset) - public static final int ZB_SYSTEM_RESET = 0x4609; - /// TI.ZPI2.MESSAGE_ID.ZB_WRITE_CONFIGURATION - /// Writes a configuration property to nonvolatile memory (zb_WriteConfiguration). - public static final int ZB_WRITE_CONFIGURATION = 0x2605; - /// TI.ZPI2.MESSAGE_ID.ZB_WRITE_CONFIGURATION_RSP - /// Response for ZB_WRITE_CONFIGURATION - public static final int ZB_WRITE_CONFIGURATION_RSP = 0x6605; - /// TI.ZPI2.MESSAGE_ID.ZDO_ACTIVE_EP_REQ - /// This command is generated to request a list of active endpoint from the destination device. - public static final int ZDO_ACTIVE_EP_REQ = 0x2505; - /// TI.ZPI2.MESSAGE_ID.ZDO_ACTIVE_EP_REQ_SRSP - /// Response for ZDO_ACTIVE_EP_REQ - public static final int ZDO_ACTIVE_EP_REQ_SRSP = 0x6505; - /// TI.ZPI2.MESSAGE_ID.ZDO_ACTIVE_EP_RSP - /// This callback message is in response to the ZDO Active Endpoint Request. - public static final int ZDO_ACTIVE_EP_RSP = 0x4585; - /// TI.ZPI2.MESSAGE_ID.ZDO_AUTO_FIND_DESTINATION - /// This function will issue a Match Description Request for the requested endpoint outputs. This message will generate a broadcast message. - public static final int ZDO_AUTO_FIND_DESTINATION = 0x4541; - /// TI.ZPI2.MESSAGE_ID.ZDO_BIND_REQ - /// This command is generated to request a Bind - public static final int ZDO_BIND_REQ = 0x2521; - /// TI.ZPI2.MESSAGE_ID.ZDO_BIND_REQ_SRSP - /// Response for ZDO_BIND_REQ - public static final int ZDO_BIND_REQ_SRSP = 0x6521; - /// TI.ZPI2.MESSAGE_ID.ZDO_BIND_RSP - /// This callback message is in response to the ZDO Bind Request - public static final int ZDO_BIND_RSP = 0x45a1; - /// TI.ZPI2.MESSAGE_ID.ZDO_COMPLEX_DESC_REQ - /// This command is generated to request for the destination device's complex descriptor - public static final int ZDO_COMPLEX_DESC_REQ = 0x2507; - /// TI.ZPI2.MESSAGE_ID.ZDO_COMPLEX_DESC_REQ_SRSP - /// Response for ZDO_COMPLEX_DESC_REQ - public static final int ZDO_COMPLEX_DESC_REQ_SRSP = 0x6507; - /// TI.ZPI2.MESSAGE_ID.ZDO_COMPLEX_DESC_RSP - /// Response for ZDO_COMPLEX_DESC_REQ - public static final int ZDO_COMPLEX_DESC_RSP = 0x4587; - /// TI.ZPI2.MESSAGE_ID.ZDO_END_DEVICE_ANNCE - /// This command is generated to request an End Device Announce. - public static final int ZDO_END_DEVICE_ANNCE = 0x250a; - /// TI.ZPI2.MESSAGE_ID.ZDO_END_DEVICE_ANNCE_IND - /// ZDO end device announce indication. - public static final int ZDO_END_DEVICE_ANNCE_IND = 0x45c1; - /// TI.ZPI2.MESSAGE_ID.ZDO_END_DEVICE_ANNCE_SRSP - /// Response for ZDO_END_DEVICE_ANNCE - public static final int ZDO_END_DEVICE_ANNCE_SRSP = 0x650a; - /// TI.ZPI2.MESSAGE_ID.ZDO_END_DEVICE_BIND_REQ - /// This command is generated to request an End Device Bind with the destination device - public static final int ZDO_END_DEVICE_BIND_REQ = 0x2520; - /// TI.ZPI2.MESSAGE_ID.ZDO_END_DEVICE_BIND_REQ_SRSP - /// Response for ZDO_END_DEVICE_BIND_REQ - public static final int ZDO_END_DEVICE_BIND_REQ_SRSP = 0x6520; - /// TI.ZPI2.MESSAGE_ID.ZDO_END_DEVICE_BIND_RSP - /// This callback message is in response to the ZDO End Device Bind Request - public static final int ZDO_END_DEVICE_BIND_RSP = 0x45a0; - /// TI.ZPI2.MESSAGE_ID.ZDO_IEEE_ADDR_REQ - /// This command will request a device's IEEE 64-bit address. You must subscribe to 'ZDO IEEE Address Response' to receive the data response to this message. The response message listed below only indicates whether or not the message was received properly. - public static final int ZDO_IEEE_ADDR_REQ = 0x2501; - /// TI.ZPI2.MESSAGE_ID.ZDO_IEEE_ADDR_REQ_SRSP - /// Response for ZDO_IEEE_ADDR_REQ - public static final int ZDO_IEEE_ADDR_REQ_SRSP = 0x6501; - /// TI.ZPI2.MESSAGE_ID.ZDO_IEEE_ADDR_RSP - /// This callback message is in response to the ZDO IEEE Address Request. - public static final int ZDO_IEEE_ADDR_RSP = 0x4581; - /// TI.ZPI2.MESSAGE_ID.ZDO_MATCH_DESC_REQ - /// This command is generated to request a list of active endpoint from the destination device - public static final int ZDO_MATCH_DESC_REQ = 0x2506; - /// TI.ZPI2.MESSAGE_ID.ZDO_MATCH_DESC_REQ_SRSP - /// Response for ZDO_MATCH_DESC_REQ - public static final int ZDO_MATCH_DESC_REQ_SRSP = 0x6506; - /// TI.ZPI2.MESSAGE_ID.ZDO_MATCH_DESC_RSP - /// This callback message is in response to the ZDO Match Description Request - public static final int ZDO_MATCH_DESC_RSP = 0x4586; - /// TI.ZPI2.MESSAGE_ID.ZDO_MGMT_BIND_REQ - /// This command is generated to request a Management Binding Table Request. - public static final int ZDO_MGMT_BIND_REQ = 0x2533; - /// TI.ZPI2.MESSAGE_ID.ZDO_MGMT_BIND_REQ_SRSP - /// Response for ZDO_MGMT_BIND_REQ - public static final int ZDO_MGMT_BIND_REQ_SRSP = 0x6533; - /// TI.ZPI2.MESSAGE_ID.ZDO_MGMT_BIND_RSP - /// This callback message is in response to the ZDO Management Binding Table Request - public static final int ZDO_MGMT_BIND_RSP = 0x45b3; - /// TI.ZPI2.MESSAGE_ID.ZDO_MGMT_DIRECT_JOIN_REQ - /// This command is generated to request a Management Direct Join Request - public static final int ZDO_MGMT_DIRECT_JOIN_REQ = 0x2535; - /// TI.ZPI2.MESSAGE_ID.ZDO_MGMT_DIRECT_JOIN_REQ_SRSP - /// Response for ZDO_MGMT_DIRECT_JOIN_REQ - public static final int ZDO_MGMT_DIRECT_JOIN_REQ_SRSP = 0x6535; - /// TI.ZPI2.MESSAGE_ID.ZDO_MGMT_DIRECT_JOIN_RSP - /// This callback message is in response to the ZDO Management Direct Join Request. - public static final int ZDO_MGMT_DIRECT_JOIN_RSP = 0x45b5; - /// TI.ZPI2.MESSAGE_ID.ZDO_MGMT_LEAVE_REQ - /// This command is generated to request a Management Leave Request - public static final int ZDO_MGMT_LEAVE_REQ = 0x2534; - /// TI.ZPI2.MESSAGE_ID.ZDO_MGMT_LEAVE_REQ_SRSP - /// Response for ZDO_MGMT_LEAVE_REQ - public static final int ZDO_MGMT_LEAVE_REQ_SRSP = 0x6534; - /// TI.ZPI2.MESSAGE_ID.ZDO_MGMT_LEAVE_RSP - /// This callback message is in response to the ZDO Management Leave Request. - public static final int ZDO_MGMT_LEAVE_RSP = 0x45b4; - /// TI.ZPI2.MESSAGE_ID.ZDO_MGMT_LQI_REQ - /// This command is generated to request a Management LQI Request. - public static final int ZDO_MGMT_LQI_REQ = 0x2531; - /// TI.ZPI2.MESSAGE_ID.ZDO_MGMT_LQI_REQ_SRSP - /// Response for ZDO_MGMT_LQI_REQ - public static final int ZDO_MGMT_LQI_REQ_SRSP = 0x6531; - /// TI.ZPI2.MESSAGE_ID.ZDO_MGMT_LQI_RSP - /// This callback message is in response to the ZDO Management LQI Request. - public static final int ZDO_MGMT_LQI_RSP = 0x45b1; - /// TI.ZPI2.MESSAGE_ID.ZDO_MGMT_NWK_DISC_REQ - /// This command is generated to request a Management Network Discovery Request - public static final int ZDO_MGMT_NWK_DISC_REQ = 0x2530; - /// TI.ZPI2.MESSAGE_ID.ZDO_MGMT_NWK_DISC_REQ_SRSP - /// Response for ZDO_MGMT_NWK_DISC_REQ - public static final int ZDO_MGMT_NWK_DISC_REQ_SRSP = 0x6530; - /// TI.ZPI2.MESSAGE_ID.ZDO_MGMT_NWK_DISC_RSP - /// This callback message is in response to the ZDO Management Network Discovery Request - public static final int ZDO_MGMT_NWK_DISC_RSP = 0x45b0; - /// TI.ZPI2.MESSAGE_ID.ZDO_MGMT_NWK_UPDATE_REQ - /// This command is provided to allow updating of network configuration parameters or to request information from devices on network conditions in the local operating environment. - public static final int ZDO_MGMT_NWK_UPDATE_REQ = 0x2537; - /// TI.ZPI2.MESSAGE_ID.ZDO_MGMT_NWK_UPDATE_REQ_SRSP - /// Response for ZDO_MGMT_NWK_UPDATE_REQ - public static final int ZDO_MGMT_NWK_UPDATE_REQ_SRSP = 0x6537; - /// TI.ZPI2.MESSAGE_ID.ZDO_MGMT_PERMIT_JOIN_REQ_SRSP - /// Response for ZDO_MGMT_PERMIT_JOIN_REQ - public static final int ZDO_MGMT_PERMIT_JOIN_REQ_SRSP = 0x6536; - /// TI.ZPI2.MESSAGE_ID.ZDO_MGMT_PERMIT_JOIN_REQUEST - /// This command is generated to request a Management Join Request - public static final int ZDO_MGMT_PERMIT_JOIN_REQ = 0x2536; - /// TI.ZPI2.MESSAGE_ID.ZDO_MGMT_PERMIT_JOIN_RSP - /// This callback message is in response to the ZDO Management Permit Join Request - public static final int ZDO_MGMT_PERMIT_JOIN_RSP = 0x45b6; - /// TI.ZPI2.MESSAGE_ID.ZDO_MGMT_RTG_REQ - /// This command is generated to request a Management Routing Table Request. - public static final int ZDO_MGMT_RTG_REQ = 0x2532; - /// TI.ZPI2.MESSAGE_ID.ZDO_MGMT_RTG_REQ_SRSP - /// Response for ZDO_MGMT_RTG_REQ - public static final int ZDO_MGMT_RTG_REQ_SRSP = 0x6532; - /// TI.ZPI2.MESSAGE_ID.ZDO_MGMT_RTG_RSP - /// This callback message is in response to the ZDO Management Routing Table Request. - public static final int ZDO_MGMT_RTG_RSP = 0x45b2; - /// TI.ZPI2.MESSAGE_ID.ZDO_NODE_DESC_REQ - /// This command is generated to inquire as to the Node Descriptor of the destination device - public static final int ZDO_NODE_DESC_REQ = 0x2502; - /// TI.ZPI2.MESSAGE_ID.ZDO_NODE_DESC_REQ_SRSP - /// Response for ZDO_NODE_DESC_REQ - public static final int ZDO_NODE_DESC_REQ_SRSP = 0x6502; - /// TI.ZPI2.MESSAGE_ID.ZDO_NODE_DESC_RSP - /// This callback message is in response to the ZDO Node Descriptor Request. - public static final int ZDO_NODE_DESC_RSP = 0x4582; - /// TI.ZPI2.MESSAGE_ID.ZDO_NWK_ADDR_REQ - /// This message will request the device to send a "Network Address Request". This message sends a broadcast message looking for a 16 bit address with a 64 bit address as bait. You must subscribe to "ZDO Network Address Response" to receive the response to this message. The response message listed below only indicates whether or not the message was received properly. - public static final int ZDO_NWK_ADDR_REQ = 0x2500; - /// TI.ZPI2.MESSAGE_ID.ZDO_NWK_ADDR_REQ_SRSP - /// Response for ZDO_NWK_ADDR_REQ - public static final int ZDO_NWK_ADDR_REQ_SRSP = 0x6500; - /// TI.ZPI2.MESSAGE_ID.ZDO_NWK_ADDR_RSP - /// This callback message is in response to the ZDO Network Address Request. - public static final int ZDO_NWK_ADDR_RSP = 0x4580; - /// TI.ZPI2.MESSAGE_ID.ZDO_POWER_DESC_REQ - /// This command is generated to inquire as to the Power Descriptor of the destination - public static final int ZDO_POWER_DESC_REQ = 0x2503; - /// TI.ZPI2.MESSAGE_ID.ZDO_POWER_DESC_REQ_SRSP - /// Response for ZDO_POWER_DESC_REQ - public static final int ZDO_POWER_DESC_REQ_SRSP = 0x6503; - /// TI.ZPI2.MESSAGE_ID.ZDO_POWER_DESC_RSP - /// This callback message is in response to the ZDO Power Descriptor Request. - public static final int ZDO_POWER_DESC_RSP = 0x4583; - /// TI.ZPI2.MESSAGE_ID.ZDO_SERVER_DISC_REQ - /// The command is used for local device to discover the location of a particular system server or servers as indicated by the ServerMask parameter. The destination addressing on this request is 'broadcast to all RxOnWhenIdle devices'. - public static final int ZDO_SERVER_DISC_REQ = 0x250c; - /// TI.ZPI2.MESSAGE_ID.ZDO_SERVER_DISC_REQ_SRSP - /// Response for ZDO_SERVER_DISC_REQ - public static final int ZDO_SERVER_DISC_REQ_SRSP = 0x650c; - /// TI.ZPI2.MESSAGE_ID.ZDO_SERVER_DISC_RSP - /// This callback message is - public static final int ZDO_SERVER_DISC_RSP = 0x458a; - /// TI.ZPI2.MESSAGE_ID.ZDO_SIMPLE_DESC_REQ - /// This command is generated to inquire as to the Simple Descriptor of the destination device's Endpoint - public static final int ZDO_SIMPLE_DESC_REQ = 0x2504; - /// TI.ZPI2.MESSAGE_ID.ZDO_SIMPLE_DESC_REQ_SRSP - /// Response for ZDO_SIMPLEDESCRIPTOR_REQUEST - public static final int ZDO_SIMPLE_DESC_REQ_SRSP = 0x6504; - /// TI.ZPI2.MESSAGE_ID.ZDO_SIMPLE_DESC_RSP - /// This callback message is in response to the ZDO Simple Descriptor Request. - public static final int ZDO_SIMPLE_DESC_RSP = 0x4584; - /// TI.ZPI2.MESSAGE_ID.ZDO_STARTUP_FROM_APP - /// In the case where compiler flag HOLD_AUTO_START is defined by default; device will start from HOLD state. Issuing this command will trigger the device to leave HOLD state to form or join a network. - public static final int ZDO_STARTUP_FROM_APP = 0x2540; - /// TI.ZPI2.MESSAGE_ID.ZDO_STARTUP_FROM_APP_SRSP - /// Response for ZDO_STARTUP_FROM_APP - public static final int ZDO_STARTUP_FROM_APP_SRSP = 0x6540; - /// TI.ZPI2.MESSAGE_ID.ZDO_STATE_CHANGE_IND - /// ZDO state change indication. - public static final int ZDO_STATE_CHANGE_IND = 0x45c0; - /// TI.ZPI2.MESSAGE_ID.ZDO_STATUS_ERROR_RSP - /// This message is the default message for error status. - public static final int ZDO_STATUS_ERROR_RSP = 0x45c3; - /// TI.ZPI2.MESSAGE_ID.ZDO_UNBIND_REQ - /// This command is generated to request an UnBind - public static final int ZDO_UNBIND_REQ = 0x2522; - /// TI.ZPI2.MESSAGE_ID.ZDO_UNBIND_REQ_SRSP - /// Response for ZDO_UNBIND_REQ - public static final int ZDO_UNBIND_REQ_SRSP = 0x6522; - /// TI.ZPI2.MESSAGE_ID.ZDO_UNBIND_RSP - /// This callback message is in response to the ZDO UnBind Request - public static final int ZDO_UNBIND_RSP = 0x45a2; - /// TI.ZPI2.MESSAGE_ID.ZDO_USER_DESC_CONF - /// This callback message is in response to the ZDO User Descriptor Set Request. - public static final int ZDO_USER_DESC_CONF = 0x4589; - /// TI.ZPI2.MESSAGE_ID.ZDO_USER_DESC_REQ - /// This command is generated to request for the destination device's user descriptor - public static final int ZDO_USER_DESC_REQ = 0x2508; - /// TI.ZPI2.MESSAGE_ID.ZDO_USER_DESC_REQ_SRSP - /// Response for ZDO_USER_DESC_REQ - public static final int ZDO_USER_DESC_REQ_SRSP = 0x6508; - /// TI.ZPI2.MESSAGE_ID.ZDO_USER_DESC_RSP - /// This callback message is in response to the ZDO User Description Request. - public static final int ZDO_USER_DESC_RSP = 0x4588; - /// TI.ZPI2.MESSAGE_ID.ZDO_USER_DESC_SET - /// This command is generated to request a User Descriptor Set Request - public static final int ZDO_USER_DESC_SET = 0x250b; - /// TI.ZPI2.MESSAGE_ID.ZDO_USER_DESC_SET_SRSP - /// Response for ZDO_USER_DESC_SET - public static final int ZDO_USER_DESC_SET_SRSP = 0x650b; - /// TI.ZPI2.MESSAGE_ID.ZMAC_ASSOCIATE_CNF - /// This sends a associat confirm command - public static final int ZMAC_ASSOCIATE_CNF = 0x4282; - /// TI.ZPI2.MESSAGE_ID.ZMAC_ASSOCIATE_IND - /// This command is used to send (on behalf of the next higher layer) an association indication message - public static final int ZMAC_ASSOCIATE_IND = 0x4281; - /// TI.ZPI2.MESSAGE_ID.ZMAC_ASSOCIATE_REQUEST - /// This command is used to request (on behalf of the next higher layer) an association with a coordinator - public static final int ZMAC_ASSOCIATE_REQUEST = 0x2206; - /// TI.ZPI2.MESSAGE_ID.ZMAC_ASSOCIATE_RESPONSE - /// Response for ZMAC_ASSOCIATE_REQUEST - public static final int ZMAC_ASSOCIATE_RESPONSE = 0x6206; - /// TI.ZPI2.MESSAGE_ID.ZMAC_BEACON_NOTIFY_IND - /// Beacon Notify Indication - public static final int ZMAC_BEACON_NOTIFY_IND = 0x4283; - /// TI.ZPI2.MESSAGE_ID.ZMAC_COMM_STATUS_IND - /// Communcation status indication - public static final int ZMAC_COMM_STATUS_IND = 0x428d; - /// TI.ZPI2.MESSAGE_ID.ZMAC_DATA_CNF - /// Data Request Confirmation - public static final int ZMAC_DATA_CNF = 0x4284; - /// TI.ZPI2.MESSAGE_ID.ZMAC_DATA_IND - /// Data Request Confirmation - public static final int ZMAC_DATA_IND = 0x4285; - /// TI.ZPI2.MESSAGE_ID.ZMAC_DATA_REQUEST - /// This command is used to send (on behalf of the next higher layer) MAC Data Frame packet. - public static final int ZMAC_DATA_REQUEST = 0x2205; - /// TI.ZPI2.MESSAGE_ID.ZMAC_DATA_RESPONSE - /// Response for ZMAC_DATA_REQUEST - public static final int ZMAC_DATA_RESPONSE = 0x6205; - /// TI.ZPI2.MESSAGE_ID.ZMAC_DISASSOCIATE_CNF - /// Disassociate Indication - public static final int ZMAC_DISASSOCIATE_CNF = 0x4287; - /// TI.ZPI2.MESSAGE_ID.ZMAC_DISASSOCIATE_IND - /// Disassociate Indication - public static final int ZMAC_DISASSOCIATE_IND = 0x4286; - /// TI.ZPI2.MESSAGE_ID.ZMAC_DISASSOCIATE_REQUEST - /// This command is used to request (on behalf of the next higher layer) a disassociation of the device from the coordinator. - public static final int ZMAC_DISASSOCIATE_REQUEST = 0x2207; - /// TI.ZPI2.MESSAGE_ID.ZMAC_DISASSOCIATE_RESPONSE - /// Response for ZMAC_DISASSOCIATE_REQUEST - public static final int ZMAC_DISASSOCIATE_RESPONSE = 0x6207; - /// TI.ZPI2.MESSAGE_ID.ZMAC_GET_REQUEST - /// This command is used to read (on behalf of the next higher layer) a MAC PIB attribute. - public static final int ZMAC_GET_REQUEST = 0x2208; - /// TI.ZPI2.MESSAGE_ID.ZMAC_GET_RESPONSE - /// Response for ZMAC_GET_REQUEST - public static final int ZMAC_GET_RESPONSE = 0x6208; - /// TI.ZPI2.MESSAGE_ID.ZMAC_INIT_REQUEST - /// This command is used to initialize the ZMAC on the current device (on behalf of the next higher layer). - public static final int ZMAC_INIT_REQUEST = 0x2202; - /// TI.ZPI2.MESSAGE_ID.ZMAC_INIT_RESPONSE - /// Response for ZMAC_INIT_REQUEST - public static final int ZMAC_INIT_RESPONSE = 0x6202; - /// TI.ZPI2.MESSAGE_ID.ZMAC_ORPHAN_IND - /// Orphan Indication - public static final int ZMAC_ORPHAN_IND = 0x428a; - /// TI.ZPI2.MESSAGE_ID.ZMAC_POLL_CNF - /// Mac Poll Confirmation - public static final int ZMAC_POLL_CNF = 0x428b; - /// TI.ZPI2.MESSAGE_ID.ZMAC_POLL_REQUEST - /// This command is used to send a MAC data request poll - public static final int ZMAC_POLL_REQUEST = 0x220d; - /// TI.ZPI2.MESSAGE_ID.ZMAC_POLL_RESPONSE - /// Response for ZMAC_POLL_REQUEST - public static final int ZMAC_POLL_RESPONSE = 0x620d; - /// TI.ZPI2.MESSAGE_ID.ZMAC_PURGE_CNF - /// Mac RX enable Confirmation - public static final int ZMAC_PURGE_CNF = 0x4290; - /// TI.ZPI2.MESSAGE_ID.ZMAC_PURGE_REQUEST - /// This command is used to send a request to the device to purge a data frame - public static final int ZMAC_PURGE_REQUEST = 0x220e; - /// TI.ZPI2.MESSAGE_ID.ZMAC_PURGE_RESPONSE - /// Response for ZMAC_PURGE_REQUEST - public static final int ZMAC_PURGE_RESPONSE = 0x620e; - /// TI.ZPI2.MESSAGE_ID.ZMAC_RESET_REQUEST - /// This command is used to send a MAC Reset command to reset MAC state machine - public static final int ZMAC_RESET_REQUEST = 0x2201; - /// TI.ZPI2.MESSAGE_ID.ZMAC_RESET_RESPONSE - /// Response for ZMAC_RESET_REQUEST - public static final int ZMAC_RESET_RESPONSE = 0x6201; - /// TI.ZPI2.MESSAGE_ID.ZMAC_RX_ENABLE_CNF - /// Mac RX enable Confirmation - public static final int ZMAC_RX_ENABLE_CNF = 0x428f; - /// TI.ZPI2.MESSAGE_ID.ZMAC_RX_ENABLE_REQUEST - /// This command contains timing information that tells the device when to enable or disable its receiver; in order to schedule a data transfer between itself and another device. The information is sent from the upper layers directly to the MAC sublayer. - public static final int ZMAC_RX_ENABLE_REQUEST = 0x220b; - /// TI.ZPI2.MESSAGE_ID.ZMAC_RX_ENABLE_RESPONSE - /// Response for ZMAC_RX_ENABLE_REQUEST - public static final int ZMAC_RX_ENABLE_RESPONSE = 0x620b; - /// TI.ZPI2.MESSAGE_ID.ZMAC_SCAN_CNF - /// Scan Confirmation - public static final int ZMAC_SCAN_CNF = 0x428c; - /// TI.ZPI2.MESSAGE_ID.ZMAC_SCAN_REQUEST - /// This command is used to send a request to the device to perform a network scan. - public static final int ZMAC_SCAN_REQUEST = 0x220c; - /// TI.ZPI2.MESSAGE_ID.ZMAC_SCAN_RESPONSE - /// Response for ZMAC_SCAN_REQUEST - public static final int ZMAC_SCAN_RESPONSE = 0x620c; - /// TI.ZPI2.MESSAGE_ID.ZMAC_SET_REQUEST - /// This command is used to request the device to write a MAC PIB value. - public static final int ZMAC_SET_REQUEST = 0x2209; - /// TI.ZPI2.MESSAGE_ID.ZMAC_SET_RESPONSE - /// Response for ZMAC_SET_REQUEST - public static final int ZMAC_SET_RESPONSE = 0x6209; - /// TI.ZPI2.MESSAGE_ID.ZMAC_SET_RX_GAIN_REQUEST - /// This command is used to send a request to the device to set Rx gain - public static final int ZMAC_SET_RX_GAIN_REQUEST = 0x220f; - /// TI.ZPI2.MESSAGE_ID.ZMAC_SET_RX_GAIN_RESPONSE - /// Response for ZMAC_SET_RX_GAIN_REQUEST - public static final int ZMAC_SET_RX_GAIN_RESPONSE = 0x620f; - /// TI.ZPI2.MESSAGE_ID.ZMAC_START_CNF - /// Mac Start Confirmation - public static final int ZMAC_START_CNF = 0x428e; - /// TI.ZPI2.MESSAGE_ID.ZMAC_START_REQUEST - /// This command is used to request the MAC to transmit beacons and become a coordinator - public static final int ZMAC_START_REQUEST = 0x2203; - /// TI.ZPI2.MESSAGE_ID.ZMAC_START_RESPONSE - /// Response for ZMAC_START_REQUEST - public static final int ZMAC_START_RESPONSE = 0x6203; - /// TI.ZPI2.MESSAGE_ID.ZMAC_SYNC_LOSS_IND - /// Indication for sync loss - public static final int ZMAC_SYNC_LOSS_IND = 0x4280; - /// TI.ZPI2.MESSAGE_ID.ZMAC_SYNCHRONIZE_REQUEST - /// This command is used to request synchronization to the current network beacon - public static final int ZMAC_SYNCHRONIZE_REQUEST = 0x2204; - /// TI.ZPI2.MESSAGE_ID.ZMAC_SYNCHRONIZE_RESPONSE - /// Response for ZMAC_SYNCHRONIZE_REQUEST - public static final int ZMAC_SYNCHRONIZE_RESPONSE = 0x6204; - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolException.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolException.java deleted file mode 100644 index c8e0146526345..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolException.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - Copyright 2008-2013 Andrew Rapp, http://code.google.com/p/xbee-api/ - - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet; - -/** - * I usually detest checked exceptions but given this is a public api, it is reasonable to - * announce users what they can expect. - * - * @author Andrew Rapp - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZToolException extends Exception { - - private static final long serialVersionUID = -5501299728920565639L; - private Exception cause; - - public ZToolException(String message) { - super(message); - } - - /** - * @param msg - * @param t - * @since 0.6.0 - */ - public ZToolException(String msg, Throwable t) { - super(msg, t); - } - - public ZToolException() { - super(); - } - - public ZToolException(Exception cause) { - super(); - this.setCause(cause); - } - - public Exception getCause() { - return cause; - } - - public void setCause(Exception cause) { - this.cause = cause; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolPacket.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolPacket.java deleted file mode 100644 index 439fd8cda4d88..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolPacket.java +++ /dev/null @@ -1,179 +0,0 @@ -/* - Copyright 2008-2013 Andrew Rapp, http://code.google.com/p/xbee-api/ - - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet; - -import org.bubblecloud.zigbee.util.ByteUtils; -import org.bubblecloud.zigbee.util.DoubleByte; -import org.bubblecloud.zigbee.util.Integers; - -/** - * @author Andrew Rapp - * @author Stefano "Kismet" Lenzi - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZToolPacket { - - public final static int PAYLOAD_START_INDEX = 4; - - public enum CommandType { - POLL, SREQ, AREQ, SRSP - } - - public enum CommandSubsystem { - RESERVED_0, SYS, RESERVED_1, RESERVED_2, AF, ZDO, ZB - } - - - //private final static Logger log = Logger.getLogger(ZToolPacket.class); - public final static int START_BYTE = 0xFE; - protected int[] packet; - private int LEN; - private DoubleByte CMD; - private int FCS; - private boolean error = false; - private String errorMsg; - private CommandType type = null; - private CommandSubsystem subsystem = null; - - /** - * I started off using bytes but quickly realized that java bytes are signed, so effectively only 7 bits. - * We should be able to use int instead. - * - * @param data - */ //PROTECTED? - public ZToolPacket() { - } - - //PROTECTED? - public ZToolPacket(DoubleByte ApiId, int[] frameData) { - this.buildPacket(ApiId, frameData); - } - - public void buildPacket(DoubleByte ApiId, int[] frameData) { - // packet size is start byte + len byte + 2 cmd bytes + data + checksum byte - packet = new int[frameData.length + 5]; - packet[0] = START_BYTE; - - // note: if checksum is not correct, XBee won't send out packet or return error. ask me how I know. - // checksum is always computed on pre-escaped packet - Checksum checksum = new Checksum(); - // Packet length does not include escape bytes - this.LEN = frameData.length; - packet[1] = this.LEN; - checksum.addByte(packet[1]); - // msb Cmd0 -> Type & Subsystem - packet[2] = ApiId.getMsb(); - checksum.addByte(packet[2]); - // lsb Cmd1 -> PROFILE_ID_HOME_AUTOMATION - packet[3] = ApiId.getLsb(); - checksum.addByte(packet[3]); - this.CMD = ApiId; - //data - for (int i = 0; i < frameData.length; i++) { - if (!ByteUtils.isByteValue(frameData[i])) { - throw new RuntimeException("Value is greater than one byte: " + frameData[i] + " (" + Integer.toHexString(frameData[i]) + ")"); - } - packet[PAYLOAD_START_INDEX + i] = frameData[i]; - checksum.addByte(packet[PAYLOAD_START_INDEX + i]); - } - // set last byte as checksum - checksum.compute(); - this.FCS = checksum.getChecksum(); - packet[packet.length - 1] = this.FCS; - - } - - public CommandType getCommandType() { - if (type != null) return type; - type = CommandType.values()[(packet[2] & 0x60) >> 5]; - return type; - } - - public CommandSubsystem getCommandSubsystem() { - if (subsystem != null) return subsystem; - subsystem = CommandSubsystem.values()[packet[2] & 0x1F]; - return subsystem; - } - - - public int[] getPacket() { - return packet; - } - - public int getLEN() { - return LEN; - } - - public DoubleByte getCMD() { - return this.CMD; - } - - public short getCommandId() { - return Integers.shortFromInts(packet, 2, 3); - } - - public int getFCS() { - return this.FCS; - } - - public static boolean isSpecialByte(int b) { - if (b == ZToolPacket.START_BYTE) { - return true; - } - - return false; - } - - public boolean isError() { - return error; - } - - public void setError(boolean error) { - this.error = error; - } - - public String getErrorMsg() { - return errorMsg; - } - - public void setErrorMsg(String errorMsg) { - this.errorMsg = errorMsg; - } - - public String toString() { - return "Packet: length = " + this.LEN + - ", apiId = " + ByteUtils.toBase16(this.CMD.getMsb()) + " " + ByteUtils.toBase16(this.CMD.getLsb()) + - ", full data = " + ByteUtils.toBase16(this.packet) + - ", checksum = " + ByteUtils.toBase16(this.FCS) + - ", error = " + this.error + - ", errorMessage = " + this.errorMsg; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolPacketHandler.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolPacketHandler.java deleted file mode 100644 index 5f1b51c59286b..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolPacketHandler.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - Copyright 2008-2013 Andrew Rapp, http://code.google.com/p/xbee-api/ - - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet; - -/** - * @author Andrew Rapp - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public interface ZToolPacketHandler { - - /** - * A callback used by {@link ZToolPacketParser} for notifying that a new packet is arrived - * NOTE: Bad packet would not be notified - * - * @param response the new {@link ZToolPacket} parsed by {@link ZToolPacketParser} - */ - public void handlePacket(ZToolPacket response); - - /** - * A callback used by {@link ZToolPacketParser} for notifying that an {@link Exception} has
- * been thrown - * - * @param th - */ - public void error(Throwable th); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolPacketParser.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolPacketParser.java deleted file mode 100644 index 0313ef83c45df..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolPacketParser.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - Copyright 2008-2013 Andrew Rapp, http://code.google.com/p/xbee-api/ - - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet; - -import org.bubblecloud.zigbee.util.ByteUtils; -import org.bubblecloud.zigbee.util.MarkableInputStream; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; -import java.io.InputStream; - -/** - * @author Andrew Rapp - * @author Alvaro Fides Valero - * @author Stefano "Kismet" Lenzi - * @author Michele Girolami - * @author Tommi S.E. Laukkanen - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class ZToolPacketParser implements Runnable { - /** - * The logger. - */ - private final static Logger logger = LoggerFactory.getLogger(ZToolPacketParser.class); - /** - * The packet handler. - */ - private ZToolPacketHandler packetHandler; - /** - * The input stream. - */ - private final InputStream inputStream; - /** - * The parser parserThread. - */ - private Thread parserThread = null; - /** - * Flag reflecting that parser has been closed and parser parserThread should exit. - */ - private boolean close = false; - - /** - * Construct which sets input stream where the packet is read from the and handler - * which further processes the received packet. - * - * @param inputStream the input stream - * @param packetHandler the packet handler - */ - public ZToolPacketParser(final InputStream inputStream, final ZToolPacketHandler packetHandler) { - logger.trace("Creating ZToolPacketParser"); - if (inputStream.markSupported()) { - this.inputStream = inputStream; - } else { - logger.trace( - "Provided InputStream {} doesn't provide the mark()/reset() feature, " + - "wrapping it up as BufferedInputStream", inputStream.getClass() - ); - this.inputStream = new MarkableInputStream(inputStream); - } - this.packetHandler = packetHandler; - - parserThread = new Thread(this, "ZToolPacketParser"); - parserThread.start(); - } - - /** - * Run method executed by the parser thread. - */ - public void run() { - logger.trace("ZToolPacketParser parserThread started"); - while (!close) { - try { - int val = inputStream.read(); - logger.trace("Read {} from input stream ", ByteUtils.formatByte(val)); - if (val == ZToolPacket.START_BYTE) { - inputStream.mark(256); - final ZToolPacketStream packetStream = new ZToolPacketStream(inputStream); - final ZToolPacket response = packetStream.parsePacket(); - - logger.trace("Response is {} -> {}", response.getClass(), response); - if (response.isError()) { - logger.error("Received a BAD PACKET {}", response.getPacket()); - inputStream.reset(); - continue; - } - - packetHandler.handlePacket(response); - } else { - if (val != 0) { - // Log if not end of stream signaling zero byte. - logger.warn("Discared stream: expected start byte but received this {}", - ByteUtils.toBase16(val)); - } - } - } catch (final IOException e) { - if (!close) { - logger.error("Exception inputStream reader parserThread", e); - packetHandler.error(e); - } - } - } - logger.debug("ZToolPacketParser parserThread exited."); - } - - /** - * Set the close flag to true. - */ - public void setClosing() { - this.close = true; - } - - /** - * Requests parser thread to shutdown. - */ - public void close() { - this.close = true; - try { - parserThread.join(); - } catch (InterruptedException e) { - logger.warn("Interrupted in packet parser thread shutdown join."); - } - } - - /** - * Checks if parser thread is alive. - * - * @return true if parser thread is alive. - */ - public boolean isAlive() { - return parserThread != null && parserThread.isAlive(); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolPacketStream.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolPacketStream.java deleted file mode 100644 index 2d6ebc561376f..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolPacketStream.java +++ /dev/null @@ -1,443 +0,0 @@ -/* - Copyright 2008-2013 Andrew Rapp, http://code.google.com/p/xbee-api/ - - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -package org.bubblecloud.zigbee.network.packet; - -import org.bubblecloud.zigbee.network.packet.af.AF_DATA_CONFIRM; -import org.bubblecloud.zigbee.network.packet.af.AF_DATA_SRSP; -import org.bubblecloud.zigbee.network.packet.af.AF_INCOMING_MSG; -import org.bubblecloud.zigbee.network.packet.af.AF_REGISTER_SRSP; -import org.bubblecloud.zigbee.network.packet.simple.*; -import org.bubblecloud.zigbee.network.packet.system.*; -import org.bubblecloud.zigbee.network.packet.util.UTIL_GET_DEVICE_INFO_RESPONSE; -import org.bubblecloud.zigbee.network.packet.util.UTIL_SET_CHANNELS_RESPONSE; -import org.bubblecloud.zigbee.network.packet.util.UTIL_SET_PANID_RESPONSE; -import org.bubblecloud.zigbee.network.packet.zdo.*; -import org.bubblecloud.zigbee.util.ByteUtils; -import org.bubblecloud.zigbee.util.DoubleByte; -import org.bubblecloud.zigbee.util.IIntArrayInputStream; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; -import java.io.InputStream; - -/** - * Reads a packet from the input stream, verifies checksum and creates an XBeeResponse object - * - * @author Andrew Rapp - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZToolPacketStream - implements IIntArrayInputStream { - - private final static Logger log = LoggerFactory.getLogger(ZToolPacketStream.class); - - private boolean done; - - private int bytesRead; - - private int length; - - private Checksum checksum = new Checksum(); - - private boolean generic = false; - - private final InputStream in; - - public ZToolPacketStream(InputStream in) { - this.in = in; - } - - /** - * @param packet - * @return - * @since 0.6.0 - Revision 60 - */ - public static ZToolPacket parsePacket(int[] packet) { - final ZToolPacket response; - int idx = 1; - final int length = packet[idx]; - idx++; - //log.debug("data length is " + ByteUtils.formatByte(length.getLength())); - final int[] payload = new int[length]; - final DoubleByte cmdId = new DoubleByte(packet[idx], packet[idx + 1]); - idx += 2; - for (int i = 0; i < payload.length; i++) { - payload[i] = packet[idx]; - idx++; - } - response = parsePayload(cmdId, payload); - int fcs = packet[idx]; - idx++; - if (fcs != response.getFCS()) { - log.debug("Parsed packet was {}", packet); - throw new ZToolParseException("Packet checksum failed"); - } - if (idx != packet.length) { - log.warn("Packet buffer contains more data that has been ignored"); - } - return response; - } - - /** - * @param packet - * @return - * @since 0.6.0 - Revision 60 - */ - - public static ZToolPacket parsePacket(byte[] packet) { - final ZToolPacket response; - int idx = 1; - if (packet[0] != 0xFE) { - throw new ZToolParseException("Buffer is not a valid packet, it doesn't start with 0xFE"); - } - final int length = packet[idx] & 0xFF; - idx++; - //log.debug("data length is " + ByteUtils.formatByte(length.getLength())); - final int[] payload = new int[length]; - final int cmdIdHiByte = packet[idx] & 0xFF; - idx++; - final int cmdIdLoByte = packet[idx] & 0xFF; - idx++; - final DoubleByte cmdId = new DoubleByte(cmdIdHiByte, cmdIdLoByte); - for (int i = 0; i < payload.length; i++) { - payload[i] = packet[idx] & 0xFF; - idx++; - } - response = parsePayload(cmdId, payload); - int fcs = packet[idx] & 0xFF; - idx++; - if (fcs != response.getFCS()) { - throw new ZToolParseException("Packet checksum failed"); - } - if (idx != packet.length) { - log.warn("Packet buffer contains more data that has been ignored"); - } - return response; - } - - public ZToolPacket parsePacket() - throws IOException { - - Exception exception = null; - done = false; - bytesRead = 0; - try { - final ZToolPacket response; - //int byteLength = this.read("Length"); - this.length = read("Length"); - //log.debug("data length is " + ByteUtils.formatByte(length.getLength())); - final int[] frameData; - final int apiIdMSB = this.read("API PROFILE_ID_HOME_AUTOMATION MSB"); - final int apiIdLSB = this.read("API PROFILE_ID_HOME_AUTOMATION LSB"); - final DoubleByte apiId = new DoubleByte(apiIdMSB, apiIdLSB); - //TODO Remove generic never used - if (generic) { - //log.info("Parsing data as generic"); - int i = 0; - frameData = new int[length]; - // Read all data bytes without parsing - while (i < frameData.length) { - frameData[i] = this.read("Data " + i + "-th"); - i++; - } - response = new ZToolPacket(apiId, frameData); - } else { - frameData = this.readRemainingBytes(); - response = parsePayload(apiId, frameData); - } - //response.setFCS(this.read("Checksum")); - int fcs = this.read("Checksum"); - //setDone(true); - if (fcs != response.getFCS()) { - //log.debug("Checksum of packet failed: received =" + fcs + " expected = " + response.getFCS()); - throw new ZToolParseException("Packet checksum failed"); - } - if (!this.isDone()) { - // TODO this is not the answer! - throw new ZToolParseException("Packet stream is not finished yet we seem to think it is"); - } - return response; - } catch (Exception e) { - //log.error("Failed due to exception", e); - exception = e; - } - final ZToolPacket exceptionResponse = new ErrorPacket(); - - if (exception != null) { - exceptionResponse.setError(true); - exceptionResponse.setErrorMsg(exception.getMessage()); - } - - return exceptionResponse; - } - - private static ZToolPacket parsePayload(final DoubleByte cmdId, final int[] payload) { - switch (cmdId.get16BitValue()) { - case ZToolCMD.SYS_ADC_READ_SRSP: - return new SYS_ADC_READ_SRSP(payload); - case ZToolCMD.SYS_RESET_RESPONSE: - return new SYS_RESET_RESPONSE(payload); - case ZToolCMD.SYS_VERSION_RESPONSE: - return new SYS_VERSION_RESPONSE(payload); - case ZToolCMD.SYS_PING_RESPONSE: - return new SYS_PING_RESPONSE(payload); - case ZToolCMD.SYS_OSAL_NV_READ_SRSP: - return new SYS_OSAL_NV_READ_SRSP(payload); - case ZToolCMD.SYS_OSAL_NV_WRITE_SRSP: - return new SYS_OSAL_NV_WRITE_SRSP(payload); - case ZToolCMD.SYS_OSAL_START_TIMER_SRSP: - return new SYS_OSAL_START_TIMER_SRSP(payload); - case ZToolCMD.SYS_OSAL_STOP_TIMER_SRSP: - return new SYS_OSAL_STOP_TIMER_SRSP(payload); - case ZToolCMD.SYS_OSAL_TIMER_EXPIRED_IND: - return new SYS_OSAL_TIMER_EXPIRED_IND(payload); - case ZToolCMD.SYS_RANDOM_SRSP: - return new SYS_RANDOM_SRSP(payload); - case ZToolCMD.SYS_RPC_ERROR: - return new SYS_RPC_ERROR(payload); - case ZToolCMD.SYS_GPIO_SRSP: - return new SYS_GPIO_SRSP(payload); - case ZToolCMD.SYS_TEST_LOOPBACK_SRSP: - return new SYS_TEST_LOOPBACK_SRSP(payload); - case ZToolCMD.AF_DATA_CONFIRM: - return new AF_DATA_CONFIRM(payload); - case ZToolCMD.AF_DATA_SRSP: - return new AF_DATA_SRSP(payload); - case ZToolCMD.AF_INCOMING_MSG: - return new AF_INCOMING_MSG(payload); - case ZToolCMD.AF_REGISTER_SRSP: - return new AF_REGISTER_SRSP(payload); - case ZToolCMD.ZB_ALLOW_BIND_CONFIRM: - return new ZB_ALLOW_BIND_CONFIRM(); - case ZToolCMD.ZB_ALLOW_BIND_RSP: - return new ZB_ALLOW_BIND_RSP(payload); - case ZToolCMD.ZB_APP_REGISTER_RSP: - return new ZB_APP_REGISTER_RSP(payload); - case ZToolCMD.ZB_BIND_CONFIRM: - return new ZB_BIND_CONFIRM(payload); - case ZToolCMD.ZB_BIND_DEVICE_RSP: - return new ZB_BIND_DEVICE_RSP(payload); - case ZToolCMD.ZB_FIND_DEVICE_CONFIRM: - return new ZB_FIND_DEVICE_CONFIRM(payload); - case ZToolCMD.ZB_FIND_DEVICE_REQUEST_RSP: - return new ZB_FIND_DEVICE_REQUEST_RSP(); - case ZToolCMD.ZB_GET_DEVICE_INFO_RSP: - return new ZB_GET_DEVICE_INFO_RSP(payload); - case ZToolCMD.ZB_PERMIT_JOINING_REQUEST_RSP: - return new ZB_PERMIT_JOINING_REQUEST_RSP(payload); - case ZToolCMD.ZB_READ_CONFIGURATION_RSP: - return new ZB_READ_CONFIGURATION_RSP(payload); - case ZToolCMD.ZB_RECEIVE_DATA_INDICATION: - return new ZB_RECEIVE_DATA_INDICATION(payload); - case ZToolCMD.ZB_SEND_DATA_CONFIRM: - return new ZB_SEND_DATA_CONFIRM(payload); - case ZToolCMD.ZB_SEND_DATA_REQUEST_RSP: - return new ZB_SEND_DATA_REQUEST_RSP(payload); - case ZToolCMD.ZB_START_CONFIRM: - return new ZB_START_CONFIRM(payload); - case ZToolCMD.ZB_START_REQUEST_RSP: - return new ZB_START_REQUEST_RSP(payload); - case ZToolCMD.ZB_WRITE_CONFIGURATION_RSP: - return new ZB_WRITE_CONFIGURATION_RSP(payload); - case ZToolCMD.ZDO_ACTIVE_EP_REQ_SRSP: - return new ZDO_ACTIVE_EP_REQ_SRSP(payload); - case ZToolCMD.ZDO_ACTIVE_EP_RSP: - return new ZDO_ACTIVE_EP_RSP(payload); - case ZToolCMD.ZDO_BIND_REQ_SRSP: - return new ZDO_BIND_REQ_SRSP(payload); - case ZToolCMD.ZDO_BIND_RSP: - return new ZDO_BIND_RSP(payload); - case ZToolCMD.ZDO_END_DEVICE_ANNCE_IND: - return new ZDO_END_DEVICE_ANNCE_IND(payload); - case ZToolCMD.ZDO_END_DEVICE_ANNCE_SRSP: - return new ZDO_END_DEVICE_ANNCE_SRSP(payload); - case ZToolCMD.ZDO_END_DEVICE_BIND_REQ_SRSP: - return new ZDO_END_DEVICE_BIND_REQ_SRSP(payload); - case ZToolCMD.ZDO_END_DEVICE_BIND_RSP: - return new ZDO_END_DEVICE_BIND_RSP(payload); - case ZToolCMD.ZDO_IEEE_ADDR_REQ_SRSP: - return new ZDO_IEEE_ADDR_REQ_SRSP(payload); - case ZToolCMD.ZDO_IEEE_ADDR_RSP: - return new ZDO_IEEE_ADDR_RSP(payload); - case ZToolCMD.ZDO_MATCH_DESC_REQ_SRSP: - return new ZDO_MATCH_DESC_REQ_SRSP(payload); - case ZToolCMD.ZDO_MATCH_DESC_RSP: - return new ZDO_MATCH_DESC_RSP(payload); - case ZToolCMD.ZDO_MGMT_LEAVE_REQ_SRSP: - return new ZDO_MGMT_LEAVE_REQ_SRSP(payload); - case ZToolCMD.ZDO_MGMT_LEAVE_RSP: - return new ZDO_MGMT_LEAVE_RSP(payload); - case ZToolCMD.ZDO_MGMT_LQI_REQ_SRSP: - return new ZDO_MGMT_LQI_REQ_SRSP(payload); - case ZToolCMD.ZDO_MGMT_LQI_RSP: - return new ZDO_MGMT_LQI_RSP(payload); - case ZToolCMD.ZDO_MGMT_NWK_UPDATE_REQ_SRSP: - return new ZDO_MGMT_NWK_UPDATE_REQ_SRSP(payload); - case ZToolCMD.ZDO_MGMT_PERMIT_JOIN_REQ_SRSP: - return new ZDO_MGMT_PERMIT_JOIN_REQ_SRSP(payload); - case ZToolCMD.ZDO_MGMT_PERMIT_JOIN_RSP: - return new ZDO_MGMT_PERMIT_JOIN_RSP(payload); - case ZToolCMD.ZDO_NODE_DESC_REQ_SRSP: - return new ZDO_NODE_DESC_REQ_SRSP(payload); - case ZToolCMD.ZDO_NODE_DESC_RSP: - return new ZDO_NODE_DESC_RSP(payload); - case ZToolCMD.ZDO_NWK_ADDR_REQ_SRSP: - return new ZDO_NWK_ADDR_REQ_SRSP(payload); - case ZToolCMD.ZDO_NWK_ADDR_RSP: - return new ZDO_NWK_ADDR_RSP(payload); - case ZToolCMD.ZDO_SIMPLE_DESC_REQ_SRSP: - return new ZDO_SIMPLE_DESC_REQ_SRSP(payload); - case ZToolCMD.ZDO_SIMPLE_DESC_RSP: - return new ZDO_SIMPLE_DESC_RSP(payload); - case ZToolCMD.ZDO_STATE_CHANGE_IND: - return new ZDO_STATE_CHANGE_IND(payload); - case ZToolCMD.ZDO_UNBIND_REQ_SRSP: - return new ZDO_UNBIND_REQ_SRSP(payload); - case ZToolCMD.ZDO_UNBIND_RSP: - return new ZDO_UNBIND_RSP(payload); - case ZToolCMD.ZDO_USER_DESC_REQ_SRSP: - return new ZDO_USER_DESC_REQ_SRSP(payload); - case ZToolCMD.ZDO_USER_DESC_RSP: - return new ZDO_USER_DESC_RSP(payload); - case ZToolCMD.ZDO_USER_DESC_CONF: - return new ZDO_USER_DESC_CONF(payload); - case ZToolCMD.ZDO_USER_DESC_SET_SRSP: - return new ZDO_USER_DESC_SET_SRSP(payload); - case ZToolCMD.ZDO_STARTUP_FROM_APP_SRSP: - return new ZDO_STARTUP_FROM_APP_SRSP(payload); - case ZToolCMD.UTIL_SET_PANID_RESPONSE: - return new UTIL_SET_PANID_RESPONSE(payload); - case ZToolCMD.UTIL_SET_CHANNELS_RESPONSE: - return new UTIL_SET_CHANNELS_RESPONSE(payload); - case ZToolCMD.UTIL_GET_DEVICE_INFO_RESPONSE: - return new UTIL_GET_DEVICE_INFO_RESPONSE(payload); - default: - return new ZToolPacket(cmdId, payload); - } - } - - public int read(final String context) - throws IOException { - int b = read(); - log.trace("Read {} byte, val is {}", context, ByteUtils.formatByte(b)); - return b; - } - - /** - * TODO implement as class that extends inputstream? - *

- * This method reads bytes from the underlying input stream and performs the following tasks: keeps track of how - * many bytes we've read, un-escapes bytes if necessary and verifies the checksum. - */ - public int read() - throws IOException { - - int b = in.read(); - - if (b == -1) { - throw new ZToolParseException("Read -1 from input stream while reading packet!"); - } - - bytesRead++; - - // when verifying checksum you must add the checksum that we are verifying - // when computing checksum, do not include start byte; when verifying, include checksum - checksum.addByte(b); - //log.debug("Read byte " + ByteUtils.formatByte(b) + " at position " + bytesRead + ", data length is " + this.length.getLength() + ", #escapeBytes is " + escapeBytes + ", remaining bytes is " + this.getRemainingBytes()); - - if (this.getFrameDataBytesRead() >= (length + 1)) { - // this is checksum and final byte of packet - done = true; - - //log.debug("Checksum byte is " + b); - /* - * if (!checksum.verify()) {/////////////Maybe expected in ZTool is 0x00, not FF//////////////////// throw - * new ZToolParseException("Checksum is incorrect. Expected 0xff, but got " + checksum.getChecksum()); } - */ - } - - return b; - } - - // TODO remove it seems useless, we can replace with a reading of all the bytes of the payload - private int[] readRemainingBytes() - throws IOException { - int[] value = new int[length - this.getFrameDataBytesRead()]; - - for (int i = 0; i < value.length; i++) { - value[i] = this.read("Remaining bytes " + (value.length - i)); - //log.debug("byte " + i + " is " + value[i]); - } - - return value; - } - - /** - * Returns number of bytes remaining, relative to the stated packet length (not including checksum). - * - * @return - */ - public int getFrameDataBytesRead() { - // subtract out the 1 length bytes and API PROFILE_ID_HOME_AUTOMATION 2 bytes - return this.getBytesRead() - 3; - } - - /** - * Number of bytes remaining to be read, including the checksum - * - * @return - */ - public int getRemainingBytes() { - // add one for checksum byte (not included) in packet length - return length - this.getFrameDataBytesRead() + 1; - } - - // get unescaped packet length - // get escaped packet length - - /** - * Does not include any escape bytes - * - * @return - */ - public int getBytesRead() { - return bytesRead; - } - - public void setBytesRead(int bytesRead) { - this.bytesRead = bytesRead; - } - - private boolean isDone() { - return done; - } - - public int getChecksum() { - return checksum.getChecksum(); - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolParseException.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolParseException.java deleted file mode 100644 index 70966f502a9c8..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/ZToolParseException.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright 2008-2013 Andrew Rapp, http://code.google.com/p/xbee-api/ - - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet; - -/** - * @author Andrew Rapp - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZToolParseException extends RuntimeException { - - private static final long serialVersionUID = 6752060371295132748L; - - public ZToolParseException(String s) { - super(s); - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/af/AF_DATA_CONFIRM.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/af/AF_DATA_CONFIRM.java deleted file mode 100644 index 23750a037278a..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/af/AF_DATA_CONFIRM.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.af; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author Stefano "Kismet" Lenzi - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class AF_DATA_CONFIRM extends ZToolPacket/* implements ICONFIRMATION, IAF*/ { - - private final static Logger profiler = LoggerFactory.getLogger("profiling." + AF_DATA_CONFIRM.class.getName()); - - /// TI.ZPI2.AF_DATA_CONFIRM.Endpoint - ///

specifies the endpoint of the message - public int Endpoint; - /// TI.ZPI2.AF_DATA_CONFIRM.Status - /// Status - public int Status; - /// TI.ZPI2.AF_DATA_CONFIRM.TransID - /// Transaction PROFILE_ID_HOME_AUTOMATION - public int TransID; - - /// TI.ZPI2.AF_DATA_CONFIRM - /// Constructor - public AF_DATA_CONFIRM() { - } - - public AF_DATA_CONFIRM(int af_status1, int num1, int num2) { - this.Status = af_status1; - this.Endpoint = num1; - this.TransID = num2; - int[] framedata = new int[3]; - framedata[0] = this.Status; - framedata[1] = this.Endpoint; - framedata[2] = this.TransID; - super.buildPacket(new DoubleByte(ZToolCMD.AF_DATA_CONFIRM), framedata); - } - - public AF_DATA_CONFIRM(int[] framedata) { - profiler.debug("AF_DATA_CONFIRM: creating object"); - this.Status = framedata[0]; - this.Endpoint = framedata[1]; - this.TransID = framedata[2]; - super.buildPacket(new DoubleByte(ZToolCMD.AF_DATA_CONFIRM), framedata); - profiler.debug("AF_DATA_CONFIRM: object created"); - } - - public byte getStatus() { - byte value = (byte) super.packet[ZToolPacket.PAYLOAD_START_INDEX]; - return value; - } - - @Override - public String toString() { - return "AF_DATA_CONFIRM{" + - "Endpoint=" + Endpoint + - ", Status=" + ResponseStatus.getStatus(Status) + - ", TransID=" + TransID + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/af/AF_DATA_REQUEST.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/af/AF_DATA_REQUEST.java deleted file mode 100644 index d392f83405ef3..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/af/AF_DATA_REQUEST.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.af; - -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; -import org.bubblecloud.zigbee.util.Integers; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class AF_DATA_REQUEST extends ZToolPacket/* implements IREQUEST,IAF*/ { - private static final Logger logger = LoggerFactory.getLogger(AF_DATA_REQUEST.class); - /// TI.ZPI2.AF_DATA_REQUEST.ClusterID - /// specifies the cluster PROFILE_ID_HOME_AUTOMATION - public DoubleByte ClusterID; - /// TI.ZPI2.AF_DATA_REQUEST.Data - /// Dynamic array, requires memory allocation. Variable length field of size 'Len' and is the transaction data frame - public int[] Data; - /// TI.ZPI2.AF_DATA_REQUEST.DestEndpoint - /// specifies the endpoint of the device - public int DestEndpoint; - /// TI.ZPI2.AF_DATA_REQUEST.DstAddr - /// the address of the destination device - public ZToolAddress16 DstAddr; - /// TI.ZPI2.AF_DATA_REQUEST.Len - /// specifies the length of the TransactionData field - public int Len; - /// TI.ZPI2.AF_DATA_REQUEST.Options - /// consists of the AF Tx Options bit fields; zero for none - public int Options; - /// TI.ZPI2.AF_DATA_REQUEST.Radius - /// the number of hops allowed to deliver the message; usually use 7 - public int Radius; - /// TI.ZPI2.AF_DATA_REQUEST.SrcEndpoint - /// specifies the endpoint of the device - public int SrcEndpoint; - /// TI.ZPI2.AF_DATA_REQUEST.TransID - /// specifies the transaction Id of the device - public int TransID; - - /// TI.ZPI2.AF_DATA_REQUEST - /// Constructor - public AF_DATA_REQUEST() { - this.Data = new int[0xff]; - } - - /// TI.ZPI2.AF_DATA_REQUEST - /// Constructor - public AF_DATA_REQUEST(ZToolAddress16 num1, int num2, int num3, DoubleByte num4, int num5, int num6, int num7, int num8, int[] buffer1) { - this.DstAddr = num1; - this.DestEndpoint = num2; - this.SrcEndpoint = num3; - this.ClusterID = num4; - this.TransID = num5; - this.Options = num6; - this.Radius = num7; - this.Len = num8; - this.Data = new int[buffer1.length]; - this.Data = buffer1; - /*if (buffer1.Length > 0xff) - { - throw new Exception("Error creating object."); - } - this.Data = new byte[0xff]; - Array.Copy(buffer1, this.Data, buffer1.Length);*/ - int[] framedata = new int[this.Data.length + 10]; - framedata[0] = this.DstAddr.getLsb(); - framedata[1] = this.DstAddr.getMsb(); - framedata[2] = this.DestEndpoint; - framedata[3] = this.SrcEndpoint; - framedata[4] = this.ClusterID.getLsb(); - framedata[5] = this.ClusterID.getMsb(); - framedata[6] = this.TransID; - framedata[7] = this.Options; - framedata[8] = this.Radius; - framedata[9] = this.Len; - for (int i = 0; i < this.Data.length; i++) { - framedata[10 + i] = this.Data[i]; - } - super.buildPacket(new DoubleByte(ZToolCMD.AF_DATA_REQUEST), framedata); - } - - public AF_DATA_REQUEST(int nwkDstAddress, short dstEndPoint, - short srcEndPoint, short clusterId, byte transId, byte bitmapOpt, byte radius, - byte[] msg) { - - //TODO Check compatibility with other Constructor - - if (msg.length > 128) { - throw new IllegalArgumentException("Payload is too big, maxium is 128"); - } - - int[] framedata = new int[msg.length + 10]; - framedata[0] = Integers.getByteAsInteger(nwkDstAddress, 0); - framedata[1] = Integers.getByteAsInteger(nwkDstAddress, 1); - framedata[2] = dstEndPoint & 0xFF; - framedata[3] = srcEndPoint & 0xFF; - framedata[4] = Integers.getByteAsInteger(clusterId, 0); - framedata[5] = Integers.getByteAsInteger(clusterId, 1); - framedata[6] = transId & 0xFF; - framedata[7] = bitmapOpt & 0xFF; - framedata[8] = radius & 0xFF; - framedata[9] = msg.length; - for (int i = 0; i < msg.length; i++) { - framedata[10 + i] = msg[i]; - } - super.buildPacket(new DoubleByte(ZToolCMD.AF_DATA_REQUEST), framedata); - - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/af/AF_DATA_SRSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/af/AF_DATA_SRSP.java deleted file mode 100644 index 8119997772804..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/af/AF_DATA_SRSP.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.af; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class AF_DATA_SRSP extends ZToolPacket /*implements IRESPONSE,IAF*/ { - /// TI.ZPI2.AF_DATA_SRSP.Status - /// Status - public int Status; - - /// TI.ZPI2.AF_DATA_SRSP - /// Constructor - public AF_DATA_SRSP() { - } - - public AF_DATA_SRSP(int[] framedata) { - this.Status = framedata[0]; - super.buildPacket(new DoubleByte(ZToolCMD.AF_DATA_SRSP), framedata); - } - - @Override - public String toString() { - return "AF_DATA_SRSP{" + - "Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/af/AF_INCOMING_MSG.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/af/AF_INCOMING_MSG.java deleted file mode 100644 index d347a5f3f4af4..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/af/AF_INCOMING_MSG.java +++ /dev/null @@ -1,173 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.af; - -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.ByteUtils; -import org.bubblecloud.zigbee.util.DoubleByte; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class AF_INCOMING_MSG extends ZToolPacket /*implements IINDICATION,IAF*/ { - - private final static Logger profiler = LoggerFactory.getLogger("profiling." + AF_INCOMING_MSG.class.getName()); - - /// TI.ZPI2.AF_INCOMING_MSG.ClusterID - /// specifies the cluster PROFILE_ID_HOME_AUTOMATION - @Deprecated - public DoubleByte ClusterID; - /// TI.ZPI2.AF_INCOMING_MSG.Data - /// Dynamic array, variable length field of size 'Len' and is the transaction data frame - @Deprecated - public int[] Data; - /// TI.ZPI2.AF_INCOMING_MSG.DstEndpoint - /// specifies the endpoint of the destination device - @Deprecated - public int DstEndpoint; - /// TI.ZPI2.AF_INCOMING_MSG.GroupID - /// Group PROFILE_ID_HOME_AUTOMATION - @Deprecated - public DoubleByte GroupID; - /// TI.ZPI2.AF_INCOMING_MSG.Len - /// specifies the length of the Data field - @Deprecated - public int Len; - /// TI.ZPI2.AF_INCOMING_MSG.LinkQuality - /// indicates the link quality measured during reception. TBD - @Deprecated - public int LinkQuality; - /// TI.ZPI2.AF_INCOMING_MSG.SecurityUse - /// indicates the type of security applied for the incoming NPDU. This field is no longer used. - @Deprecated - public int SecurityUse; - /// TI.ZPI2.AF_INCOMING_MSG.SrcAddr - /// specifies the address of the source device - @Deprecated - public ZToolAddress16 SrcAddr; - /// TI.ZPI2.AF_INCOMING_MSG.SrcEndpoint - /// specifies the endpoint of the source device - @Deprecated - public int SrcEndpoint; - /// TI.ZPI2.AF_INCOMING_MSG.Timestamp - /// Timestamp - @Deprecated - public long Timestamp; - /// TI.ZPI2.AF_INCOMING_MSG.TransSeqNumber - /// specifies the transaction Id of the device - @Deprecated - public int TransSeqNumber; - /// TI.ZPI2.AF_INCOMING_MSG.WasBroadcast - /// WasBroadcast - @Deprecated - public int WasBroadcast; - private byte[] payload; - - /// TI.ZPI2.AF_INCOMING_MSG - /// Constructor - public AF_INCOMING_MSG() { - this.Data = new int[0xff]; - } - - public AF_INCOMING_MSG(int[] framedata) { - profiler.debug("AF_INCOMING_MSG: creating object"); - this.GroupID = new DoubleByte(framedata[1], framedata[0]); - this.ClusterID = new DoubleByte(framedata[3], framedata[2]); - this.SrcAddr = new ZToolAddress16(framedata[5], framedata[4]); - this.SrcEndpoint = framedata[6]; - this.DstEndpoint = framedata[7]; - this.WasBroadcast = framedata[8]; - this.LinkQuality = framedata[9]; - this.SecurityUse = framedata[10]; - byte[] bytes = new byte[4]; - bytes[3] = (byte) framedata[11]; - bytes[2] = (byte) framedata[12]; - bytes[1] = (byte) framedata[13]; - bytes[0] = (byte) framedata[14]; - this.Timestamp = ByteUtils.convertMultiByteToLong(bytes); - this.TransSeqNumber = framedata[15]; - this.Len = framedata[16]; - this.Data = new int[framedata.length - 17]; - for (int i = 0; i < this.Data.length; i++) { - this.Data[i] = framedata[17 + i]; - } - super.buildPacket(new DoubleByte(ZToolCMD.AF_INCOMING_MSG), framedata); - profiler.debug("AF_INCOMING_MSG: object created"); - } - - /// TI.ZPI2.AF_INCOMING_MSG.SECURITY_STATUS - /// Security status - public class SECURITY_STATUS { - /// TI.ZPI2.AF_INCOMING_MSG.SECURITY_STATUS.ENABLED - /// Security status - public static final int ENABLED = 1; - /// TI.ZPI2.AF_INCOMING_MSG.SECURITY_STATUS.NOT_ENABLED - /// Security status - public static final int NOT_ENABLED = 0; - } - - public byte getTransId() { - return (byte) (super.packet[ZToolPacket.PAYLOAD_START_INDEX + 15]); - } - - public byte getSrcEndpoint() { - return (byte) super.packet[ZToolPacket.PAYLOAD_START_INDEX + 6]; - } - - public short getDstEndpoint() { - return (byte) super.packet[ZToolPacket.PAYLOAD_START_INDEX + 7]; - } - - public int getSrcAddr() { - return (int) ((super.packet[ZToolPacket.PAYLOAD_START_INDEX + 5] << 8) - + (super.packet[ZToolPacket.PAYLOAD_START_INDEX + 4])); - } - - public short getClusterId() { - return (short) ((super.packet[ZToolPacket.PAYLOAD_START_INDEX + 3] << 8) - + (super.packet[ZToolPacket.PAYLOAD_START_INDEX + 2])); - } - - public short getGroupId() { - return (short) ((super.packet[ZToolPacket.PAYLOAD_START_INDEX + 1] << 8) - + (super.packet[ZToolPacket.PAYLOAD_START_INDEX + 0])); - } - - public byte[] getData() { - if (payload == null) { - payload = new byte[Data.length]; - for (int i = 0; i < payload.length; i++) { - payload[i] = (byte) Data[i]; - } - - } - return payload; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/af/AF_REGISTER.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/af/AF_REGISTER.java deleted file mode 100644 index d5b6e851e25f8..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/af/AF_REGISTER.java +++ /dev/null @@ -1,171 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.af; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; -import org.bubblecloud.zigbee.util.Integers; - -/** - * @author Stefano "Kismet" Lenzi - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class AF_REGISTER extends ZToolPacket /*implements IREQUEST, IAF*/ { - /// TI.ZPI2.AF_REGISTER.AppDeviceId - /// specifies the device description id for this endpoint - public DoubleByte AppDeviceId; - /// TI.ZPI2.AF_REGISTER.AppDevVer - /// specifies the version of the device description - public int AppDevVer; - /// TI.ZPI2.AF_REGISTER.AppInClusterList - /// Dynamic array, requires memory allocation. variable length field of size 'AppNumInClusters' and is the list of Input Cluster Ids - public DoubleByte[] AppInClusterList; - /// TI.ZPI2.AF_REGISTER.AppNumInClusters - /// the number of Input cluster Ids following in the AppInClusterList - public int AppNumInClusters; - /// TI.ZPI2.AF_REGISTER.AppNumOutClusters - /// specifies the number of Output cluster Ids following in the AppOutClusterList - public int AppNumOutClusters; - /// TI.ZPI2.AF_REGISTER.AppOutClusterList - /// Dynamic array, requires memory allocation. Variable length field of size 'AppNumOutClusters' and is the list of Output Cluster Ids - public DoubleByte[] AppOutClusterList; - /// TI.ZPI2.AF_REGISTER.AppProfID - /// specifies the profile id of the application - public DoubleByte AppProfID; - /// TI.ZPI2.AF_REGISTER.EndPoint - /// specifies the endpoint of the device - public int EndPoint; - /// TI.ZPI2.AF_REGISTER.LatencyReq - /// Latency - //public int LatencyReq; - - /// TI.ZPI2.AF_REGISTER - /// Constructor - public AF_REGISTER() { - this.AppInClusterList = new DoubleByte[0xff]; - this.AppOutClusterList = new DoubleByte[0xff]; - } - - - public AF_REGISTER(int EndPoint, DoubleByte AppProfID, DoubleByte AppDeviceId, int AppDevVer, int AppNumInClusters, DoubleByte[] AppInClusterList, int AppNumOutClusters, DoubleByte[] AppOutClusterList) { - this.EndPoint = EndPoint; - this.AppProfID = AppProfID; - this.AppDeviceId = AppDeviceId; - this.AppDevVer = AppDevVer; - - this.AppNumInClusters = AppNumInClusters; - this.AppInClusterList = new DoubleByte[AppInClusterList.length]; - this.AppInClusterList = AppInClusterList; -// if (numArray1.Length > 0xff) -// { -// throw new Exception("Error creating object."); -// } -// this.AppInClusterList = new ushort[0xff]; -// Array.Copy(numArray1, this.AppInClusterList, numArray1.Length); - this.AppNumOutClusters = AppNumOutClusters; - this.AppOutClusterList = new DoubleByte[AppOutClusterList.length]; - this.AppOutClusterList = AppOutClusterList; -// if (numArray2.Length > 0xff) -// { -// throw new Exception("Error creating object."); -// } -// this.AppOutClusterList = new ushort[0xff]; -// Array.Copy(numArray2, this.AppOutClusterList, numArray2.Length); - - int[] framedata = new int[9 + this.AppInClusterList.length * 2 + this.AppOutClusterList.length * 2]; - framedata[0] = this.EndPoint; - framedata[1] = this.AppProfID.getLsb(); - framedata[2] = this.AppProfID.getMsb(); - framedata[3] = this.AppDeviceId.getLsb(); - framedata[4] = this.AppDeviceId.getMsb(); - framedata[5] = this.AppDevVer; - framedata[6] = 0; - framedata[7] = this.AppNumInClusters; - for (int i = 0; i < this.AppInClusterList.length; i++) { - framedata[(i * 2) + 8] = this.AppInClusterList[i].getLsb(); - framedata[(i * 2) + 9] = this.AppInClusterList[i].getMsb(); - } - framedata[((this.AppInClusterList.length) * 2) + 8] = this.AppNumOutClusters; - for (int i = 0; i < this.AppOutClusterList.length; i++) { - framedata[(i * 2) + ((this.AppInClusterList.length) * 2) + 9] = this.AppOutClusterList[i].getLsb(); - framedata[(i * 2) + ((this.AppInClusterList.length) * 2) + 10] = this.AppOutClusterList[i].getMsb(); - } - super.buildPacket(new DoubleByte(ZToolCMD.AF_REGISTER), framedata); - } - - public AF_REGISTER(byte endPoint, int profileId, short deviceId, byte deviceVersion, - int[] inputs, int[] outputs) { - - //TODO Check compatibility with other Constructor - - int[] framedata = new int[9 + inputs.length * 2 + outputs.length * 2]; - int j; - framedata[0] = 0xFF & endPoint; - framedata[1] = Integers.getByteAsInteger(profileId, 0); - framedata[2] = Integers.getByteAsInteger(profileId, 1); - framedata[3] = Integers.getByteAsInteger(deviceId, 0); - framedata[4] = Integers.getByteAsInteger(deviceId, 1); - framedata[5] = 0xFF & deviceVersion; - framedata[6] = 0; //Unused see page 34 of specification - framedata[7] = inputs.length; - j = 8; - for (int i = 0; i < inputs.length; i++) { - framedata[j] = Integers.getByteAsInteger(inputs[i], 0); - j++; - framedata[j] = Integers.getByteAsInteger(inputs[i], 1); - j++; - } - framedata[j] = outputs.length; - j++; - - for (int i = 0; i < outputs.length; i++) { - framedata[j] = Integers.getByteAsInteger(outputs[i], 0); - j++; - framedata[j] = Integers.getByteAsInteger(outputs[i], 1); - j++; - } - super.buildPacket(new DoubleByte(ZToolCMD.AF_REGISTER), framedata); - } - - /// TI.ZPI2.AF_REGISTER.LATENCY_TYPE - /// Latency type - /*public class LATENCY_TYPE { - /// TI.ZPI2.AF_REGISTER.LATENCY_TYPE.FAST_BEACONS - /// Latency type - public static final int FAST_BEACONS = 1; - /// TI.ZPI2.AF_REGISTER.LATENCY_TYPE.NO_LATENCY_REQS - /// Latency type - public static final int NO_LATENCY_REQS = 0; - /// TI.ZPI2.AF_REGISTER.LATENCY_TYPE.SLOW_BEACONS - /// Latency type - public static final int SLOW_BEACONS = 2; - }*/ -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/af/AF_REGISTER_SRSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/af/AF_REGISTER_SRSP.java deleted file mode 100644 index dbca3693f9001..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/af/AF_REGISTER_SRSP.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.af; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class AF_REGISTER_SRSP extends ZToolPacket /*implements IRESPONSE, IAF*/ { - /// TI.ZPI1.AF_REGISTER_RESPONSE.Status - /// Status - public int Status; - - /// TI.ZPI1.AF_REGISTER_RESPONSE - /// Constructor - public AF_REGISTER_SRSP() { - } - - public AF_REGISTER_SRSP(int[] framedata) { - this.Status = framedata[0]; - super.buildPacket(new DoubleByte(ZToolCMD.AF_REGISTER_SRSP), framedata); - } - - /// TI.ZPI1.AF_REGISTER_SRSP.AF_STATUS - /// Status code for AF responses - public class AF_STATUS { - /// TI.ZPI1.AF_REGISTER_SRSP.AF_STATUS.FAILED - /// Status code for AF responses - public static final int FAILED = 1; - /// TI.ZPI1.AF_REGISTER_SRSP.AF_STATUS.INVALID_PARAMETER - /// Status code for AF responses - public static final int INVALID_PARAMETER = 3; - /// TI.ZPI1.AF_REGISTER_SRSP.AF_STATUS.MEM_FAIL - /// Status code for AF responses - public static final int MEM_FAIL = 2; - /// TI.ZPI1.AF_REGISTER_SRSP.AF_STATUS.SUCCESS - /// Status code for AF responses - public static final int SUCCESS = 0; - } - - public int getStatus() { - return this.Status; - } - - @Override - public String toString() { - return "AF_REGISTER_SRSP{" + - "Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_ALLOW_BIND.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_ALLOW_BIND.java deleted file mode 100644 index e243cb8646a0a..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_ALLOW_BIND.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.simple; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZB_ALLOW_BIND extends ZToolPacket /*implements IREQUEST,ISIMPLEAPI*/ { - /// TI.ZPI2.ZB_ALLOW_BIND.Timeout - /// The number of seconds ( max. 64 ) for which the device will remain in the Allow Bind mode ( If 0, the device will turn off Allow Bind mode immediately. If 0xFF, the device will remain in the mode indefinitely. ) - public int Timeout; - - /// TI.ZPI2.ZB_ALLOW_BIND - /// Constructor - public ZB_ALLOW_BIND() { - } - - /// TI.ZPI2.ZB_ALLOW_BIND - /// Constructor - public ZB_ALLOW_BIND(int num1) { - this.Timeout = num1; - int[] framedata = {num1}; - super.buildPacket(new DoubleByte(ZToolCMD.ZB_ALLOW_BIND), framedata); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_ALLOW_BIND_CONFIRM.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_ALLOW_BIND_CONFIRM.java deleted file mode 100644 index 192b71bdac40d..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_ALLOW_BIND_CONFIRM.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.simple; - -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZB_ALLOW_BIND_CONFIRM extends ZToolPacket /*implements IREPONSE_CALLBACK,ISIMPLEAPI*/ { - /// TI.ZPI2.ZB_ALLOW_BIND_CONFIRM.Source - /// Source - public ZToolAddress16 Source; - - /// TI.ZPI2.ZB_ALLOW_BIND_CONFIRM - /// Constructor - public ZB_ALLOW_BIND_CONFIRM() { - } - - /// TI.ZPI2.ZB_ALLOW_BIND_CONFIRM - /// Constructor - public ZB_ALLOW_BIND_CONFIRM(int[] framedata) { - this.Source = new ZToolAddress16(framedata[1], framedata[0]); - super.buildPacket(new DoubleByte(ZToolCMD.ZB_ALLOW_BIND_CONFIRM), framedata); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_ALLOW_BIND_RSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_ALLOW_BIND_RSP.java deleted file mode 100644 index b671f71599914..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_ALLOW_BIND_RSP.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.simple; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZB_ALLOW_BIND_RSP extends ZToolPacket/* implements IRESPONSE,ISIMPLEAPI*/ { - public ZB_ALLOW_BIND_RSP() { - super.buildPacket(new DoubleByte(ZToolCMD.ZB_ALLOW_BIND_RSP), new int[0]); - } - - public ZB_ALLOW_BIND_RSP(int[] framedata) { - super.buildPacket(new DoubleByte(ZToolCMD.ZB_ALLOW_BIND_RSP), framedata); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_APP_REGISTER_REQUEST.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_APP_REGISTER_REQUEST.java deleted file mode 100644 index 1857723330546..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_APP_REGISTER_REQUEST.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.simple; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZB_APP_REGISTER_REQUEST extends ZToolPacket /*implements IREQUEST,ISIMPLEAPI*/ { - /// TI.ZPI2.ZB_APP_REGISTER_REQUEST.AppEndPoint - /// The endpoint of the device on which this application should reside ( value 1 through 240 ). This should be set to same value for all devices in this network. - public int AppEndPoint; - /// TI.ZPI2.ZB_APP_REGISTER_REQUEST.AppProfileID - /// The profile id of the application. This should be set to same value for all devices in this network. - public DoubleByte AppProfileID; - /// TI.ZPI2.ZB_APP_REGISTER_REQUEST.DeviceId - /// The device description id for this endpoint - public DoubleByte DeviceId; - /// TI.ZPI2.ZB_APP_REGISTER_REQUEST.DeviceVersion - /// The version of the device description - public int DeviceVersion; - /// TI.ZPI2.ZB_APP_REGISTER_REQUEST.InputCommandsList - /// List of input commands that are processed by this device application - public DoubleByte[] InputCommandsList; - /// TI.ZPI2.ZB_APP_REGISTER_REQUEST.InputCommandsNum - /// The number of Input commands Ids following in the InputCommandsList - public int InputCommandsNum; - /// TI.ZPI2.ZB_APP_REGISTER_REQUEST.OutputCommandsList - /// List of output commands that are generated by this device application - public DoubleByte[] OutputCommandsList; - /// TI.ZPI2.ZB_APP_REGISTER_REQUEST.OutputCommandsNum - /// The number of Output command Ids in the OutputCommandsList - public int OutputCommandsNum; - /// TI.ZPI2.ZB_APP_REGISTER_REQUEST.Unused - /// Unused parameter - public int Unused; - - /// TI.ZPI2.ZB_APP_REGISTER_REQUEST - /// Constructor - public ZB_APP_REGISTER_REQUEST() { - this.InputCommandsList = new DoubleByte[0xff]; - this.OutputCommandsList = new DoubleByte[0xff]; - } - - /// TI.ZPI2.ZB_APP_REGISTER_REQUEST - /// Constructor - public ZB_APP_REGISTER_REQUEST(int num1, DoubleByte num2, DoubleByte num3, int num4, int num5, int num6, DoubleByte[] numArray1, int num7, DoubleByte[] numArray2) { - this.AppEndPoint = num1; - this.AppProfileID = num2; - this.DeviceId = num3; - this.DeviceVersion = num4; - this.Unused = num5; - this.InputCommandsNum = num6; - this.InputCommandsList = new DoubleByte[numArray1.length]; - this.InputCommandsList = numArray1; - /*if (numArray1.Length > 0xff) - { - throw new Exception("Error creating object."); - } - this.InputCommandsList = new ushort[0xff]; - Array.Copy(numArray1, this.InputCommandsList, numArray1.Length);*/ - this.OutputCommandsNum = num7; - this.OutputCommandsList = new DoubleByte[numArray2.length]; - this.OutputCommandsList = numArray2; - /*if (numArray2.Length > 0xff) - { - throw new Exception("Error creating object."); - } - this.OutputCommandsList = new ushort[0xff]; - Array.Copy(numArray2, this.OutputCommandsList, numArray2.Length);*/ - int[] framedata = new int[9 + this.InputCommandsList.length * 2 + this.OutputCommandsList.length * 2]; - framedata[0] = this.AppEndPoint; - framedata[1] = this.AppProfileID.getLsb(); - framedata[2] = this.AppProfileID.getMsb(); - framedata[3] = this.DeviceId.getLsb(); - framedata[4] = this.DeviceId.getMsb(); - framedata[5] = this.DeviceVersion; - framedata[6] = this.Unused; - framedata[7] = this.InputCommandsNum; - for (int i = 0; i < this.InputCommandsList.length; i++) { - framedata[(i * 2) + 8] = this.InputCommandsList[i].getLsb(); - framedata[(i * 2) + 9] = this.InputCommandsList[i].getMsb(); - } - framedata[((this.InputCommandsList.length) * 2) + 8] = this.OutputCommandsNum; - for (int i = 0; i < this.OutputCommandsList.length; i++) { - framedata[(i * 2) + ((this.InputCommandsList.length) * 2) + 9] = this.OutputCommandsList[i].getLsb(); - framedata[(i * 2) + ((this.InputCommandsList.length) * 2) + 10] = this.OutputCommandsList[i].getMsb(); - } - super.buildPacket(new DoubleByte(ZToolCMD.ZB_APP_REGISTER_REQUEST), framedata); - - - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_APP_REGISTER_RSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_APP_REGISTER_RSP.java deleted file mode 100644 index 1ee0354e66b2b..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_APP_REGISTER_RSP.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.simple; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZB_APP_REGISTER_RSP extends ZToolPacket/* implements IRESPONSE,ISIMPLEAPI*/ { - /// TI.ZPI2.ZB_APP_REGISTER_RSP.Status - /// Status - public int Status; - - /// TI.ZPI2.ZB_APP_REGISTER_RSP - /// Constructor - public ZB_APP_REGISTER_RSP() { - } - - public ZB_APP_REGISTER_RSP(int[] framedata) { - this.Status = framedata[0]; - super.buildPacket(new DoubleByte(ZToolCMD.ZB_APP_REGISTER_RSP), framedata); - } - - @Override - public String toString() { - return "ZB_APP_REGISTER_RSP{" + - "Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_BIND_CONFIRM.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_BIND_CONFIRM.java deleted file mode 100644 index 11f5e14ded8b3..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_BIND_CONFIRM.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.simple; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZB_BIND_CONFIRM extends ZToolPacket /*implements IRESPONSE_CALLBACK,ISIMPLEAPI*/ { - /// TI.ZPI2.ZB_BIND_CONFIRM.CommandId - /// CommandId - public DoubleByte CommandId; - /// TI.ZPI2.ZB_BIND_CONFIRM.Status - /// The immediate return value from executing the RPC. - public int Status; - - /// TI.ZPI2.ZB_BIND_CONFIRM - /// Constructor - public ZB_BIND_CONFIRM() { - } - - /// TI.ZPI2.ZB_BIND_CONFIRM - /// Constructor - public ZB_BIND_CONFIRM(int[] framedata) { - this.CommandId = new DoubleByte(framedata[1], framedata[0]); - this.Status = framedata[2]; - super.buildPacket(new DoubleByte(ZToolCMD.ZB_FIND_DEVICE_CONFIRM), framedata); - } - - @Override - public String toString() { - return "ZB_BIND_CONFIRM{" + - "CommandId=" + CommandId + - ", Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_BIND_DEVICE.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_BIND_DEVICE.java deleted file mode 100644 index 0cd9cd62bd203..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_BIND_DEVICE.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.simple; - -import org.bubblecloud.zigbee.network.packet.ZToolAddress64; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZB_BIND_DEVICE extends ZToolPacket /*implements IREQUEST, ISIMPLEAPI*/ { - /// TI.ZPI2.ZB_BIND_DEVICE.Action - /// CREATE or DELETE a binding entry. - public int Action; - /// TI.ZPI2.ZB_BIND_DEVICE.CommandId - /// The Command identifier of packets for this binding. - public DoubleByte CommandId; - /// TI.ZPI2.ZB_BIND_DEVICE.Destination - /// IEEE address of device to establish the binding with ( all zeros indicate NULL ). - public ZToolAddress64 Destination; - - /// TI.ZPI2.ZB_BIND_DEVICE - /// Constructor - public ZB_BIND_DEVICE() { - } - - public ZB_BIND_DEVICE(int bind_action_type1, DoubleByte num1, ZToolAddress64 num2) { - this.Action = bind_action_type1; - this.CommandId = num1; - this.Destination = num2; - int[] framedata = new int[11]; - framedata[0] = this.Action; - framedata[1] = this.CommandId.getLsb(); - framedata[2] = this.CommandId.getMsb(); - byte[] bytes = Destination.getAddress(); - for (int i = 0; i < 8; i++) { - framedata[i + 2] = bytes[7 - i]; - } - super.buildPacket(new DoubleByte(ZToolCMD.ZB_BIND_DEVICE), framedata); - } - - /// TI.ZPI2.ZB_BIND_DEVICE.BIND_ACTION_TYPE - /// Reset type - public class BIND_ACTION_TYPE { - /// TI.ZPI2.ZB_BIND_DEVICE.BIND_ACTION_TYPE.CREATE_BIND - /// Reset type - public static final int CREATE_BIND = 1; - /// TI.ZPI2.ZB_BIND_DEVICE.BIND_ACTION_TYPE.DELETE_BIND - /// Reset type - public static final int DELETE_BIND = 0; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_BIND_DEVICE_RSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_BIND_DEVICE_RSP.java deleted file mode 100644 index abf7a762f7dd8..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_BIND_DEVICE_RSP.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.simple; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZB_BIND_DEVICE_RSP extends ZToolPacket /*implements IRESPONSE,ISIMPLEAPI*/ { - public ZB_BIND_DEVICE_RSP() { - super.buildPacket(new DoubleByte(ZToolCMD.ZB_BIND_DEVICE_RSP), new int[0]); - } - - public ZB_BIND_DEVICE_RSP(int[] framedata) { - super.buildPacket(new DoubleByte(ZToolCMD.ZB_BIND_DEVICE_RSP), framedata); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_FIND_DEVICE_CONFIRM.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_FIND_DEVICE_CONFIRM.java deleted file mode 100644 index 0e64d32b9afbb..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_FIND_DEVICE_CONFIRM.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.simple; - -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZB_FIND_DEVICE_CONFIRM extends ZToolPacket /*implements IRESPONSE_CALLBACK,ISIMPLEAPI*/ { - /// TI.ZPI2.ZB_FIND_DEVICE_CONFIRM.Result - /// The 64-bit IEEE address of device that was searched for. - public int[] Result; - /// TI.ZPI2.ZB_FIND_DEVICE_CONFIRM.SearchKey - /// The 16-bit short address of the device that was found. - public DoubleByte SearchKey; - /// TI.ZPI2.ZB_FIND_DEVICE_CONFIRM.SearchType - /// The type of search that was performed. - public int SearchType; - - /// TI.ZPI2.ZB_FIND_DEVICE_CONFIRM - /// Constructor - public ZB_FIND_DEVICE_CONFIRM() { - } - - /// TI.ZPI2.ZB_FIND_DEVICE_CONFIRM - /// Constructor - public ZB_FIND_DEVICE_CONFIRM(int[] framedata) { - this.SearchType = framedata[0]; - this.SearchKey = new DoubleByte(framedata[2], framedata[1]); - this.Result = new int[8]; - for (int i = 0; i < 8; i++) { - this.Result[i] = framedata[i + 3]; - } - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_FIND_DEVICE_REQUEST.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_FIND_DEVICE_REQUEST.java deleted file mode 100644 index 77ee3fe45f8ec..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_FIND_DEVICE_REQUEST.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.simple; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.ByteUtils; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZB_FIND_DEVICE_REQUEST extends ZToolPacket /*implements IREQUEST,ISIMPLEAPI*/ { - /// TI.ZPI2.ZB_FIND_DEVICE_REQUEST.SearchKey - /// IEEE address of the device to find. - public long SearchKey; - - /// TI.ZPI2.ZB_FIND_DEVICE_REQUEST - /// Constructor - public ZB_FIND_DEVICE_REQUEST() { - } - - /// TI.ZPI2.ZB_FIND_DEVICE_REQUEST - /// Constructor - public ZB_FIND_DEVICE_REQUEST(long num1) { - this.SearchKey = num1; - int[] framedata = ByteUtils.convertLongtoMultiByte(this.SearchKey); - super.buildPacket(new DoubleByte(ZToolCMD.ZB_FIND_DEVICE_REQUEST), framedata); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_FIND_DEVICE_REQUEST_RSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_FIND_DEVICE_REQUEST_RSP.java deleted file mode 100644 index 0c711dac72c8b..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_FIND_DEVICE_REQUEST_RSP.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.simple; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZB_FIND_DEVICE_REQUEST_RSP extends ZToolPacket /*implements IRESPONSE,ISIMPLEAPI*/ { - public ZB_FIND_DEVICE_REQUEST_RSP() { - super.buildPacket(new DoubleByte(ZToolCMD.ZB_FIND_DEVICE_REQUEST_RSP), new int[0]); - } - - public ZB_FIND_DEVICE_REQUEST_RSP(int[] framedata) { - super.buildPacket(new DoubleByte(ZToolCMD.ZB_FIND_DEVICE_REQUEST_RSP), framedata); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_GET_DEVICE_INFO.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_GET_DEVICE_INFO.java deleted file mode 100644 index 8ff604a1ce444..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_GET_DEVICE_INFO.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.simple; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZB_GET_DEVICE_INFO extends ZToolPacket /*implements IREQUEST,ISIMPLEAPI*/ { - /// TI.ZPI2.ZB_GET_DEVICE_INFO.Param - /// Identifier of the device info parameter to read. - public int Param; - - /// TI.ZPI2.ZB_GET_DEVICE_INFO - /// Constructor - public ZB_GET_DEVICE_INFO() { - } - - public ZB_GET_DEVICE_INFO(int dev_info_type1) { - this.Param = dev_info_type1; - int[] framedata = {dev_info_type1}; - super.buildPacket(new DoubleByte(ZToolCMD.ZB_GET_DEVICE_INFO), framedata); - } - - /// TI.ZPI2.ZB_GET_DEVICE_INFO.DEV_INFO_TYPE - /// Reset type - public class DEV_INFO_TYPE { - /// TI.ZPI2.ZB_GET_DEVICE_INFO.DEV_INFO_TYPE.CHANNEL - /// Reset type - public static final int CHANNEL = 5; - /// TI.ZPI2.ZB_GET_DEVICE_INFO.DEV_INFO_TYPE.EXT_PAN_ID - /// Reset type - public static final int EXT_PAN_ID = 7; - /// TI.ZPI2.ZB_GET_DEVICE_INFO.DEV_INFO_TYPE.IEEE_ADDR - /// Reset type - public static final int IEEE_ADDR = 1; - /// TI.ZPI2.ZB_GET_DEVICE_INFO.DEV_INFO_TYPE.PAN_ID - /// Reset type - public static final int PAN_ID = 6; - /// TI.ZPI2.ZB_GET_DEVICE_INFO.DEV_INFO_TYPE.PARENT_IEEE_ADDR - /// Reset type - public static final int PARENT_IEEE_ADDR = 4; - /// TI.ZPI2.ZB_GET_DEVICE_INFO.DEV_INFO_TYPE.PARENT_SHORT_ADDR - /// Reset type - public static final int PARENT_SHORT_ADDR = 3; - /// TI.ZPI2.ZB_GET_DEVICE_INFO.DEV_INFO_TYPE.SHORT_ADDR - /// Reset type - public static final int SHORT_ADDR = 2; - /// TI.ZPI2.ZB_GET_DEVICE_INFO.DEV_INFO_TYPE.STATE - /// Reset type - public static final int STATE = 0; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_GET_DEVICE_INFO_RSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_GET_DEVICE_INFO_RSP.java deleted file mode 100644 index aa0775788d0de..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_GET_DEVICE_INFO_RSP.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.simple; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZB_GET_DEVICE_INFO_RSP extends ZToolPacket /*implements IRESPONSE,ISIMPLEAPI*/ { - /// TI.ZPI2.ZB_GET_DEVICE_INFO_RSP.Param - /// Device parameter. - public int Param; - /// TI.ZPI2.ZB_GET_DEVICE_INFO_RSP.Value - /// Parameter value. - public int[] Value; - - /// TI.ZPI2.ZB_GET_DEVICE_INFO_RSP - /// Constructor - public ZB_GET_DEVICE_INFO_RSP() { - this.Value = new int[8]; - } - - /// TI.ZPI2.ZB_GET_DEVICE_INFO_RSP - /// Constructor - public ZB_GET_DEVICE_INFO_RSP(int[] framedata) { - this.Param = framedata[0]; - this.Value = new int[8]; - for (int i = 0; i < 8; i++) { - this.Value[i] = framedata[i + 1]; - } - /*if (buffer1.Length > 8) - { - throw new Exception("Error creating object."); - } - this.Value = new byte[8]; - Array.Copy(buffer1, this.Value, buffer1.Length);*/ - super.buildPacket(new DoubleByte(ZToolCMD.ZB_GET_DEVICE_INFO_RSP), framedata); - } - - public class DEV_INFO_TYPE { - /// TI.ZPI2.ZB_GET_DEVICE_INFO.DEV_INFO_TYPE.CHANNEL - /// Reset type - public static final int CHANNEL = 5; - /// TI.ZPI2.ZB_GET_DEVICE_INFO.DEV_INFO_TYPE.EXT_PAN_ID - /// Reset type - public static final int EXT_PAN_ID = 7; - /// TI.ZPI2.ZB_GET_DEVICE_INFO.DEV_INFO_TYPE.IEEE_ADDR - /// Reset type - public static final int IEEE_ADDR = 1; - /// TI.ZPI2.ZB_GET_DEVICE_INFO.DEV_INFO_TYPE.PAN_ID - /// Reset type - public static final int PAN_ID = 6; - /// TI.ZPI2.ZB_GET_DEVICE_INFO.DEV_INFO_TYPE.PARENT_IEEE_ADDR - /// Reset type - public static final int PARENT_IEEE_ADDR = 4; - /// TI.ZPI2.ZB_GET_DEVICE_INFO.DEV_INFO_TYPE.PARENT_SHORT_ADDR - /// Reset type - public static final int PARENT_SHORT_ADDR = 3; - /// TI.ZPI2.ZB_GET_DEVICE_INFO.DEV_INFO_TYPE.SHORT_ADDR - /// Reset type - public static final int SHORT_ADDR = 2; - /// TI.ZPI2.ZB_GET_DEVICE_INFO.DEV_INFO_TYPE.STATE - /// Reset type - public static final int STATE = 0; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_PERMIT_JOINING_REQUEST.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_PERMIT_JOINING_REQUEST.java deleted file mode 100644 index 02783b5999559..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_PERMIT_JOINING_REQUEST.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.simple; - -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZB_PERMIT_JOINING_REQUEST extends ZToolPacket/* implements IREQUEST,ISIMPLEAPI*/ { - /// TI.ZPI2.ZB_PERMIT_JOINING_REQUEST.Destination - /// Short adddress of the device on which to control the joining permissions. This is usually the local device address or the special broadcast address that denotes all routers and coordinator ( 0xFFFC ). - public ZToolAddress16 Destination; - /// TI.ZPI2.ZB_PERMIT_JOINING_REQUEST.Timeout - /// The amount of time in seconds for which the joining permissions should be turned on. If set to 0x00, the device will turn off the joining permissions indefinitely. If it is set to 0xFF, the joining permissions will be turned on indefinitely. - public int Timeout; - - /// TI.ZPI2.ZB_PERMIT_JOINING_REQUEST - /// Constructor - public ZB_PERMIT_JOINING_REQUEST() { - } - - /// TI.ZPI2.ZB_PERMIT_JOINING_REQUEST - /// Constructor - public ZB_PERMIT_JOINING_REQUEST(ZToolAddress16 num1, int num2) { - this.Destination = num1; - this.Timeout = num2; - int[] framedata = new int[3]; - framedata[0] = this.Destination.getLsb(); - framedata[1] = this.Destination.getMsb(); - framedata[2] = this.Timeout; - super.buildPacket(new DoubleByte(ZToolCMD.ZB_PERMIT_JOINING_REQUEST), framedata); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_PERMIT_JOINING_REQUEST_RSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_PERMIT_JOINING_REQUEST_RSP.java deleted file mode 100644 index 4bcfdc447abf5..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_PERMIT_JOINING_REQUEST_RSP.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.simple; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZB_PERMIT_JOINING_REQUEST_RSP extends ZToolPacket /*imlements IRESPONSE, ISIMPLEAPI*/ { - /// TI.ZPI2.ZB_PERMIT_JOINING_REQUEST_RSP.Status - /// Status. - public int Status; - - /// TI.ZPI2.ZB_PERMIT_JOINING_REQUEST_RSP - /// Constructor - public ZB_PERMIT_JOINING_REQUEST_RSP() { - } - - /// TI.ZPI2.ZB_PERMIT_JOINING_REQUEST_RSP - /// Constructor - public ZB_PERMIT_JOINING_REQUEST_RSP(int[] framedata) { - this.Status = framedata[0]; - super.buildPacket(new DoubleByte(ZToolCMD.ZB_PERMIT_JOINING_REQUEST_RSP), framedata); - } - - @Override - public String toString() { - return "ZB_PERMIT_JOINING_REQUEST_RSP{" + - "Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_READ_CONFIGURATION.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_READ_CONFIGURATION.java deleted file mode 100644 index fc6ffb694ff2e..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_READ_CONFIGURATION.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.simple; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZB_READ_CONFIGURATION extends ZToolPacket /*implements IREQUEST,ISIMPLEAPI*/ { - /// TI.ZPI2.ZB_READ_CONFIGURATION.ConfigId - /// Identifier of property to read. - public int ConfigId; - - /// TI.ZPI2.ZB_READ_CONFIGURATION - /// Constructor - public ZB_READ_CONFIGURATION() { - } - - /// TI.ZPI2.ZB_READ_CONFIGURATION - /// Constructor - public ZB_READ_CONFIGURATION(int num1) { - this.ConfigId = num1; - int[] framedata = {num1}; - super.buildPacket(new DoubleByte(ZToolCMD.ZB_READ_CONFIGURATION), framedata); - } - - public class CONFIG_ID { - public static final int ZCD_NV_STARTUP_OPTION = 0x03; - public static final int ZCD_NV_LOGICAL_TYPE = 0x87; - public static final int ZCD_NV_POLL_RATE = 0x24; - public static final int ZCD_NV_QEUED_POL_RATE = 0x25; - public static final int ZCD_NV_RESPONSE_POLL_RATE = 0x26; - public static final int ZCD_NV_POLL_FAILURE_RETRIES = 0x29; - public static final int ZCD_NV_INDIRECT_MSG_TIMEOUT = 0x2B; - public static final int ZCD_NV_APS_FRAME_RETRIES = 0x43; - public static final int ZCD_NV_APS_ACK_WAIT_DURATION = 0x44; - public static final int ZCD_NV_BINDING_TIME = 0x46; - public static final int ZCD_NV_USERDESC = 0x81; - public static final int ZCD_NV_PANID = 0x83; - public static final int ZCD_NV_CHANLIST = 0x84; - public static final int ZCD_NV_PRECFGKEY = 0x62; - public static final int ZCD_NV_PRECFGKEYS_ENABLE = 0x63; - public static final int ZCD_NV_SECURITY_MODE = 0x64; - public static final int ZCD_NV_BCAST_RETRIES = 0x2E; - public static final int ZCD_NV_PASSIVE_ACK_TIMEOUT = 0x2F; - public static final int ZCD_NV_BCAST_DELIVERY_TIME = 0x30; - public static final int ZCD_NV_ROUTE_EXPIRY_TIME = 0x2C; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_READ_CONFIGURATION_RSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_READ_CONFIGURATION_RSP.java deleted file mode 100644 index 543f58422b36a..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_READ_CONFIGURATION_RSP.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.simple; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -import java.util.Arrays; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZB_READ_CONFIGURATION_RSP extends ZToolPacket /*implements IRESPONSE,ISIMPLEAPI*/ { - // TI.ZPI2.ZB_READ_CONFIGURATION_RSP.ConfigId - /// The identifier of the property that was read. - public int ConfigId; - /// TI.ZPI2.ZB_READ_CONFIGURATION_RSP.Len - /// The size of the value of the property. - public int Len; - /// TI.ZPI2.ZB_READ_CONFIGURATION_RSP.Status - /// The result of the read operation. - public int Status; - /// TI.ZPI2.ZB_READ_CONFIGURATION_RSP.Value - /// The value of the property that was read. - public int[] Value; - - /// TI.ZPI2.ZB_READ_CONFIGURATION_RSP - /// Constructor - public ZB_READ_CONFIGURATION_RSP() { - this.Value = new int[0xff]; - } - - /// TI.ZPI2.ZB_READ_CONFIGURATION_RSP - /// Constructor - public ZB_READ_CONFIGURATION_RSP(int[] framedata) { - this.Status = framedata[0]; - this.ConfigId = framedata[1]; - this.Len = framedata[2]; - this.Value = new int[framedata.length - 3]; - for (int i = 0; i < this.Value.length; i++) { - this.Value[i] = framedata[i + 3]; - } - /*if (buffer1.Length > 0xff) - { - throw new Exception("Error creating object."); - } - this.Value = new byte[0xff]; - Array.Copy(buffer1, this.Value, buffer1.Length);*/ - super.buildPacket(new DoubleByte(ZToolCMD.ZB_READ_CONFIGURATION_RSP), framedata); - } - - public class CONFIG_ID { - public static final int ZCD_NV_STARTUP_OPTION = 0x03; - public static final int ZCD_NV_LOGICAL_TYPE = 0x87; - public static final int ZCD_NV_POLL_RATE = 0x24; - public static final int ZCD_NV_QEUED_POL_RATE = 0x25; - public static final int ZCD_NV_RESPONSE_POLL_RATE = 0x26; - public static final int ZCD_NV_POLL_FAILURE_RETRIES = 0x29; - public static final int ZCD_NV_INDIRECT_MSG_TIMEOUT = 0x2B; - public static final int ZCD_NV_APS_FRAME_RETRIES = 0x43; - public static final int ZCD_NV_APS_ACK_WAIT_DURATION = 0x44; - public static final int ZCD_NV_BINDING_TIME = 0x46; - public static final int ZCD_NV_USERDESC = 0x81; - public static final int ZCD_NV_PANID = 0x83; - public static final int ZCD_NV_CHANLIST = 0x84; - public static final int ZCD_NV_PRECFGKEY = 0x62; - public static final int ZCD_NV_PRECFGKEYS_ENABLE = 0x63; - public static final int ZCD_NV_SECURITY_MODE = 0x64; - public static final int ZCD_NV_BCAST_RETRIES = 0x2E; - public static final int ZCD_NV_PASSIVE_ACK_TIMEOUT = 0x2F; - public static final int ZCD_NV_BCAST_DELIVERY_TIME = 0x30; - public static final int ZCD_NV_ROUTE_EXPIRY_TIME = 0x2C; - } - - @Override - public String toString() { - return "ZB_READ_CONFIGURATION_RSP{" + - "ConfigId=" + ConfigId + - ", Len=" + Len + - ", Status=" + ResponseStatus.getStatus(Status) + - ", Value=" + Arrays.toString(Value) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_RECEIVE_DATA_INDICATION.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_RECEIVE_DATA_INDICATION.java deleted file mode 100644 index 85c164378069f..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_RECEIVE_DATA_INDICATION.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.simple; - -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZB_RECEIVE_DATA_INDICATION extends ZToolPacket /*implements IRESPONSE_CALLBAC,ISIMPLEAPI*/ { - /// TI.ZPI2.ZB_RECEIVE_DATA_INDICATION.Command - /// The CommandId of the data packet. - public DoubleByte Command; - /// TI.ZPI2.ZB_RECEIVE_DATA_INDICATION.Data - /// The received data packet payload. - public int[] Data; - /// TI.ZPI2.ZB_RECEIVE_DATA_INDICATION.Len - /// The length of the data payload. - public DoubleByte Len; - /// TI.ZPI2.ZB_RECEIVE_DATA_INDICATION.Source - /// The 16-bit address of the device that sent the data packet. - public ZToolAddress16 Source; - - /// TI.ZPI2.ZB_RECEIVE_DATA_INDICATION - /// Constructor - public ZB_RECEIVE_DATA_INDICATION() { - this.Data = new int[0xff]; - } - - /// TI.ZPI2.ZB_RECEIVE_DATA_INDICATION - /// Constructor - public ZB_RECEIVE_DATA_INDICATION(int[] framedata) { - this.Source = new ZToolAddress16(framedata[1], framedata[0]); - this.Command = new DoubleByte(framedata[3], framedata[2]); - this.Len = new DoubleByte(framedata[5], framedata[4]); - this.Data = new int[framedata.length - 6]; - for (int i = 0; i < this.Data.length; i++) { - this.Data[i] = framedata[i + 6]; - } - /*if (buffer1.Length > 0xff) - { - throw new Exception("Error creating object."); - } - this.Data = new byte[0xff]; - Array.Copy(buffer1, this.Data, buffer1.Length);*/ - super.buildPacket(new DoubleByte(ZToolCMD.ZB_RECEIVE_DATA_INDICATION), framedata); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_SEND_DATA_CONFIRM.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_SEND_DATA_CONFIRM.java deleted file mode 100644 index b8ce9fb6141e6..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_SEND_DATA_CONFIRM.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.simple; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZB_SEND_DATA_CONFIRM extends ZToolPacket /*implements IRESPONSE_CALLBACK,ISIMPLEAPI*/ { - /// TI.ZPI2.ZB_SEND_DATA_CONFIRM.Handle - /// Handle. - public int Handle; - /// TI.ZPI2.ZB_SEND_DATA_CONFIRM.Status - /// The immediate return value from executing the RPC. - public int Status; - - /// TI.ZPI2.ZB_SEND_DATA_CONFIRM - /// Constructor - public ZB_SEND_DATA_CONFIRM() { - } - - /// TI.ZPI2.ZB_SEND_DATA_CONFIRM - /// Constructor - public ZB_SEND_DATA_CONFIRM(int[] framedata) { - this.Handle = framedata[0]; - this.Status = framedata[1]; - super.buildPacket(new DoubleByte(ZToolCMD.ZB_SEND_DATA_CONFIRM), framedata); - } - - @Override - public String toString() { - return "ZB_SEND_DATA_CONFIRM{" + - "Handle=" + Handle + - ", Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_SEND_DATA_REQUEST.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_SEND_DATA_REQUEST.java deleted file mode 100644 index d43f48a23c2d4..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_SEND_DATA_REQUEST.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.simple; - -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZB_SEND_DATA_REQUEST extends ZToolPacket /*implements IREQUEST,ISIMPLEAPI*/ { - /// TI.ZPI2.ZB_SEND_DATA_REQUEST.CommandId - /// Command identifier of the data packet. - public DoubleByte CommandId; - /// TI.ZPI2.ZB_SEND_DATA_REQUEST.Destination - /// Short address of destination device ( 0xFFFE indicates NULL address and a binding must have been established previously for this command identifier. Broadcast addresses include 0xFFFF for all devices, 0xFFFC for all routers/coordinator devices and 0xFFFD for all devices with receiver turned ON ). - public ZToolAddress16 Destination; - /// TI.ZPI2.ZB_SEND_DATA_REQUEST.Handle - /// Identifier for this data send operation. - public int Handle; - /// TI.ZPI2.ZB_SEND_DATA_REQUEST.PayloadLen - /// Size in bytes of the data packet payload. - public int PayloadLen; - /// TI.ZPI2.ZB_SEND_DATA_REQUEST.PayloadValue - /// Packet payload. - public int[] PayloadValue; - /// TI.ZPI2.ZB_SEND_DATA_REQUEST.Radius - /// Max number of hops the data packet can travel ( set to 0 to use default value ). - public int Radius; - /// TI.ZPI2.ZB_SEND_DATA_REQUEST.TxOptions - /// Bit mask of transmission options ( 0x10 for end-to-end acknowledgements and retransmissions ). - public int TxOptions; - - /// TI.ZPI2.ZB_SEND_DATA_REQUEST - /// Constructor - public ZB_SEND_DATA_REQUEST() { - this.PayloadValue = new int[0xff]; - } - - public ZB_SEND_DATA_REQUEST(ZToolAddress16 num1, DoubleByte num2, int num3, int txoptions_type1, int num4, int num5, int[] buffer1) { - this.Destination = num1; - this.CommandId = num2; - this.Handle = num3; - this.TxOptions = txoptions_type1; - this.Radius = num4; - this.PayloadLen = num5; - this.PayloadValue = new int[buffer1.length]; - this.PayloadValue = buffer1; - /*if (buffer1.Length > 0xff) - { - throw new Exception("Error creating object."); - } - this.PayloadValue = new byte[0xff]; - Array.Copy(buffer1, this.PayloadValue, buffer1.Length);*/ - int[] framedata = new int[this.PayloadValue.length + 8]; - framedata[0] = this.Destination.getLsb(); - framedata[1] = this.Destination.getMsb(); - framedata[2] = this.CommandId.getLsb(); - framedata[3] = this.CommandId.getMsb(); - framedata[4] = this.Handle; - framedata[5] = this.TxOptions; - framedata[6] = this.Radius; - framedata[7] = this.PayloadLen; - for (int i = 0; i < this.PayloadValue.length; i++) { - framedata[i + 8] = this.PayloadValue[i]; - } - super.buildPacket(new DoubleByte(ZToolCMD.ZB_SEND_DATA_REQUEST), framedata); - - } - - /// TI.ZPI2.ZB_SEND_DATA_REQUEST.TXOPTIONS_TYPE - /// Reset type - public class TXOPTIONS_TYPE { - /// TI.ZPI2.ZB_SEND_DATA_REQUEST.TXOPTIONS_TYPE.END-TO-END-ACK - /// Reset type - public static final int END_TO_END_ACK = 0x10; - /// TI.ZPI2.ZB_SEND_DATA_REQUEST.TXOPTIONS_TYPE.NONE - /// Reset type - public static final int NONE = 0; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_SEND_DATA_REQUEST_RSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_SEND_DATA_REQUEST_RSP.java deleted file mode 100644 index 8a1987f59fae2..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_SEND_DATA_REQUEST_RSP.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.simple; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZB_SEND_DATA_REQUEST_RSP extends ZToolPacket/* implemetns IRESPONSE,ISIMPLEAPI*/ { - public ZB_SEND_DATA_REQUEST_RSP() { - super.buildPacket(new DoubleByte(ZToolCMD.ZB_SEND_DATA_REQUEST_RSP), new int[0]); - } - - public ZB_SEND_DATA_REQUEST_RSP(int[] framedata) { - super.buildPacket(new DoubleByte(ZToolCMD.ZB_SEND_DATA_REQUEST_RSP), framedata); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_START_CONFIRM.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_START_CONFIRM.java deleted file mode 100644 index 9c0df4c0adcb9..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_START_CONFIRM.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.simple; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZB_START_CONFIRM extends ZToolPacket /*implements IRESPONSE_CALLBACK,ISIMPLEAPI*/ { - /// TI.ZPI2.ZB_START_CONFIRM.Status - /// The immediate return value from executing the RPC. - public int Status; - - /// TI.ZPI2.ZB_START_CONFIRM - /// Constructor - public ZB_START_CONFIRM() { - } - - /// TI.ZPI2.ZB_START_CONFIRM - /// Constructor - public ZB_START_CONFIRM(int[] framedata) { - this.Status = framedata[0]; - super.buildPacket(new DoubleByte(ZToolCMD.ZB_START_CONFIRM), framedata); - } - - @Override - public String toString() { - return "ZB_START_CONFIRM{" + - "Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_START_REQUEST.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_START_REQUEST.java deleted file mode 100644 index 1e25449bfd6d2..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_START_REQUEST.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.simple; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZB_START_REQUEST extends ZToolPacket /*implements IREQUEST;ISIMLPEAPI*/ { - public ZB_START_REQUEST() { - super.buildPacket(new DoubleByte(ZToolCMD.ZB_START_REQUEST), new int[0]); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_START_REQUEST_RSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_START_REQUEST_RSP.java deleted file mode 100644 index c4d72219f7265..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_START_REQUEST_RSP.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.simple; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZB_START_REQUEST_RSP extends ZToolPacket /*miplements IRESPONSE;ISIMPLEAPI*/ { - public ZB_START_REQUEST_RSP() { - super.buildPacket(new DoubleByte(ZToolCMD.ZB_START_REQUEST_RSP), new int[0]); - } - - public ZB_START_REQUEST_RSP(int[] framedata) { - super.buildPacket(new DoubleByte(ZToolCMD.ZB_START_REQUEST_RSP), framedata); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_SYSTEM_RESET.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_SYSTEM_RESET.java deleted file mode 100644 index c80e3a740ef21..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_SYSTEM_RESET.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.simple; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZB_SYSTEM_RESET extends ZToolPacket /*implements IREQUEST,ISIMPLEAPI*/ { - public ZB_SYSTEM_RESET() { - super.buildPacket(new DoubleByte(ZToolCMD.ZB_SYSTEM_RESET), new int[0]); - } - - public ZB_SYSTEM_RESET(int[] framedata) { - super.buildPacket(new DoubleByte(ZToolCMD.ZB_SYSTEM_RESET), framedata); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_WRITE_CONFIGURATION.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_WRITE_CONFIGURATION.java deleted file mode 100644 index ffc7c1a956e66..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_WRITE_CONFIGURATION.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.simple; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZB_WRITE_CONFIGURATION extends ZToolPacket/* implements IREQUEST,ISIMPLEAPI*/ { - - /// TI.ZPI2.ZB_WRITE_CONFIGURATION - /// Constructor - public ZB_WRITE_CONFIGURATION(int nv_item_id, int[] nv_item_value) { - int[] framedata = new int[nv_item_value.length + 2]; - framedata[0] = nv_item_id; - framedata[1] = nv_item_value.length; - for (int i = 0; i < nv_item_value.length; i++) { - framedata[i + 2] = nv_item_value[i]; - } - super.buildPacket(new DoubleByte(ZToolCMD.ZB_WRITE_CONFIGURATION), framedata); - } - - public class CONFIG_ID { - public static final int ZCD_NV_STARTUP_OPTION = 0x03; - public static final int ZCD_NV_LOGICAL_TYPE = 0x87; - public static final int ZCD_NV_POLL_RATE = 0x24; - public static final int ZCD_NV_QEUED_POL_RATE = 0x25; - public static final int ZCD_NV_RESPONSE_POLL_RATE = 0x26; - public static final int ZCD_NV_POLL_FAILURE_RETRIES = 0x29; - public static final int ZCD_NV_INDIRECT_MSG_TIMEOUT = 0x2B; - public static final int ZCD_NV_APS_FRAME_RETRIES = 0x43; - public static final int ZCD_NV_APS_ACK_WAIT_DURATION = 0x44; - public static final int ZCD_NV_BINDING_TIME = 0x46; - public static final int ZCD_NV_USERDESC = 0x81; - public static final int ZCD_NV_PANID = 0x83; - public static final int ZCD_NV_CHANLIST = 0x84; - public static final int ZCD_NV_PRECFGKEY = 0x62; - public static final int ZCD_NV_PRECFGKEYS_ENABLE = 0x63; - public static final int ZCD_NV_SECURITY_MODE = 0x64; - public static final int ZCD_NV_BCAST_RETRIES = 0x2E; - public static final int ZCD_NV_PASSIVE_ACK_TIMEOUT = 0x2F; - public static final int ZCD_NV_BCAST_DELIVERY_TIME = 0x30; - public static final int ZCD_NV_ROUTE_EXPIRY_TIME = 0x2C; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_WRITE_CONFIGURATION_RSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_WRITE_CONFIGURATION_RSP.java deleted file mode 100644 index 3f3e4ff53fe2f..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/simple/ZB_WRITE_CONFIGURATION_RSP.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.simple; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZB_WRITE_CONFIGURATION_RSP extends ZToolPacket/* implements IRESPONSE,ISIMPLEAPI*/ { - /// TI.ZPI2.ZB_WRITE_CONFIGURATION_RSP.Status - /// The immediate return value from executing the RPC. - public int Status; - - /// TI.ZPI2.ZB_WRITE_CONFIGURATION_RSP - /// Constructor - public ZB_WRITE_CONFIGURATION_RSP() { - } - - /// TI.ZPI2.ZB_WRITE_CONFIGURATION_RSP - /// Constructor - public ZB_WRITE_CONFIGURATION_RSP(int[] framedata) { - this.Status = framedata[0]; - super.buildPacket(new DoubleByte(ZToolCMD.ZB_WRITE_CONFIGURATION_RSP), framedata); - } - - @Override - public String toString() { - return "ZB_WRITE_CONFIGURATION_RSP{" + - "Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_ADC_READ.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_ADC_READ.java deleted file mode 100644 index 9b1af5e9167bc..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_ADC_READ.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.system; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class SYS_ADC_READ extends ZToolPacket /*implements IREQUEST,ISYSTEM*/ { - /// TI.ZPI2.SYS_ADC_READ.Channel - /// Channel: 0x00-0x07 = AIN0 - AIN7; 0x0E = temp; 0x0F = voltage - public int Channel; - /// TI.ZPI2.SYS_ADC_READ.Resolution - /// Resolution: 1 = 8-bit; 2 = 10-bit; 3 = 12-bit; 4 = 14-bit - public int Resolution; - - /// TI.ZPI2.SYS_ADC_READ - /// Constructor - public SYS_ADC_READ() { - } - - /// TI.ZPI2.SYS_ADC_READ - /// Constructor - public SYS_ADC_READ(int num1, int num2) { - this.Channel = num1; - this.Resolution = num2; - int[] framedata = {num1, num2}; - super.buildPacket(new DoubleByte(ZToolCMD.SYS_ADC_READ), framedata); - } - - public class CHANNEL { - public static final int AIN0 = 0x06; - public static final int AIN1 = 0x07; - public static final int AIN0_1 = 0x0B; - public static final int TEMPERATURE = 0x0E; - public static final int VOLTAGE = 0x0F; - } - - public class RESOLUTION { - public static final int BITS7 = 0x00; - public static final int BITS9 = 0x01; - public static final int BITS10 = 0x02; - public static final int BITS12 = 0x03; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_ADC_READ_SRSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_ADC_READ_SRSP.java deleted file mode 100644 index d983bc28aaf5e..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_ADC_READ_SRSP.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.system; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class SYS_ADC_READ_SRSP extends ZToolPacket /*implements IRESPONSE,ISYSTEM*/ { - /// TI.ZPI2.SYS_ADC_READ_SRSP.Value - /// ADC value - public DoubleByte Value; - - /// TI.ZPI2.SYS_ADC_READ_SRSP - /// Constructor - public SYS_ADC_READ_SRSP() { - } - - /// TI.ZPI2.SYS_ADC_READ_SRSP - /// Constructor - public SYS_ADC_READ_SRSP(int[] framedata) { - this.Value = new DoubleByte(framedata[1], framedata[0]); - super.buildPacket(new DoubleByte(ZToolCMD.SYS_ADC_READ_SRSP), framedata); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_GPIO.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_GPIO.java deleted file mode 100644 index 99694cd83eaf9..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_GPIO.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.system; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class SYS_GPIO extends ZToolPacket /*implements IREQUEST,ISYSTEM*/ { - public int Operation; - public int Value; - - public SYS_GPIO() { - - } - - public SYS_GPIO(int num1, int num2) { - this.Operation = num1; - this.Value = num2; - int[] framedata = new int[2]; - framedata[0] = this.Operation; - framedata[1] = this.Value; - super.buildPacket(new DoubleByte(ZToolCMD.SYS_GPIO), framedata); - } - - public class OPERATION { - public static final int SET_DIRECTION = 0; - public static final int SET_INPUT_MODE = 1; - public static final int SET = 2; - public static final int CLEAR = 3; - public static final int TOGGLE = 4; - public static final int READ = 5; - } - - public class VALUE { - public static final int GPIO1 = 0x01; - public static final int GPIO2 = 0x02; - public static final int GPIO3 = 0x08; - public static final int GPIO4 = 0x10; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_GPIO_SRSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_GPIO_SRSP.java deleted file mode 100644 index 0e149c7dc2f32..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_GPIO_SRSP.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.system; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class SYS_GPIO_SRSP extends ZToolPacket /*implements IRESPONSE,ISYSTEM*/ { - - public DoubleByte Value; - - public SYS_GPIO_SRSP() { - } - - public SYS_GPIO_SRSP(int[] framedata) { - this.Value = new DoubleByte(framedata[1], framedata[0]); - super.buildPacket(new DoubleByte(ZToolCMD.SYS_GPIO_SRSP), framedata); - } - - public class VALUE { - - public static final int GPIO1 = 0x01; - public static final int GPIO2 = 0x02; - public static final int GPIO3 = 0x08; - public static final int GPIO4 = 0x10; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_OSAL_NV_READ.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_OSAL_NV_READ.java deleted file mode 100644 index 454a3255e7d91..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_OSAL_NV_READ.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.system; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class SYS_OSAL_NV_READ extends ZToolPacket /*implements IREQUEST, ISYSTEM*/ { - /// TI.ZPI2.SYS_OSAL_NV_READ.Id - /// Attribute PROFILE_ID_HOME_AUTOMATION - public DoubleByte Id; - /// TI.ZPI2.SYS_OSAL_NV_READ.Offset - /// Memory offset into item (up to 250) - public int Offset; - - /// TI.ZPI2.SYS_OSAL_NV_READ - /// Constructor - public SYS_OSAL_NV_READ() { - } - - /// TI.ZPI2.SYS_OSAL_NV_READ - /// Constructor - public SYS_OSAL_NV_READ(DoubleByte num1, int num2) { - this.Id = num1; - this.Offset = num2; - int[] framedata = new int[3]; - framedata[0] = this.Id.getLsb(); - framedata[1] = this.Id.getMsb(); - framedata[2] = this.Offset; - super.buildPacket(new DoubleByte(ZToolCMD.SYS_OSAL_NV_READ), framedata); - } - - public class ID { - public static final int ZP_NV_APP_ITEM_1 = 0x0300; - public static final int ZP_NV_APP_ITEM_2 = 0x0301; - public static final int ZP_NV_APP_ITEM_3 = 0x0302; - public static final int ZP_NV_APP_ITEM_4 = 0x0303; - public static final int ZP_NV_APP_ITEM_5 = 0x0304; - public static final int ZP_NV_APP_ITEM_6 = 0x0305; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_OSAL_NV_READ_SRSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_OSAL_NV_READ_SRSP.java deleted file mode 100644 index 32f9aa0c3d267..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_OSAL_NV_READ_SRSP.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.system; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -import java.util.Arrays; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class SYS_OSAL_NV_READ_SRSP extends ZToolPacket /*implements IRESPONSE,ISYSTEM*/ { - /// TI.ZPI2.SYS_OSAL_NV_READ_SRSP.Len - /// Length of value. - public int Len; - /// TI.ZPI2.SYS_OSAL_NV_READ_SRSP.Status - /// The fail status is returned if the address value in the command message was not within the valid range. - public int Status; - /// TI.ZPI2.SYS_OSAL_NV_READ_SRSP.Value - /// Dynamic array, contains the data read from the target. - public int[] Value; - - /// TI.ZPI2.SYS_OSAL_NV_READ_SRSP - /// Constructor - public SYS_OSAL_NV_READ_SRSP() { - this.Value = new int[0xff]; - } - - public SYS_OSAL_NV_READ_SRSP(int[] framedata) { - this.Status = framedata[0]; - this.Len = framedata[1]; - this.Value = new int[framedata.length - 2]; - for (int i = 0; i < this.Value.length; i++) { - this.Value[i] = framedata[i + 2]; - } - /*if (buffer1.Length > 0xff) - { - throw new Exception("Error creating object."); - } - this.Value = new byte[0xff]; - Array.Copy(buffer1, this.Value, buffer1.Length);*/ - super.buildPacket(new DoubleByte(ZToolCMD.SYS_OSAL_NV_READ_SRSP), framedata); - } - - @Override - public String toString() { - return "SYS_OSAL_NV_READ_SRSP{" + - "Len=" + Len + - ", Status=" + ResponseStatus.getStatus(Status) + - ", Value=" + Arrays.toString(Value) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_OSAL_NV_WRITE.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_OSAL_NV_WRITE.java deleted file mode 100644 index d745e336d6d7b..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_OSAL_NV_WRITE.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.system; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class SYS_OSAL_NV_WRITE extends ZToolPacket /*implements IREQUEST,ISYSTEM*/ { - /// TI.ZPI2.SYS_OSAL_NV_WRITE.Id - /// indicates the PROFILE_ID_HOME_AUTOMATION of the NV item to be written. - public DoubleByte Id; - /// TI.ZPI2.SYS_OSAL_NV_WRITE.Len - /// Number of bytes in item (up to 250) - public int Len; - /// TI.ZPI2.SYS_OSAL_NV_WRITE.Offset - /// Memory offset into item (up to 250) - public int Offset; - /// TI.ZPI2.SYS_OSAL_NV_WRITE.Value - /// Dynamic array, requires memory allocation. Contains the data value that is to be written to the location. - public int[] Value; - - /// TI.ZPI2.SYS_OSAL_NV_WRITE - /// Constructor - public SYS_OSAL_NV_WRITE() { - this.Value = new int[0xff]; - } - - /// TI.ZPI2.SYS_OSAL_NV_WRITE - /// Constructor - public SYS_OSAL_NV_WRITE(DoubleByte num1, int num2, int num3, int[] buffer1) { - this.Id = num1; - this.Offset = num2; - this.Len = num3; - this.Value = new int[buffer1.length]; - this.Value = buffer1; - /*if (buffer1.Length > 0xff) - { - throw new Exception("Error creating object."); - } - this.Value = new byte[0xff]; - Array.Copy(buffer1, this.Value, buffer1.Length);*/ - int[] framedata = new int[buffer1.length + 4]; - framedata[0] = this.Id.getLsb(); - framedata[1] = this.Id.getMsb(); - framedata[2] = this.Offset; - framedata[3] = this.Len; - for (int i = 4; i < framedata.length; i++) { - framedata[i] = this.Value[i - 4]; - } - super.buildPacket(new DoubleByte(ZToolCMD.SYS_OSAL_NV_WRITE), framedata); - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_OSAL_NV_WRITE_SRSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_OSAL_NV_WRITE_SRSP.java deleted file mode 100644 index 073107a53a070..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_OSAL_NV_WRITE_SRSP.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.system; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class SYS_OSAL_NV_WRITE_SRSP extends ZToolPacket /*implements IRESPONSE;ISYSTEM*/ { - /// TI.ZPI2.SYS_OSAL_NV_WRITE_SRSP.Status - /// Status - public int Status; - - /// TI.ZPI2.SYS_OSAL_NV_WRITE_SRSP - /// Constructor - public SYS_OSAL_NV_WRITE_SRSP() { - } - - public SYS_OSAL_NV_WRITE_SRSP(int[] framedata) { - this.Status = framedata[0]; - super.buildPacket(new DoubleByte(ZToolCMD.SYS_OSAL_NV_READ_SRSP), framedata); - } - - @Override - public String toString() { - return "SYS_OSAL_NV_WRITE_SRSP{" + - "Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_OSAL_START_TIMER.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_OSAL_START_TIMER.java deleted file mode 100644 index eb55a6642822f..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_OSAL_START_TIMER.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.system; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class SYS_OSAL_START_TIMER extends ZToolPacket /*implements IREQUEST,ISYSTEM*/ { - /// TI.ZPI2.SYS_OSAL_START_TIMER.Id - /// Timer PROFILE_ID_HOME_AUTOMATION: 0-3 - public int Id; - /// TI.ZPI2.SYS_OSAL_START_TIMER.Timeout - /// Timeout in milliseconds. - public DoubleByte Timeout; - - /// TI.ZPI2.SYS_OSAL_START_TIMER - /// Constructor - public SYS_OSAL_START_TIMER() { - } - - /// TI.ZPI2.SYS_OSAL_START_TIMER - /// Constructor - public SYS_OSAL_START_TIMER(int num1, DoubleByte num2) { - this.Id = num1; - this.Timeout = num2; - int[] framedata = new int[3]; - framedata[0] = this.Id; - framedata[1] = this.Timeout.getLsb(); - framedata[2] = this.Timeout.getMsb(); - super.buildPacket(new DoubleByte(ZToolCMD.SYS_OSAL_START_TIMER), framedata); - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_OSAL_START_TIMER_SRSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_OSAL_START_TIMER_SRSP.java deleted file mode 100644 index de4a45057e0a1..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_OSAL_START_TIMER_SRSP.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.system; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class SYS_OSAL_START_TIMER_SRSP extends ZToolPacket /*implements IRESPONSE,ISYSTEM*/ { - /// TI.ZPI2.SYS_OSAL_START_TIMER_SRSP.Status - /// Status - public int Status; - - /// TI.ZPI2.SYS_OSAL_START_TIMER_SRSP - /// Constructor - public SYS_OSAL_START_TIMER_SRSP() { - } - - public SYS_OSAL_START_TIMER_SRSP(int[] framedata) { - this.Status = framedata[0]; - super.buildPacket(new DoubleByte(ZToolCMD.SYS_OSAL_START_TIMER_SRSP), framedata); - } - - @Override - public String toString() { - return "SYS_OSAL_START_TIMER_SRSP{" + - "Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_OSAL_STOP_TIMER.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_OSAL_STOP_TIMER.java deleted file mode 100644 index 3de329cfc901a..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_OSAL_STOP_TIMER.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.system; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class SYS_OSAL_STOP_TIMER extends ZToolPacket/* implements IREQUEST,ISYSTEM*/ { - /// TI.ZPI2.SYS_OSAL_STOP_TIMER.Id - /// Timer PROFILE_ID_HOME_AUTOMATION: 0-3 - public int Id; - - /// TI.ZPI2.SYS_OSAL_STOP_TIMER - /// Constructor - public SYS_OSAL_STOP_TIMER() { - } - - /// TI.ZPI2.SYS_OSAL_STOP_TIMER - /// Constructor - public SYS_OSAL_STOP_TIMER(int num1) { - this.Id = num1; - int[] framedata = {this.Id}; - super.buildPacket(new DoubleByte(ZToolCMD.SYS_OSAL_STOP_TIMER), framedata); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_OSAL_STOP_TIMER_SRSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_OSAL_STOP_TIMER_SRSP.java deleted file mode 100644 index 9e8bdedc2fff9..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_OSAL_STOP_TIMER_SRSP.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.system; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class SYS_OSAL_STOP_TIMER_SRSP extends ZToolPacket /*implements IRESPONSE,ISYSTEM*/ { - /// TI.ZPI2.SYS_OSAL_STOP_TIMER_SRSP.Status - /// Status - public int Status; - - /// TI.ZPI2.SYS_OSAL_STOP_TIMER_SRSP - /// Constructor - public SYS_OSAL_STOP_TIMER_SRSP() { - } - - public SYS_OSAL_STOP_TIMER_SRSP(int[] framedata) { - this.Status = framedata[0]; - super.buildPacket(new DoubleByte(ZToolCMD.SYS_OSAL_STOP_TIMER_SRSP), framedata); - } - - @Override - public String toString() { - return "SYS_OSAL_STOP_TIMER_SRSP{" + - "Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_OSAL_TIMER_EXPIRED_IND.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_OSAL_TIMER_EXPIRED_IND.java deleted file mode 100644 index 397de9fc132ec..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_OSAL_TIMER_EXPIRED_IND.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.system; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class SYS_OSAL_TIMER_EXPIRED_IND extends ZToolPacket /*implements IINDICATION,ISYSTEM*/ { - /// TI.ZPI2.SYS_OSAL_TIMER_EXPIRED_IND.Id - /// Timer PROFILE_ID_HOME_AUTOMATION - public int Id; - - /// TI.ZPI2.SYS_OSAL_TIMER_EXPIRED_IND - /// Constructor - public SYS_OSAL_TIMER_EXPIRED_IND() { - } - - /// TI.ZPI2.SYS_OSAL_TIMER_EXPIRED_IND - /// Constructor - public SYS_OSAL_TIMER_EXPIRED_IND(int[] framedata) { - this.Id = framedata[0]; - super.buildPacket(new DoubleByte(ZToolCMD.SYS_OSAL_TIMER_EXPIRED_IND), framedata); - } - - public SYS_OSAL_TIMER_EXPIRED_IND(int num1) { - this.Id = num1; - int[] framedata = {num1}; - super.buildPacket(new DoubleByte(ZToolCMD.SYS_OSAL_TIMER_EXPIRED_IND), framedata); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_PING.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_PING.java deleted file mode 100644 index f5370af694a4a..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_PING.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.system; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class SYS_PING extends ZToolPacket /*implements IREQUEST,ISYSTEM*/ { - public SYS_PING() { - - super.buildPacket(new DoubleByte(ZToolCMD.SYS_PING), new int[0]); - } - - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_PING_RESPONSE.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_PING_RESPONSE.java deleted file mode 100644 index 7d0ac6ecf8eda..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_PING_RESPONSE.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.system; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class SYS_PING_RESPONSE extends ZToolPacket /*implements IRESPONSE,ISYSTEM*/ { - /// TI.ZPI1.SYS_PING_RESPONSE.Capabilities - /// This field represents the interfaces that this device can handle (compiled into the device). - public int Capabilities; - - /// TI.ZPI1.SYS_PING_RESPONSE - /// Constructor - public SYS_PING_RESPONSE() { - } - - public SYS_PING_RESPONSE(DoubleByte capabilities1) { - this.Capabilities = capabilities1.get16BitValue(); - - int[] framedata = new int[2]; - framedata[0] = capabilities1.getLsb(); - framedata[1] = capabilities1.getMsb(); - - super.buildPacket(new DoubleByte(ZToolCMD.SYS_PING_RESPONSE), framedata); - } - - public SYS_PING_RESPONSE(int[] framedata) { - this.Capabilities = new DoubleByte(framedata[1], framedata[0]).get16BitValue(); - - super.buildPacket(new DoubleByte(ZToolCMD.SYS_PING_RESPONSE), framedata); - } - - /// TI.ZPI1.SYS_PING_RESPONSE.CAPABILITIES - /// Capabilities bitfield - public class CAPABILITIES { - /// TI.ZPI2.SYS_PING_RESPONSE.CAPABILITIES.MT_CAP_AF - /// Capabilities bitfield - public static final int MT_CAP_AF = 8; - /// TI.ZPI2.SYS_PING_RESPONSE.CAPABILITIES.MT_CAP_APP - /// Capabilities bitfield - public static final int MT_CAP_APP = 0x100; - /// TI.ZPI2.SYS_PING_RESPONSE.CAPABILITIES.MT_CAP_DEBUG - /// Capabilities bitfield - public static final int MT_CAP_DEBUG = 0x80; - /// TI.ZPI2.SYS_PING_RESPONSE.CAPABILITIES.MT_CAP_MAC - /// Capabilities bitfield - public static final int MT_CAP_MAC = 2; - /// TI.ZPI2.SYS_PING_RESPONSE.CAPABILITIES.MT_CAP_NWK - /// Capabilities bitfield - public static final int MT_CAP_NWK = 4; - /// TI.ZPI2.SYS_PING_RESPONSE.CAPABILITIES.MT_CAP_SAPI - /// Capabilities bitfield - public static final int MT_CAP_SAPI = 0x20; - /// TI.ZPI2.SYS_PING_RESPONSE.CAPABILITIES.MT_CAP_SYS - /// Capabilities bitfield - public static final int MT_CAP_SYS = 1; - /// TI.ZPI2.SYS_PING_RESPONSE.CAPABILITIES.MT_CAP_UTIL - /// Capabilities bitfield - public static final int MT_CAP_UTIL = 0x40; - /// TI.ZPI2.SYS_PING_RESPONSE.CAPABILITIES.MT_CAP_ZDO - /// Capabilities bitfield - public static final int MT_CAP_ZDO = 0x10; - /// TI.ZPI2.SYS_PING_RESPONSE.CAPABILITIES.NONE - /// Capabilities bitfield - public static final int NONE = 0; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_RANDOM.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_RANDOM.java deleted file mode 100644 index c073da8680824..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_RANDOM.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.system; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class SYS_RANDOM extends ZToolPacket /*implements IREQUEST,ISYSTEM*/ { - public SYS_RANDOM() { - - super.buildPacket(new DoubleByte(ZToolCMD.SYS_RANDOM), new int[0]); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_RANDOM_SRSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_RANDOM_SRSP.java deleted file mode 100644 index 0a63931ef8483..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_RANDOM_SRSP.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.system; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class SYS_RANDOM_SRSP extends ZToolPacket /*implements IREPONSE,ISYSTEM*/ { - /// TI.ZPI2.SYS_RANDOM_SRSP.Value - /// Random value - public DoubleByte Value; - - /// TI.ZPI2.SYS_RANDOM_SRSP - /// Constructor - public SYS_RANDOM_SRSP() { - } - - /// TI.ZPI2.SYS_RANDOM_SRSP - /// Constructor - public SYS_RANDOM_SRSP(int[] framedata) { - this.Value = new DoubleByte(framedata[1], framedata[0]); - super.buildPacket(new DoubleByte(ZToolCMD.SYS_RANDOM_SRSP), framedata); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_RESET.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_RESET.java deleted file mode 100644 index 4b76c65a19ef3..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_RESET.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.system; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class SYS_RESET extends ZToolPacket /*implements IREQUEST,ISYSTEM*/ { - /// TI.ZPI1.SYS_RESET.Type - /// requests a target device reset (0) or port bootloader reset (1). If the target device does not support port bootloading, bootloader reset commands are ignored and no response is sent from the target. - public int Type; - - /// TI.ZPI1.SYS_RESET - /// Constructor - @Deprecated - public SYS_RESET() { - } - - public SYS_RESET(int reset_type1) { - this.Type = reset_type1; - - int[] framedata = new int[1]; - framedata[0] = this.Type; - - super.buildPacket(new DoubleByte(ZToolCMD.SYS_RESET), framedata); - } - - public SYS_RESET(int[] framedata) { - this.Type = framedata[0]; - - super.buildPacket(new DoubleByte(ZToolCMD.SYS_RESET), framedata); - } - - /// TI.ZPI1.SYS_RESET.RESET_TYPE - /// Reset type - public class RESET_TYPE { - /// TI.ZPI1.SYS_RESET.RESET_TYPE.SERIAL_BOOTLOADER - /// Reset type - public static final int SERIAL_BOOTLOADER = 1; - /// TI.ZPI1.SYS_RESET.RESET_TYPE.TARGET_DEVICE - /// Reset type - public static final int TARGET_DEVICE = 0; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_RESET_RESPONSE.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_RESET_RESPONSE.java deleted file mode 100644 index 318afeb7cef2d..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_RESET_RESPONSE.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.system; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class SYS_RESET_RESPONSE extends ZToolPacket /*implements IRESPONE,ISYSTEM*/ { - /// TI.ZPI2.SYS_RESET_RESPONSE.HwRev - /// Hardware revision - public int HwRev; - /// TI.ZPI2.SYS_RESET_RESPONSE.MajorRel - /// Major release number - public int MajorRel; - /// TI.ZPI2.SYS_RESET_RESPONSE.MinorRel - /// Minor release number - public int MinorRel; - /// TI.ZPI2.SYS_RESET_RESPONSE.Product - /// Product PROFILE_ID_HOME_AUTOMATION - public int Product; - /// TI.ZPI2.SYS_RESET_RESPONSE.Reason - /// Reset reason - public int Reason; - /// TI.ZPI2.SYS_RESET_RESPONSE.TransportRev - /// Transport revision - public int TransportRev; - - /// TI.ZPI2.SYS_RESET_RESPONSE - /// Constructor - public SYS_RESET_RESPONSE() { - } - - /// TI.ZPI2.SYS_RESET_RESPONSE - /// Constructor - public SYS_RESET_RESPONSE(int[] framedata) { - this.Reason = framedata[0]; - this.TransportRev = framedata[1]; - this.Product = framedata[2]; - this.MajorRel = framedata[3]; - this.MinorRel = framedata[4]; - this.HwRev = framedata[5]; - super.buildPacket(new DoubleByte(ZToolCMD.SYS_RESET_RESPONSE), framedata); - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_RPC_ERROR.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_RPC_ERROR.java deleted file mode 100644 index c256e5785bdd2..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_RPC_ERROR.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.system; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class SYS_RPC_ERROR extends ZToolPacket /*implements IRESPONSE, ISYSTEM*/ { - /// TI.ZPI2.SYS_RPC_ERROR.ErrCmd0 - /// Command byte 0 of the message causing an error. - public int ErrCmd0; - /// TI.ZPI2.SYS_RPC_ERROR.ErrCmd1 - /// Command byte 1 of the message causing an error. - public int ErrCmd1; - /// TI.ZPI2.SYS_RPC_ERROR.Status - /// Status - public int Status; - - /// TI.ZPI2.SYS_RPC_ERROR - /// Constructor - public SYS_RPC_ERROR() { - } - - /// TI.ZPI2.SYS_RPC_ERROR - /// Constructor - public SYS_RPC_ERROR(int num1, int num2, int num3) { - this.Status = num1; - this.ErrCmd0 = num2; - this.ErrCmd1 = num3; - int[] framedata = {num1, num2, num3}; - super.buildPacket(new DoubleByte(ZToolCMD.SYS_RPC_ERROR), framedata); - } - - public SYS_RPC_ERROR(int[] framedata) { - this.Status = framedata[0]; - this.ErrCmd0 = framedata[1]; - this.ErrCmd1 = framedata[3]; - super.buildPacket(new DoubleByte(ZToolCMD.SYS_RPC_ERROR), framedata); - } - - @Override - public String toString() { - return "SYS_RPC_ERROR{" + - "ErrCmd0=" + ErrCmd0 + - ", ErrCmd1=" + ErrCmd1 + - ", Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_TEST_LOOPBACK.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_TEST_LOOPBACK.java deleted file mode 100644 index b341202c6a87b..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_TEST_LOOPBACK.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.system; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class SYS_TEST_LOOPBACK extends ZToolPacket/* implements IREQUEST,ISYSTEM*/ { - public int[] TestData; - - public SYS_TEST_LOOPBACK() { - - } - - public SYS_TEST_LOOPBACK(int[] buffer1) { - this.TestData = new int[buffer1.length]; - this.TestData = buffer1; - int[] framedata = new int[buffer1.length]; - framedata = this.TestData; - super.buildPacket(new DoubleByte(ZToolCMD.SYS_TEST_LOOPBACK), framedata); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_TEST_LOOPBACK_SRSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_TEST_LOOPBACK_SRSP.java deleted file mode 100644 index b34d9280b6fc3..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_TEST_LOOPBACK_SRSP.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.system; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class SYS_TEST_LOOPBACK_SRSP extends ZToolPacket/* implements IRESPONSE,ISYSTEM*/ { - public int[] TestData; - - public SYS_TEST_LOOPBACK_SRSP() { - - } - - public SYS_TEST_LOOPBACK_SRSP(int[] framedata) { - this.TestData = new int[framedata.length]; - this.TestData = framedata; - super.buildPacket(new DoubleByte(ZToolCMD.SYS_TEST_LOOPBACK_SRSP), framedata); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_TEST_RF.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_TEST_RF.java deleted file mode 100644 index bdc5727424927..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_TEST_RF.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.system; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class SYS_TEST_RF extends ZToolPacket /*implemtns IREQUEST,ISYSTEM*/ { - public int TestMode; - public int Frequency; - public int TxPower; - - public SYS_TEST_RF() { - - } - - public SYS_TEST_RF(int num1, int num2, int num3) { - this.TestMode = num1; - this.Frequency = num2; - this.TxPower = num3; - int[] framedata = new int[3]; - framedata[0] = this.TestMode; - framedata[1] = this.Frequency; - framedata[2] = this.TxPower; - super.buildPacket(new DoubleByte(ZToolCMD.SYS_TEST_RF), framedata); - } - - public class TEST_MODE { - public static final int UNMODULATED = 0; - public static final int PSEUDO_RANDOM = 1; - public static final int RECEIVE = 2; - } - - public class TX_POWER { - public static final int DBM_0_6 = 0xff; - public static final int DBM_0_5 = 0xdf; - public static final int DBM_0_3 = 0xbf; - public static final int DBM_0_2 = 0x9f; - public static final int DBM_MIN_0_1 = 0x7f; - public static final int DBM_MIN_0_4 = 0x5f; - public static final int DBM_MIN_0_9 = 0x3f; - public static final int DBM_MIN_1_5 = 0x1f; - public static final int DBM_MIN_2_7 = 0x1b; - public static final int DBM_MIN_4_0 = 0x17; - public static final int DBM_MIN_5_7 = 0x13; - public static final int DBM_MIN_7_9 = 0x0f; - public static final int DBM_MIN_10_8 = 0x0b; - public static final int DBM_MIN_15_4 = 0x07; - public static final int DBM_MIN_18_6 = 0x06; - public static final int DBM_MIN_25_2 = 0x03; - - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_VERSION.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_VERSION.java deleted file mode 100644 index dcb3d2514b0ef..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_VERSION.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.system; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class SYS_VERSION extends ZToolPacket /*implements IREQUEST,ISYSTEM*/ { - - public SYS_VERSION() { - - super.buildPacket(new DoubleByte(ZToolCMD.SYS_VERSION), new int[0]); - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_VERSION_RESPONSE.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_VERSION_RESPONSE.java deleted file mode 100644 index 481f90e35436f..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/system/SYS_VERSION_RESPONSE.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.system; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class SYS_VERSION_RESPONSE extends ZToolPacket /*implements /*IRESPONSE,ISYTEM*/ { - /// TI.ZPI2.SYS_VERSION_RESPONSE.HwRev - /// Hardware revision - public int HwRev; - /// TI.ZPI2.SYS_VERSION_RESPONSE.MajorRel - /// Major release number - public int MajorRel; - /// TI.ZPI2.SYS_VERSION_RESPONSE.MinorRel - /// Minor release number - public int MinorRel; - /// TI.ZPI2.SYS_VERSION_RESPONSE.Product - /// Product PROFILE_ID_HOME_AUTOMATION - public int Product; - /// TI.ZPI2.SYS_VERSION_RESPONSE.TransportRev - /// Transport revision - public int TransportRev; - - /// TI.ZPI2.SYS_VERSION_RESPONSE - /// Constructor - public SYS_VERSION_RESPONSE() { - } - - /// TI.ZPI2.SYS_VERSION_RESPONSE - /// Constructor - public SYS_VERSION_RESPONSE(int[] framedata) { - this.TransportRev = framedata[0]; - this.Product = framedata[1]; - this.MajorRel = framedata[2]; - this.MinorRel = framedata[3]; - this.HwRev = framedata[4]; - super.buildPacket(new DoubleByte(ZToolCMD.SYS_VERSION_RESPONSE), framedata); - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_CALLBACK_SUBSCRIBE.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_CALLBACK_SUBSCRIBE.java deleted file mode 100644 index 3c4d9b0e285c1..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_CALLBACK_SUBSCRIBE.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.network.packet.util; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.6.0 - */ -public class UTIL_CALLBACK_SUBSCRIBE extends ZToolPacket /*implements IREQUEST, ISYSTEM*/ { - /// TI.ZPI1.SYS_CALLBACK_SUBSCRIBE.Action - /// contains the action of the command - public int Action; - /// TI.ZPI1.SYS_CALLBACK_SUBSCRIBE.CommandID - /// contains the Command PROFILE_ID_HOME_AUTOMATION field of the expected callback message - public DoubleByte CommandID; - - /// TI.ZPI1.SYS_CALLBACK_SUBSCRIBE - /// Constructor - public UTIL_CALLBACK_SUBSCRIBE() { - } - - public UTIL_CALLBACK_SUBSCRIBE(DoubleByte num, int subs_action) { - this.CommandID = num; - this.Action = subs_action; - - int[] framedata = new int[3]; - framedata[0] = this.CommandID.getLsb(); - framedata[1] = this.CommandID.getMsb(); - framedata[2] = this.Action; - - super.buildPacket(new DoubleByte(ZToolCMD.UTIL_CALLBACK_SUBSCRIBE), framedata); - } - - public UTIL_CALLBACK_SUBSCRIBE(int[] framedata) { - - this.CommandID = new DoubleByte(framedata[0], framedata[1]); - this.Action = framedata[2]; - - super.buildPacket(new DoubleByte(ZToolCMD.UTIL_CALLBACK_SUBSCRIBE), framedata); - } - - /// TI.ZPI1.SYS_CALLBACK_SUBSCRIBE.SUBS_ACTION - /// Subscribe Action - public class SUBS_ACTION { - /// TI.ZPI1.SYS_CALLBACK_SUBSCRIBE.SUBS_ACTION.SUBSCRIBE - /// Subscribe Action - public static final int SUBSCRIBE = 1; - /// TI.ZPI1.SYS_CALLBACK_SUBSCRIBE.SUBS_ACTION.UNSUBSCRIBE - /// Subscribe Action - public static final int UNSUBSCRIBE = 0; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_CALLBACK_SUBSCRIBE_RESPONSE.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_CALLBACK_SUBSCRIBE_RESPONSE.java deleted file mode 100644 index 75f1da5f42acc..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_CALLBACK_SUBSCRIBE_RESPONSE.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.network.packet.util; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.6.0 - */ -public class UTIL_CALLBACK_SUBSCRIBE_RESPONSE extends ZToolPacket /*implements IRESPONSE;ISYSTEM*/ { - /// TI.ZPI1.SYS_CALLBACK_SUBSCRIBE_RESPONSE.Status - /// indicates SUCCESS or FAILURE - public int Status; - - /// TI.ZPI1.SYS_CALLBACK_SUBSCRIBE_RESPONSE - /// Constructor - public UTIL_CALLBACK_SUBSCRIBE_RESPONSE() { - } - - public UTIL_CALLBACK_SUBSCRIBE_RESPONSE(int cmd_status) { - this.Status = cmd_status; - - int[] framedata = new int[1]; - framedata[0] = this.Status; - - super.buildPacket(new DoubleByte(ZToolCMD.UTIL_CALLBACK_SUBSCRIBE_RESPONSE), framedata); - } - - public UTIL_CALLBACK_SUBSCRIBE_RESPONSE(int[] framedata) { - this.Status = framedata[0]; - super.buildPacket(new DoubleByte(ZToolCMD.UTIL_CALLBACK_SUBSCRIBE_RESPONSE), framedata); - } - - @Override - public String toString() { - return "UTIL_CALLBACK_SUBSCRIBE_RESPONSE{" + - "Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_GET_DEVICE_INFO.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_GET_DEVICE_INFO.java deleted file mode 100644 index f50dcca77731a..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_GET_DEVICE_INFO.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.util; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.6.0 - */ -public class UTIL_GET_DEVICE_INFO extends ZToolPacket /*implements IREQUEST, ISYSTEM*/ { - - public UTIL_GET_DEVICE_INFO() { - super.buildPacket(new DoubleByte(ZToolCMD.UTIL_GET_DEVICE_INFO), new int[0]); - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_GET_DEVICE_INFO_RESPONSE.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_GET_DEVICE_INFO_RESPONSE.java deleted file mode 100644 index a62bf9d48730b..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_GET_DEVICE_INFO_RESPONSE.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.network.packet.util; - -import org.bubblecloud.zigbee.network.packet.*; -import org.bubblecloud.zigbee.util.DoubleByte; - -import java.util.Arrays; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.6.0 - */ -public class UTIL_GET_DEVICE_INFO_RESPONSE extends ZToolPacket /*implements /*IRESPONSE; ISYSTEM*/ { - /// TI.ZPI1.SYS_GET_DEVICE_INFO_RESPONSE.AssocDevicesList - /// Dynamic array; Assoc Devices List - public DoubleByte[] AssocDevicesList; - /// TI.ZPI1.SYS_GET_DEVICE_INFO_RESPONSE.DeviceState - /// Device Type - public int DeviceState; - /// TI.ZPI1.SYS_GET_DEVICE_INFO_RESPONSE.DeviceType - /// Bitmap byte field indicating device type; where bits 0 to 2 indicate the capability for the device to operate as a coordinator; router; or end device; respectively - public int DeviceType; - /// TI.ZPI1.SYS_GET_DEVICE_INFO_RESPONSE.IEEEAddr - /// IEEE Address - public ZToolAddress64 IEEEAddr; - /// TI.ZPI1.SYS_GET_DEVICE_INFO_RESPONSE.NumAssocDevices - /// Number Assoc Devices - public int NumAssocDevices; - /// TI.ZPI1.SYS_GET_DEVICE_INFO_RESPONSE.ShortAddress - /// Short Address - public ZToolAddress16 ShortAddress; - /// TI.ZPI1.SYS_GET_DEVICE_INFO_RESPONSE.Status - /// The fail status is returned if the address value in the command message was not within the valid range. - public int Status; - - /// TI.ZPI1.SYS_GET_DEVICE_INFO_RESPONSE - /// Constructor - public UTIL_GET_DEVICE_INFO_RESPONSE() { - this.AssocDevicesList = new DoubleByte[0xff]; - } - - public UTIL_GET_DEVICE_INFO_RESPONSE(int cmd_status1, ZToolAddress64 num1, ZToolAddress16 num2, int device_type1, int device_state1, int num3, DoubleByte[] numArray1) { - this.Status = cmd_status1; - this.IEEEAddr = num1; - this.ShortAddress = num2; - this.DeviceType = device_type1; - this.DeviceState = device_state1; - this.NumAssocDevices = num3; - this.AssocDevicesList = numArray1; - /*if (numArray1.length > 0xff) - { - throw new Exception("Error creating object."); - } - this.AssocDevicesList = new DoubleByte[0xff]; - Array.Copy(numArray1; this.AssocDevicesList; numArray1.length);*/ - int[] framedata = new int[14 + (numArray1.length * 2)]; - framedata[0] = this.Status; - for (int i = 0; i < 8; i++) { - framedata[i + 1] = this.IEEEAddr.getAddress()[7 - i]; - } - framedata[9] = this.ShortAddress.getLsb(); - framedata[10] = this.ShortAddress.getMsb(); - framedata[11] = this.DeviceType; - framedata[12] = this.DeviceState; - framedata[13] = this.NumAssocDevices; - for (int i = 0; i < numArray1.length; i++) { - framedata[14 + (i * 2)] = numArray1[i].getLsb(); - framedata[14 + (i * 2) + 1] = numArray1[i].getMsb(); - } - - super.buildPacket(new DoubleByte(ZToolCMD.UTIL_GET_DEVICE_INFO_RESPONSE), framedata); - } - - public UTIL_GET_DEVICE_INFO_RESPONSE(int[] framedata) { - - this.Status = framedata[0]; - byte[] bytes = new byte[8]; - for (int i = 0; i < 8; i++) { - bytes[7 - i] = (byte) framedata[i + 1]; - } - this.IEEEAddr = new ZToolAddress64(bytes); - this.ShortAddress = new ZToolAddress16(framedata[9], framedata[10]); - this.DeviceType = framedata[11]; - this.DeviceState = framedata[12]; - this.NumAssocDevices = framedata[13]; - //AssocDevicesList=new DoubleByte[(framedata.length-14)/2];//Actually more than NumAssocDevices - AssocDevicesList = new DoubleByte[this.NumAssocDevices]; - for (int i = 0; i < this.AssocDevicesList.length; i++) { - AssocDevicesList[i] = new DoubleByte(framedata[14 + (i * 2)], framedata[15 + (i * 2)]); - } - - super.buildPacket(new DoubleByte(ZToolCMD.UTIL_GET_DEVICE_INFO_RESPONSE), framedata); - } - - - /// TI.ZPI1.SYS_GET_DEVICE_INFO_RESPONSE.DEVICE_STATE - /// Device state - public class DEVICE_STATE { - /// TI.ZPI1.SYS_GET_DEVICE_INFO_RESPONSE.DEVICE_STATE.DEV_COORD_STARTING - /// Device state - public static final int DEV_COORD_STARTING = 8; - /// TI.ZPI1.SYS_GET_DEVICE_INFO_RESPONSE.DEVICE_STATE.DEV_END_DEVICE - /// Device state - public static final int DEV_END_DEVICE = 6; - /// TI.ZPI1.SYS_GET_DEVICE_INFO_RESPONSE.DEVICE_STATE.DEV_END_DEVICE_UNAUTH - /// Device state - public static final int DEV_END_DEVICE_UNAUTH = 5; - /// TI.ZPI1.SYS_GET_DEVICE_INFO_RESPONSE.DEVICE_STATE.DEV_HOLD - /// Device state - public static final int DEV_HOLD = 0; - /// TI.ZPI1.SYS_GET_DEVICE_INFO_RESPONSE.DEVICE_STATE.DEV_INIT - /// Device state - public static final int DEV_INIT = 1; - /// TI.ZPI1.SYS_GET_DEVICE_INFO_RESPONSE.DEVICE_STATE.DEV_NWK_DISC - /// Device state - public static final int DEV_NWK_DISC = 2; - /// TI.ZPI1.SYS_GET_DEVICE_INFO_RESPONSE.DEVICE_STATE.DEV_NWK_JOINING - /// Device state - public static final int DEV_NWK_JOINING = 3; - /// TI.ZPI1.SYS_GET_DEVICE_INFO_RESPONSE.DEVICE_STATE.DEV_NWK_ORPHAN - /// Device state - public static final int DEV_NWK_ORPHAN = 10; - /// TI.ZPI1.SYS_GET_DEVICE_INFO_RESPONSE.DEVICE_STATE.DEV_NWK_REJOIN - /// Device state - public static final int DEV_NWK_REJOIN = 4; - /// TI.ZPI1.SYS_GET_DEVICE_INFO_RESPONSE.DEVICE_STATE.DEV_ROUTER - /// Device state - public static final int DEV_ROUTER = 7; - /// TI.ZPI1.SYS_GET_DEVICE_INFO_RESPONSE.DEVICE_STATE.DEV_ZB_COORD - /// Device state - public static final int DEV_ZB_COORD = 9; - } - - /// TI.ZPI1.SYS_GET_DEVICE_INFO_RESPONSE.DEVICE_TYPE - /// Device type bitfield - public class DEVICE_TYPE { - /// TI.ZPI1.SYS_GET_DEVICE_INFO_RESPONSE.DEVICE_TYPE.COORDINATOR - /// Device type bitfield - public static final int COORDINATOR = 1; - /// TI.ZPI1.SYS_GET_DEVICE_INFO_RESPONSE.DEVICE_TYPE.END_DEVICE - /// Device type bitfield - public static final int END_DEVICE = 4; - /// TI.ZPI1.SYS_GET_DEVICE_INFO_RESPONSE.DEVICE_TYPE.NONE - /// Device type bitfield - public static final int NONE = 0; - /// TI.ZPI1.SYS_GET_DEVICE_INFO_RESPONSE.DEVICE_TYPE.ROUTER - /// Device type bitfield - public static final int ROUTER = 2; - } - - @Override - public String toString() { - return "UTIL_GET_DEVICE_INFO_RESPONSE{" + - "AssocDevicesList=" + Arrays.toString(AssocDevicesList) + - ", DeviceState=" + DeviceState + - ", DeviceType=" + DeviceType + - ", IEEEAddr=" + IEEEAddr + - ", NumAssocDevices=" + NumAssocDevices + - ", ShortAddress=" + ShortAddress + - ", Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_GET_NV_INFO.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_GET_NV_INFO.java deleted file mode 100644 index 0dd79ec89098e..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_GET_NV_INFO.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.util; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.6.0 - */ -public class UTIL_GET_NV_INFO extends ZToolPacket/* implements IREQUEST, ISYSTEM*/ { - public UTIL_GET_NV_INFO() { - - super.buildPacket(new DoubleByte(ZToolCMD.UTIL_GET_NV_INFO), new int[0]); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_GET_NV_INFO_RESPONSE.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_GET_NV_INFO_RESPONSE.java deleted file mode 100644 index 8b2702da9a672..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_GET_NV_INFO_RESPONSE.java +++ /dev/null @@ -1,195 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.network.packet.util; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolAddress64; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.ByteUtils; -import org.bubblecloud.zigbee.util.DoubleByte; - -import java.util.Arrays; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.6.0 - */ -public class UTIL_GET_NV_INFO_RESPONSE extends ZToolPacket /*implements IREQUEST, ISYSTEM*/ { - /// TI.ZPI1.SYS_GET_NV_INFO_RESPONSE.IEEEAddress - /// IEEE Address - public ZToolAddress64 IEEEAddress; - /// TI.ZPI1.SYS_GET_NV_INFO_RESPONSE.PanID - /// Pan PROFILE_ID_HOME_AUTOMATION - public int PanID; - /// TI.ZPI1.SYS_GET_NV_INFO_RESPONSE.PreConfigKey - /// PreConfigKey - public int[] PreConfigKey; - /// TI.ZPI1.SYS_GET_NV_INFO_RESPONSE.ScanChannels - /// Scan Channels - public int ScanChannels; - /// TI.ZPI1.SYS_GET_NV_INFO_RESPONSE.SecurityMode - /// This specifies the network messaging security mode, zero disables security - public int SecurityMode; - /// TI.ZPI1.SYS_GET_NV_INFO_RESPONSE.Status - /// Status - public int Status; - - /// TI.ZPI1.SYS_GET_NV_INFO_RESPONSE - /// Constructor - public UTIL_GET_NV_INFO_RESPONSE() { - this.PreConfigKey = new int[0x10]; - } - - public UTIL_GET_NV_INFO_RESPONSE(int cmd_status1, ZToolAddress64 num1, int zigbee_channels1, int num2, int num3, int[] buffer1) { - this.Status = cmd_status1; - this.IEEEAddress = num1; - this.ScanChannels = zigbee_channels1; - this.PanID = num2; - this.SecurityMode = num3; - this.PreConfigKey = new int[buffer1.length]; - this.PreConfigKey = buffer1; - /*if (buffer1.length > 0x10) { - throw new Exception("Error creating object."); - } - this.PreConfigKey = new byte[0x10]; - Array.Copy(buffer1, this.PreConfigKey, buffer1.Length);*/ - int[] framedata = new int[15 + buffer1.length]; - framedata[0] = this.Status; - for (int i = 0; i < 8; i++) { - framedata[i + 1] = this.IEEEAddress.getAddress()[7 - i]; - } - int[] bytes = new int[4]; - bytes = ByteUtils.convertLongtoMultiByte(this.ScanChannels);////////////WARNING! - framedata[9] = bytes[3]; - framedata[10] = bytes[2]; - framedata[11] = bytes[1]; - framedata[12] = bytes[0]; - framedata[13] = this.PanID; - framedata[14] = this.SecurityMode; - - for (int i = 0; i < buffer1.length; i++) { - framedata[i + 15] = buffer1[(buffer1.length - 1) - i]; - } - - super.buildPacket(new DoubleByte(ZToolCMD.UTIL_GET_NV_INFO_RESPONSE), framedata); - } - - public UTIL_GET_NV_INFO_RESPONSE(int[] framedata) { - - this.Status = framedata[0]; - byte[] bytes = new byte[8]; - for (int i = 0; i < 8; i++) { - bytes[7 - i] = (byte) framedata[i + 1]; - } - this.IEEEAddress = new ZToolAddress64(bytes); - int[] bytes2 = new int[4]; - - bytes2[3] = framedata[9]; - bytes2[2] = framedata[10]; - bytes2[1] = framedata[11]; - bytes2[0] = framedata[12]; - this.ScanChannels = ByteUtils.convertMultiByteToInt(bytes2);////////////WARNING! - this.PanID = framedata[13]; - this.SecurityMode = framedata[14]; - - this.PreConfigKey = new int[0x10]; - for (int i = 0; i < this.PreConfigKey.length; i++) { - this.PreConfigKey[(this.PreConfigKey.length - 1) - i] = framedata[i + 15]; - } - - super.buildPacket(new DoubleByte(ZToolCMD.UTIL_GET_NV_INFO_RESPONSE), framedata); - } - - /// TI.ZPI1.SYS_GET_NV_INFO_RESPONSE.ZIGBEE_CHANNELS - /// Channels bitfield - public class ZIGBEE_CHANNELS { - /// TI.ZPI1.SYS_GET_NV_INFO_RESPONSE.ZIGBEE_CHANNELS.ALL_CHANNELS - /// Channels bitfield - public static final int ALL_CHANNELS = 0x7fff800; - /// TI.ZPI1.SYS_GET_NV_INFO_RESPONSE.ZIGBEE_CHANNELS.CHNL_0x00000800 - /// Channels bitfield - public static final int CHNL_0x00000800 = 0x800; - /// TI.ZPI1.SYS_GET_NV_INFO_RESPONSE.ZIGBEE_CHANNELS.CHNL_0x00001000 - /// Channels bitfield - public static final int CHNL_0x00001000 = 0x1000; - /// TI.ZPI1.SYS_GET_NV_INFO_RESPONSE.ZIGBEE_CHANNELS.CHNL_0x00002000 - /// Channels bitfield - public static final int CHNL_0x00002000 = 0x2000; - /// TI.ZPI1.SYS_GET_NV_INFO_RESPONSE.ZIGBEE_CHANNELS.CHNL_0x00004000 - /// Channels bitfield - public static final int CHNL_0x00004000 = 0x4000; - /// TI.ZPI1.SYS_GET_NV_INFO_RESPONSE.ZIGBEE_CHANNELS.CHNL_0x00008000 - /// Channels bitfield - public static final int CHNL_0x00008000 = 0x8000; - /// TI.ZPI1.SYS_GET_NV_INFO_RESPONSE.ZIGBEE_CHANNELS.CHNL_0x00010000 - /// Channels bitfield - public static final int CHNL_0x00010000 = 0x10000; - /// TI.ZPI1.SYS_GET_NV_INFO_RESPONSE.ZIGBEE_CHANNELS.CHNL_0x00020000 - /// Channels bitfield - public static final int CHNL_0x00020000 = 0x20000; - /// TI.ZPI1.SYS_GET_NV_INFO_RESPONSE.ZIGBEE_CHANNELS.CHNL_0x00040000 - /// Channels bitfield - public static final int CHNL_0x00040000 = 0x40000; - /// TI.ZPI1.SYS_GET_NV_INFO_RESPONSE.ZIGBEE_CHANNELS.CHNL_0x00080000 - /// Channels bitfield - public static final int CHNL_0x00080000 = 0x80000; - /// TI.ZPI1.SYS_GET_NV_INFO_RESPONSE.ZIGBEE_CHANNELS.CHNL_0x00100000 - /// Channels bitfield - public static final int CHNL_0x00100000 = 0x100000; - /// TI.ZPI1.SYS_GET_NV_INFO_RESPONSE.ZIGBEE_CHANNELS.CHNL_0x00200000 - /// Channels bitfield - public static final int CHNL_0x00200000 = 0x200000; - /// TI.ZPI1.SYS_GET_NV_INFO_RESPONSE.ZIGBEE_CHANNELS.CHNL_0x00400000 - /// Channels bitfield - public static final int CHNL_0x00400000 = 0x400000; - /// TI.ZPI1.SYS_GET_NV_INFO_RESPONSE.ZIGBEE_CHANNELS.CHNL_0x00800000 - /// Channels bitfield - public static final int CHNL_0x00800000 = 0x800000; - /// TI.ZPI1.SYS_GET_NV_INFO_RESPONSE.ZIGBEE_CHANNELS.CHNL_0x01000000 - /// Channels bitfield - public static final int CHNL_0x01000000 = 0x1000000; - /// TI.ZPI1.SYS_GET_NV_INFO_RESPONSE.ZIGBEE_CHANNELS.CHNL_0x02000000 - /// Channels bitfield - public static final int CHNL_0x02000000 = 0x2000000; - /// TI.ZPI1.SYS_GET_NV_INFO_RESPONSE.ZIGBEE_CHANNELS.CHNL_0x04000000 - /// Channels bitfield - public static final int CHNL_0x04000000 = 0x4000000; - /// TI.ZPI1.SYS_GET_NV_INFO_RESPONSE.ZIGBEE_CHANNELS.NONE - /// Channels bitfield - public static final int NONE = 0; - } - - @Override - public String toString() { - return "UTIL_GET_NV_INFO_RESPONSE{" + - "IEEEAddress=" + IEEEAddress + - ", PanID=" + PanID + - ", PreConfigKey=" + Arrays.toString(PreConfigKey) + - ", ScanChannels=" + ScanChannels + - ", SecurityMode=" + SecurityMode + - ", Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_SET_CHANNELS.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_SET_CHANNELS.java deleted file mode 100644 index 2a4e1f1f1a4c8..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_SET_CHANNELS.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.network.packet.util; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.ByteUtils; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.6.0 - */ -public class UTIL_SET_CHANNELS extends ZToolPacket/* implements IREQUEST,ISYSTEM*/ { - /// TI.ZPI1.SYS_SET_CHANNELS.Channels - /// Channels. - public int Channels; - - /// TI.ZPI1.SYS_SET_CHANNELS - /// Constructor - public UTIL_SET_CHANNELS() { - } - - public UTIL_SET_CHANNELS(int zigbee_channels1) { - this.Channels = zigbee_channels1; - - int[] framedata = new int[]{0, 0, 0, 0}; - int[] bytes = ByteUtils.convertLongtoMultiByte(this.Channels);////////////WARNING! - int j = 0; - for (int i = bytes.length - 1; i >= 0; i--) { - framedata[j] = bytes[i]; - j++; - } - super.buildPacket(new DoubleByte(ZToolCMD.UTIL_SET_CHANNELS), framedata); - } - - public UTIL_SET_CHANNELS(int[] framedata) { - - int[] bytes = new int[4]; - bytes[3] = framedata[0]; - bytes[2] = framedata[1]; - bytes[1] = framedata[2]; - bytes[0] = framedata[3]; - this.Channels = ByteUtils.convertMultiByteToInt(bytes);////////////WARNING! - super.buildPacket(new DoubleByte(ZToolCMD.UTIL_SET_CHANNELS), framedata); - } - - /// TI.ZPI1.SYS_SET_CHANNELS.ZIGBEE_CHANNELS - /// Channels bitfield - public class ZIGBEE_CHANNELS { - /// TI.ZPI1.SYS_SET_CHANNELS.ZIGBEE_CHANNELS.ALL_CHANNELS - /// Channels bitfield - public static final int ALL_CHANNELS = 0x7fff800; - /// TI.ZPI1.SYS_SET_CHANNELS.ZIGBEE_CHANNELS.CHNL_0x00000800 - /// Channels bitfield - public static final int CHNL_0x00000800 = 0x800; - /// TI.ZPI1.SYS_SET_CHANNELS.ZIGBEE_CHANNELS.CHNL_0x00001000 - /// Channels bitfield - public static final int CHNL_0x00001000 = 0x1000; - /// TI.ZPI1.SYS_SET_CHANNELS.ZIGBEE_CHANNELS.CHNL_0x00002000 - /// Channels bitfield - public static final int CHNL_0x00002000 = 0x2000; - /// TI.ZPI1.SYS_SET_CHANNELS.ZIGBEE_CHANNELS.CHNL_0x00004000 - /// Channels bitfield - public static final int CHNL_0x00004000 = 0x4000; - /// TI.ZPI1.SYS_SET_CHANNELS.ZIGBEE_CHANNELS.CHNL_0x00008000 - /// Channels bitfield - public static final int CHNL_0x00008000 = 0x8000; - /// TI.ZPI1.SYS_SET_CHANNELS.ZIGBEE_CHANNELS.CHNL_0x00010000 - /// Channels bitfield - public static final int CHNL_0x00010000 = 0x10000; - /// TI.ZPI1.SYS_SET_CHANNELS.ZIGBEE_CHANNELS.CHNL_0x00020000 - /// Channels bitfield - public static final int CHNL_0x00020000 = 0x20000; - /// TI.ZPI1.SYS_SET_CHANNELS.ZIGBEE_CHANNELS.CHNL_0x00040000 - /// Channels bitfield - public static final int CHNL_0x00040000 = 0x40000; - /// TI.ZPI1.SYS_SET_CHANNELS.ZIGBEE_CHANNELS.CHNL_0x00080000 - /// Channels bitfield - public static final int CHNL_0x00080000 = 0x80000; - /// TI.ZPI1.SYS_SET_CHANNELS.ZIGBEE_CHANNELS.CHNL_0x00100000 - /// Channels bitfield - public static final int CHNL_0x00100000 = 0x100000; - /// TI.ZPI1.SYS_SET_CHANNELS.ZIGBEE_CHANNELS.CHNL_0x00200000 - /// Channels bitfield - public static final int CHNL_0x00200000 = 0x200000; - /// TI.ZPI1.SYS_SET_CHANNELS.ZIGBEE_CHANNELS.CHNL_0x00400000 - /// Channels bitfield - public static final int CHNL_0x00400000 = 0x400000; - /// TI.ZPI1.SYS_SET_CHANNELS.ZIGBEE_CHANNELS.CHNL_0x00800000 - /// Channels bitfield - public static final int CHNL_0x00800000 = 0x800000; - /// TI.ZPI1.SYS_SET_CHANNELS.ZIGBEE_CHANNELS.CHNL_0x01000000 - /// Channels bitfield - public static final int CHNL_0x01000000 = 0x1000000; - /// TI.ZPI1.SYS_SET_CHANNELS.ZIGBEE_CHANNELS.CHNL_0x02000000 - /// Channels bitfield - public static final int CHNL_0x02000000 = 0x2000000; - /// TI.ZPI1.SYS_SET_CHANNELS.ZIGBEE_CHANNELS.CHNL_0x04000000 - /// Channels bitfield - public static final int CHNL_0x04000000 = 0x4000000; - /// TI.ZPI1.SYS_SET_CHANNELS.ZIGBEE_CHANNELS.NONE - /// Channels bitfield - public static final int NONE = 0; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_SET_CHANNELS_RESPONSE.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_SET_CHANNELS_RESPONSE.java deleted file mode 100644 index b8478747d2b55..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_SET_CHANNELS_RESPONSE.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.network.packet.util; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.6.0 - */ -public class UTIL_SET_CHANNELS_RESPONSE extends ZToolPacket /*implements IRESPONSE,ISYSTEM*/ { - /// TI.ZPI1.SYS_SET_CHANNELS_RESPONSE.Status - /// Status - public int Status; - - /// TI.ZPI1.SYS_SET_CHANNELS_RESPONSE - /// Constructor - public UTIL_SET_CHANNELS_RESPONSE() { - } - - public UTIL_SET_CHANNELS_RESPONSE(int cmd_status1) { - this.Status = cmd_status1; - - int[] framedata = new int[1]; - framedata[0] = this.Status; - - super.buildPacket(new DoubleByte(ZToolCMD.UTIL_SET_CHANNELS_RESPONSE), framedata); - } - - public UTIL_SET_CHANNELS_RESPONSE(int[] framedata) { - this.Status = framedata[0]; - - super.buildPacket(new DoubleByte(ZToolCMD.UTIL_SET_CHANNELS_RESPONSE), framedata); - } - - @Override - public String toString() { - return "UTIL_SET_CHANNELS_RESPONSE{" + - "Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_SET_PANID.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_SET_PANID.java deleted file mode 100644 index d857311952652..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_SET_PANID.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.network.packet.util; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.6.0 - */ -public class UTIL_SET_PANID extends ZToolPacket/* implements IREQUEST,ISYSTEM*/ { - /// TI.ZPI1.SYS_SET_PANID.PanID - /// PanID. - public DoubleByte PanID; - - /// TI.ZPI1.SYS_SET_PANID - /// Constructor - public UTIL_SET_PANID() { - } - - /// TI.ZPI1.SYS_SET_PANID - /// Constructor - public UTIL_SET_PANID(DoubleByte num1) { - this.PanID = num1; - - int[] framedata = new int[1]; - framedata[0] = this.PanID.getMsb(); - framedata[1] = this.PanID.getLsb(); - - super.buildPacket(new DoubleByte(ZToolCMD.UTIL_SET_PANID), framedata); - } - - public UTIL_SET_PANID(int[] framedata) { - this.PanID = new DoubleByte(framedata[1], framedata[0]); - - super.buildPacket(new DoubleByte(ZToolCMD.UTIL_SET_PANID), framedata); - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_SET_PANID_RESPONSE.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_SET_PANID_RESPONSE.java deleted file mode 100644 index c828d3f9bbf95..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_SET_PANID_RESPONSE.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.network.packet.util; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.6.0 - */ -public class UTIL_SET_PANID_RESPONSE extends ZToolPacket/* implements IRESPONSE,ISYSTEM*/ { - /// TI.ZPI1.SYS_SET_PANID_RESPONSE.Status - /// Status - public int Status; - - /// TI.ZPI1.SYS_SET_PANID_RESPONSE - /// Constructor - public UTIL_SET_PANID_RESPONSE() { - } - - public UTIL_SET_PANID_RESPONSE(int cmd_status1) { - this.Status = cmd_status1; - - int[] framedata = new int[1]; - framedata[0] = this.Status; - - super.buildPacket(new DoubleByte(ZToolCMD.UTIL_SET_PANID_RESPONSE), framedata); - } - - public UTIL_SET_PANID_RESPONSE(int[] framedata) { - this.Status = framedata[0]; - - super.buildPacket(new DoubleByte(ZToolCMD.UTIL_SET_PANID_RESPONSE), framedata); - } - - @Override - public String toString() { - return "UTIL_SET_PANID_RESPONSE{" + - "Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_SET_PRECONFIG_KEY.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_SET_PRECONFIG_KEY.java deleted file mode 100644 index fce8cc85126d5..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_SET_PRECONFIG_KEY.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.network.packet.util; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.6.0 - */ -public class UTIL_SET_PRECONFIG_KEY extends ZToolPacket /*implements IREQUEST,ISYSTEM*/ { - /// TI.ZPI1.SYS_SET_PRECONFIG_KEY.PreConfigKey - /// PreConfigKey. - public int[] PreConfigKey; - - /// TI.ZPI1.SYS_SET_PRECONFIG_KEY - /// Constructor - public UTIL_SET_PRECONFIG_KEY() { - this.PreConfigKey = new int[0x10]; - } - - /// TI.ZPI1.SYS_SET_PRECONFIG_KEY - /// Constructor - public UTIL_SET_PRECONFIG_KEY(int[] buffer1) { - this.PreConfigKey = new int[0x10]; - this.PreConfigKey = buffer1; - /*if (buffer1.Length > 0x10) - { - throw new Exception("Error creating object."); - } - this.PreConfigKey = new byte[0x10]; - Array.Copy(buffer1, this.PreConfigKey, buffer1.Length);*/ - - int[] framedata = new int[buffer1.length]; - - for (int i = 0; i < buffer1.length; i++) { - framedata[i] = buffer1[(buffer1.length - 1) - i]; - } - - super.buildPacket(new DoubleByte(ZToolCMD.UTIL_SET_PRECONFIG_KEY), framedata); - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_SET_PRECONFIG_KEY_RESPONSE.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_SET_PRECONFIG_KEY_RESPONSE.java deleted file mode 100644 index cae9e17be4c94..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_SET_PRECONFIG_KEY_RESPONSE.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.network.packet.util; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.6.0 - */ -public class UTIL_SET_PRECONFIG_KEY_RESPONSE extends ZToolPacket /*implements IRESPONSE,ISYSTEM*/ { - /// TI.ZPI1.SYS_SET_PRECONFIG_KEY_RESPONSE.Status - /// Status - public int Status; - - /// TI.ZPI1.SYS_SET_PRECONFIG_KEY_RESPONSE - /// Constructor - public UTIL_SET_PRECONFIG_KEY_RESPONSE() { - } - - public UTIL_SET_PRECONFIG_KEY_RESPONSE(int cmd_status1) { - this.Status = cmd_status1; - - int[] framedata = new int[1]; - framedata[0] = this.Status; - - super.buildPacket(new DoubleByte(ZToolCMD.UTIL_SET_PRECONFIG_KEY_RESPONSE), framedata); - } - - public UTIL_SET_PRECONFIG_KEY_RESPONSE(int[] framedata) { - this.Status = framedata[0]; - - super.buildPacket(new DoubleByte(ZToolCMD.UTIL_SET_PRECONFIG_KEY_RESPONSE), framedata); - } - - @Override - public String toString() { - return "UTIL_SET_PRECONFIG_KEY_RESPONSE{" + - "Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_SET_SECURITY_LEVEL.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_SET_SECURITY_LEVEL.java deleted file mode 100644 index 3d87173494326..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_SET_SECURITY_LEVEL.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.network.packet.util; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.6.0 - */ -public class UTIL_SET_SECURITY_LEVEL extends ZToolPacket /*implements IREQUEST,ISYSTEM*/ { - /// TI.ZPI1.SYS_SET_SECURITY_LEVEL.SecurityLevel - /// Security Level. - public int SecurityLevel; - - /// TI.ZPI1.SYS_SET_SECURITY_LEVEL - /// Constructor - public UTIL_SET_SECURITY_LEVEL() { - } - - /// TI.ZPI1.SYS_SET_SECURITY_LEVEL - /// Constructor - public UTIL_SET_SECURITY_LEVEL(int num1) { - this.SecurityLevel = num1; - - int[] framedata = new int[1]; - framedata[0] = this.SecurityLevel; - - super.buildPacket(new DoubleByte(ZToolCMD.UTIL_SET_SECURITY_LEVEL), framedata); - } - - public UTIL_SET_SECURITY_LEVEL(int[] framedata) { - this.SecurityLevel = framedata[0]; - - super.buildPacket(new DoubleByte(ZToolCMD.UTIL_SET_SECURITY_LEVEL), framedata); - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_SET_SECURITY_LEVEL_RESPONSE.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_SET_SECURITY_LEVEL_RESPONSE.java deleted file mode 100644 index 42de383ab105a..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/util/UTIL_SET_SECURITY_LEVEL_RESPONSE.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.network.packet.util; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.6.0 - */ -public class UTIL_SET_SECURITY_LEVEL_RESPONSE extends ZToolPacket /*implements IRESPONSE,ISYSTEM*/ { - /// TI.ZPI1.SYS_SET_SECURITY_LEVEL_RESPONSE.Status - /// Status - public int Status; - - /// TI.ZPI1.SYS_SET_SECURITY_LEVEL_RESPONSE - /// Constructor - public UTIL_SET_SECURITY_LEVEL_RESPONSE() { - } - - public UTIL_SET_SECURITY_LEVEL_RESPONSE(int cmd_status1) { - this.Status = cmd_status1; - - int[] framedata = new int[1]; - framedata[0] = this.Status; - - super.buildPacket(new DoubleByte(ZToolCMD.UTIL_SET_SECURITY_LEVEL_RESPONSE), framedata); - } - - public UTIL_SET_SECURITY_LEVEL_RESPONSE(int[] framedata) { - this.Status = framedata[0]; - - super.buildPacket(new DoubleByte(ZToolCMD.UTIL_SET_SECURITY_LEVEL_RESPONSE), framedata); - } - - @Override - public String toString() { - return "UTIL_SET_SECURITY_LEVEL_RESPONSE{" + - "Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_ACTIVE_EP_REQ.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_ACTIVE_EP_REQ.java deleted file mode 100644 index 582ebe734c745..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_ACTIVE_EP_REQ.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; -import org.bubblecloud.zigbee.util.Integers; - -/** - * @author Stefano "Kismet" Lenzi - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_ACTIVE_EP_REQ extends ZToolPacket /*implements IREQUEST,IZDO*/ { - /// TI.ZPI1.ZDO_ACTIVE_EP_REQ.DstAddr - /// destination address - - /// TI.ZPI1.ZDO_ACTIVE_EP_REQ.NWKAddrOfInterest - /// NWK address for the request - - /// TI.ZPI1.ZDO_ACTIVE_EP_REQ - /// Constructor - public ZDO_ACTIVE_EP_REQ() { - } - - public ZDO_ACTIVE_EP_REQ(ZToolAddress16 dstAddr, ZToolAddress16 nwkAddrOfInterest) { - int[] framedata = new int[4]; - framedata[0] = dstAddr.getLsb(); - framedata[1] = dstAddr.getMsb(); - framedata[2] = nwkAddrOfInterest.getLsb(); - framedata[3] = nwkAddrOfInterest.getMsb(); - - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_ACTIVE_EP_REQ), framedata); - } - - public ZDO_ACTIVE_EP_REQ(short nwkAddress) { - int[] framedata = new int[4]; - - framedata[0] = Integers.getByteAsInteger(nwkAddress, 0); - framedata[1] = Integers.getByteAsInteger(nwkAddress, 1); - framedata[2] = framedata[0]; - framedata[3] = framedata[1]; - - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_ACTIVE_EP_REQ), framedata); - } - - public ZDO_ACTIVE_EP_REQ(int nwkAddress) { - int[] framedata = new int[4]; - - framedata[0] = Integers.getByteAsInteger((short) nwkAddress, 0); - framedata[1] = Integers.getByteAsInteger((short) nwkAddress, 1); - framedata[2] = framedata[0]; - framedata[3] = framedata[1]; - - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_ACTIVE_EP_REQ), framedata); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_ACTIVE_EP_REQ_SRSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_ACTIVE_EP_REQ_SRSP.java deleted file mode 100644 index e51d89071ead0..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_ACTIVE_EP_REQ_SRSP.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_ACTIVE_EP_REQ_SRSP extends ZToolPacket /*implements IRESPONSE,IZDO*/ { - /// TI.ZPI1.ZDO_ACTIVE_EP_REQ_SRSP.Status - /// Status - public int Status; - - /// TI.ZPI1.ZDO_ACTIVE_EP_REQ_SRSP - /// Constructor - public ZDO_ACTIVE_EP_REQ_SRSP() { - } - - public ZDO_ACTIVE_EP_REQ_SRSP(int[] framedata) { - this.Status = framedata[0]; - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_ACTIVE_EP_REQ_SRSP), framedata); - } - - @Override - public String toString() { - return "ZDO_ACTIVE_EP_REQ_SRSP{" + - "Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_ACTIVE_EP_RSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_ACTIVE_EP_RSP.java deleted file mode 100644 index 3ae20f04d7699..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_ACTIVE_EP_RSP.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -import java.util.Arrays; - -/** - * @author Stefano "Kismet" Lenzi - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class ZDO_ACTIVE_EP_RSP extends ZToolPacket /*implements IRESPONSE_CALLBACK,IZDO*/ { - /// TI.ZPI1.ZDO_ACTIVE_EP_RSP.ActiveEndpointCount - /// Number of active endpoint in the list - public int ActiveEndpointCount; - /// TI.ZPI1.ZDO_ACTIVE_EP_RSP.ActiveEndpointList - /// Array of active endpoints on this device - public int[] ActiveEndpointList; - /// TI.ZPI1.ZDO_ACTIVE_EP_RSP.NWKAddrOfInterest - /// Device's short address that this response describes. - public ZToolAddress16 nwkAddr; - /// TI.ZPI1.ZDO_ACTIVE_EP_RSP.SrcAddress - /// the message's source network address - public ZToolAddress16 SrcAddress; - /// TI.ZPI1.ZDO_ACTIVE_EP_RSP.Status - /// this field indicates either SUCCESS or FAILURE - public int Status; - private short[] list; - - /// TI.ZPI1.ZDO_ACTIVE_EP_RSP - /// Constructor - public ZDO_ACTIVE_EP_RSP() { - this.ActiveEndpointList = new int[0xff]; - } - - public ZDO_ACTIVE_EP_RSP(int[] framedata) { - this.SrcAddress = new ZToolAddress16(framedata[1], framedata[0]); - this.Status = framedata[2]; - this.nwkAddr = new ZToolAddress16(framedata[4], framedata[3]); - - this.ActiveEndpointCount = framedata[5]; - this.ActiveEndpointList = new int[this.ActiveEndpointCount]; - for (int i = 0; i < this.ActiveEndpointList.length; i++) { - this.ActiveEndpointList[i] = framedata[i + 6]; - } - - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_ACTIVE_EP_RSP), framedata); - } - - - public short[] getActiveEndPointList() { - if (list == null) { - list = new short[super.packet[ZToolPacket.PAYLOAD_START_INDEX + 5]]; - for (int i = 0; i < list.length; i++) { - list[i] = (short) super.packet[ZToolPacket.PAYLOAD_START_INDEX + 6 + i]; - } - } - return list; - } - - @Override - public String toString() { - return "ZDO_ACTIVE_EP_RSP{" + - "ActiveEndpointCount=" + ActiveEndpointCount + - ", ActiveEndpointList=" + Arrays.toString(ActiveEndpointList) + - ", nwkAddr=" + nwkAddr + - ", SrcAddress=" + SrcAddress + - ", Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_BIND_REQ.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_BIND_REQ.java deleted file mode 100644 index 3da78ee8983c7..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_BIND_REQ.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.ZToolAddress64; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; -import org.bubblecloud.zigbee.util.Integers; - -/** - * @author Stefano "Kismet" Lenzi - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_BIND_REQ extends ZToolPacket /*implements IREQUEST,IZDO*/ { - - public ZDO_BIND_REQ(ZToolAddress16 nwkDst, - ZToolAddress64 ieeeSrc, int epSrc, - DoubleByte cluster, int addressingMode, - ZToolAddress64 ieeeDst, int epDst) { - - int[] framedata; - if (addressingMode == 3) { - framedata = new int[23]; - } else { - framedata = new int[16]; - } - framedata[0] = nwkDst.getLsb(); - framedata[1] = nwkDst.getMsb(); - byte[] bytes = ieeeSrc.getAddress(); - for (int i = 0; i < 8; i++) { - framedata[i + 2] = bytes[7 - i] & 0xFF; - } - framedata[10] = epSrc; - framedata[11] = cluster.getLsb(); - framedata[12] = cluster.getMsb(); - framedata[13] = addressingMode; - bytes = ieeeDst.getAddress(); - if (addressingMode == 3) { - for (int i = 0; i < 8; i++) { - framedata[i + 14] = bytes[7 - i] & 0xFF; - } - framedata[22] = epDst; - } else { - framedata[14] = bytes[7]; - framedata[15] = bytes[6]; - } - - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_BIND_REQ), framedata); - } - - public ZDO_BIND_REQ( - short nwkDstAdr, short clusterId, - long bindSrcAdr, byte bindSrcEP, - short bindDstAdr, byte bindDstEP - ) { - int[] framedata = new int[17]; - framedata[0] = Integers.getByteAsInteger(nwkDstAdr, 0); - framedata[1] = Integers.getByteAsInteger(nwkDstAdr, 1); - for (int i = 0; i < 8; i++) { - framedata[i + 2] = Integers.getByteAsInteger(bindSrcAdr, i); - } - framedata[10] = bindSrcEP & 0xFF; - framedata[11] = Integers.getByteAsInteger(clusterId, 0); - framedata[12] = Integers.getByteAsInteger(clusterId, 1); - framedata[13] = ADDRESS_MODE.ADDRESS_16_BIT; - framedata[14] = Integers.getByteAsInteger(bindDstAdr, 0); - framedata[15] = Integers.getByteAsInteger(bindDstAdr, 1); - framedata[16] = bindDstEP & 0xFF; //TODO REMOVE?!??! - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_BIND_REQ), framedata); - } - - public ZDO_BIND_REQ( - short nwkDstAdr, short clusterId, - long bindSrcAdr, byte bindSrcEP, - long bindDstAdr, byte bindDstEP - ) { - int[] framedata = new int[23]; - framedata[0] = Integers.getByteAsInteger(nwkDstAdr, 0); - framedata[1] = Integers.getByteAsInteger(nwkDstAdr, 1); - for (int i = 0; i < 8; i++) { - framedata[i + 2] = Integers.getByteAsInteger(bindSrcAdr, i); - } - framedata[10] = bindSrcEP & 0xFF; - framedata[11] = Integers.getByteAsInteger(clusterId, 0); - framedata[12] = Integers.getByteAsInteger(clusterId, 1); - framedata[13] = ADDRESS_MODE.ADDRESS_64_BIT; - for (int i = 0; i < 8; i++) { - framedata[i + 14] = Integers.getByteAsInteger(bindDstAdr, i); - } - framedata[22] = bindDstEP & 0xFF; - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_BIND_REQ), framedata); - } - - - /// TI.ZPI1.ZDO_BIND_REQ.ADDRESS_MODE - /// Specified the format of the coordinator address - public class ADDRESS_MODE { - /// TI.ZPI1.ZDO_BIND_REQ.ADDRESS_MODE.ADDRESS_16_BIT - /// Specified the format of the coordinator address - public static final int ADDRESS_16_BIT = 2; - /// TI.ZPI1.ZDO_BIND_REQ.ADDRESS_MODE.ADDRESS_64_BIT - /// Specified the format of the coordinator address - public static final int ADDRESS_64_BIT = 3; - /// TI.ZPI1.ZDO_BIND_REQ.ADDRESS_MODE.ADDRESS_NOT_PRESENT - /// Specified the format of the coordinator address - public static final int ADDRESS_NOT_PRESENT = 0; - /// TI.ZPI1.ZDO_BIND_REQ.ADDRESS_MODE.BROADCAST - /// Specified the format of the coordinator address - public static final int BROADCAST = 15; - /// TI.ZPI1.ZDO_BIND_REQ.ADDRESS_MODE.GROUP_ADDRESS - /// Specified the format of the coordinator address - public static final int GROUP_ADDRESS = 1; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_BIND_REQ_SRSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_BIND_REQ_SRSP.java deleted file mode 100644 index 113ad7092ccd6..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_BIND_REQ_SRSP.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_BIND_REQ_SRSP extends ZToolPacket /*implements IREPONSE,IZDO*/ { - /// TI.ZPI1.ZDO_BIND_REQ_SRSP.Status - /// Status - public int Status; - - /// TI.ZPI1.ZDO_BIND_REQ_SRSP - /// Constructor - public ZDO_BIND_REQ_SRSP() { - } - - public ZDO_BIND_REQ_SRSP(int[] framedata) { - this.Status = framedata[0]; - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_BIND_REQ_SRSP), framedata); - } - - @Override - public String toString() { - return "ZDO_BIND_REQ_SRSP{" + - "Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_BIND_RSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_BIND_RSP.java deleted file mode 100644 index 7930e0c5696a7..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_BIND_RSP.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_BIND_RSP extends ZToolPacket /*implements IRESPONSE_CALLBACK,IZDO*/ { - /// TI.ZPI1.ZDO_BIND_RSP.SrcAddress - /// the message's source network address - public ZToolAddress16 SrcAddress; - /// TI.ZPI1.ZDO_BIND_RSP.Status - /// this field indicates status of the bind request - public int Status; - - /// TI.ZPI1.ZDO_BIND_RSP - /// Constructor - public ZDO_BIND_RSP() { - } - - public ZDO_BIND_RSP(int[] framedata) { - this.SrcAddress = new ZToolAddress16(framedata[1], framedata[0]); - this.Status = framedata[2]; - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_BIND_RSP), framedata); - } - - - @Override - public String toString() { - return "ZDO_BIND_RSP{" + - "SrcAddress=" + SrcAddress + - " Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_END_DEVICE_ANNCE.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_END_DEVICE_ANNCE.java deleted file mode 100644 index 064b081486564..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_END_DEVICE_ANNCE.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.ZToolAddress64; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_END_DEVICE_ANNCE extends ZToolPacket /*implements IREQUEST,IZDO*/ { - /// TI.ZPI1.ZDO_END_DEVICE_ANNCE.Capabilities - /// MAC capabilities - public int Capabilities; - /// TI.ZPI1.ZDO_END_DEVICE_ANNCE.DevAddr - /// Device network address. - public ZToolAddress16 nwkAddr; - /// TI.ZPI1.ZDO_END_DEVICE_ANNCE.DeviceAddress - /// The 64 bit IEEE Address of the device you want to announce - public ZToolAddress64 IEEEAddress; - - /// TI.ZPI1.ZDO_END_DEVICE_ANNCE - /// Constructor - public ZDO_END_DEVICE_ANNCE() { - } - - public ZDO_END_DEVICE_ANNCE(ZToolAddress16 num1, ZToolAddress64 num2, int capability_info1) { - this.nwkAddr = num1; - this.IEEEAddress = num2; - this.Capabilities = capability_info1; - - int[] framedata = new int[11]; - framedata[0] = this.nwkAddr.getLsb(); - framedata[1] = this.nwkAddr.getMsb(); - byte[] bytes = this.IEEEAddress.getAddress(); - for (int i = 0; i < 8; i++) { - framedata[i + 2] = bytes[7 - i]; - } - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_END_DEVICE_ANNCE), framedata); - } - - /// TI.ZPI1.ZDO_END_DEVICE_ANNCE.CAPABILITY_INFO - /// Capability Information bitfield - public class CAPABILITY_INFO { - /// TI.ZPI1.ZDO_END_DEVICE_ANNCE.CAPABILITY_INFO.ALTER_PAN_COORD - /// Capability Information bitfield - public static final int ALTER_PAN_COORD = 1; - /// TI.ZPI1.ZDO_END_DEVICE_ANNCE.CAPABILITY_INFO.DEVICE_TYPE - /// Capability Information bitfield - public static final int DEVICE_TYPE = 2; - /// TI.ZPI1.ZDO_END_DEVICE_ANNCE.CAPABILITY_INFO.NONE - /// Capability Information bitfield - public static final int NONE = 0; - /// TI.ZPI1.ZDO_END_DEVICE_ANNCE.CAPABILITY_INFO.POWER_SOURCE - /// Capability Information bitfield - public static final int POWER_SOURCE = 4; - /// TI.ZPI1.ZDO_END_DEVICE_ANNCE.CAPABILITY_INFO.RECEIVER_ON_WHEN_IDLE - /// Capability Information bitfield - public static final int RECEIVER_ON_WHEN_IDLE = 8; - /// TI.ZPI1.ZDO_END_DEVICE_ANNCE.CAPABILITY_INFO.SECURITY_CAPABILITY - /// Capability Information bitfield - public static final int SECURITY_CAPABILITY = 0x40; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_END_DEVICE_ANNCE_IND.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_END_DEVICE_ANNCE_IND.java deleted file mode 100644 index fcced3be81228..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_END_DEVICE_ANNCE_IND.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.ZToolAddress64; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_END_DEVICE_ANNCE_IND extends ZToolPacket /*implements IRESPONSE_CALLBACK,IZDO*/ { - /// TI.ZPI2.ZDO_END_DEVICE_ANNCE_IND.Capabilities - /// Capabilities - public int Capabilities; - /// TI.ZPI2.ZDO_END_DEVICE_ANNCE_IND.IEEEAddr - /// 64 bit IEEE address of source device - public ZToolAddress64 IEEEAddr; - /// TI.ZPI2.ZDO_END_DEVICE_ANNCE_IND.NwkAddr - /// Network address - public ZToolAddress16 NwkAddr; - /// TI.ZPI2.ZDO_END_DEVICE_ANNCE_IND.SrcAddr - /// Source address - public ZToolAddress16 SrcAddr; - - /// TI.ZPI2.ZDO_END_DEVICE_ANNCE_IND - /// Constructor - public ZDO_END_DEVICE_ANNCE_IND() { - } - - /// TI.ZPI2.ZDO_END_DEVICE_ANNCE_IND - /// Constructor - public ZDO_END_DEVICE_ANNCE_IND(int[] framedata) { - this.SrcAddr = new ZToolAddress16(framedata[1], framedata[0]); - this.NwkAddr = new ZToolAddress16(framedata[3], framedata[2]); - byte[] bytes = new byte[8]; - for (int i = 0; i < 8; i++) { - bytes[i] = (byte) framedata[11 - i]; - } - this.IEEEAddr = new ZToolAddress64(bytes); - this.Capabilities = framedata[12]; - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_END_DEVICE_ANNCE_IND), framedata); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_END_DEVICE_ANNCE_SRSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_END_DEVICE_ANNCE_SRSP.java deleted file mode 100644 index d1aa3932aff1c..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_END_DEVICE_ANNCE_SRSP.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_END_DEVICE_ANNCE_SRSP extends ZToolPacket /*implements IRSPONSE,IZDO*/ { - /// TI.ZPI1.ZDO_END_DEVICE_ANNCE_SRSP.Status - /// Status - public int Status; - - /// TI.ZPI1.ZDO_END_DEVICE_ANNCE_SRSP - /// Constructor - public ZDO_END_DEVICE_ANNCE_SRSP() { - } - - public ZDO_END_DEVICE_ANNCE_SRSP(int[] framedata) { - this.Status = framedata[0]; - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_END_DEVICE_ANNCE_SRSP), framedata); - } - - @Override - public String toString() { - return "ZDO_END_DEVICE_ANNCE_SRSP{" + - "Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_END_DEVICE_BIND_REQ.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_END_DEVICE_BIND_REQ.java deleted file mode 100644 index 226738c572018..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_END_DEVICE_BIND_REQ.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_END_DEVICE_BIND_REQ extends ZToolPacket /*implements IREQUEST,IZDo*/ { - /// TI.ZPI1.ZDO_END_DEVICE_BIND_REQ.DstAddr - /// destination address - public ZToolAddress16 DstAddr; - /// TI.ZPI1.ZDO_END_DEVICE_BIND_REQ.Endpoint - /// Device's Endpoint - public int Endpoint; - /// TI.ZPI1.ZDO_END_DEVICE_BIND_REQ.InClusterList - /// Array of input cluster IDs - NumInClusters long - public DoubleByte[] InClusterList; - /// TI.ZPI1.ZDO_END_DEVICE_BIND_REQ.LocalCoordinator - /// Local coordinator's short address - public DoubleByte LocalCoordinator; - /// TI.ZPI1.ZDO_END_DEVICE_BIND_REQ.NumInClusters - /// Number of ClusterIds in the InClusterList - public int NumInClusters; - /// TI.ZPI1.ZDO_END_DEVICE_BIND_REQ.NumOutClusters - /// Number of ClusterIds in the OutClusterList - public int NumOutClusters; - /// TI.ZPI1.ZDO_END_DEVICE_BIND_REQ.OutClusterList - /// Array of output cluster IDs - NumOutClusters long - public DoubleByte[] OutClusterList; - /// TI.ZPI1.ZDO_END_DEVICE_BIND_REQ.ProfileID - /// Profile PROFILE_ID_HOME_AUTOMATION to match - public DoubleByte ProfileID; - - /// TI.ZPI1.ZDO_END_DEVICE_BIND_REQ - /// Constructor - public ZDO_END_DEVICE_BIND_REQ() { - this.InClusterList = new DoubleByte[15]; - this.OutClusterList = new DoubleByte[15]; - } - - public ZDO_END_DEVICE_BIND_REQ(ZToolAddress16 num1, DoubleByte num2, int num3, DoubleByte num4, int num5, DoubleByte[] numArray1, int num6, DoubleByte[] numArray2, int security_suite1) { - this.DstAddr = num1; - this.LocalCoordinator = num2; - this.Endpoint = num3; - this.ProfileID = num4; - this.NumInClusters = num5; - this.InClusterList = new DoubleByte[numArray1.length]; - this.InClusterList = numArray1; - /*if (numArray1.Length > 15) - { - throw new Exception("Error creating object."); - } - this.InClusterList = new ushort[15]; - Array.Copy(numArray1, this.InClusterList, numArray1.Length);*/ - this.NumOutClusters = num6; - this.OutClusterList = new DoubleByte[numArray1.length]; - this.OutClusterList = numArray1; - /*if (numArray2.Length > 15) - { - throw new Exception("Error creating object."); - } - this.OutClusterList = new ushort[15]; - Array.Copy(numArray2, this.OutClusterList, numArray2.Length);*/ - - int[] framedata = new int[9 + this.InClusterList.length * 2 + this.OutClusterList.length * 2]; - framedata[0] = this.DstAddr.getLsb(); - framedata[1] = this.DstAddr.getMsb(); - framedata[2] = this.LocalCoordinator.getLsb(); - framedata[3] = this.LocalCoordinator.getMsb(); - framedata[4] = this.Endpoint; - framedata[5] = this.ProfileID.getLsb(); - framedata[6] = this.ProfileID.getMsb(); - framedata[7] = this.NumInClusters; - for (int i = 0; i < this.InClusterList.length; i++) { - framedata[(i * 2) + 8] = this.InClusterList[i].getLsb(); - framedata[(i * 2) + 9] = this.InClusterList[i].getMsb(); - } - framedata[((this.InClusterList.length) * 2) + 8] = this.NumOutClusters; - for (int i = 0; i < this.OutClusterList.length; i++) { - framedata[(i * 2) + ((this.InClusterList.length) * 2) + 9] = this.OutClusterList[i].getLsb(); - framedata[(i * 2) + ((this.InClusterList.length) * 2) + 10] = this.OutClusterList[i].getMsb(); - } - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_END_DEVICE_BIND_REQ), framedata); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_END_DEVICE_BIND_REQ_SRSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_END_DEVICE_BIND_REQ_SRSP.java deleted file mode 100644 index b2d6dfd8c7bb7..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_END_DEVICE_BIND_REQ_SRSP.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_END_DEVICE_BIND_REQ_SRSP extends ZToolPacket /*implements IRESPONSE,IZDO*/ { - /// TI.ZPI1.ZDO_END_DEVICE_BIND_REQ_SRSP.Status - /// Status - public int Status; - - /// TI.ZPI1.ZDO_END_DEVICE_BIND_REQ_SRSP - /// Constructor - public ZDO_END_DEVICE_BIND_REQ_SRSP() { - } - - public ZDO_END_DEVICE_BIND_REQ_SRSP(int[] framedata) { - this.Status = framedata[0]; - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_END_DEVICE_BIND_REQ_SRSP), framedata); - } - - @Override - public String toString() { - return "ZDO_END_DEVICE_BIND_REQ_SRSP{" + - "Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_END_DEVICE_BIND_RSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_END_DEVICE_BIND_RSP.java deleted file mode 100644 index d1c566a4594a6..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_END_DEVICE_BIND_RSP.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_END_DEVICE_BIND_RSP extends ZToolPacket /*implements IRESPONE_CALLBACK,IZDO*/ { - /// TI.ZPI1.ZDO_END_DEVICE_BIND_RSP.SrcAddress - /// the message's source network address - public ZToolAddress16 SrcAddress; - /// TI.ZPI1.ZDO_END_DEVICE_BIND_RSP.Status - /// this field indicates status of the bind request - public int Status; - - /// TI.ZPI1.ZDO_END_DEVICE_BIND_RSP - /// Constructor - public ZDO_END_DEVICE_BIND_RSP() { - } - - public ZDO_END_DEVICE_BIND_RSP(int[] framedata) { - this.SrcAddress = new ZToolAddress16(framedata[1], framedata[0]); - this.Status = framedata[2]; - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_END_DEVICE_BIND_RSP), framedata); - } - - @Override - public String toString() { - return "ZDO_END_DEVICE_BIND_RSP{" + - "SrcAddress=" + SrcAddress + - ", Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_IEEE_ADDR_REQ.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_IEEE_ADDR_REQ.java deleted file mode 100644 index 6fc387c6eacc8..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_IEEE_ADDR_REQ.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; -import org.bubblecloud.zigbee.util.Integers; - -/** - * @author Stefano "Kismet" Lenzi - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class ZDO_IEEE_ADDR_REQ extends ZToolPacket /*implements IREQUEST,IZDo*/ { - /// TI.ZPI1.ZDO_IEEE_ADDR_REQ.ReqType - /// Request type - //public int ReqType; - /// TI.ZPI1.ZDO_IEEE_ADDR_REQ.ShortAddr - /// short address of the destination device - //public ZToolAddress16 ShortAddr; - /// TI.ZPI1.ZDO_IEEE_ADDR_REQ.StartIndex - /// Starting index into the list of children. This is used to get more of the list if the list is to large for one message. - //public int StartIndex; - - /// TI.ZPI1.ZDO_IEEE_ADDR_REQ - /// Constructor - public ZDO_IEEE_ADDR_REQ() { - } - - public short getShortAddress() { - - return (short) (packet[PAYLOAD_START_INDEX + 0] + (packet[PAYLOAD_START_INDEX + 1] << 8)); - } - - public REQ_TYPE getRequestType() { - return REQ_TYPE.fromValue(packet[PAYLOAD_START_INDEX + 2]); - } - - public int getStartIndex() { - return super.packet[PAYLOAD_START_INDEX + 3]; - } - - - public ZDO_IEEE_ADDR_REQ(int nwkAddress, REQ_TYPE type, byte startIndex) { - int[] framedata = new int[4]; - framedata[0] = Integers.getByteAsInteger(nwkAddress, 0); - framedata[1] = Integers.getByteAsInteger(nwkAddress, 1); - framedata[2] = type.getValue(); - framedata[3] = startIndex & 0xFF; - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_IEEE_ADDR_REQ), framedata); - } - - public ZDO_IEEE_ADDR_REQ(ZToolAddress16 num1, int req_type1, int num2) { - int[] framedata = new int[4]; - framedata[0] = num1.getLsb(); - framedata[1] = num1.getMsb(); - framedata[2] = req_type1; - framedata[3] = num2; - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_IEEE_ADDR_REQ), framedata); - } - - /// TI.ZPI1.ZDO_IEEE_ADDR_REQ.REQ_TYPE - /// Request type - public enum REQ_TYPE { - EXTENDED(1), SINGLE_DEVICE_RESPONSE(0); - - private int value; - - private REQ_TYPE(int v) { - value = v; - } - - public int getValue() { - return value; - } - - public static REQ_TYPE fromValue(int v) { - REQ_TYPE[] values = REQ_TYPE.values(); - for (int i = 0; i < values.length; i++) { - if (values[i].value == v) return values[i]; - } - return null; - } - - - /// TI.ZPI1.ZDO_IEEE_ADDR_REQ.REQ_TYPE.EXTENDED - /// Request type - //public static final int EXTENDED = 1; - /// TI.ZPI1.ZDO_IEEE_ADDR_REQ.REQ_TYPE.SINGLE_DEVICE_RESPONSE - /// Request type - //public static final int SINGLE_DEVICE_RESPONSE = 0; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_IEEE_ADDR_REQ_SRSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_IEEE_ADDR_REQ_SRSP.java deleted file mode 100644 index 0002f9f4f300b..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_IEEE_ADDR_REQ_SRSP.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_IEEE_ADDR_REQ_SRSP extends ZToolPacket/* implements IRESPONSE,IZDO*/ { - /// TI.ZPI1.ZDO_IEEE_ADDR_REQ_SRSP.Status - /// Status - public int Status; - - /// TI.ZPI1.ZDO_IEEE_ADDR_REQ_SRSP - /// Constructor - public ZDO_IEEE_ADDR_REQ_SRSP() { - } - - public ZDO_IEEE_ADDR_REQ_SRSP(int[] framedata) { - this.Status = framedata[0]; - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_IEEE_ADDR_REQ_SRSP), framedata); - } - - @Override - public String toString() { - return "ZDO_IEEE_ADDR_REQ_SRSP{" + - "Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_IEEE_ADDR_RSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_IEEE_ADDR_RSP.java deleted file mode 100644 index d0b4af7d84416..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_IEEE_ADDR_RSP.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.*; -import org.bubblecloud.zigbee.util.DoubleByte; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.Arrays; - -/** - * @author Stefano "Kismet" Lenzi - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class ZDO_IEEE_ADDR_RSP extends ZToolPacket /*implements IRESPONSE_CALLBACK_IZDO*/ { - private static final Logger logger = LoggerFactory.getLogger(ZDO_IEEE_ADDR_RSP.class); - /// TI.ZPI1.ZDO_IEEE_ADDR_RSP.AssocDevList - /// Dynamic array, array of 16 bit short addresses - list of network address for associated devices. This list can be a partial list if the entire list doesn't fit into a packet. If it is a partial list, the starting index is StartIndex. - public ZToolAddress16[] AssocDevList; - public short[] assocDevList; - /// TI.ZPI1.ZDO_IEEE_ADDR_RSP.IEEEAddr - /// 64 bit IEEE address of source device - public ZToolAddress64 IEEEAddr; - public ZToolAddress16 nwkAddr; - /// TI.ZPI1.ZDO_IEEE_ADDR_RSP.NumAssocDev - /// the number of associated devices - public int NumAssocDev; - /// TI.ZPI1.ZDO_IEEE_ADDR_RSP.SrcAddress - /// Source address, size is dependent on SrcAddrMode - public ZToolAddress64 SrcAddress; - /// TI.ZPI1.ZDO_IEEE_ADDR_RSP.SrcAddrMode - /// indicates that the SrcAddr is either 16 bits or 64 bits - public int SrcAddrMode; - /// TI.ZPI1.ZDO_IEEE_ADDR_RSP.StartIndex - /// Starting index into the list of associated devices for this report. - public int StartIndex; - /// TI.ZPI1.ZDO_IEEE_ADDR_RSP.Status - /// this field indicates either SUCCESS or FAILURE - public int Status; - - /// TI.ZPI1.ZDO_IEEE_ADDR_RSP - /// Constructor - public ZDO_IEEE_ADDR_RSP() { - this.AssocDevList = new ZToolAddress16[0xff]; - } - - public ZDO_IEEE_ADDR_RSP(int[] framedata) { - this.Status = framedata[0]; - byte[] bytes = new byte[8]; - for (int i = 0; i < 8; i++) { - bytes[i] = (byte) framedata[8 - i]; - } - this.IEEEAddr = new ZToolAddress64(bytes); - this.nwkAddr = new ZToolAddress16(framedata[10], framedata[9]); - this.StartIndex = framedata[11]; - this.NumAssocDev = framedata[12]; - this.AssocDevList = new ZToolAddress16[this.NumAssocDev]; - this.assocDevList = new short[this.NumAssocDev]; - for (int i = 0; i < this.AssocDevList.length; i++) { - this.AssocDevList[i] = new ZToolAddress16(framedata[14 + (i * 2)], framedata[13 + (i * 2)]); - } - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_IEEE_ADDR_RSP), framedata); - } - - public ZToolAddress64 getIEEEAddress() { - return IEEEAddr; - } - - public int[] getAssociatedNodesList() { - int[] values = new int[AssocDevList.length]; - for (int i = 0; i < AssocDevList.length; i++) { - logger.trace("Associated node - msb: " + AssocDevList[i].getMsb() + " lsb: " + AssocDevList[i].getLsb()); - values[i] = ((int) AssocDevList[i].get16BitValue() & 0xFFFF); - } - return values; - } - - public int getStartIndex() { - return StartIndex; - } - - public int getAssociatedNodeCount() { - return NumAssocDev; - } - - @Override - public String toString() { - return "ZDO_IEEE_ADDR_RSP{" + - "AssocDevList=" + Arrays.toString(AssocDevList) + - ", assocDevList=" + Arrays.toString(assocDevList) + - ", IEEEAddr=" + IEEEAddr + - ", nwkAddr=" + nwkAddr + - ", NumAssocDev=" + NumAssocDev + - ", SrcAddress=" + SrcAddress + - ", SrcAddrMode=" + SrcAddrMode + - ", StartIndex=" + StartIndex + - ", Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MATCH_DESC_REQ.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MATCH_DESC_REQ.java deleted file mode 100644 index 5b0d6fe45c504..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MATCH_DESC_REQ.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_MATCH_DESC_REQ extends ZToolPacket /*implements IREQUEST,IZDO*/ { - /// TI.ZPI1.ZDO_MATCH_DESC_REQ.DstAddr - /// destination address - public ZToolAddress16 DstAddr; - /// TI.ZPI1.ZDO_MATCH_DESC_REQ.InClusterList - /// Array of input cluster IDs - NumInClusters long - public DoubleByte[] InClusterList; - /// TI.ZPI1.ZDO_MATCH_DESC_REQ.NumInClusters - /// Number of ClusterIds in the InClusterList - public int NumInClusters; - /// TI.ZPI1.ZDO_MATCH_DESC_REQ.NumOutClusters - /// Number of ClusterIds in the - public int NumOutClusters; - /// TI.ZPI1.ZDO_MATCH_DESC_REQ.NWKAddrOfInterest - /// NWK address for the request - public ZToolAddress16 NWKAddrOfInterest; - /// TI.ZPI1.ZDO_MATCH_DESC_REQ.OutClusterList - /// Array of output cluster IDs - NumOutClusters long - public DoubleByte[] OutClusterList; - /// TI.ZPI1.ZDO_MATCH_DESC_REQ.ProfileID - /// Profile PROFILE_ID_HOME_AUTOMATION to match - public DoubleByte ProfileID; - - /// TI.ZPI1.ZDO_MATCH_DESC_REQ - /// Constructor - public ZDO_MATCH_DESC_REQ() { - this.InClusterList = new DoubleByte[0x10]; - this.OutClusterList = new DoubleByte[0x10]; - } - - public ZDO_MATCH_DESC_REQ(ZToolAddress16 num1, ZToolAddress16 num2, DoubleByte num3, int num4, DoubleByte[] numArray1, int num5, DoubleByte[] numArray2, int security_suite1) { - this.DstAddr = num1; - this.NWKAddrOfInterest = num2; - this.ProfileID = num3; - this.NumInClusters = num4; - this.InClusterList = new DoubleByte[numArray1.length]; - this.InClusterList = numArray1; - /*if (numArray1.Length > 0x10) - { - throw new Exception("Error creating object."); - } - this.InClusterList = new ushort[0x10]; - Array.Copy(numArray1, this.InClusterList, numArray1.Length);*/ - this.NumOutClusters = num5; - this.OutClusterList = new DoubleByte[numArray1.length]; - this.OutClusterList = numArray1; - /*if (numArray2.Length > 0x10) - { - throw new Exception("Error creating object."); - } - this.OutClusterList = new ushort[0x10]; - Array.Copy(numArray2, this.OutClusterList, numArray2.Length);*/ - - - int[] framedata = new int[8 + this.InClusterList.length * 2 + this.OutClusterList.length * 2]; - framedata[0] = this.DstAddr.getLsb(); - framedata[1] = this.DstAddr.getMsb(); - framedata[2] = this.NWKAddrOfInterest.getLsb(); - framedata[3] = this.NWKAddrOfInterest.getMsb(); - framedata[4] = this.ProfileID.getLsb(); - framedata[5] = this.ProfileID.getMsb(); - framedata[6] = this.NumInClusters; - for (int i = 0; i < this.InClusterList.length; i++) { - framedata[(i * 2) + 7] = this.InClusterList[i].getLsb(); - framedata[(i * 2) + 8] = this.InClusterList[i].getMsb(); - } - framedata[((this.InClusterList.length) * 2) + 7] = this.NumOutClusters; - for (int i = 0; i < this.OutClusterList.length; i++) { - framedata[(i * 2) + ((this.InClusterList.length) * 2) + 8] = this.OutClusterList[i].getLsb(); - framedata[(i * 2) + ((this.InClusterList.length) * 2) + 9] = this.OutClusterList[i].getMsb(); - } - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_MATCH_DESC_REQ), framedata); - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MATCH_DESC_REQ_SRSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MATCH_DESC_REQ_SRSP.java deleted file mode 100644 index 4d03d678ed764..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MATCH_DESC_REQ_SRSP.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_MATCH_DESC_REQ_SRSP extends ZToolPacket /*implements IRSPONSE,IZDO*/ { - /// TI.ZPI1.ZDO_MATCH_DESC_REQ_SRSP.Status - /// Status - public int Status; - - /// TI.ZPI1.ZDO_MATCH_DESC_REQ_SRSP - /// Constructor - public ZDO_MATCH_DESC_REQ_SRSP() { - } - - public ZDO_MATCH_DESC_REQ_SRSP(int[] framedata) { - this.Status = framedata[0]; - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_MATCH_DESC_REQ_SRSP), framedata); - } - - @Override - public String toString() { - return "ZDO_MATCH_DESC_REQ_SRSP{" + - "Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MATCH_DESC_RSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MATCH_DESC_RSP.java deleted file mode 100644 index 40fbb314e911a..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MATCH_DESC_RSP.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -import java.util.Arrays; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_MATCH_DESC_RSP extends ZToolPacket /*implements IRESPONSE_CALLBACK,IZDo*/ { - /// TI.ZPI1.ZDO_MATCH_DESC_RSP.MatchCount - /// Number of active endpoints in the list - public int MatchCount; - /// TI.ZPI1.ZDO_MATCH_DESC_RSP.MatchEndpointList - /// Array of active endpoints on this device - public int[] MatchEndpointList; - /// TI.ZPI1.ZDO_MATCH_DESC_RSP.NWKAddrOfInterest - /// Device's short address that this response describes - public ZToolAddress16 NWKAddrOfInterest; - /// TI.ZPI1.ZDO_MATCH_DESC_RSP.SrcAddress - /// the message's source network address - public ZToolAddress16 SrcAddress; - /// TI.ZPI1.ZDO_MATCH_DESC_RSP.Status - /// this field indicates either SUCCESS or FAILURE - public int Status; - - /// TI.ZPI1.ZDO_MATCH_DESC_RSP - /// Constructor - public ZDO_MATCH_DESC_RSP() { - this.MatchEndpointList = new int[0xff]; - } - - public ZDO_MATCH_DESC_RSP(int[] framedata) { - this.SrcAddress = new ZToolAddress16(framedata[1], framedata[0]); - this.Status = framedata[2]; - this.NWKAddrOfInterest = new ZToolAddress16(framedata[4], framedata[3]); - this.MatchCount = framedata[5]; - this.MatchEndpointList = new int[this.MatchCount]; - for (int i = 0; i < this.MatchEndpointList.length; i++) { - this.MatchEndpointList[i] = framedata[i + 6]; - } - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_MATCH_DESC_RSP), framedata); - } - - @Override - public String toString() { - return "ZDO_MATCH_DESC_RSP{" + - "MatchCount=" + MatchCount + - ", MatchEndpointList=" + Arrays.toString(MatchEndpointList) + - ", NWKAddrOfInterest=" + NWKAddrOfInterest + - ", SrcAddress=" + SrcAddress + - ", Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_LEAVE_REQ.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_LEAVE_REQ.java deleted file mode 100644 index 15ef1c12cea20..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_LEAVE_REQ.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.ZToolAddress64; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_MGMT_LEAVE_REQ extends ZToolPacket /*implements IREQUEST,IZDO*/ { - /// TI.ZPI1.ZDO_MGMT_LEAVE_REQ.DeviceAddress - /// The 64 bit IEEE Address of the device you want to leave. - public ZToolAddress64 DeviceAddress; - /// TI.ZPI1.ZDO_MGMT_LEAVE_REQ.DstAddr - /// Destination network address. - public ZToolAddress16 DstAddr; - /// TI.ZPI1.ZDO_MGMT_LEAVE_REQ.RemoveChildren - /// This field has a value of 1 if the device being asked to leave the network is also being asked to remove its child devices, if any. Otherwise it has a value of 0. Currently, the stack profile of Home Control specifies that this field should always be set to 0 - public int RemoveChildren_Rejoin; - - /// TI.ZPI1.ZDO_MGMT_LEAVE_REQ - /// Constructor - public ZDO_MGMT_LEAVE_REQ() { - } - - public ZDO_MGMT_LEAVE_REQ(ZToolAddress16 num1, ZToolAddress64 num2, int flag1) { - this.DstAddr = num1; - this.DeviceAddress = num2; - this.RemoveChildren_Rejoin = flag1; - - int[] framedata = new int[11]; - framedata[0] = this.DstAddr.getLsb(); - framedata[1] = this.DstAddr.getMsb(); - for (int i = 0; i < 8; i++) { - framedata[2 + i] = this.DeviceAddress.getAddress()[7 - i]; - } - framedata[10] = this.RemoveChildren_Rejoin; - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_MGMT_LEAVE_REQ), framedata); - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_LEAVE_REQ_SRSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_LEAVE_REQ_SRSP.java deleted file mode 100644 index 315900f1a2b15..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_LEAVE_REQ_SRSP.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_MGMT_LEAVE_REQ_SRSP extends ZToolPacket /*implements IRESPONSE,IZDO*/ { - /// TI.ZPI1.ZDO_MGMT_LEAVE_REQ_SRSP.Status - /// Status - public int Status; - - /// TI.ZPI1.ZDO_MGMT_LEAVE_REQ_SRSP - /// Constructor - public ZDO_MGMT_LEAVE_REQ_SRSP() { - } - - public ZDO_MGMT_LEAVE_REQ_SRSP(int[] framedata) { - this.Status = framedata[0]; - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_MGMT_LEAVE_REQ_SRSP), framedata); - } - - @Override - public String toString() { - return "ZDO_MGMT_LEAVE_REQ_SRSP{" + - "Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_LEAVE_RSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_LEAVE_RSP.java deleted file mode 100644 index 54f4a88ac87ee..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_LEAVE_RSP.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_MGMT_LEAVE_RSP extends ZToolPacket /*implements IRESPONSE_CALLBACK,IZDO*/ { - /// TI.ZPI1.ZDO_MGMT_LEAVE_RSP.SrcAddress - /// Source address of the message - public ZToolAddress16 SrcAddress; - /// TI.ZPI1.ZDO_MGMT_LEAVE_RSP.Status - /// this field indicates either SUCCESS (0) or FAILURE (1). - public int Status; - - /// TI.ZPI1.ZDO_MGMT_LEAVE_RSP - /// Constructor - public ZDO_MGMT_LEAVE_RSP() { - } - - public ZDO_MGMT_LEAVE_RSP(int[] framedata) { - this.SrcAddress = new ZToolAddress16(framedata[1], framedata[0]); - this.Status = framedata[2]; - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_MGMT_LEAVE_RSP), framedata); - } - - @Override - public String toString() { - return "ZDO_MGMT_LEAVE_RSP{" + - "SrcAddress=" + SrcAddress + - ", Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_LQI_REQ.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_LQI_REQ.java deleted file mode 100644 index a7e43c8dcd20b..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_LQI_REQ.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_MGMT_LQI_REQ extends ZToolPacket /*implements IREQUEST,IZDO*/ { - /// TI.ZPI1.ZDO_MGMT_LQI_REQ.DstAddr - /// Destination network address. - public ZToolAddress16 DstAddr; - /// TI.ZPI1.ZDO_MGMT_LQI_REQ.StartIndex - /// Where to start. The result can be more networks than can be reported, so this field allows a user to ask for more. - public int StartIndex; - - /// TI.ZPI1.ZDO_MGMT_LQI_REQ - /// Constructor - public ZDO_MGMT_LQI_REQ() { - } - - /// TI.ZPI1.ZDO_MGMT_LQI_REQ - /// Constructor - public ZDO_MGMT_LQI_REQ(ZToolAddress16 num1, int num2) { - this.DstAddr = num1; - this.StartIndex = num2; - - int[] framedata = new int[3]; - framedata[0] = this.DstAddr.getLsb(); - framedata[1] = this.DstAddr.getMsb(); - framedata[2] = this.StartIndex; - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_MGMT_LQI_REQ), framedata); - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_LQI_REQ_SRSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_LQI_REQ_SRSP.java deleted file mode 100644 index c15ece64313e2..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_LQI_REQ_SRSP.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_MGMT_LQI_REQ_SRSP extends ZToolPacket /*implements IRESPONSE,IZDO*/ { - /// TI.ZPI1.ZDO_MGMT_LQI_REQ_SRSP.Status - /// Status - public int Status; - - /// TI.ZPI1.ZDO_MGMT_LQI_REQ_SRSP - /// Constructor - public ZDO_MGMT_LQI_REQ_SRSP() { - } - - public ZDO_MGMT_LQI_REQ_SRSP(int[] framedata) { - this.Status = framedata[0]; - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_MGMT_LQI_REQ_SRSP), framedata); - } - - @Override - public String toString() { - return "ZDO_MGMT_LQI_REQ_SRSP{" + - "Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_LQI_RSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_LQI_RSP.java deleted file mode 100644 index 701b5bea6e125..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_LQI_RSP.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.*; -import org.bubblecloud.zigbee.util.ByteUtils; -import org.bubblecloud.zigbee.util.DoubleByte; - -import java.util.Arrays; - -/** - * @author Alvaro Fides Valero - * @author Manlio Bacco - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_MGMT_LQI_RSP extends ZToolPacket /*implements IRESPONSE_CALLBACK,IZDo*/ { - /// TI.ZPI1.ZDO_MGMT_LQI_RSP.NeighborLQICount - /// Number of entries in this response. - public int NeighborLQICount; //TODO we should remove this - /// TI.ZPI1.ZDO_MGMT_LQI_RSP.NeighborLQIEntries - /// Total number of entries available in the device. - public int NeighborLQIEntries; - /// TI.ZPI1.ZDO_MGMT_LQI_RSP.NeighborLqiList - /// Dynamic array, Number of entries in this response. - public NeighborLqiListItemClass[] NeighborLqiList; - //private NeighborLqiListItemClass NeighborLqiListItemClassDummyObj; - /// TI.ZPI1.ZDO_MGMT_LQI_RSP.SrcAddress - /// Source address of the message - public ZToolAddress16 SrcAddress; - /// TI.ZPI1.ZDO_MGMT_LQI_RSP.StartIndex - /// Where in the total number of entries this response starts. - public int StartIndex; - /// TI.ZPI1.ZDO_MGMT_LQI_RSP.Status - /// this field indicates either SUCCESS or FAILURE. - public int Status; - - /// TI.ZPI1.ZDO_MGMT_LQI_RSP - /// Constructor - public ZDO_MGMT_LQI_RSP() { - this.NeighborLqiList = new NeighborLqiListItemClass[]{}; - } - - public ZDO_MGMT_LQI_RSP(int[] framedata) { - this.SrcAddress = new ZToolAddress16(framedata[1], framedata[0]); - this.Status = framedata[2]; - this.NeighborLQIEntries = framedata[3]; - this.StartIndex = framedata[4]; - this.NeighborLQICount = framedata[5]; - this.NeighborLqiList = new NeighborLqiListItemClass[framedata[5]]; - - int NOpt1; - int NOpt2; - - int k = 0; - byte[] bytes = new byte[8]; - for (int z = 0; z < this.NeighborLqiList.length; z++) { - for (int j = 0; j < 8; j++) { - bytes[7 - j] = (byte) framedata[6 + k + j];///MSB>TI.ZPI1.ZDO_MGMT_LQI_RSP.NeighborLqiListItemClass - /// Contains information in a single item of a network list - public class NeighborLqiListItemClass { - - public int Depth; - public ZToolAddress64 ExtendedAddress; - public long ExtendedPanID; - public ZToolAddress16 NetworkAddress; - public int Reserved_Relationship_RxOnWhenIdle_DeviceType; - public int Reserved_PermitJoining; - public int RxLQI; - - public NeighborLqiListItemClass() { - } - - public NeighborLqiListItemClass(long num1, ZToolAddress64 num2, ZToolAddress16 num3, int num4, int num5, int num6, int num7) { - this.ExtendedPanID = num1; - this.ExtendedAddress = num2; - this.NetworkAddress = num3; - this.Reserved_Relationship_RxOnWhenIdle_DeviceType = num4; - this.Reserved_PermitJoining = num5; - this.Depth = num6; - this.RxLQI = num7; - } - } - - /** - * @return the number of Neighbor LQI entries present on the message - */ - public int getNeighborLQICount() { - return this.NeighborLqiList.length; - } - - /** - * @return the index of the first entries available on the message with respect - * to the Neighbor LQI Tables on the device - */ - public int getStartIndex() { - return StartIndex; - } - - /** - * @return the number of Neighbor LQI entries available on the device - */ - public int getNeighborLQIEntries() { - return this.NeighborLQIEntries; - } - - public NeighborLqiListItemClass[] getNeighborLqiList() { - return NeighborLqiList; - } - - @Override - public String toString() { - return "ZDO_MGMT_LQI_RSP{" + - "NeighborLQICount=" + NeighborLQICount + - ", NeighborLQIEntries=" + NeighborLQIEntries + - ", NeighborLqiList=" + Arrays.toString(NeighborLqiList) + - ", SrcAddress=" + SrcAddress + - ", StartIndex=" + StartIndex + - ", Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_NWK_UPDATE_REQ.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_NWK_UPDATE_REQ.java deleted file mode 100644 index ca1fe3e052acb..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_NWK_UPDATE_REQ.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; -import org.bubblecloud.zigbee.util.Integers; - -/** - * Request to switch channel or change PAN PROFILE_ID_HOME_AUTOMATION. - * - * @author Tommi S.E. Laukkanen - */ -public class ZDO_MGMT_NWK_UPDATE_REQ extends ZToolPacket { - private final int destinationAddress; - private final int destinationAddressMode; - private final int channelMask; - private final int scanDuration; - private final int scanCount; - private final int networkManagerAddress; - - public ZDO_MGMT_NWK_UPDATE_REQ( - final int destinationAddress, - final int destinationAddressMode, - final int channelMask, - final int scanDuration, - final int scanCount, - final int networkManagerAddress) { - - this.destinationAddress = destinationAddress; - this.destinationAddressMode = destinationAddressMode; - this.channelMask = channelMask; - this.scanDuration = scanDuration; - this.scanCount = scanCount; - this.networkManagerAddress = networkManagerAddress; - - int[] framedata = new int[11]; - - framedata[0] = Integers.getByteAsInteger(this.destinationAddress, 0); - framedata[1] = Integers.getByteAsInteger(this.destinationAddress, 1); - - framedata[2] = this.destinationAddressMode; - - framedata[3] = Integers.getByteAsInteger(this.channelMask, 0); - framedata[4] = Integers.getByteAsInteger(this.channelMask, 1); - framedata[5] = Integers.getByteAsInteger(this.channelMask, 2); - framedata[6] = Integers.getByteAsInteger(this.channelMask, 3); - - framedata[7] = this.scanDuration; - framedata[8] = this.scanCount; - - framedata[9] = Integers.getByteAsInteger(this.networkManagerAddress, 0); - framedata[10] = Integers.getByteAsInteger(this.networkManagerAddress, 1); - - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_MGMT_NWK_UPDATE_REQ), framedata); - } - - @Override - public String toString() { - return "ZDO_MGMT_NWK_UPDATE_REQ{" + - "destinationAddress=" + destinationAddress + - ", destinationAddressMode=" + destinationAddressMode + - ", channelMask=" + channelMask + - ", scanDuration=" + scanDuration + - ", scanCount=" + scanCount + - ", networkManagerAddress=" + networkManagerAddress + - '}'; - } - - public static final int CHANNEL_MASK_NONE = 0x00000000; - public static final int CHANNEL_MASK_ALL = 0x07FFF800; - public static final int CHANNEL_MASK_11 = 0x00000800; - public static final int CHANNEL_MASK_12 = 0x00001000; - public static final int CHANNEL_MASK_13 = 0x00002000; - public static final int CHANNEL_MASK_14 = 0x00004000; - public static final int CHANNEL_MASK_15 = 0x00008000; - public static final int CHANNEL_MASK_16 = 0x00010000; - public static final int CHANNEL_MASK_17 = 0x00020000; - public static final int CHANNEL_MASK_18 = 0x00040000; - public static final int CHANNEL_MASK_19 = 0x00080000; - public static final int CHANNEL_MASK_20 = 0x00100000; - public static final int CHANNEL_MASK_21 = 0x00200000; - public static final int CHANNEL_MASK_22 = 0x00400000; - public static final int CHANNEL_MASK_23 = 0x00800000; - public static final int CHANNEL_MASK_24 = 0x01000000; - public static final int CHANNEL_MASK_25 = 0x02000000; - public static final int CHANNEL_MASK_26 = 0x04000000; - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_NWK_UPDATE_REQ_SRSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_NWK_UPDATE_REQ_SRSP.java deleted file mode 100644 index 08b03e7853a35..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_NWK_UPDATE_REQ_SRSP.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.HashMap; -import java.util.Map; - -/** - * Response for requesting the network to switch channel or change PAN PROFILE_ID_HOME_AUTOMATION. - * - * @author Tommi S.E. Laukkanen - */ -public class ZDO_MGMT_NWK_UPDATE_REQ_SRSP extends ZToolPacket { - /** - * The logger. - */ - private final static Logger logger = LoggerFactory.getLogger(ZDO_MGMT_NWK_UPDATE_REQ_SRSP.class); - - public int Status; - - public ZDO_MGMT_NWK_UPDATE_REQ_SRSP(int[] framedata) { - this.Status = framedata[0]; - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_MGMT_NWK_UPDATE_REQ_SRSP), framedata); - } - - @Override - public String toString() { - return "ZDO_MGMT_NWK_UPDATE_REQ_SRSP{" + - "Status=" + ResponseStatus.getStatus(Status) + - '}'; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_PERMIT_JOIN_REQ.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_PERMIT_JOIN_REQ.java deleted file mode 100644 index 8024eb16372e4..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_PERMIT_JOIN_REQ.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_MGMT_PERMIT_JOIN_REQ extends ZToolPacket /*implements IREQUEST,IZDO*/ { - /// TI.ZPI1.ZDO_MGMT_PERMIT_JOIN_REQ.DstAddr - /// Destination network address. - public ZToolAddress16 DstAddr; - /// TI.ZPI1.ZDO_MGMT_PERMIT_JOIN_REQ.Duration - /// The duration to permit joining. 0 = join disabled. 0xff = join enabled. 0x01-0xfe = number of seconds to permit joining - public int Duration; - /// TI.ZPI1.ZDO_MGMT_PERMIT_JOIN_REQ.TCSignificance - /// Trust Center Significance - public int TCSignificance; - - /// TI.ZPI1.ZDO_MGMT_PERMIT_JOIN_REQ - /// Constructor - public ZDO_MGMT_PERMIT_JOIN_REQ() { - } - - /// TI.ZPI1.ZDO_MGMT_PERMIT_JOIN_REQ - /// Constructor - public ZDO_MGMT_PERMIT_JOIN_REQ(ZToolAddress16 num1, int num2, int num3) { - this.DstAddr = num1; - this.Duration = num2; - this.TCSignificance = num3; - - int[] framedata = new int[4]; - framedata[0] = this.DstAddr.getLsb(); - framedata[1] = this.DstAddr.getMsb(); - framedata[2] = this.Duration; - framedata[3] = this.TCSignificance; - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_MGMT_PERMIT_JOIN_REQ), framedata); - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_PERMIT_JOIN_REQ_SRSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_PERMIT_JOIN_REQ_SRSP.java deleted file mode 100644 index 3af66352aa9d6..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_PERMIT_JOIN_REQ_SRSP.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_MGMT_PERMIT_JOIN_REQ_SRSP extends ZToolPacket /*implements IRESPONSE,IZDO*/ { - /// TI.ZPI1.ZDO_MGMT_PERMIT_JOIN_REQ_SRSP.Status - /// Status - public int Status; - - /// TI.ZPI1.ZDO_MGMT_PERMIT_JOIN_REQ_SRSP - /// Constructor - public ZDO_MGMT_PERMIT_JOIN_REQ_SRSP() { - } - - public ZDO_MGMT_PERMIT_JOIN_REQ_SRSP(int[] framedata) { - this.Status = framedata[0]; - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_MGMT_PERMIT_JOIN_REQ_SRSP), framedata); - } - - @Override - public String toString() { - return "ZDO_MGMT_PERMIT_JOIN_REQ_SRSP{" + - "Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_PERMIT_JOIN_RSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_PERMIT_JOIN_RSP.java deleted file mode 100644 index 5d287b275dbcc..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_MGMT_PERMIT_JOIN_RSP.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_MGMT_PERMIT_JOIN_RSP extends ZToolPacket /*implements IRESPONSE_CALLBACK,IZDO*/ { - /// TI.ZPI1.ZDO_MGMT_PERMIT_JOIN_RSP.SrcAddress - /// Source address of the message - public ZToolAddress16 SrcAddress; - /// TI.ZPI1.ZDO_MGMT_PERMIT_JOIN_RSP.Status - /// this field indicates either SUCCESS (0) or FAILURE (1). - public int Status; - - /// TI.ZPI1.ZDO_MGMT_PERMIT_JOIN_RSP - /// Constructor - public ZDO_MGMT_PERMIT_JOIN_RSP() { - } - - public ZDO_MGMT_PERMIT_JOIN_RSP(int[] framedata) { - this.SrcAddress = new ZToolAddress16(framedata[1], framedata[0]); - this.Status = framedata[2]; - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_MGMT_PERMIT_JOIN_RSP), framedata); - } - - @Override - public String toString() { - return "ZDO_MGMT_PERMIT_JOIN_RSP{" + - "SrcAddress=" + SrcAddress + - ", Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_NODE_DESC_REQ.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_NODE_DESC_REQ.java deleted file mode 100644 index 03546d632de2d..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_NODE_DESC_REQ.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; -import org.bubblecloud.zigbee.util.Integers; - -/** - * @author Stefano "Kismet" Lenzi - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class ZDO_NODE_DESC_REQ extends ZToolPacket /*implements IREQUEST,IZDO*/ { - /// TI.ZPI1.ZDO_NODE_DESC_REQ.DstAddr - /// destination address - public ZToolAddress16 DstAddr; - /// TI.ZPI1.ZDO_NODE_DESC_REQ.NWKAddrOfInterest - /// NWK address for the request - public ZToolAddress16 NWKAddrOfInterest; - - /// TI.ZPI1.ZDO_NODE_DESC_REQ - /// Constructor - public ZDO_NODE_DESC_REQ() { - } - - public ZDO_NODE_DESC_REQ(short destination) { - //TODO Check compatibility with other Constructor - int[] framedata = new int[4]; - framedata[0] = Integers.getByteAsInteger(destination, 0); - framedata[1] = Integers.getByteAsInteger(destination, 1); - framedata[2] = framedata[0]; - framedata[3] = framedata[1]; - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_NODE_DESC_REQ), framedata); - } - - public ZDO_NODE_DESC_REQ(ZToolAddress16 num1, ZToolAddress16 num2) { - this.DstAddr = num1; - this.NWKAddrOfInterest = num2; - - int[] framedata = new int[4]; - framedata[0] = this.DstAddr.getLsb(); - framedata[1] = this.DstAddr.getMsb(); - framedata[2] = this.NWKAddrOfInterest.getLsb(); - framedata[3] = this.NWKAddrOfInterest.getMsb(); - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_NODE_DESC_REQ), framedata); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_NODE_DESC_REQ_SRSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_NODE_DESC_REQ_SRSP.java deleted file mode 100644 index 7b14d35b28979..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_NODE_DESC_REQ_SRSP.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_NODE_DESC_REQ_SRSP extends ZToolPacket/* implements IRESPONSE,IZDo*/ { - /// TI.ZPI1.ZDO_NODE_DESC_REQ_SRSP.Status - /// Status - public int Status; - - /// TI.ZPI1.ZDO_NODE_DESC_REQ_SRSP - /// Constructor - public ZDO_NODE_DESC_REQ_SRSP() { - } - - public ZDO_NODE_DESC_REQ_SRSP(int[] framedata) { - this.Status = framedata[0]; - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_NODE_DESC_REQ_SRSP), framedata); - } - - @Override - public String toString() { - return "ZDO_NODE_DESC_REQ_SRSP{" + - "Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_NODE_DESC_RSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_NODE_DESC_RSP.java deleted file mode 100644 index ed90ba0de08aa..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_NODE_DESC_RSP.java +++ /dev/null @@ -1,182 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_NODE_DESC_RSP extends ZToolPacket /*implements IRESPONSE_CALLBACK,IZDO*/ { - /// TI.ZPI1.ZDO_NODE_DESC_RSP.APSFlags - /// Node Flags assigned for APS. For V1.0 all bits are reserved - public int APSFlags; - /// TI.ZPI1.ZDO_NODE_DESC_RSP.BufferSize - /// Indicates size of maximum NPDU. This field is used as a high level indication for api - public int BufferSize; - /// TI.ZPI1.ZDO_NODE_DESC_RSP.Capabilities - /// Capability flags stored for the MAC - public int Capabilities; - /// TI.ZPI1.ZDO_NODE_DESC_RSP.ComplexDescriptorAvailable - /// Indicates if complex descriptor is available for the node - public int ComplexDescriptorAvailable; - /// TI.ZPI1.ZDO_NODE_DESC_RSP.ManufacturerCode - /// Specifies a manufacturer code that is allocated by ZigBee Alliance, relating to the manufacturer to the device - public DoubleByte ManufacturerCode; - /// TI.ZPI1.ZDO_NODE_DESC_RSP.NodeType - /// Node type - public int NodeType; - /// TI.ZPI1.ZDO_NODE_DESC_RSP.NWKAddrOfInterest - /// Device's short address of this Node descriptor - public ZToolAddress16 nwkAddr; - /// TI.ZPI1.ZDO_NODE_DESC_RSP.ServerMask - /// Specifies the system server capability - public int ServerMask; - /// TI.ZPI1.ZDO_NODE_DESC_RSP.SrcAddress - /// the message's source network address. - public ZToolAddress16 SrcAddress; - /// TI.ZPI1.ZDO_NODE_DESC_RSP.Status - /// this field indicates either SUCCESS or FAILURE. - public int Status; - /// TI.ZPI1.ZDO_NODE_DESC_RSP.TransferSize - /// Indicates maximum size of Transfer up to 0x7fff (This field is reserved in version 1.0 and shall be set to zero ). - public DoubleByte TransferSize; - /// TI.ZPI1.ZDO_NODE_DESC_RSP.UserDescriptorAvailable - /// Indicates if user descriptor is available for the node - public int UserDescriptorAvailable; - public int FreqBand; - - /// TI.ZPI1.ZDO_NODE_DESC_RSP - /// Constructor - public ZDO_NODE_DESC_RSP() { - } - - public ZDO_NODE_DESC_RSP(int[] framedata) { - this.SrcAddress = new ZToolAddress16(framedata[1], framedata[0]); - this.Status = framedata[2]; - this.nwkAddr = new ZToolAddress16(framedata[4], framedata[3]); - this.NodeType = framedata[5] & (0x07);///Experimental - this.ComplexDescriptorAvailable = (framedata[5] & (0x08)) >>> 3;///Experimental - this.UserDescriptorAvailable = (framedata[5] & (16)) >>> 4;///Experimental - this.APSFlags = framedata[6] & (0x0F); - this.FreqBand = framedata[6] & (0xF0) >>> 4; - this.Capabilities = framedata[10]; - this.ManufacturerCode = new DoubleByte(framedata[12], framedata[11]); - this.BufferSize = framedata[13]; - this.TransferSize = new DoubleByte(framedata[15], framedata[14]); - this.ServerMask = new DoubleByte(framedata[17], framedata[16]).get16BitValue(); - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_NODE_DESC_RSP), framedata); - } - - /// TI.ZPI1.ZDO_NODE_DESC_RSP.CAPABILITY_INFO - /// Capability Information bitfield - public class CAPABILITY_INFO { - /// TI.ZPI1.ZDO_NODE_DESC_RSP.CAPABILITY_INFO.ALLOCATE_ADDRESS - /// Capability Information bitfield - public static final int ALLOCATE_ADDRESS = 0x80; - /// TI.ZPI1.ZDO_NODE_DESC_RSP.CAPABILITY_INFO.ALTER_PAN_COORD - /// Capability Information bitfield - public static final int ALTER_PAN_COORD = 1; - /// TI.ZPI1.ZDO_NODE_DESC_RSP.CAPABILITY_INFO.DEVICE_TYPE - /// Capability Information bitfield - public static final int DEVICE_TYPE = 2; - /// TI.ZPI1.ZDO_NODE_DESC_RSP.CAPABILITY_INFO.NONE - /// Capability Information bitfield - public static final int NONE = 0; - /// TI.ZPI1.ZDO_NODE_DESC_RSP.CAPABILITY_INFO.POWER_SOURCE - /// Capability Information bitfield - public static final int POWER_SOURCE = 4; - /// TI.ZPI1.ZDO_NODE_DESC_RSP.CAPABILITY_INFO.RECEIVER_ON_WHEN_IDLE - /// Capability Information bitfield - public static final int RECEIVER_ON_WHEN_IDLE = 8; - /// TI.ZPI1.ZDO_NODE_DESC_RSP.CAPABILITY_INFO.SECURITY_CAPABILITY - /// Capability Information bitfield - public static final int SECURITY_CAPABILITY = 0x40; - } - - - /// TI.ZPI1.ZDO_NODE_DESC_RSP.NODE_TYPE - /// Type of Node - public class NODE_TYPE { - /// TI.ZPI1.ZDO_NODE_DESC_RSP.NODE_TYPE.COORDINATOR - /// Type of Node - public static final int COORDINATOR = 0; - /// TI.ZPI1.ZDO_NODE_DESC_RSP.NODE_TYPE.END_DEVICE - /// Type of Node - public static final int END_DEVICE = 2; - /// TI.ZPI1.ZDO_NODE_DESC_RSP.NODE_TYPE.ROUTER - /// Type of Node - public static final int ROUTER = 1; - } - - /// TI.ZPI1.ZDO_NODE_DESC_RSP.SERVER_CAPABILITY - /// Capabilities bitfield - public class SERVER_CAPABILITY { - /// TI.ZPI1.ZDO_NODE_DESC_RSP.SERVER_CAPABILITY.BACKUP_TRUST_CENTER - /// Capabilities bitfield - public static final int BACKUP_TRUST_CENTER = 2; - /// TI.ZPI1.ZDO_NODE_DESC_RSP.SERVER_CAPABILITY.BAK_BIND_TABLE_CACHE - /// Capabilities bitfield - public static final int BAK_BIND_TABLE_CACHE = 8; - /// TI.ZPI1.ZDO_NODE_DESC_RSP.SERVER_CAPABILITY.BAK_DISC_CACHE - /// Capabilities bitfield - public static final int BAK_DISC_CACHE = 50; - /// TI.ZPI1.ZDO_NODE_DESC_RSP.SERVER_CAPABILITY.NONE - /// Capabilities bitfield - public static final int NONE = 0; - /// TI.ZPI1.ZDO_NODE_DESC_RSP.SERVER_CAPABILITY.PRIM_BIND_TABLE_CACHE - /// Capabilities bitfield - public static final int PRIM_BIND_TABLE_CACHE = 4; - /// TI.ZPI1.ZDO_NODE_DESC_RSP.SERVER_CAPABILITY.PRIM_DISC_CACHE - /// Capabilities bitfield - public static final int PRIM_DISC_CACHE = 0x16; - /// TI.ZPI1.ZDO_NODE_DESC_RSP.SERVER_CAPABILITY.PRIM_TRUST_CENTER - /// Capabilities bitfield - public static final int PRIM_TRUST_CENTER = 1; - } - - @Override - public String toString() { - return "ZDO_NODE_DESC_RSP{" + - "APSFlags=" + APSFlags + - ", BufferSize=" + BufferSize + - ", Capabilities=" + Capabilities + - ", ComplexDescriptorAvailable=" + ComplexDescriptorAvailable + - ", ManufacturerCode=" + ManufacturerCode + - ", NodeType=" + NodeType + - ", nwkAddr=" + nwkAddr + - ", ServerMask=" + ServerMask + - ", SrcAddress=" + SrcAddress + - ", Status=" + ResponseStatus.getStatus(Status) + - ", TransferSize=" + TransferSize + - ", UserDescriptorAvailable=" + UserDescriptorAvailable + - ", FreqBand=" + FreqBand + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_NWK_ADDR_REQ.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_NWK_ADDR_REQ.java deleted file mode 100644 index 48bd68645bb7e..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_NWK_ADDR_REQ.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ZToolAddress64; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_NWK_ADDR_REQ extends ZToolPacket /*implements IREQUEST,IZDO*/ { - /// TI.ZPI1.ZDO_NWK_ADDR_REQ.IEEEAddress - /// 64 bit address bait - public ZToolAddress64 IEEEAddress; - /// TI.ZPI1.ZDO_NWK_ADDR_REQ.ReqType - /// Request type - public int ReqType; - /// TI.ZPI1.ZDO_NWK_ADDR_REQ.StartIndex - /// Starting index into the list of children. This is used to get more of the list if the list is to large for one message. - public int StartIndex; - - /// TI.ZPI1.ZDO_NWK_ADDR_REQ - /// Constructor - public ZDO_NWK_ADDR_REQ() { - } - - public ZDO_NWK_ADDR_REQ(ZToolAddress64 num1, int req_type1, int num2) { - this.IEEEAddress = num1; - this.ReqType = req_type1; - this.StartIndex = num2; - - int[] framedata = new int[10]; - for (int i = 0; i < 8; i++) { - framedata[i] = this.IEEEAddress.getAddress()[7 - i]; - } - framedata[8] = this.ReqType; - framedata[9] = this.StartIndex; - - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_NWK_ADDR_REQ), framedata); - } - - /// TI.ZPI1.ZDO_NWK_ADDR_REQ.REQ_TYPE - /// Request type - public class REQ_TYPE { - /// TI.ZPI1.ZDO_NWK_ADDR_REQ.REQ_TYPE.EXTENDED - /// Request type - public static final int EXTENDED = 1; - /// TI.ZPI1.ZDO_NWK_ADDR_REQ.REQ_TYPE.SINGLE_DEVICE_RESPONSE - /// Request type - public static final int SINGLE_DEVICE_RESPONSE = 0; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_NWK_ADDR_REQ_SRSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_NWK_ADDR_REQ_SRSP.java deleted file mode 100644 index 11352ef0d9fbe..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_NWK_ADDR_REQ_SRSP.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_NWK_ADDR_REQ_SRSP extends ZToolPacket /*implements IRESPONSE,IZDO*/ { - /// TI.ZPI1.ZDO_NWK_ADDR_REQ_SRSP.Status - /// Status - public int Status; - - /// TI.ZPI1.ZDO_NWK_ADDR_REQ_SRSP - /// Constructor - public ZDO_NWK_ADDR_REQ_SRSP() { - } - - public ZDO_NWK_ADDR_REQ_SRSP(int[] framedata) { - this.Status = framedata[0]; - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_NWK_ADDR_REQ_SRSP), framedata); - } - - @Override - public String toString() { - return "ZDO_NWK_ADDR_REQ_SRSP{" + - "Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_NWK_ADDR_RSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_NWK_ADDR_RSP.java deleted file mode 100644 index a480cfbffdce9..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_NWK_ADDR_RSP.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.*; -import org.bubblecloud.zigbee.util.DoubleByte; - -import java.util.Arrays; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_NWK_ADDR_RSP extends ZToolPacket /*implements IRESPONSE_CALLBACK,IZDO*/ { - /// TI.ZPI1.ZDO_NWK_ADDR_RSP.AssocDevList - /// Dynamic array, array of 16 bit short addresses - list of network address for associated devices. This list can be a partial list if the entire list doesn't fit into a packet. If it is a partial list, the starting index is StartIndex. - public ZToolAddress16[] AssocDevList; - /// TI.ZPI1.ZDO_NWK_ADDR_RSP.IEEEAddr - /// 64 bit IEEE address of source device - public ZToolAddress64 IEEEAddr; - /// TI.ZPI1.ZDO_NWK_ADDR_RSP.NumAssocDev - /// number of associated devices - public int NumAssocDev; - /// TI.ZPI1.ZDO_NWK_ADDR_RSP.nwkAddr - /// short network address of responding device - public ZToolAddress16 nwkAddr; - /// TI.ZPI1.ZDO_NWK_ADDR_RSP.SrcAddress - /// Source address, size is dependent on SrcAddrMode - public ZToolAddress64 SrcAddress; - /// TI.ZPI1.ZDO_NWK_ADDR_RSP.StartIndex - /// Starting index into the list of associated devices for this report. - public int StartIndex; - /// TI.ZPI1.ZDO_NWK_ADDR_RSP.Status - /// this field indicates either SUCCESS or FAILURE - public int Status; - - /// TI.ZPI1.ZDO_NWK_ADDR_RSP - /// Constructor - public ZDO_NWK_ADDR_RSP() { - this.AssocDevList = new ZToolAddress16[0xff]; - } - - public ZDO_NWK_ADDR_RSP(int[] framedata) { - ///WARNING: variable length. - ///resulting SrcAddress is 8 bytes but serialized is either 2 or 8 depending on Mode - this.Status = framedata[0]; - byte[] bytes = new byte[8]; - for (int i = 0; i < 8; i++) { - bytes[i] = (byte) framedata[8 - i]; - } - this.IEEEAddr = new ZToolAddress64(bytes); - this.nwkAddr = new ZToolAddress16(framedata[10], framedata[9]); - this.StartIndex = framedata[11]; - this.NumAssocDev = framedata[12]; - this.AssocDevList = new ZToolAddress16[this.NumAssocDev]; - for (int i = 0; i < this.AssocDevList.length; i++) { - this.AssocDevList[i] = new ZToolAddress16(framedata[14 + (i * 2)], framedata[13 + (i * 2)]); - } - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_NWK_ADDR_RSP), framedata); - } - - @Override - public String toString() { - return "ZDO_NWK_ADDR_RSP{" + - "AssocDevList=" + Arrays.toString(AssocDevList) + - ", IEEEAddr=" + IEEEAddr + - ", NumAssocDev=" + NumAssocDev + - ", nwkAddr=" + nwkAddr + - ", SrcAddress=" + SrcAddress + - ", StartIndex=" + StartIndex + - ", Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_SIMPLE_DESC_REQ.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_SIMPLE_DESC_REQ.java deleted file mode 100644 index 5c64345a3d07b..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_SIMPLE_DESC_REQ.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; -import org.bubblecloud.zigbee.util.Integers; - -/** - * @author Stefano "Kismet" Lenzi - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class ZDO_SIMPLE_DESC_REQ extends ZToolPacket /*implements IREQUEST,IZDO*/ { - /// TI.ZPI1.ZDO_SIMPLE_DESC_REQ.DstAddr - /// destination address - public ZToolAddress16 DstAddr; - /// TI.ZPI1.ZDO_SIMPLE_DESC_REQ.Endpoint - /// End point - public int Endpoint; - /// TI.ZPI1.ZDO_SIMPLE_DESC_REQ.NWKAddrOfInterest - /// NWK address for the request - public ZToolAddress16 NWKAddrOfInterest; - - /// TI.ZPI1.ZDO_SIMPLE_DESC_REQ - /// Constructor - public ZDO_SIMPLE_DESC_REQ() { - } - - public ZDO_SIMPLE_DESC_REQ(ZToolAddress16 dstAddr, ZToolAddress16 nwkAddressOfInterest, int endPoint) { - int[] framedata = new int[5]; - framedata[0] = dstAddr.getLsb(); - framedata[1] = dstAddr.getMsb(); - framedata[2] = nwkAddressOfInterest.getLsb(); - framedata[3] = nwkAddressOfInterest.getMsb(); - framedata[4] = endPoint; - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_SIMPLE_DESC_REQ), framedata); - } - - public ZDO_SIMPLE_DESC_REQ(short nwkAddress, short endPoint) { - int[] framedata = new int[5]; - - framedata[0] = Integers.getByteAsInteger(nwkAddress, 0); - framedata[1] = Integers.getByteAsInteger(nwkAddress, 1); - framedata[2] = framedata[0]; - framedata[3] = framedata[1]; - framedata[4] = endPoint & 0xFF; - - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_SIMPLE_DESC_REQ), framedata); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_SIMPLE_DESC_REQ_SRSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_SIMPLE_DESC_REQ_SRSP.java deleted file mode 100644 index 4d5b836ca8ad0..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_SIMPLE_DESC_REQ_SRSP.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_SIMPLE_DESC_REQ_SRSP extends ZToolPacket /*implements IRESPONSE,IZDO*/ { - /// TI.ZPI1.ZDO_SIMPLE_DESC_REQ_SRSP.Status - /// Status - public int Status; - - /// TI.ZPI1.ZDO_SIMPLE_DESC_REQ_SRSP - /// Constructor - public ZDO_SIMPLE_DESC_REQ_SRSP() { - } - - public ZDO_SIMPLE_DESC_REQ_SRSP(int[] framedata) { - this.Status = framedata[0]; - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_SIMPLE_DESC_REQ_SRSP), framedata); - } - - @Override - public String toString() { - return "ZDO_SIMPLE_DESC_REQ_SRSP{" + - "Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_SIMPLE_DESC_RSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_SIMPLE_DESC_RSP.java deleted file mode 100644 index 43fbab4d7da6e..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_SIMPLE_DESC_RSP.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; -import org.bubblecloud.zigbee.util.Integers; - -import java.util.Arrays; - -/** - * @author Stefano "Kismet" Lenzi - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class ZDO_SIMPLE_DESC_RSP extends ZToolPacket /*implements IRESPONSE_CALLBACK,IZDO*/ { - /// TI.ZPI1.ZDO_SIMPLE_DESC_RSP.AppDevID - /// The Device Description PROFILE_ID_HOME_AUTOMATION for this endpoint. - public DoubleByte DevID; - /// TI.ZPI1.ZDO_SIMPLE_DESC_RSP.AppDevVer - /// Flags indicating app version - public int DevVer; - /// TI.ZPI1.ZDO_SIMPLE_DESC_RSP.AppInClusterCount - /// The number of input clusters in the AppInClusterList - public int InClusterCount; - /// TI.ZPI1.ZDO_SIMPLE_DESC_RSP.AppInClusterList - /// List of input cluster IDs supported - public DoubleByte[] InClusterList; - /// TI.ZPI1.ZDO_SIMPLE_DESC_RSP.AppOutClusterCount - /// The number of output clusters in the AppOutClusterList - public int OutClusterCount; - /// TI.ZPI1.ZDO_SIMPLE_DESC_RSP.AppOutClusterList - /// List of output cluster IDs supported - public DoubleByte[] OutClusterList; - /// TI.ZPI1.ZDO_SIMPLE_DESC_RSP.AppProfID - /// The profile PROFILE_ID_HOME_AUTOMATION for this endpoint. - public DoubleByte ProfID; - - /// TI.ZPI1.ZDO_SIMPLE_DESC_RSP.Endpoint - /// End point - public int Endpoint; - /// TI.ZPI1.ZDO_SIMPLE_DESC_RSP.NWKAddrOfInterest - /// Device's short address that this response describes. - public ZToolAddress16 nwkAddr; - /// TI.ZPI1.ZDO_SIMPLE_DESC_RSP.SrcAddress - /// the message's source network address. - public ZToolAddress16 SrcAddress; - /// TI.ZPI1.ZDO_SIMPLE_DESC_RSP.Status - /// this field indicates either SUCCESS or FAILURE. - public int Status; - public int len; - private short[] inputs; - private short[] outputs; - - /// TI.ZPI1.ZDO_SIMPLE_DESC_RSP - /// Constructor - public ZDO_SIMPLE_DESC_RSP() { - this.InClusterList = new DoubleByte[0xff]; - this.OutClusterList = new DoubleByte[0xff]; - } - - public ZDO_SIMPLE_DESC_RSP(int[] framedata) { - this.SrcAddress = new ZToolAddress16(framedata[1], framedata[0]); - this.Status = framedata[2]; - this.nwkAddr = new ZToolAddress16(framedata[4], framedata[3]); - this.len = framedata[5]; - this.Endpoint = framedata[6]; - this.ProfID = new DoubleByte(framedata[8], framedata[7]); - this.DevID = new DoubleByte(framedata[10], framedata[9]); - this.DevVer = framedata[11]; - - this.InClusterCount = framedata[12]; - this.InClusterList = new DoubleByte[this.InClusterCount]; - - for (int i = 0; i < this.InClusterCount; i++) { - this.InClusterList[i] = new DoubleByte(framedata[(i * 2) + 14], framedata[(i * 2) + 13]); - } - this.OutClusterCount = framedata[((this.InClusterCount) * 2) + 13]; - this.OutClusterList = new DoubleByte[this.OutClusterCount]; - for (int i = 0; i < this.OutClusterCount; i++) { - this.OutClusterList[i] = new DoubleByte(framedata[(i * 2) + ((this.InClusterCount) * 2) + 15], framedata[(i * 2) + ((this.InClusterCount) * 2) + 14]); - } - - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_SIMPLE_DESC_RSP), framedata); - } - - /// TI.ZPI1.ZDO_SIMPLE_DESC_RSP.APP_DEV_VER - /// App dev ver - public class DEV_VER { - /// TI.ZPI1.ZDO_SIMPLE_DESC_RSP.APP_DEV_VER.VER_100 - /// App dev ver - public static final int VER_100 = 0; - } - - public short[] getInputClustersList() { - if (inputs == null) { - inputs = new short[super.packet[ZToolPacket.PAYLOAD_START_INDEX + 12]]; - int j = 0; - for (int i = 0; i < inputs.length; i++) { - inputs[i] = Integers.shortFromInts( - super.packet, - ZToolPacket.PAYLOAD_START_INDEX + 14 + j, - ZToolPacket.PAYLOAD_START_INDEX + 13 + j - ); - j += 2; - } - } - return inputs; - } - - public int getInputClustersCount() { - return getInputClustersList().length; - } - - - public short[] getOutputClustersList() { - if (outputs == null) { - int j = getInputClustersCount() * 2; - outputs = new short[super.packet[ZToolPacket.PAYLOAD_START_INDEX + 13 + j]]; - for (int i = 0; i < outputs.length; i++) { - outputs[i] = Integers.shortFromInts( - super.packet, - ZToolPacket.PAYLOAD_START_INDEX + 15 + j, - ZToolPacket.PAYLOAD_START_INDEX + 14 + j - ); - j += 2; - } - } - return outputs; - } - - public int getOutputClustersCount() { - return getOutputClustersList().length; - } - - public byte getEndPoint() { - return (byte) (super.packet[ZToolPacket.PAYLOAD_START_INDEX + 6]); - } - - public short getProfileId() { - return Integers.shortFromInts( - super.packet, - ZToolPacket.PAYLOAD_START_INDEX + 8, - ZToolPacket.PAYLOAD_START_INDEX + 7 - ); - } - - public short getDeviceId() { - return Integers.shortFromInts( - super.packet, - ZToolPacket.PAYLOAD_START_INDEX + 10, - ZToolPacket.PAYLOAD_START_INDEX + 9 - ); - } - - public byte getDeviceVersion() { - return (byte) super.packet[ZToolPacket.PAYLOAD_START_INDEX + 11]; - } - - @Override - public String toString() { - return "ZDO_SIMPLE_DESC_RSP{" + - "DevID=" + DevID + - ", DevVer=" + DevVer + - ", InClusterCount=" + InClusterCount + - ", InClusterList=" + Arrays.toString(InClusterList) + - ", OutClusterCount=" + OutClusterCount + - ", OutClusterList=" + Arrays.toString(OutClusterList) + - ", ProfID=" + ProfID + - ", Endpoint=" + Endpoint + - ", nwkAddr=" + nwkAddr + - ", SrcAddress=" + SrcAddress + - ", Status=" + ResponseStatus.getStatus(Status) + - ", len=" + len + - ", inputs=" + Arrays.toString(inputs) + - ", outputs=" + Arrays.toString(outputs) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_STARTUP_FROM_APP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_STARTUP_FROM_APP.java deleted file mode 100644 index 22c3247a69106..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_STARTUP_FROM_APP.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author alfiva - */ -public class ZDO_STARTUP_FROM_APP extends ZToolPacket /*implements IREQUEST,ISYSTEM*/ { - /// TI.ZPI1.SYS_RESET.Type - /// requests a target device reset (0) or port bootloader reset (1). If the target device does not support port bootloading, bootloader reset commands are ignored and no response is sent from the target. - public int Type; - - /// TI.ZPI1.SYS_RESET - /// Constructor - public ZDO_STARTUP_FROM_APP() { - } - - public ZDO_STARTUP_FROM_APP(int reset_type1) { - this.Type = reset_type1; - - int[] framedata = new int[1]; - framedata[0] = this.Type; - - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_STARTUP_FROM_APP), framedata); - } - - public ZDO_STARTUP_FROM_APP(int[] framedata) { - this.Type = framedata[0]; - - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_STARTUP_FROM_APP), framedata); - } - - /// TI.ZPI1.SYS_RESET.RESET_TYPE - /// Reset type - public class RESET_TYPE { - /// TI.ZPI1.SYS_RESET.RESET_TYPE.SERIAL_BOOTLOADER - /// Reset type - public static final int SERIAL_BOOTLOADER = 1; - /// TI.ZPI1.SYS_RESET.RESET_TYPE.TARGET_DEVICE - /// Reset type - public static final int TARGET_DEVICE = 0; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_STARTUP_FROM_APP_SRSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_STARTUP_FROM_APP_SRSP.java deleted file mode 100644 index 451cb651759dc..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_STARTUP_FROM_APP_SRSP.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author alfiva - */ -public class ZDO_STARTUP_FROM_APP_SRSP extends ZToolPacket /*implements IRESPONSE,IZDO*/ { - /// TI.ZPI1.ZDO_ACTIVE_EP_REQ_SRSP.Status - /// Status - public int Status; - - /// TI.ZPI1.ZDO_ACTIVE_EP_REQ_SRSP - /// Constructor - public ZDO_STARTUP_FROM_APP_SRSP() { - } - - public ZDO_STARTUP_FROM_APP_SRSP(int[] framedata) { - this.Status = framedata[0]; - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_STARTUP_FROM_APP_SRSP), framedata); - } - - @Override - public String toString() { - return "ZDO_STARTUP_FROM_APP_SRSP{" + - "Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_STATE_CHANGE_IND.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_STATE_CHANGE_IND.java deleted file mode 100644 index cd7c2a021e6a1..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_STATE_CHANGE_IND.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -import java.util.HashMap; -import java.util.Map; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_STATE_CHANGE_IND extends ZToolPacket /*implements IRESPONSE_CALLBACK,IZDO*/ { - /// TI.ZPI2.ZDO_STATE_CHANGE_IND.State - /// State - public int State; - - /// TI.ZPI2.ZDO_STATE_CHANGE_IND - /// Constructor - public ZDO_STATE_CHANGE_IND() { - } - - public ZDO_STATE_CHANGE_IND(int[] framedata) { - this.State = framedata[0]; - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_STATE_CHANGE_IND), framedata); - } - - @Override - public String toString() { - return "ZDO_STATE_CHANGE_IND{" + - "State=" + CMD_STATUS.getStatus(State) + - '}'; - } - - public enum CMD_STATUS { - DEV_HOLD(0x00), // Initialized - not started automatically - DEV_INIT(0x01), // Initialized - not connected to anything - DEV_NWK_DISC(0x02), // Discovering PAN's to join - DEV_NWK_JOINING(0x03), // Joining a PAN - DEV_NWK_REJOINING(0x04), // ReJoining a PAN, only for end-devices - DEV_END_DEVICE_UNAUTH(0x05), // Joined but not yet authenticated by trust center - DEV_END_DEVICE(0x06), // Started as device after authentication - DEV_ROUTER(0x07), // Device joined, authenticated and is a router - DEV_COORD_STARTING(0x08), // Started as ZigBee Coordinator - DEV_ZB_COORD(0x09), // Started as ZigBee Coordinator - DEV_NWK_ORPHAN(0x0A); // Device has lost information about its parent - - private static Map mapping = new HashMap(); - private int value; - - private CMD_STATUS(int value) { - this.value = value; - } - - public int getValue() { - return value; - } - - public static CMD_STATUS getStatus(int value) { - return mapping.get(value); - } - - static { - for (CMD_STATUS status : CMD_STATUS.values()) { - mapping.put(status.value, status); - } - } - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_UNBIND_REQ.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_UNBIND_REQ.java deleted file mode 100644 index 47112369ce79e..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_UNBIND_REQ.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.ZToolAddress64; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; -import org.bubblecloud.zigbee.util.Integers; - -/** - * @author Stefano "Kismet" Lenzi - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_UNBIND_REQ extends ZToolPacket /*implements IREQUEST,IZDO*/ { - - public ZDO_UNBIND_REQ(ZToolAddress16 nwkDst, - ZToolAddress64 ieeeSrc, int epSrc, - DoubleByte cluster, int addressingMode, - ZToolAddress64 ieeeDst, int epDst) { - - int[] framedata; - if (addressingMode == 3) { - framedata = new int[23]; - } else { - framedata = new int[16]; - } - framedata[0] = nwkDst.getLsb(); - framedata[1] = nwkDst.getMsb(); - byte[] bytes = ieeeSrc.getAddress(); - for (int i = 0; i < 8; i++) { - framedata[i + 2] = bytes[7 - i] & 0xFF; - } - framedata[10] = epSrc; - framedata[11] = cluster.getLsb(); - framedata[12] = cluster.getMsb(); - framedata[13] = addressingMode; - bytes = ieeeDst.getAddress(); - if (addressingMode == 3) { - for (int i = 0; i < 8; i++) { - framedata[i + 14] = bytes[7 - i] & 0xFF; - } - framedata[22] = epDst; - } else { - framedata[14] = bytes[7]; - framedata[15] = bytes[6]; - } - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_UNBIND_REQ), framedata); - } - - public ZDO_UNBIND_REQ( - short nwkDstAdr, short clusterId, - long bindSrcAdr, byte bindSrcEP, - short bindDstAdr, byte bindDstEP - ) { - int[] framedata = new int[17]; - framedata[0] = Integers.getByteAsInteger(nwkDstAdr, 0); - framedata[1] = Integers.getByteAsInteger(nwkDstAdr, 1); - for (int i = 0; i < 8; i++) { - framedata[i + 2] = Integers.getByteAsInteger(bindSrcAdr, i); - } - framedata[10] = bindSrcEP & 0xFF; - framedata[11] = Integers.getByteAsInteger(clusterId, 0); - framedata[12] = Integers.getByteAsInteger(clusterId, 1); - framedata[13] = ADDRESS_MODE.ADDRESS_16_BIT; - framedata[14] = Integers.getByteAsInteger(bindDstAdr, 0); - framedata[15] = Integers.getByteAsInteger(bindDstAdr, 1); - framedata[16] = bindDstEP & 0xFF; //TODO REMOVE?!??! - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_UNBIND_REQ), framedata); - } - - public ZDO_UNBIND_REQ( - short nwkDstAdr, short clusterId, - long bindSrcAdr, byte bindSrcEP, - long bindDstAdr, byte bindDstEP - ) { - int[] framedata = new int[23]; - framedata[0] = Integers.getByteAsInteger(nwkDstAdr, 0); - framedata[1] = Integers.getByteAsInteger(nwkDstAdr, 1); - for (int i = 0; i < 8; i++) { - framedata[i + 2] = Integers.getByteAsInteger(bindSrcAdr, i); - } - framedata[10] = bindSrcEP & 0xFF; - framedata[11] = Integers.getByteAsInteger(clusterId, 0); - framedata[12] = Integers.getByteAsInteger(clusterId, 1); - framedata[13] = ADDRESS_MODE.ADDRESS_64_BIT; - for (int i = 0; i < 8; i++) { - framedata[i + 14] = Integers.getByteAsInteger(bindDstAdr, i); - } - framedata[22] = bindDstEP & 0xFF; //TODO REMOVE?!??! - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_UNBIND_REQ), framedata); - } - - - /// TI.ZPI1.ZDO_UNBIND_REQ.ADDRESS_MODE - /// Specified the format of the coordinator address - public class ADDRESS_MODE { - /// TI.ZPI1.ZDO_UNBIND_REQ.ADDRESS_MODE.ADDRESS_16_BIT - /// Specified the format of the coordinator address - public static final int ADDRESS_16_BIT = 2; - /// TI.ZPI1.ZDO_UNBIND_REQ.ADDRESS_MODE.ADDRESS_64_BIT - /// Specified the format of the coordinator address - public static final int ADDRESS_64_BIT = 3; - /// TI.ZPI1.ZDO_UNBIND_REQ.ADDRESS_MODE.ADDRESS_NOT_PRESENT - /// Specified the format of the coordinator address - public static final int ADDRESS_NOT_PRESENT = 0; - /// TI.ZPI1.ZDO_UNBIND_REQ.ADDRESS_MODE.BROADCAST - /// Specified the format of the coordinator address - public static final int BROADCAST = 15; - /// TI.ZPI1.ZDO_UNBIND_REQ.ADDRESS_MODE.GROUP_ADDRESS - /// Specified the format of the coordinator address - public static final int GROUP_ADDRESS = 1; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_UNBIND_REQ_SRSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_UNBIND_REQ_SRSP.java deleted file mode 100644 index 7d9cf2051df9c..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_UNBIND_REQ_SRSP.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_UNBIND_REQ_SRSP extends ZToolPacket /*implements IRESPONSE,IZDO*/ { - /// TI.ZPI1.ZDO_UNBIND_REQ_SRSP.Status - /// Status - public int Status; - - /// TI.ZPI1.ZDO_UNBIND_REQ_SRSP - /// Constructor - public ZDO_UNBIND_REQ_SRSP() { - } - - public ZDO_UNBIND_REQ_SRSP(int[] framedata) { - this.Status = framedata[0]; - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_UNBIND_REQ_SRSP), framedata); - } - - @Override - public String toString() { - return "ZDO_UNBIND_REQ_SRSP{" + - "Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_UNBIND_RSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_UNBIND_RSP.java deleted file mode 100644 index 8900aa875f5d4..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_UNBIND_RSP.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_UNBIND_RSP extends ZToolPacket/* implements IRESPONSE_CALLBACK,IZDO*/ { - /// TI.ZPI1.ZDO_UNBIND_RSP.SrcAddress - /// the message's source network address - public ZToolAddress16 SrcAddress; - /// TI.ZPI1.ZDO_UNBIND_RSP.Status - /// this field indicates status of the bind request - public int Status; - - /// TI.ZPI1.ZDO_UNBIND_RSP - /// Constructor - public ZDO_UNBIND_RSP() { - } - - public ZDO_UNBIND_RSP(int[] framedata) { - this.SrcAddress = new ZToolAddress16(framedata[1], framedata[0]); - this.Status = framedata[2]; - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_UNBIND_RSP), framedata); - } - - @Override - public String toString() { - return "ZDO_UNBIND_RSP{" + - "SrcAddress=" + SrcAddress + - ", Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_USER_DESC_CONF.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_USER_DESC_CONF.java deleted file mode 100644 index 2ff34a19ac39a..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_USER_DESC_CONF.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_USER_DESC_CONF extends ZToolPacket /*implements IRESPONSE_CALLBACK,IZDO*/ { - /// TI.ZPI1.ZDO_USER_DESC_CONF.SrcAddress - /// Source address of the message - public ZToolAddress16 SrcAddress; - /// TI.ZPI1.ZDO_USER_DESC_CONF.Status - /// this field indicates status of the request - public int Status; - public ZToolAddress16 nwkAddr; - - /// TI.ZPI1.ZDO_USER_DESC_CONF - /// Constructor - public ZDO_USER_DESC_CONF() { - } - - public ZDO_USER_DESC_CONF(int[] framedata) { - this.SrcAddress = new ZToolAddress16(framedata[1], framedata[0]); - this.Status = framedata[2]; - this.nwkAddr = new ZToolAddress16(framedata[4], framedata[3]); - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_USER_DESC_CONF), framedata); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_USER_DESC_REQ.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_USER_DESC_REQ.java deleted file mode 100644 index 398d83d7dfca2..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_USER_DESC_REQ.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_USER_DESC_REQ extends ZToolPacket /*implements IREQUEST,IZDO*/ { - /// TI.ZPI1.ZDO_USER_DESC_REQ.DstAddr - /// destination address - public ZToolAddress16 DstAddr; - /// TI.ZPI1.ZDO_USER_DESC_REQ.NWKAddrOfInterest - /// NWK address for the request - public ZToolAddress16 nwkAddr; - - /// TI.ZPI1.ZDO_USER_DESC_REQ - /// Constructor - public ZDO_USER_DESC_REQ() { - } - - public ZDO_USER_DESC_REQ(ZToolAddress16 num1, ZToolAddress16 num2) { - this.DstAddr = num1; - this.nwkAddr = num2; - - int[] framedata = new int[4]; - framedata[0] = this.DstAddr.getLsb(); - framedata[1] = this.DstAddr.getMsb(); - framedata[2] = this.nwkAddr.getLsb(); - framedata[3] = this.nwkAddr.getMsb(); - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_USER_DESC_REQ), framedata); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_USER_DESC_REQ_SRSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_USER_DESC_REQ_SRSP.java deleted file mode 100644 index 3437a2cbcf758..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_USER_DESC_REQ_SRSP.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_USER_DESC_REQ_SRSP extends ZToolPacket /*implements IRESPONSE,IZDO*/ { - /// TI.ZPI1.ZDO_USER_DESC_REQ_SRSP.Status - /// Status - public int Status; - - /// TI.ZPI1.ZDO_USER_DESC_REQ_SRSP - /// Constructor - public ZDO_USER_DESC_REQ_SRSP() { - } - - public ZDO_USER_DESC_REQ_SRSP(int[] framedata) { - this.Status = framedata[0]; - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_USER_DESC_REQ_SRSP), framedata); - } - - @Override - public String toString() { - return "ZDO_USER_DESC_REQ_SRSP{" + - "Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_USER_DESC_RSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_USER_DESC_RSP.java deleted file mode 100644 index 35da94705de31..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_USER_DESC_RSP.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -import java.util.Arrays; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_USER_DESC_RSP extends ZToolPacket/* implements IRESPONSE_CALLBACK,IZDO*/ { - - /// TI.ZPI1.ZDO_USER_DESC_RSP.DescLen - /// Length, in bytes, of the user descriptor - public int DescLen; - /// TI.ZPI1.ZDO_USER_DESC_RSP.Descriptor - /// Dynamic array, User descriptor array (can be up to 15 bytes). - public int[] Descriptor; - /// TI.ZPI1.ZDO_USER_DESC_RSP.NWKAddrOfInterest - /// Device's short address that this response describes. - public ZToolAddress16 nwkAddr; - /// TI.ZPI1.ZDO_USER_DESC_RSP.SrcAddress - /// the message's source network address. - public ZToolAddress16 SrcAddress; - /// TI.ZPI1.ZDO_USER_DESC_RSP.Status - /// this field indicates either SUCCESS or FAILURE. - public int Status; - - /// TI.ZPI1.ZDO_USER_DESC_RSP - /// Constructor - public ZDO_USER_DESC_RSP() { - this.Descriptor = new int[0xff]; - } - - public ZDO_USER_DESC_RSP(int[] framedata) { - this.SrcAddress = new ZToolAddress16(framedata[1], framedata[0]); - this.Status = framedata[2]; - this.nwkAddr = new ZToolAddress16(framedata[4], framedata[3]); - this.DescLen = framedata[5]; - this.Descriptor = new int[this.DescLen]; - for (int i = 0; i < this.Descriptor.length; i++) { - this.Descriptor[i] = framedata[i + 6]; - } - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_USER_DESC_RSP), framedata); - } - - @Override - public String toString() { - return "ZDO_USER_DESC_RSP{" + - "DescLen=" + DescLen + - ", Descriptor=" + Arrays.toString(Descriptor) + - ", nwkAddr=" + nwkAddr + - ", SrcAddress=" + SrcAddress + - ", Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_USER_DESC_SET.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_USER_DESC_SET.java deleted file mode 100644 index 8b5875ff4671f..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_USER_DESC_SET.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_USER_DESC_SET extends ZToolPacket /*implements IREQUEST,IZDO*/ { - /// TI.ZPI1.ZDO_USER_DESC_SET.DescLen - /// Length, in bytes, of the user descriptor. - public int DescLen; - /// TI.ZPI1.ZDO_USER_DESC_SET.Descriptor - /// User descriptor array (can be up to 15 bytes). - public int[] Descriptor; - /// TI.ZPI1.ZDO_USER_DESC_SET.DstAddr - /// Destination network address. - public ZToolAddress16 DstAddr; - /// TI.ZPI1.ZDO_USER_DESC_SET.NWKAddrOfInterest - /// NWK address for the request. - public ZToolAddress16 nwkAddr; - - - /// TI.ZPI1.ZDO_USER_DESC_SET - /// Constructor - public ZDO_USER_DESC_SET() { - this.Descriptor = new int[15]; - } - - public ZDO_USER_DESC_SET(ZToolAddress16 num1, ZToolAddress16 num2, int num3, int[] buffer1) { - this.DstAddr = num1; - this.nwkAddr = num2; - this.DescLen = num3; - this.Descriptor = new int[buffer1.length]; - this.Descriptor = buffer1; - /*if (buffer1.Length > 15) - { - throw new Exception("Error creating object."); - } - this.Descriptor = new byte[15]; - Array.Copy(buffer1, this.Descriptor, buffer1.Length);*/ - - int[] framedata = new int[5 + this.Descriptor.length]; - framedata[0] = this.DstAddr.getLsb(); - framedata[1] = this.DstAddr.getMsb(); - framedata[2] = this.nwkAddr.getLsb(); - framedata[3] = this.nwkAddr.getMsb(); - framedata[4] = this.DescLen; - for (int i = 0; i < this.Descriptor.length; i++) { - framedata[i + 5] = this.Descriptor[i]; - } - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_USER_DESC_SET), framedata); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_USER_DESC_SET_SRSP.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_USER_DESC_SET_SRSP.java deleted file mode 100644 index c31828212037f..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/packet/zdo/ZDO_USER_DESC_SET_SRSP.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.network.packet.zdo; - -import org.bubblecloud.zigbee.network.packet.ResponseStatus; -import org.bubblecloud.zigbee.network.packet.ZToolCMD; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.util.DoubleByte; - -/** - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ZDO_USER_DESC_SET_SRSP extends ZToolPacket /*implements IRESPONSE,IZDO*/ { - /// TI.ZPI1.ZDO_USER_DESC_SET_SRSP.Status - /// Status - public int Status; - - /// TI.ZPI1.ZDO_USER_DESC_SET_SRSP - /// Constructor - public ZDO_USER_DESC_SET_SRSP() { - } - - public ZDO_USER_DESC_SET_SRSP(int[] framedata) { - this.Status = framedata[0]; - super.buildPacket(new DoubleByte(ZToolCMD.ZDO_USER_DESC_SET_SRSP), framedata); - } - - @Override - public String toString() { - return "ZDO_USER_DESC_SET_SRSP{" + - "Status=" + ResponseStatus.getStatus(Status) + - '}'; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/port/ZigBeeInterface.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/port/ZigBeeInterface.java deleted file mode 100644 index dffcf9ecdcd5a..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/port/ZigBeeInterface.java +++ /dev/null @@ -1,338 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -package org.bubblecloud.zigbee.network.port; - -import org.bubblecloud.zigbee.network.AsynchronousCommandListener; -import org.bubblecloud.zigbee.network.SynchronousCommandListener; -import org.bubblecloud.zigbee.network.packet.ZToolPacket; -import org.bubblecloud.zigbee.network.packet.ZToolPacketHandler; -import org.bubblecloud.zigbee.network.packet.ZToolPacketParser; -import org.bubblecloud.zigbee.util.DoubleByte; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; -import java.io.OutputStream; -import java.util.*; - -/** - * ZigBeeSerialInterface is used to startup connection to ZigBee network. - * - * @author Stefano "Kismet" Lenzi - * @author Tommi S.E. Laukkanen - * @author Chris Hatton - */ -public class ZigBeeInterface implements ZToolPacketHandler { - /** - * The logger. - */ - private final static Logger LOGGER = LoggerFactory.getLogger(ZigBeeInterface.class); - /** - * The port interface. - */ - final ZigBeePort port; - /** - * The packet parser. - */ - private ZToolPacketParser parser; - /** - * Support paraller processing of different command types. Only one command per command ID can be in process - * at a time. - */ - private final boolean supportMultipleSynchrounsCommand = false; - /** - * Synchronous command listeners. - */ - private final Hashtable synchronousCommandListeners - = new Hashtable(); - /** - * Asynchronous command listeners. - */ - private final HashSet asynchrounsCommandListeners - = new HashSet(); - /** - * Timeout times for synchronous command listeners. - */ - private final HashMap synchronousCommandListenerTimeouts = - new HashMap(); - - /** - * Constructor for configuring the ZigBee Network connection parameters. - * @param port the ZigBee transport implementation. - */ - public ZigBeeInterface(ZigBeePort port) { - this.port = port; - } - - /** - * Opens connection to ZigBee Network. - * @return true if connection startup was success. - */ - public boolean open() { - if (!port.open()) { - return false; - } - parser = new ZToolPacketParser(port.getInputStream(), this); - return true; - } - - /** - * Closes connection ot ZigBee Network. - */ - public void close() { - synchronized (port) { - if (parser != null) { - parser.setClosing(); - } - if (port != null) { - port.close(); - } - if (parser != null) { - parser.close(); - } - } - } - - /* ZToolPacketHandler */ - - /** - * Exception in packet parsing. - * @param th the exception - */ - public void error(final Throwable th) { - LOGGER.error("Exception in packet parsing: ", th); - } - - /** - * Handle parsed packet. - * @param packet the packet - */ - public void handlePacket(final ZToolPacket packet) { - final DoubleByte cmdId = packet.getCMD(); - switch (cmdId.getMsb() & 0xE0) { - // Received incoming message which can be either message from dongle or remote device. - case 0x40: - LOGGER.debug("<-- {} ({})", packet.getClass().getSimpleName(), packet); - notifyAsynchronousCommand(packet); - break; - - // Received synchronous command response. - case 0x60: - LOGGER.debug("<- {} ({})", packet.getClass().getSimpleName(), packet); - notifySynchronousCommand(packet); - break; - - default: - LOGGER.error("Received unknown packet. ({}) ({})", packet.getClass().getSimpleName(), packet); - } - } - - /** - * Send packet to dongle. - * @param packet the packet - * @throws IOException if IO exception occurs while sending packet - */ - private void sendPacket(final ZToolPacket packet) - throws IOException { - LOGGER.debug("-> {} ({}) ", packet.getClass().getSimpleName(), packet.toString()); - final int[] pck = packet.getPacket(); - synchronized (port) { - final OutputStream out = port.getOutputStream(); - if (out == null) { - // Socket has not been opened or is already closed. - return; - } - for (int i = 0; i < pck.length; i++) { - out.write(pck[i]); - } - out.flush(); - } - } - - - /** - * Cleans expired synchronous command listeners. - */ - private void cleanExpiredSynchronousCommandListeners() { - final long now = System.currentTimeMillis(); - final ArrayList expired = new ArrayList(); - synchronized (synchronousCommandListeners) { - final Iterator> i = - synchronousCommandListeners.entrySet().iterator(); - while (i.hasNext()) { - Map.Entry entry = i.next(); - - final long expiration = synchronousCommandListenerTimeouts.get(entry.getValue()); - if (expiration != -1L && expiration < now) { - expired.add(entry.getKey()); - } - } - - for (Short key : expired) { - synchronousCommandListeners.remove(key); - } - synchronousCommandListeners.notifyAll(); - } - } - - /** - * Sends synchronous command and adds listener. - * @param packet the command packet - * @param listener the synchronous command response listener - * @param timeout the timeout - * @throws IOException if IO exception occurs in packet sending - */ - public void sendSynchronousCommand(final ZToolPacket packet, final SynchronousCommandListener listener, - final long timeout) - throws IOException { - if (timeout == -1L) { - synchronousCommandListenerTimeouts.put(listener, -1L); - } else { - final long expirationTime = System.currentTimeMillis() + timeout; - synchronousCommandListenerTimeouts.put(listener, expirationTime); - } - - final DoubleByte cmdId = packet.getCMD(); - final int value = (cmdId.getMsb() & 0xE0); - if (value != 0x20) { - throw new IllegalArgumentException("You are trying to send a non SREQ packet as synchronous command. " - + "Evaluated " + value + " instead of " + 0x20 + "\nPacket " - + packet.getClass().getName() + "\n" + packet - ); - } - - cleanExpiredSynchronousCommandListeners(); - - if (supportMultipleSynchrounsCommand) { - synchronized (synchronousCommandListeners) { - final short id = (short) (cmdId.get16BitValue() & 0x1FFF); - while (synchronousCommandListeners.get(cmdId) != null) { - try { - LOGGER.trace("Waiting for other request {} to complete", id); - synchronousCommandListeners.wait(500); - cleanExpiredSynchronousCommandListeners(); - } catch (InterruptedException ignored) { - } - } - synchronousCommandListeners.put(id, listener); - } - } else { - synchronized (synchronousCommandListeners) { - final short id = (short) (cmdId.get16BitValue() & 0x1FFF); - while (synchronousCommandListeners.isEmpty() == false) { - try { - LOGGER.debug("Waiting for other request to complete"); - synchronousCommandListeners.wait(500); - cleanExpiredSynchronousCommandListeners(); - } catch (InterruptedException ignored) { - } - } - LOGGER.trace("Put synchronousCommandListeners listener for {} command", id); - synchronousCommandListeners.put(id, listener); - } - } - LOGGER.trace("Sending SynchrounsCommand {} ", packet); - sendPacket(packet); - } - - /** - * Sends asynchronous command. - * @param packet the packet. - * @throws IOException if IO exception occurs in packet sending. - */ - public void sendAsynchronousCommand(final ZToolPacket packet) throws IOException { - int value = (packet.getCMD().getMsb() & 0xE0); - if (value != 0x40) { - throw new IllegalArgumentException("You are trying to send a non AREQ packet. " - + "Evaluated " + value + " instead of " - + 0x40 + "\nPacket " + packet.getClass().getName() + "\n" + packet - ); - } - sendPacket(packet); - } - - /** - * Notifies listeners about synchronous command response. - * @param packet the received packet - */ - private void notifySynchronousCommand(final ZToolPacket packet) { - final DoubleByte cmdId = packet.getCMD(); - synchronized (synchronousCommandListeners) { - final short id = (short) (cmdId.get16BitValue() & 0x1FFF); - final SynchronousCommandListener listener = synchronousCommandListeners.get(id); - if (listener != null) { - listener.receivedCommandResponse(packet); - synchronousCommandListeners.remove(id); - synchronousCommandListeners.notifyAll(); - } else { - LOGGER.warn("Received {} synchronous command response but no listeners were registered", id); - } - - } - } - - /** - * Adds asynchronous command listener. - * @param listener the listener - * @return true if listener did not already exist. - */ - public boolean addAsynchronousCommandListener(AsynchronousCommandListener listener) { - boolean result = false; - synchronized (asynchrounsCommandListeners) { - result = asynchrounsCommandListeners.add(listener); - } - return result; - } - - /** - * Removes asynchronous command listener. - * @param listener the listener - * @return true if listener did not already exist. - */ - public boolean removeAsynchronousCommandListener(AsynchronousCommandListener listener) { - boolean result = false; - synchronized (asynchrounsCommandListeners) { - result = asynchrounsCommandListeners.remove(listener); - } - return result; - } - - /** - * Notifies listeners about asynchronous message. - * @param packet the packet containing the message - */ - private void notifyAsynchronousCommand(final ZToolPacket packet) { - final AsynchronousCommandListener[] listeners; - - synchronized (asynchrounsCommandListeners) { - listeners = asynchrounsCommandListeners.toArray(new AsynchronousCommandListener[]{}); - } - - for (final AsynchronousCommandListener listener : listeners) { - try { - listener.receivedAsynchronousCommand(packet); - } catch (Throwable e) { - LOGGER.error("Error in incoming asynchronous message processing.", e); - } - } - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/port/ZigBeeNetworkManagerImpl.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/port/ZigBeeNetworkManagerImpl.java deleted file mode 100644 index 73a026fbba67e..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/network/port/ZigBeeNetworkManagerImpl.java +++ /dev/null @@ -1,1544 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ -package org.bubblecloud.zigbee.network.port; - -import org.bubblecloud.zigbee.network.*; -import org.bubblecloud.zigbee.network.packet.*; -import org.bubblecloud.zigbee.network.packet.af.*; -import org.bubblecloud.zigbee.network.packet.simple.*; -import org.bubblecloud.zigbee.network.packet.system.SYS_RESET; -import org.bubblecloud.zigbee.network.packet.system.SYS_RESET_RESPONSE; -import org.bubblecloud.zigbee.network.packet.util.UTIL_GET_DEVICE_INFO; -import org.bubblecloud.zigbee.network.packet.util.UTIL_GET_DEVICE_INFO_RESPONSE; -import org.bubblecloud.zigbee.network.packet.zdo.*; -import org.bubblecloud.zigbee.util.Integers; -import org.bubblecloud.zigbee.network.model.*; -import org.bubblecloud.zigbee.util.NetworkAddressUtil; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; - -/** - * The zigbee network manager port port implementation. - * - * @author Stefano "Kismet" Lenzi - * @author Michele Girolami - * @author Manlio Bacco - * @author Tommi S.E. Laukkanen - * @author Chris Hatton - */ -public class ZigBeeNetworkManagerImpl implements ZigBeeNetworkManager { - - private final static Logger logger = LoggerFactory.getLogger(ZigBeeNetworkManagerImpl.class); - private final static Logger logger4Waiter = LoggerFactory.getLogger(WaitForCommand.class); - - public static final int DEFAULT_TIMEOUT = 5000; - public static final String TIMEOUT_KEY = "zigbee.driver.cc2530.timeout"; - - public static final int RESEND_TIMEOUT_DEFAULT = 1000; - public static final String RESEND_TIMEOUT_KEY = "zigbee.driver.cc2530.resend.timeout"; - - public static final int RESEND_MAX_RESEND_DEFAULT = 3; - public static final String RESEND_MAX_RESEND_KEY = "zigbee.driver.cc2530.resend.max"; - - public static final boolean RESEND_ONLY_EXCEPTION_DEFAULT = true; - public static final String RESEND_ONLY_EXCEPTION_KEY = "zigbee.driver.cc2530.resend.exceptionally"; - - private final int TIMEOUT; - private final int RESEND_TIMEOUT; - private final int RESEND_MAX_RETRY; - private final boolean RESEND_ONLY_EXCEPTION; - - private ZigBeeInterface zigbeeInterface; - private ZigBeePort port; - private DriverStatus state; - private NetworkMode mode; - private short pan; - private byte channel; - private boolean cleanStatus; - - private final HashSet announceListeners = new HashSet(); - private final AnnounceListenerFilter announceListenerFilter = new AnnounceListenerFilter(announceListeners); - - private final ArrayList messageListeners = new ArrayList(); - private final AFMessageListenerFilter afMessageListenerFilter = new AFMessageListenerFilter(messageListeners); - - private long ieeeAddress = -1; - private final HashMap, Thread> conversation3Way = new HashMap, Thread>(); - - public ZigBeeNetworkManagerImpl(ZigBeePort port, NetworkMode mode, int pan, int channel, - boolean cleanNetworkStatus, long timeout) { - - int aux = RESEND_TIMEOUT_DEFAULT; - try { - aux = Integer.parseInt(System.getProperty(RESEND_TIMEOUT_KEY)); - logger.trace("Using RESEND_TIMEOUT set from enviroment {}", aux); - } catch (NumberFormatException ex) { - logger.trace("Using RESEND_TIMEOUT set as DEFAULT {}", aux); - } - RESEND_TIMEOUT = aux; - - aux = (int) Math.max(DEFAULT_TIMEOUT, timeout); - try { - aux = Integer.parseInt(System.getProperty(TIMEOUT_KEY)); - logger.trace("Using TIMEOUT set from enviroment {}", aux); - } catch (NumberFormatException ex) { - logger.trace("Using TIMEOUT set as DEFAULT {}ms", aux); - } - TIMEOUT = aux; - - aux = RESEND_MAX_RESEND_DEFAULT; - try { - aux = Integer.parseInt(System.getProperty(RESEND_MAX_RESEND_KEY)); - logger.trace("Using RESEND_MAX_RETRY set from enviroment {}", aux); - } catch (NumberFormatException ex) { - logger.trace("Using RESEND_MAX_RETRY set as DEFAULT {}", aux); - } - RESEND_MAX_RETRY = aux; - - boolean b = RESEND_ONLY_EXCEPTION_DEFAULT; - try { - aux = Integer.parseInt(System.getProperty(RESEND_ONLY_EXCEPTION_KEY)); - logger.trace("Using RESEND_MAX_RETRY set from enviroment {}", aux); - } catch (NumberFormatException ex) { - logger.trace("Using RESEND_MAX_RETRY set as DEFAULT {}", aux); - } - RESEND_ONLY_EXCEPTION = b; - state = DriverStatus.CLOSED; - this.cleanStatus = cleanNetworkStatus; - setPort(port); - setZigBeeNetwork((byte) channel, (short) pan); - setZigBeeNodeMode(mode); - } - - public void startup() { - if (state == DriverStatus.CLOSED) { - state = DriverStatus.CREATED; - logger.trace("Initializing hardware."); - setState(DriverStatus.HARDWARE_INITIALIZING); - if (initializeHardware()) { - setState(DriverStatus.HARDWARE_READY); - } else { - shutdown(); - return; - } - - logger.trace("Initializing network."); - setState(DriverStatus.NETWORK_INITIALIZING); - if (!initializeZigBeeNetwork()) { - shutdown(); - return; - } - } else { - throw new IllegalStateException("Driver already opened, current status is:" + state); - } - } - - public void shutdown() { - if (state == DriverStatus.CLOSED) { - logger.debug("Already CLOSED"); - return; - } - if (state == DriverStatus.NETWORK_READY) { - logger.trace("Closing NETWORK"); - setState(DriverStatus.HARDWARE_READY); - } - if (state == DriverStatus.NETWORK_INITIALIZING || state == DriverStatus.HARDWARE_READY) { - logger.trace("Closing HARDWARE"); - dongleReset(); - zigbeeInterface.close(); - setState(DriverStatus.CREATED); - } - setState(DriverStatus.CLOSED); - } - - @SuppressWarnings("unchecked") - private boolean initializeHardware() { - zigbeeInterface = new ZigBeeInterface(port); - if (!zigbeeInterface.open()) { - logger.error("Failed to initialize the dongle on port {}.", port); - return false; - } - return true; - } - - private boolean initializeZigBeeNetwork() { - if (cleanStatus) { - if (!configureZigBeeNetwork()) { - return false; - } - } - if (!createZigBeeNetwork()) { - logger.error("Failed to start zigbee network."); - return false; - } - if (checkZigBeeNetworkConfiguration()) { - logger.error("Dongle configuration does not match the specified configuration."); - return false; - } - return true; - } - - private boolean createZigBeeNetwork() { - createCustomDevicesOnDongle(); - switch (mode) { - case Coordinator: - logger.debug("Creating network as coordinator."); - break; - - case Router: - logger.debug("Creating network as router."); - break; - - case EndDevice: - logger.debug("Creating network as end device."); - break; - } - - final int INSTANT_STARTUP = 0; - - ZDO_STARTUP_FROM_APP_SRSP response = (ZDO_STARTUP_FROM_APP_SRSP) sendSynchrouns( - zigbeeInterface, new ZDO_STARTUP_FROM_APP(INSTANT_STARTUP) - ); - if (response == null) return false; - switch (response.Status) { - case 0: { - logger.info("Initialized ZigBee network with existing network state."); - return true; - } - case 1: { - logger.info("Initialized ZigBee network with new or reset network state."); - return true; - } - case 2: { - logger.warn("Initializing ZigBee network failed."); - return false; - } - default: { - logger.error("Unexpected response state for ZDO_STARTUP_FROM_APP {}", response.Status); - return false; - } - } - - - } - - private boolean checkZigBeeNetworkConfiguration() { - int value = -1; - boolean mismatch = false; - if ((value = getCurrentChannel()) != channel) { - logger.warn( - "The channel configuration differ from the channel configuration in use: " + - "in use {}, while the configured is {}.\n" + - "The ZigBee network should be reconfigured or configuration corrected.", - value, channel - ); - mismatch = true; - } - if ((value = getCurrentPanId()) != pan) { - logger.warn( - "The PanId configuration differ from the channel configuration in use: " + - "in use {}, while the configured is {}.\n" + - "The ZigBee network should be reconfigured or configuration corrected.", - value, pan - ); - mismatch = true; - } - if ((value = getZigBeeNodeMode()) != mode.ordinal()) { - logger.warn( - "The NetworkMode configuration differ from the channel configuration in use: " + - "in use {}, while the configured is {}.\n" + - "The ZigBee network should be reconfigured or configuration corrected.", - value, mode.ordinal() - ); - mismatch = true; - } - - return mismatch; - } - - private boolean configureZigBeeNetwork() { - logger.debug("Resetting network stack."); - - logger.error("Setting clean state."); - if (!dongleSetCleanState(true)) { - logger.error("Unable to set clean state for dongle"); - return false; - } - logger.debug("Setting channel to {}.", channel); - if (!dongleSetChannel()) { - logger.error("Unable to set CHANNEL for ZigBee Network"); - return false; - } else { - logger.trace("CHANNEL set"); - } - logger.debug("Setting PAN to {}.", pan); - if (!dongleSetPanId()) { - logger.error("Unable to set PANID for ZigBee Network"); - return false; - } else { - logger.trace("PANID set"); - } - logger.debug("Changing the Network Mode to {}.", mode); - if (dongleSetNetworkMode() == false) { - logger.error("Unable to set NETWORK_MODE for ZigBee Network"); - return false; - } else { - logger.trace("NETWORK_MODE set"); - } - if (!dongleReset()) { - logger.error("Unable to reset dongle"); - return false; - } - if (!dongleSetCleanState(false)) { - logger.error("Unable to unset clean state for dongle"); - return false; - } - return true; - } - - protected boolean dongleMasterReset() { - //---------START FROM APP - logger.trace("Reset seq: Trying STARTFROMAPP"); - ZDO_STARTUP_FROM_APP_SRSP responseA1 = (ZDO_STARTUP_FROM_APP_SRSP) sendSynchrouns( - zigbeeInterface, new ZDO_STARTUP_FROM_APP(ZDO_STARTUP_FROM_APP.RESET_TYPE.TARGET_DEVICE) - ); - if (responseA1 == null) { - logger.error("Reset seq: Failed STARTFROMAPP"); - return false; - } - //---------ZB WRITE CONF - logger.trace("Reset seq: Trying WRITECONF"); - ZB_WRITE_CONFIGURATION_RSP responseA2 = (ZB_WRITE_CONFIGURATION_RSP) sendSynchrouns( - zigbeeInterface, new ZB_WRITE_CONFIGURATION(3, new int[]{2}) - ); - if (responseA2 == null) { - logger.error("Reset seq: Failed WRITECONF"); - return false; - } - //---------GET DEVICE INFO - logger.debug("Reset seq: Trying GETDEVICEINFO"); -// final WaitForCommand waiter1 = new WaitForCommand( -// ZToolCMD.UTIL_GET_DEVICE_INFO_RESPONSE, -// zigbeeSerialInterface -// ); -// try{ -// zigbeeSerialInterface.sendAsynchrounsCommand(new UTIL_GET_DEVICE_INFO()); -// } catch (IOException e) { -// logger.error("GetDeviceInfo of Master Reset failed", e); -// return false; -// } -// UTIL_GET_DEVICE_INFO_RESPONSE responseA3 = (UTIL_GET_DEVICE_INFO_RESPONSE) waiter1.getCommand(TIMEOUT); - UTIL_GET_DEVICE_INFO_RESPONSE responseA3 = (UTIL_GET_DEVICE_INFO_RESPONSE) sendSynchrouns(zigbeeInterface, new UTIL_GET_DEVICE_INFO()); - if (responseA3 == null) { - logger.error("Reset seq: Failed GETDEVICEINFO"); - return false; - } - ZToolAddress16[] addresses = new ZToolAddress16[responseA3.AssocDevicesList.length]; - for (int k = 0; k < responseA3.AssocDevicesList.length; k++) { - addresses[k] = new ZToolAddress16(responseA3.AssocDevicesList[k].getMsb(), responseA3.AssocDevicesList[k].getLsb()); - } - //---------ZDO GET IEEE ADDR - logger.trace("Reset seq: Trying GETIEEEADDR"); - ZToolAddress64[] longAddresses = new ZToolAddress64[addresses.length]; - for (int k = 0; k < addresses.length; k++) { -// ZDO_IEEE_ADDR_RSP responseA4 = sendZDOIEEEAddressRequest(new ZDO_IEEE_ADDR_REQ(addresses[k],ZDO_IEEE_ADDR_REQ.REQ_TYPE.EXTENDED.getValue(),0)); - - ZDO_IEEE_ADDR_RSP responseA4 = null; - WaitForCommand waiter = new WaitForCommand(ZToolCMD.ZDO_IEEE_ADDR_RSP, zigbeeInterface); - logger.trace("Sending ZDO_IEEE_ADDR_REQ"); - ZDO_IEEE_ADDR_REQ_SRSP response = (ZDO_IEEE_ADDR_REQ_SRSP) sendSynchrouns(zigbeeInterface, new ZDO_IEEE_ADDR_REQ(addresses[k], ZDO_IEEE_ADDR_REQ.REQ_TYPE.EXTENDED.getValue(), 0)); - if (response == null || response.Status != 0) { - logger.trace("ZDO_IEEE_ADDR_REQ failed, received {}", response); - waiter.cleanup(); - } else { - responseA4 = (ZDO_IEEE_ADDR_RSP) waiter.getCommand(TIMEOUT); - } - - if (responseA4 != null) { - longAddresses[k] = responseA4.getIEEEAddress(); - } else { - longAddresses[k] = null; - } - } - //---------ZDO MGMT LEAVE - logger.trace("Reset seq: Trying LEAVE"); - long start = System.currentTimeMillis(); - for (int k = 0; k < longAddresses.length; k++) { - if (longAddresses[k] != null) { - WaitForCommand waiter3 = new WaitForCommand(ZToolCMD.ZDO_MGMT_LEAVE_RSP, zigbeeInterface); - - ZDO_MGMT_LEAVE_REQ_SRSP response = (ZDO_MGMT_LEAVE_REQ_SRSP) sendSynchrouns(zigbeeInterface, new ZDO_MGMT_LEAVE_REQ(addresses[k], longAddresses[k], 3)); - if ((System.currentTimeMillis() - start) > TIMEOUT) { - logger.error("Reset seq: Failed LEAVE"); - return false; - } - if (response == null || response.Status != 0) { - waiter3.cleanup(); - logger.error("Reset seq: Failed LEAVE"); - return false; - } else { - if ((System.currentTimeMillis() - start) > TIMEOUT) { - logger.error("Reset seq: Failed LEAVE"); - return false; - } - ZDO_MGMT_LEAVE_RSP responseA5 = (ZDO_MGMT_LEAVE_RSP) waiter3.getCommand(TIMEOUT); - if ((System.currentTimeMillis() - start) > TIMEOUT) { - logger.error("Reset seq: Failed LEAVE"); - return false; - } - if (responseA5 == null || responseA5.Status != 0) { - logger.error("Reset seq: Failed LEAVE"); - return false; - } - } - } - if ((System.currentTimeMillis() - start) > TIMEOUT) { - logger.error("Reset seq: Failed LEAVE"); - return false; - } - } - - //---------SYS RESET - logger.debug("Reset seq: Trying SYSRESET"); - if (!dongleReset()) { - logger.error("Reset seq: Failed SYSRESET"); - return false; - } - //---------START FROM APP -// //already in initializeZigBeeNetwork -// ZDO_STARTUP_FROM_APP_SRSP responseA7 = (ZDO_STARTUP_FROM_APP_SRSP) sendSynchrouns( -// zigbeeSerialInterface, new ZDO_STARTUP_FROM_APP(ZDO_STARTUP_FROM_APP.RESET_TYPE.TARGET_DEVICE) -// ); -// if (responseA7==null)return false; - return true; - } - - private void setState(DriverStatus value) { - logger.trace("{} -> {}", this.state, value); - synchronized (this) { - state = value; - notifyAll(); - } - if (state == DriverStatus.HARDWARE_READY) { - postHardwareEnabled(); - } - } - - private void postHardwareEnabled() { - if (!messageListeners.contains(afMessageListenerFilter)) { - zigbeeInterface.addAsynchronousCommandListener(afMessageListenerFilter); - } - if (!announceListeners.contains(announceListenerFilter)) { - zigbeeInterface.addAsynchronousCommandListener(announceListenerFilter); - } - } - - private boolean waitForHardware() { - synchronized (this) { - while (state == DriverStatus.CREATED || state == DriverStatus.CLOSED) { - logger.debug("Waiting for hardware to become ready"); - try { - wait(); - } catch (InterruptedException ignored) { - } - } - return isHardwareReady(); - } - } - - private boolean waitForNetwork() { - synchronized (this) { - while (state != DriverStatus.NETWORK_READY && state != DriverStatus.CLOSED) { - logger.debug("Waiting for network to become ready"); - try { - wait(); - } catch (InterruptedException ignored) { - } - } - return isNetworkReady(); - } - } - - - private String buildDriverThreadName(String serialPort, int bitrate, int channel) { - return "ZigBeeNetworkManager[" + serialPort + "," + bitrate + "]"; - } - - public void setZigBeeNodeMode(NetworkMode m) { - if (state != DriverStatus.CLOSED) { - throw new IllegalStateException("Network mode can be changed only " + - "if driver is CLOSED while it is:" + state); - } -// cleanStatus = mode != m; - mode = m; - } - - public void setZigBeeNetwork(byte ch, short panId) { - if (state != DriverStatus.CLOSED) { - throw new IllegalStateException("Network mode can be changed only " + - "if driver is CLOSED while it is:" + state); - } - //cleanStatus = ch != channel || panId != pan; - channel = ch; - pan = panId; - } - - public void setPort(ZigBeePort port) { - if (state != DriverStatus.CLOSED) { - throw new IllegalStateException("Serial port can be changed only " + - "if driver is CLOSED while it is:" + state); - } - this.port = port; - } - - @Override - public HashSet getAnnounceListeners() { - return announceListeners; - } - - public RESPONSE sendLocalRequest(REQUEST request) { - if (waitForNetwork() == false) return null; - RESPONSE result = (RESPONSE) sendSynchrouns(zigbeeInterface, request); - if (result == null) { - logger.error("{} timed out waiting for synchronous local response.", request.getClass().getSimpleName()); - } - return result; - } - - public RESPONSE sendRemoteRequest(REQUEST request) { - if (waitForNetwork() == false) return null; - RESPONSE result = null; - - waitAndLock3WayConversation(request); - final WaitForCommand waiter = new WaitForCommand(ZToolCMD.ZDO_MGMT_PERMIT_JOIN_RSP, zigbeeInterface); - - logger.trace("Sending {}", request); - ZToolPacket response = sendSynchrouns(zigbeeInterface, request); - if (response == null) { - logger.error("{} timed out waiting for synchronous local response.", request.getClass().getSimpleName()); - waiter.cleanup(); - return null; - } else { - logger.error("{} timed out waiting for asynchronous remote response.", request.getClass().getSimpleName()); - result = (RESPONSE) waiter.getCommand(TIMEOUT); - unLock3WayConversation(request); - return result; - } - } - - public ZDO_MGMT_LQI_RSP sendLQIRequest(ZDO_MGMT_LQI_REQ request) { - - if (waitForNetwork() == false) return null; - ZDO_MGMT_LQI_RSP result = null; - - waitAndLock3WayConversation(request); - final WaitForCommand waiter = new WaitForCommand(ZToolCMD.ZDO_MGMT_LQI_RSP, zigbeeInterface); - - logger.trace("Sending ZDO_MGMT_LQI_REQ {}", request); - ZDO_MGMT_LQI_REQ_SRSP response = (ZDO_MGMT_LQI_REQ_SRSP) sendSynchrouns(zigbeeInterface, request); - if (response == null || response.Status != 0) { - logger.trace("ZDO_MGMT_LQI_REQ failed, received {}", response); - waiter.cleanup(); - } else { - result = (ZDO_MGMT_LQI_RSP) waiter.getCommand(TIMEOUT); - } - unLock3WayConversation(request); - return result; - } - - public ZDO_IEEE_ADDR_RSP sendZDOIEEEAddressRequest(ZDO_IEEE_ADDR_REQ request) { - if (waitForNetwork() == false) return null; - ZDO_IEEE_ADDR_RSP result = null; - - waitAndLock3WayConversation(request); - final WaitForCommand waiter = new WaitForCommand(ZToolCMD.ZDO_IEEE_ADDR_RSP, zigbeeInterface); - - logger.trace("Sending ZDO_IEEE_ADDR_REQ {}", request); - ZDO_IEEE_ADDR_REQ_SRSP response = (ZDO_IEEE_ADDR_REQ_SRSP) sendSynchrouns(zigbeeInterface, request); - if (response == null || response.Status != 0) { - logger.warn("ZDO_IEEE_ADDR_REQ failed, received {}", response); - waiter.cleanup(); - } else { - result = (ZDO_IEEE_ADDR_RSP) waiter.getCommand(TIMEOUT); - } - unLock3WayConversation(request); - return result; - } - - public ZDO_NODE_DESC_RSP sendZDONodeDescriptionRequest(ZDO_NODE_DESC_REQ request) { - if (waitForNetwork() == false) return null; - ZDO_NODE_DESC_RSP result = null; - - waitAndLock3WayConversation(request); - final WaitForCommand waiter = new WaitForCommand(ZToolCMD.ZDO_NODE_DESC_RSP, zigbeeInterface); - - ZDO_NODE_DESC_REQ_SRSP response = (ZDO_NODE_DESC_REQ_SRSP) sendSynchrouns(zigbeeInterface, request); - if (response == null || response.Status != 0) { - waiter.cleanup(); - } else { - result = (ZDO_NODE_DESC_RSP) waiter.getCommand(TIMEOUT); - } - - unLock3WayConversation(request); - return result; - } - - public ZDO_ACTIVE_EP_RSP sendZDOActiveEndPointRequest(ZDO_ACTIVE_EP_REQ request) { - if (waitForNetwork() == false) return null; - ZDO_ACTIVE_EP_RSP result = null; - - waitAndLock3WayConversation(request); - final WaitForCommand waiter = new WaitForCommand(ZToolCMD.ZDO_ACTIVE_EP_RSP, zigbeeInterface); - - logger.trace("Sending ZDO_ACTIVE_EP_REQ {}", request); - ZDO_ACTIVE_EP_REQ_SRSP response = (ZDO_ACTIVE_EP_REQ_SRSP) sendSynchrouns(zigbeeInterface, request); - if (response == null || response.Status != 0) { - logger.trace("ZDO_ACTIVE_EP_REQ failed, received {}", response); - waiter.cleanup(); - } else { - result = (ZDO_ACTIVE_EP_RSP) waiter.getCommand(TIMEOUT); - } - unLock3WayConversation(request); - return result; - } - - public ZDO_MGMT_PERMIT_JOIN_RSP sendPermitJoinRequest(ZDO_MGMT_PERMIT_JOIN_REQ request) { - if (waitForNetwork() == false) return null; - ZDO_MGMT_PERMIT_JOIN_RSP result = null; - - waitAndLock3WayConversation(request); - final WaitForCommand waiter = new WaitForCommand(ZToolCMD.ZDO_MGMT_PERMIT_JOIN_RSP, zigbeeInterface); - - logger.trace("Sending ZDO_MGMT_PERMIT_JOIN_REQ {}", request); - ZDO_MGMT_PERMIT_JOIN_REQ_SRSP response = (ZDO_MGMT_PERMIT_JOIN_REQ_SRSP) sendSynchrouns(zigbeeInterface, request); - if (response == null || response.Status != 0) { - logger.trace("ZDO_MGMT_PERMIT_JOIN_REQ failed, received {}", response); - waiter.cleanup(); - } else { - result = (ZDO_MGMT_PERMIT_JOIN_RSP) waiter.getCommand(TIMEOUT); - } - unLock3WayConversation(request); - return result; - } - - public boolean sendZDOLeaveRequest(ZToolAddress16[] addresses) { - //---------ZDO GET IEEE ADDR - logger.trace("Reset seq: Trying GETIEEEADDR"); - ZToolAddress64[] longAddresses = new ZToolAddress64[addresses.length]; - for (int k = 0; k < addresses.length; k++) { -// ZDO_IEEE_ADDR_RSP responseA4 = sendZDOIEEEAddressRequest(new ZDO_IEEE_ADDR_REQ(addresses[k],ZDO_IEEE_ADDR_REQ.REQ_TYPE.EXTENDED.getValue(),0)); - - ZDO_IEEE_ADDR_RSP responseA4 = null; - WaitForCommand waiter = new WaitForCommand(ZToolCMD.ZDO_IEEE_ADDR_RSP, zigbeeInterface); - logger.trace("Sending ZDO_IEEE_ADDR_REQ"); - ZDO_IEEE_ADDR_REQ_SRSP response = (ZDO_IEEE_ADDR_REQ_SRSP) sendSynchrouns(zigbeeInterface, new ZDO_IEEE_ADDR_REQ(addresses[k], ZDO_IEEE_ADDR_REQ.REQ_TYPE.EXTENDED.getValue(), 0)); - if (response == null || response.Status != 0) { - logger.trace("ZDO_IEEE_ADDR_REQ failed, received {}", response); - waiter.cleanup(); - } else { - responseA4 = (ZDO_IEEE_ADDR_RSP) waiter.getCommand(TIMEOUT); - } - - if (responseA4 != null) { - longAddresses[k] = responseA4.getIEEEAddress(); - } else { - longAddresses[k] = null; - } - } - //---------ZDO MGMT LEAVE - logger.debug("Reset seq: Trying LEAVE"); - long start = System.currentTimeMillis(); - for (int k = 0; k < longAddresses.length; k++) { - if (longAddresses[k] != null) { - WaitForCommand waiter3 = new WaitForCommand(ZToolCMD.ZDO_MGMT_LEAVE_RSP, zigbeeInterface); - - ZDO_MGMT_LEAVE_REQ_SRSP response = (ZDO_MGMT_LEAVE_REQ_SRSP) sendSynchrouns(zigbeeInterface, new ZDO_MGMT_LEAVE_REQ(addresses[k], longAddresses[k], 0)); - if (response == null) { - logger.error("Leave request time out."); - return false; - } - if (response.Status != 0) { - waiter3.cleanup(); - logger.error("Leave SRSP error status: " + response.Status); - return false; - } - ZDO_MGMT_LEAVE_RSP responseA5 = (ZDO_MGMT_LEAVE_RSP) waiter3.getCommand(TIMEOUT); - if (responseA5 == null) { - logger.error("Leave request got no RSP."); - return false; - } - if (responseA5.Status != 0) { - logger.error("Leave request RSP error status: " + responseA5.Status); - return false; - } - } - if ((System.currentTimeMillis() - start) > TIMEOUT) { - logger.error("Reset seq: Failed LEAVE"); - return false; - } - } - - return true; - } - - - /** - * @param request - */ - private void waitAndLock3WayConversation(ZToolPacket request) { - synchronized (conversation3Way) { - Class clz = request.getClass(); - Thread requestor = null; - while ((requestor = conversation3Way.get(clz)) != null) { - if (requestor.isAlive() == false) { - logger.error("Thread {} whom requested {} DIED before unlocking the conversation"); - logger.debug("The thread {} who was waiting for {} to complete DIED, so we have to remove the lock"); - conversation3Way.put(clz, null); - break; - } - logger.trace( - "{} is waiting for {} to complete which was issued by {} to complete", - new Object[]{Thread.currentThread(), clz, requestor} - ); - try { - conversation3Way.wait(); - } catch (InterruptedException ex) { - //ex.printStackTrace(); - } catch (IllegalMonitorStateException ex) { - ex.printStackTrace(); - } - } - conversation3Way.put(clz, Thread.currentThread()); - } - } - - /** - * Release the lock held for the 3-way communication - * - * @param request - */ - private void unLock3WayConversation(ZToolPacket request) { - Class clz = request.getClass(); - Thread requestor = null; - synchronized (conversation3Way) { - requestor = conversation3Way.get(clz); - conversation3Way.put(clz, null); - conversation3Way.notify(); - } - if (requestor == null) { - logger.error("LOCKING BROKEN - SOMEONE RELEASE THE LOCK WITHOUT LOCKING IN ADVANCE for {}", clz); - } else if (requestor != Thread.currentThread()) { - logger.error( - "Thread {} stolen the answer of {} waited by {}", - new Object[]{Thread.currentThread(), clz, requestor} - ); - } - } - - public ZDO_SIMPLE_DESC_RSP sendZDOSimpleDescriptionRequest(ZDO_SIMPLE_DESC_REQ request) { - if (waitForNetwork() == false) return null; - ZDO_SIMPLE_DESC_RSP result = null; - waitAndLock3WayConversation(request); - final WaitForCommand waiter = new WaitForCommand(ZToolCMD.ZDO_SIMPLE_DESC_RSP, zigbeeInterface); - - ZDO_SIMPLE_DESC_REQ_SRSP response = (ZDO_SIMPLE_DESC_REQ_SRSP) sendSynchrouns(zigbeeInterface, request); - if (response == null || response.Status != 0) { - waiter.cleanup(); - } else { - result = (ZDO_SIMPLE_DESC_RSP) waiter.getCommand(TIMEOUT); - } - - unLock3WayConversation(request); - return result; - } - - private class WaitForCommand implements AsynchronousCommandListener { - - final ZToolPacket[] result = new ZToolPacket[]{null}; - final int waitFor; - final ZigBeeInterface driver; - - public WaitForCommand(int waitFor, ZigBeeInterface driver) { - this.waitFor = waitFor; - this.driver = driver; - logger4Waiter.trace("Waiting for asynchronous response message {}.", waitFor); - driver.addAsynchronousCommandListener(this); - } - - - public void receivedAsynchronousCommand(ZToolPacket packet) { - logger4Waiter.trace("Received a packet {} and waiting for {}", packet.getCMD().get16BitValue(), waitFor); - logger4Waiter.trace("received {} {}", packet.getClass(), packet.toString()); - if (packet.isError()) return; - if (packet.getCMD().get16BitValue() != waitFor) { - logger4Waiter.trace("Received unexpected packet: " + packet.getClass().getSimpleName()); - return; - } - synchronized (result) { - result[0] = packet; - logger4Waiter.trace("Received expected response: {}", packet.getClass().getSimpleName()); - cleanup(); - } - } - - public ZToolPacket getCommand(final long timeout) { - synchronized (result) { - final long wakeUpTime = System.currentTimeMillis() + timeout; - while (result[0] == null && wakeUpTime > System.currentTimeMillis()) { - try { - result.wait(wakeUpTime - System.currentTimeMillis()); - } catch (InterruptedException ignored) { - } - - } - } - if (result[0] == null) { - logger4Waiter.trace("Timeout {} expired and no packet with {} received", timeout, waitFor); - } - cleanup(); - return result[0]; - } - - public void cleanup() { - synchronized (result) { - driver.removeAsynchronousCommandListener(this); - result.notify(); - } - } - } - - private boolean dongleReset() { - if (waitForHardware() == false) return false; - - final WaitForCommand waiter = new WaitForCommand( - ZToolCMD.SYS_RESET_RESPONSE, - zigbeeInterface - ); - - try { - zigbeeInterface.sendAsynchronousCommand(new SYS_RESET(SYS_RESET.RESET_TYPE.SERIAL_BOOTLOADER)); - } catch (IOException e) { - logger.error("DongleReset failed", e); - return false; - } - - SYS_RESET_RESPONSE response = - (SYS_RESET_RESPONSE) waiter.getCommand(TIMEOUT); - - return response != null; - } - - private boolean dongleSetCleanState(boolean clean) { - ZB_WRITE_CONFIGURATION_RSP response; - if (clean) { - response = (ZB_WRITE_CONFIGURATION_RSP) sendSynchrouns( - zigbeeInterface, - new ZB_WRITE_CONFIGURATION( - ZB_WRITE_CONFIGURATION.CONFIG_ID.ZCD_NV_STARTUP_OPTION, - new int[]{0x00000002} - ) - ); - - if (response == null || response.Status != 0) { - logger.warn("Couldn't set ZCD_NV_STARTUP_OPTION to CLEAN_STATE"); - return false; - } else { - logger.trace("Set ZCD_NV_STARTUP_OPTION to CLEAN_STATE"); - } - } else { - response = (ZB_WRITE_CONFIGURATION_RSP) sendSynchrouns( - zigbeeInterface, - new ZB_WRITE_CONFIGURATION( - ZB_WRITE_CONFIGURATION.CONFIG_ID.ZCD_NV_STARTUP_OPTION, - new int[]{0x00000000} - ) - ); - - if (response == null || response.Status != 0) { - logger.info("Couldn't set ZCD_NV_STARTUP_OPTION back to DO_NOTHING"); - return false; - } - } - return true; - } - - static final int[] buildChannelMask(int channel) { - int channelMask = 1 << channel; - int[] mask = new int[4]; - for (int i = 0; i < mask.length; i++) { - mask[i] = Integers.getByteAsInteger(channelMask, i); - } - return mask; - } - - private boolean dongleSetChannel(int[] channelMask) { - - logger.trace( - "Setting the channel to {}{}{}{}", new Object[]{ - Integer.toHexString(channelMask[0]), - Integer.toHexString(channelMask[1]), - Integer.toHexString(channelMask[2]), - Integer.toHexString(channelMask[3]) - } - ); - - ZB_WRITE_CONFIGURATION_RSP response = - (ZB_WRITE_CONFIGURATION_RSP) sendSynchrouns( - zigbeeInterface, - new ZB_WRITE_CONFIGURATION( - ZB_WRITE_CONFIGURATION.CONFIG_ID.ZCD_NV_CHANLIST, - channelMask - ) - ); - - return response != null && response.Status == 0; - } - - private boolean dongleSetChannel(int ch) { - int[] channelMask = buildChannelMask(ch); - - return dongleSetChannel(channelMask); - } - - private boolean dongleSetChannel() { - int[] channelMask = buildChannelMask(channel); - - return dongleSetChannel(channelMask); - } - - private boolean dongleSetNetworkMode() { - - ZB_WRITE_CONFIGURATION_RSP response = - (ZB_WRITE_CONFIGURATION_RSP) sendSynchrouns( - zigbeeInterface, - new ZB_WRITE_CONFIGURATION( - ZB_WRITE_CONFIGURATION.CONFIG_ID.ZCD_NV_LOGICAL_TYPE, - new int[]{mode.ordinal()} - ) - ); - - return response != null && response.Status == 0; - } - - private boolean dongleSetPanId() { - ZB_WRITE_CONFIGURATION_RSP response = - (ZB_WRITE_CONFIGURATION_RSP) sendSynchrouns( - zigbeeInterface, - new ZB_WRITE_CONFIGURATION( - ZB_WRITE_CONFIGURATION.CONFIG_ID.ZCD_NV_PANID, - new int[]{ - Integers.getByteAsInteger(pan, 0), - Integers.getByteAsInteger(pan, 1) - } - ) - ); - - return response != null && response.Status == 0; - } - - private ZToolPacket sendSynchrouns(final ZigBeeInterface hwDriver, final ZToolPacket request) { - final ZToolPacket[] response = new ZToolPacket[]{null}; -// final int TIMEOUT = 1000, MAX_SEND = 3; - int sending = 1; - - logger.trace("{} sending as synchronous command.", request.getClass().getSimpleName()); - - SynchronousCommandListener listener = new SynchronousCommandListener() { - - public void receivedCommandResponse(ZToolPacket packet) { - logger.trace(" {} received as synchronous command.", packet.getClass().getSimpleName()); - synchronized (response) { - // Do not set response[0] again. - response[0] = packet; - response.notify(); - } - } - }; - - while (sending <= RESEND_MAX_RETRY) { - try { - try { - hwDriver.sendSynchronousCommand(request, listener, RESEND_TIMEOUT); - } catch (Exception ex) { - ex.printStackTrace(); - } - logger.trace("{} sent (synchronous command, retry: {}).", request.getClass().getSimpleName(), sending); - synchronized (response) { - long wakeUpTime = System.currentTimeMillis() + RESEND_TIMEOUT; - while (response[0] == null && wakeUpTime > System.currentTimeMillis()) { - final long sleeping = wakeUpTime - System.currentTimeMillis(); - logger.trace("Waiting for synchronous command up to {}ms till {} Unixtime", sleeping, wakeUpTime); - if (sleeping <= 0) { - break; - } - try { - response.wait(sleeping); - } catch (InterruptedException ignored) { - } - } - } - if (response[0] != null) { - logger.trace("{} -> {}", - request.getClass().getSimpleName(), response[0].getClass().getSimpleName()); - break; // Break out as we have response. - } else { - logger.warn("{} executed and timed out while waiting for response.", - request.getClass().getSimpleName()); - } - if (RESEND_ONLY_EXCEPTION) { - break; - } else { - logger.info("Failed to send {} during the {}-th tentative", request.getClass().getName(), sending); - sending++; - } - } catch (Exception ignored) { - logger.info("Failed to send {} during the {}-th tentative", request.getClass().getName(), sending); - logger.trace("Sending operation failed due to ", ignored); - sending++; - } - } - - return response[0]; - } - - public boolean addAnnunceListener(AnnounceListener listner) { - if (announceListeners.isEmpty() && isHardwareReady()) { - zigbeeInterface.addAsynchronousCommandListener(announceListenerFilter); - } - return announceListeners.add(listner); - } - - public boolean removeAnnunceListener(AnnounceListener listner) { - boolean result = announceListeners.remove(listner); - if (announceListeners.isEmpty() && isHardwareReady()) { - zigbeeInterface.removeAsynchronousCommandListener(announceListenerFilter); - } - return result; - } - - public AF_REGISTER_SRSP sendAFRegister(AF_REGISTER request) { - if (waitForNetwork() == false) return null; - - AF_REGISTER_SRSP response = (AF_REGISTER_SRSP) sendSynchrouns(zigbeeInterface, request); - return response; - } - - public AF_DATA_CONFIRM sendAFDataRequest(AF_DATA_REQUEST request) { - if (waitForNetwork() == false) return null; - AF_DATA_CONFIRM result = null; - - waitAndLock3WayConversation(request); - final WaitForCommand waiter = new WaitForCommand(ZToolCMD.AF_DATA_CONFIRM, zigbeeInterface); - - AF_DATA_SRSP response = (AF_DATA_SRSP) sendSynchrouns(zigbeeInterface, request); - if (response == null || response.Status != 0) { - waiter.cleanup(); - } else { - result = (AF_DATA_CONFIRM) waiter.getCommand(TIMEOUT); - } - unLock3WayConversation(request); - - return result; - } - - public ZDO_BIND_RSP sendZDOBind(ZDO_BIND_REQ request) { - if (waitForNetwork() == false) return null; - ZDO_BIND_RSP result = null; - - waitAndLock3WayConversation(request); - final WaitForCommand waiter = new WaitForCommand(ZToolCMD.ZDO_BIND_RSP, zigbeeInterface); - - ZDO_BIND_REQ_SRSP response = (ZDO_BIND_REQ_SRSP) sendSynchrouns(zigbeeInterface, request); - if (response == null || response.Status != 0) { - waiter.cleanup(); - } else { - result = (ZDO_BIND_RSP) waiter.getCommand(TIMEOUT); - } - unLock3WayConversation(request); - return result; - } - - public ZDO_UNBIND_RSP sendZDOUnbind(ZDO_UNBIND_REQ request) { - if (waitForNetwork() == false) return null; - ZDO_UNBIND_RSP result = null; - - waitAndLock3WayConversation(request); - final WaitForCommand waiter = new WaitForCommand(ZToolCMD.ZDO_UNBIND_RSP, zigbeeInterface); - - ZDO_UNBIND_REQ_SRSP response = (ZDO_UNBIND_REQ_SRSP) sendSynchrouns(zigbeeInterface, request); - if (response == null || response.Status != 0) { - waiter.cleanup(); - } else { - result = (ZDO_UNBIND_RSP) waiter.getCommand(TIMEOUT); - } - - unLock3WayConversation(request); - return result; - } - - public boolean removeAFMessageListener(ApplicationFrameworkMessageListener listner) { - boolean result = false; - synchronized (messageListeners) { - result = messageListeners.remove(listner); - } - - if (messageListeners.isEmpty() && isHardwareReady()) { - if (zigbeeInterface.removeAsynchronousCommandListener(afMessageListenerFilter)) { - logger.trace("Removed AsynchrounsCommandListener {} to ZigBeeSerialInterface", afMessageListenerFilter.getClass().getName()); - } else { - logger.warn("Could not remove AsynchrounsCommandListener {} to ZigBeeSerialInterface", afMessageListenerFilter.getClass().getName()); - } - } - if (result) { - logger.trace("Removed ApplicationFrameworkMessageListener {}:{}", listner, listner.getClass().getName()); - return true; - } else { - logger.warn("Could not remove ApplicationFrameworkMessageListener {}:{}", listner, listner.getClass().getName()); - return false; - } - } - - public boolean addAFMessageListner(ApplicationFrameworkMessageListener listner) { - if (messageListeners.isEmpty() && isHardwareReady()) { - if (zigbeeInterface.addAsynchronousCommandListener(afMessageListenerFilter)) { - logger.trace("Added AsynchrounsCommandListener {} to ZigBeeSerialInterface", afMessageListenerFilter.getClass().getName()); - } else { - logger.trace("Could not add AsynchrounsCommandListener {} to ZigBeeSerialInterface", afMessageListenerFilter.getClass().getName()); - } - } - boolean result = false; - synchronized (messageListeners) { - result = messageListeners.add(listner); - } - - if (result) { - logger.trace("Added ApplicationFrameworkMessageListener {}:{}", listner, listner.getClass().getName()); - return true; - } else { - logger.warn("Could not add ApplicationFrameworkMessageListener {}:{}", listner, listner.getClass().getName()); - return false; - } - } - - private boolean isNetworkReady() { - synchronized (this) { - return state.ordinal() >= DriverStatus.NETWORK_READY.ordinal() - && state.ordinal() < DriverStatus.CLOSED.ordinal(); - } - } - - private boolean isHardwareReady() { - synchronized (this) { - return state.ordinal() >= DriverStatus.HARDWARE_READY.ordinal() - && state.ordinal() < DriverStatus.CLOSED.ordinal(); - } - } - - /** - * @return - * @since 0.2.0 - */ - public long getExtendedPanId() { - if (waitForNetwork() == false) { - logger.info("Failed to reach the {} level: getExtendedPanId() failed", DriverStatus.NETWORK_READY); - return -1; - } - - int[] result = getDeviceInfo(ZB_GET_DEVICE_INFO.DEV_INFO_TYPE.EXT_PAN_ID); - - if (result == null) { - return -1; - } else { - return Integers.shortFromInts(result, 7, 0); - } - } - - /** - * @return - * @since 0.2.0 - */ - public long getIEEEAddress() { - - if (ieeeAddress != -1) { - return ieeeAddress; - } - - if (waitForNetwork() == false) { - logger.info("Failed to reach the {} level: getIEEEAddress() failed", DriverStatus.NETWORK_READY); - return -1; - } - - int[] result = getDeviceInfo(ZB_GET_DEVICE_INFO.DEV_INFO_TYPE.IEEE_ADDR); - - if (result == null) { - return -1; - } else { - ieeeAddress = Integers.longFromInts(result, 7, 0); - return ieeeAddress; - } - } - - /** - * @return - * @since 0.2.0 - */ - public int getCurrentPanId() { - if (waitForNetwork() == false) { - logger.info("Failed to reach the {} level: getCurrentPanId() failed", DriverStatus.NETWORK_READY); - return -1; - } - - int[] result = getDeviceInfo(ZB_GET_DEVICE_INFO.DEV_INFO_TYPE.PAN_ID); - - if (result == null) { - return -1; - } else { - return Integers.shortFromInts(result, 1, 0); - } - } - - /** - * @return - * @since 0.2.0 - */ - public int getCurrentChannel() { - if (waitForNetwork() == false) { - logger.info("Failed to reach the {} level: getCurrentChannel() failed", DriverStatus.NETWORK_READY); - return -1; - } - - int[] result = getDeviceInfo(ZB_GET_DEVICE_INFO.DEV_INFO_TYPE.CHANNEL); - - if (result == null) { - return -1; - } else { - return result[0]; - } - } - - /** - * @return - * @since 0.2.0 - */ - public int getCurrentState() { - if (waitForNetwork() == false) { - logger.info("Failed to reach the {} level: getCurrentChannel() failed", DriverStatus.NETWORK_READY); - return -1; - } - - int[] result = getDeviceInfo(ZB_GET_DEVICE_INFO.DEV_INFO_TYPE.STATE); - - if (result == null) { - return -1; - } else { - return result[0]; - } - } - - - private int[] getDeviceInfo(int type) { - ZB_GET_DEVICE_INFO_RSP response = (ZB_GET_DEVICE_INFO_RSP) sendSynchrouns( - zigbeeInterface, new ZB_GET_DEVICE_INFO(type) - ); - - if (response == null) { - logger.warn("Failed getDeviceInfo for {} due to null value", type); - return null; - } else if (response.Param != type) { - logger.warn("Failed getDeviceInfo for {} non matching response returned {}", type, response.Param); - return null; - } else { - logger.trace("getDeviceInfo for {} done", type); - return response.Value; - } - } - - public int getZigBeeNodeMode() { - ZB_READ_CONFIGURATION_RSP response = - (ZB_READ_CONFIGURATION_RSP) sendSynchrouns( - zigbeeInterface, - new ZB_READ_CONFIGURATION(ZB_WRITE_CONFIGURATION.CONFIG_ID.ZCD_NV_LOGICAL_TYPE) - ); - if (response != null && response.Status == 0) { - return response.Value[0]; - } else { - return -1; - } - } - - public DriverStatus getDriverStatus() { - return state; - } - - private int[] ep, prof, dev, ver; - private short[][] inp, out; - - public void addCustomEndpoint(String endpointNumber, String profileID, String deviceID, String version, String inputClusters, String outputCluster) { - - String[] inputGroupsNumber = null, outputGroupsNumber = null, inputClusterGroup = null, outputClusterGroup = null; - if (checkString(inputClusters)) - inputGroupsNumber = inputClusters.trim().split("]"); - if (checkString(outputCluster)) - outputGroupsNumber = outputCluster.trim().split("]"); - - if (inputGroupsNumber != null && outputGroupsNumber != null && inputGroupsNumber.length > 0 && inputGroupsNumber.length == outputGroupsNumber.length) { - - int max = -1; - for (int i = 0; i < inputGroupsNumber.length; i++) { - inputGroupsNumber[i] = inputGroupsNumber[i].replace("[", ""); - inputGroupsNumber[i] = inputGroupsNumber[i].replace("]", ""); - inputGroupsNumber[i] = inputGroupsNumber[i].replace(" ", ""); - - int temp = inputGroupsNumber[i].trim().split(",").length; - if (temp > max) - max = temp; - } - inp = new short[inputGroupsNumber.length][max]; - for (int i = 0; i < inputGroupsNumber.length; i++) { - inputClusterGroup = inputGroupsNumber[i].trim().split(","); - for (int j = 0; j < inputClusterGroup.length; j++) { - if (toShort(inputClusterGroup[j]) != -1) - inp[i][j] = toShort(inputClusterGroup[j]); - } - } - - max = -1; - for (int i = 0; i < outputGroupsNumber.length; i++) { - outputGroupsNumber[i] = outputGroupsNumber[i].replace("[", ""); - outputGroupsNumber[i] = outputGroupsNumber[i].replace("]", ""); - outputGroupsNumber[i] = outputGroupsNumber[i].replace(" ", ""); - - int temp = outputGroupsNumber[i].trim().split(",").length; - if (temp > max) - max = temp; - } - out = new short[outputGroupsNumber.length][max]; - for (int i = 0; i < outputGroupsNumber.length; i++) { - outputClusterGroup = outputGroupsNumber[i].trim().split(","); - for (int j = 0; j < outputClusterGroup.length; j++) { - if (toShort(outputClusterGroup[j]) != -1) - out[i][j] = toShort(outputClusterGroup[j]); - } - } - - ep = new int[inputGroupsNumber.length]; - prof = new int[inputGroupsNumber.length]; - dev = new int[inputGroupsNumber.length]; - ver = new int[inputGroupsNumber.length]; - - String[] eps = endpointNumber.trim().split(","); - for (int i = 0; i < eps.length; i++) { - ep[i] = toShort(eps[i]); - } - String[] profs = profileID.trim().split(","); - for (int i = 0; i < profs.length; i++) { - prof[i] = toShort(profs[i]); - } - String[] devs = deviceID.trim().split(","); - for (int i = 0; i < devs.length; i++) { - dev[i] = toShort(devs[i]); - } - String[] vers = version.trim().split(","); - for (int i = 0; i < vers.length; i++) { - ver[i] = toShort(vers[i]); - } - } - } - - private boolean checkString(String s) { - if (s != null && !s.isEmpty()) - return true; - - return false; - } - - private Short toShort(String s) { - - try { - return Short.parseShort(s); - } catch (Exception ex) { - return -1; - } - } - - public void createCustomDevicesOnDongle() { - - int[] input, output; - - if (this.ep != null) - for (int i = 0; i < this.ep.length; i++) { - // input - int size = 0; - for (int j = 0; j < this.inp[i].length; j++) { - - if (this.inp[i][j] != 0 && this.inp[i][j] != -1) - size++; - } - - input = new int[size]; - for (int j = 0; j < this.inp[i].length; j++) { - - if (this.inp[i][j] != 0 && this.inp[i][j] != -1) - input[j] = this.inp[i][j]; - } - - // output - size = 0; - for (int j = 0; j < this.out[i].length; j++) { - - if (this.out[i][j] != 0 && this.out[i][j] != -1) - size++; - } - - output = new int[size]; - for (int j = 0; j < this.out[i].length; j++) { - - if (this.out[i][j] != 0 && this.out[i][j] != -1) - output[j] = this.out[i][j]; - } - - if (newDevice(new AF_REGISTER(new Byte(this.ep[i] + ""), this.prof[i], new Short(this.dev[i] + ""), new Byte(this.ver[i] + ""), input, output))) - logger.debug("Custom device {} registered at endpoint {}", this.dev[i], this.ep[i]); - else - logger.debug("Custom device {} registration failed at endpoint {}", this.dev[i], this.ep[i]); - } - } - - public boolean newDevice(AF_REGISTER request) { - - try { - AF_REGISTER_SRSP response = (AF_REGISTER_SRSP) sendSynchrouns(zigbeeInterface, request); - if (response != null && response.Status == 0) - return true; - } catch (Exception e) { - e.printStackTrace(); - } - - return false; - } - - - private class AnnounceListenerFilter implements AsynchronousCommandListener { - - private final Collection listners; - - private AnnounceListenerFilter(Collection list) { - listners = list; - } - - public void receivedAsynchronousCommand(ZToolPacket packet) { - if (packet.isError()) return; - if (packet.getCMD().get16BitValue() == ZToolCMD.ZDO_END_DEVICE_ANNCE_IND) { - logger.debug("Recieved announce message {} value is {}", packet.getClass(), packet); - ZDO_END_DEVICE_ANNCE_IND annunce = (ZDO_END_DEVICE_ANNCE_IND) packet; - for (AnnounceListener l : listners) { - l.announce(annunce.SrcAddr, annunce.IEEEAddr, annunce.NwkAddr, annunce.Capabilities); - - } - } else if (packet.getCMD().get16BitValue() == ZToolCMD.ZDO_STATE_CHANGE_IND) { - try { - ZDO_STATE_CHANGE_IND p = ((ZDO_STATE_CHANGE_IND) packet); - switch (p.State) { - case 0: - logger.trace("Initialized - not started automatically"); - break; - case 1: - logger.trace("Initialized - not connected to anything"); - break; - case 2: - logger.trace("Discovering PANs to join or waiting for permit join"); - break; - case 3: - logger.trace("Joining a PAN"); - break; - case 4: - logger.trace("Rejoining a PAN, only for end-devices"); - break; - case 5: - logger.trace("Joined but not yet authenticated by trust center"); - break; - case 6: - logger.trace("Started as device after authentication"); - break; - case 7: - logger.trace("Device joined, authenticated and is a router"); - break; - case 8: - logger.trace("Starting as ZigBee Coordinator"); - break; - case 9: - logger.debug("Started as ZigBee Coordinator"); - setState(DriverStatus.NETWORK_READY); - break; - case 10: - logger.debug("Device has lost information about its parent"); - break; - default: - break; - } - } catch (Exception ex) { - // ignored - } - } - } - } - - private class AFMessageListenerFilter implements AsynchronousCommandListener { - - private final Collection listners; - - private AFMessageListenerFilter(Collection list) { - listners = list; - } - - public void receivedAsynchronousCommand(ZToolPacket packet) { - if (packet.isError()) return; - if (packet.getCMD().get16BitValue() == ZToolCMD.AF_INCOMING_MSG) { - AF_INCOMING_MSG msg = (AF_INCOMING_MSG) packet; - if (listners.isEmpty()) { - logger.warn("Received AF_INCOMING_MSG but no listeners. " + - "Message was from {} and cluster {} to end point {}. Data: {}", - msg.getSrcAddr(), msg.getClusterId(), - msg.getDstEndpoint(), msg); - } else { - logger.debug("Received AF_INCOMING_MSG from {} and cluster {} to end point {}. Data: {}", - msg.getSrcAddr(), msg.getClusterId(), - msg.getDstEndpoint(), msg); - } - ArrayList localCopy = null; - synchronized (listners) { - localCopy = new ArrayList(listners); - } - for (ApplicationFrameworkMessageListener l : localCopy) { - l.notify(msg); - } - } - } - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/ArraysUtil.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/ArraysUtil.java deleted file mode 100644 index c828572395cee..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/ArraysUtil.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.util; - -/** - * @author Stefano "Kismet" Lenzi - * @author Francesco Furfari - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.4.0 - */ -public class ArraysUtil { - - /** - * Create a new int[] by concatenating prefix and postfix - * - * @param prefix the first the int[] to join - * @param postfix the second the int[] to join - * @return the new int[] obtained by concatenating prefix and postfix - */ - public static final int[] append(int[] prefix, int[] postfix) { - int[] result = new int[prefix.length + postfix.length]; - System.arraycopy(prefix, 0, result, 0, prefix.length); - System.arraycopy(postfix, 0, result, prefix.length, postfix.length); - return result; - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/ByteUtils.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/ByteUtils.java deleted file mode 100644 index 3db764acaa4c4..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/ByteUtils.java +++ /dev/null @@ -1,294 +0,0 @@ -/* - Copyright 2008-2013 Andrew Rapp, http://code.google.com/p/xbee-api/ - - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.util; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author Andrew Rapp - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class ByteUtils { - - private final static Logger logger = LoggerFactory.getLogger(ByteUtils.class); - - /** - * There is a slight problem with this method that you might have noticed; a Java int is signed, so we can't make - * use of the 32nd bit. This means we this method does not support a four byte value with msb greater than 01111111 ((2^7-1) or 127). - *

- * TODO use long instead of int to support 4 bytes values. note that long assignments are not atomic. - */ - public static int convertMultiByteToInt(int[] bytes) { - - if (bytes.length > 4) { - throw new RuntimeException("too big"); - } else if (bytes.length == 4 && ((bytes[0] & 0x80) == 0x80)) { - // 0x80 == 10000000, 0x7e == 01111111 - throw new RuntimeException("Java int can't support a four byte value, with msb byte greater than 7e"); - } - - int val = 0; - - for (int i = 0; i < bytes.length; i++) { - - if (bytes[i] > 0xFF) { - throw new RuntimeException("Values exceeds byte range: " + bytes[i]); - } - - if (i == (bytes.length - 1)) { - val += bytes[i]; - } else { - val += bytes[i] << ((bytes.length - i - 1) * 8); - } - } - - return val; - } - - public static long convertMultiByteToLong(byte[] bytes) { - - if (bytes.length > 8) { - throw new IllegalArgumentException("too many bytes can't be converted to long"); - } else if (bytes.length == 8 && ((bytes[0] & 0x80) == 0x80)) { - // 0x80 == 10000000, 0x7e == 01111111 - throw new RuntimeException("Java long can't support a 8 bytes value, where msb byte greater than 7e"); - } - - long val = 0; - - for (int i = 0; i < bytes.length; i++) { - val += 0x000000FF & bytes[i]; - val = val << 8; - } - - return val; - } - - public static int[] convertLongtoMultiByte(long val) { - - int size = 0; - - if ((val >> 56) > 0) { - size = 8; - } else if ((val >> 48) > 0) { - size = 7; - } else if ((val >> 40) > 0) { - size = 6; - } else if ((val >> 32) > 0) { - size = 5; - } else if ((val >> 24) > 0) { - size = 4; - } else if ((val >> 16) > 0) { - size = 3; - } else if ((val >> 8) > 0) { - size = 2; - } else { - size = 1; - } - - int[] data = new int[size]; - - for (int i = 0; i < size; i++) { - data[i] = (int) ((val >> (size - i - 1) * 8) & 0xFF); - } - - return data; - } - - public final static String toBase16(final int[] arr) { - return toBase16(arr, 0, arr.length); - } - - /** - * @since 0.6.0 - */ - public final static String toBase16(final int[] arr, final int start, final int end) { - - StringBuffer sb = new StringBuffer(); - - for (int i = start; i < end; i++) { - sb.append(toBase16(arr[i])); - - if (i < arr.length - 1) { - sb.append(" "); - } - } - - return sb.toString(); - } - - /** - * @param bytes the String representing the bytes in hex form - * @return the formatted bytes - * @since 0.6.0 - Revision 60 - */ - public static int[] fromBase16toIntArray(String bytes) { - final String PATTERN = "\\s*((0x[0-9a-f]{2}|[0-9a-f]{2})\\s*)+"; - bytes = bytes.toLowerCase(); - if (bytes.matches(PATTERN) == false) { - throw new IllegalArgumentException("Unable to parse " + bytes + " doesn't match regex " + PATTERN); - } - String[] singleBytes = bytes.split("\\s+"); - String item; - int[] values = new int[singleBytes.length]; - for (int i = 0; i < singleBytes.length; i++) { - item = singleBytes[i]; - if (item.length() == 0) - continue; - - if (item.startsWith("0x")) { - item = item.substring(2); - } - - values[i] = (Integer.parseInt(item, 16) & 0xFF); - } - return values; - } - - /** - * This method return a byte[] from a String. It support the format
- * of the {@link #toBase16(byte[])} and in general it supports the following {@link java.util.regex.Pattern}:
- *

\s*((0x[0-9a-f]{2}|[0-9a-f]{2})\s*)+
- * Exmaple: - *
-     * 0x23 0xab 0xfE 0xDD
-     * 0x23 0xab 0xfe 0xdd
-     * 0x23 ab 0xfE DD
-     * 
- * NOTE
- * The main difference with {@link #fromBase16toIntArray(String)} is that the data returned
- * is signed, so values goes from -128 to 127 - * - * @param bytes the String representing the bytes in hex form - * @return the formatted bytes - * @since 0.6.0 - Revision 60 - */ - public static byte[] fromBase16toByteArray(String bytes) { - int[] values = fromBase16toIntArray(bytes); - byte[] returns = new byte[values.length]; - for (int i = 0; i < values.length; i++) { - returns[i] = (byte) (values[i] & 0xFF); - } - return returns; - } - - public static String toBase16(byte[] arr) { - StringBuffer sb = new StringBuffer(); - - for (int i = 0; i < arr.length; i++) { - sb.append(toBase16(arr[i])); - if (i < arr.length - 1) { - sb.append(" "); - } - } - - return sb.toString(); - } - - private static String padBase2(String s) { - - for (int i = s.length(); i < 8; i++) { - s = "0" + s; - } - - return s; - } - - /** - * Returns true if the bit is on (1) at the specified position - * Position range: 1-8 - */ - public static boolean getBit(int b, int position) { - - if (position < 1 || position > 8) { - throw new IllegalArgumentException("Position is out of range"); - } - - if (b > 0xff) { - throw new IllegalArgumentException("input value is larger than a byte"); - } - - if (((b >> (--position)) & 0x1) == 0x1) { - return true; - } - - return false; - } - - /** - * @param b the int value to check if it contains a byte representable value - * @return true if the value of the int could be expressed with 8 bits - * @since 0.8.0 - */ - public static boolean isByteValue(int b) { - final boolean valid = ((b & 0xffffff00) == 0 || (b & 0xffffff00) == 0xffffff00); - if (logger.isTraceEnabled() && valid && (b < -128 || b > 127)) { - logger.trace( - "The value {} ({}) is considered a byte because only the 8 least significant bits are set" + - ", but its value is outside signed byte that is between -128 and 127", b, Integer.toHexString(b) - ); - } - return valid; - } - - public static String toBase16(int b) { - if (!isByteValue(b)) { - throw new IllegalArgumentException("Error converting " + b + " input value to hex string it is larger than a byte"); - } - if (b < 0) { - return "0x" + Integer.toHexString(b).substring(6); - } else if (b < 0x10) { - return "0x0" + Integer.toHexString(b); - } else if (b >= 0x10) { - return "0x" + Integer.toHexString(b); - } else { - throw new IllegalArgumentException("Unable to recognize the value " + b); - } - } - - public static String toBase2(int b) { - - if (b > 0xff) { - throw new IllegalArgumentException("input value is larger than a byte"); - } - - return padBase2(Integer.toBinaryString(b)); - } - - public static String formatByte(int b) { - return "base10=" + Integer.toString(b) + ",base16=" + toBase16(b) + ",base2=" + toBase2(b); - } - - public static byte unsignedByteFromInt(int i) { - return (byte) (i > 127 ? i - 256 : i); // This is an explicit form of the conversion java performs anyway - } - - public static int intFromUnsignedByte(byte b) { - return (b < 0 ? b + 256 : b); - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/Cie.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/Cie.java deleted file mode 100644 index 0681f0f2efd41..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/Cie.java +++ /dev/null @@ -1,83 +0,0 @@ -package org.bubblecloud.zigbee.util; - -/** - * Cie color conversion. - */ -public class Cie { - public double x; - public double y; - public double Y; - - public static Cie rgb2cie2(double R, double G, double B) { - double X = 0.412315f*R + 0.357600f*G + 0.180500f*B; - double Y = 0.212600f*R + 0.715200f*G + 0.072200f*B; - double Z = 0.019327f*R + 0.119200f*G + 0.950633f*B; - - Cie cie = new Cie(); - cie.x = X / (X + Y + Z); - cie.y = Y / (X + Y + Z); - cie.Y = Y; - return cie; - } - - public static Cie rgb2cie(double r, double g, double b) { - - double rf, gf, bf; - double X, Y, Z; - - if (r <= 0.04045) - r = r/12; - else - r = (float) Math.pow((r+0.055)/1.055,2.4); - - if (g <= 0.04045) - g = g/12; - else - g = (float) Math.pow((g+0.055)/1.055,2.4); - - if (b <= 0.04045) - b = b/12; - else - b = (float) Math.pow((b+0.055)/1.055,2.4); - - X = 0.436052025f*r + 0.385081593f*g + 0.143087414f *b; - Y = 0.222491598f*r + 0.71688606f *g + 0.060621486f *b; - Z = 0.013929122f*r + 0.097097002f*g + 0.71418547f *b; - - double x; - double y; - - double sum = X + Y + Z; - if (sum != 0) { - x = X / sum; - y = Y / sum; - } - else { - float Xr = 0.964221f; // reference white - float Yr = 1.0f; - float Zr = 0.825211f; - - x = Xr / (Xr + Yr + Zr); - y = Yr / (Xr + Yr + Zr); - } - Cie cie = new Cie(); - cie.x = x; - cie.y = y; - cie.Y = Y; - return cie; - } - - public static Cie rgb2cie3(double R, double G, double B) { - double X = 0.436052025f*R + 0.385081593f*G + 0.143087414f*B; - double Y = 0.222491598f*R + 0.71688606f*G + 0.060621486f*B; - double Z = 0.013929122f*R + 0.097097002f*G + 0.71418547f*B; - - Cie cie = new Cie(); - cie.x = X / (X + Y + Z); - cie.y = Y / (X + Y + Z); - cie.Y = Y; - return cie; - } - -} - diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/CircularBufferInt.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/CircularBufferInt.java deleted file mode 100644 index 1548df5864c74..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/CircularBufferInt.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.util; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -/** - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.4.0 - Revision 62 - */ -public class CircularBufferInt { - - private static final Logger logger = LoggerFactory.getLogger(CircularBufferInt.class); - - private final int[] buffer; - private int head; - private int tail; - private int used; - - private final boolean overwrite; - - public CircularBufferInt(final int size, final boolean cyclic) { - buffer = new int[size]; - overwrite = cyclic; - tail = 0; - head = 0; - used = 0; - } - - public CircularBufferInt(final int[] data, final int size, final boolean cyclic) { - buffer = new int[size]; - overwrite = cyclic; - if (cyclic == false && data.length > size) { - throw new IndexOutOfBoundsException( - "Trying to copy " + data.length + " to non-cyclic buffer of " + size + "." + - "You should either increase the size of the buffer or set it as cyclic" - ); - } else if (cyclic == true && data.length > size) { - for (tail = 0; tail < buffer.length; tail++) { - buffer[tail] = data[data.length - buffer.length + tail]; - } - } else { - for (tail = 0; tail < data.length; tail++) { - buffer[tail] = data[tail]; - } - } - head = 0; - used = tail; - } - - public int slots() { - return buffer.length; - } - - public int size() { - return used; - } - - public boolean isFull() { - return used == buffer.length; - } - - public boolean isEmpty() { - return used == 0; - } - - public void add(int value) { - if (isFull()) { - if (overwrite) { - remove(); - } else { - throw new IndexOutOfBoundsException( - "Trying to add data to a full circular buffer, if you need it to " + - "overwrite its own data please create it with cyclic=true" - ); - } - } - buffer[tail] = value; - tail = (tail + 1) % buffer.length; - used += 1; - } - - - public int get(int idx) { - if (idx >= size() || idx < 0) { - throw new IndexOutOfBoundsException( - "Trying to get data from " + idx + " but size is " + size() - ); - } - return buffer[(head + idx) % buffer.length]; - } - - public int remove() { - if (isEmpty()) { - throw new IndexOutOfBoundsException( - "Trying to remove data from an empty circular buffer" - ); - } - final int val = buffer[head]; - head = (head + 1) % buffer.length; - used -= 1; - return val; - } - - public int[] toArray() { - int[] values = new int[size()]; - int i = 0; - for (int j = head; j < buffer.length; j++) { - values[i] = buffer[j]; - i += 1; - } - for (int j = 0; j < tail; j++) { - values[i] = buffer[j]; - i += 1; - } - return values; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/DoubleByte.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/DoubleByte.java deleted file mode 100644 index 95f55b6fdc2a4..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/DoubleByte.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - Copyright 2008-2013 Andrew Rapp, http://code.google.com/p/xbee-api/ - - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.util; - - -/** - * @author Andrew Rapp - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public class DoubleByte { - - private int msb; - private int lsb; - - public DoubleByte() { - - } - - /** - * Decomposes a 16bit int into high and low bytes - * - * @param val - */ - public DoubleByte(int val) { - if (val > 0xFFFF || val < 0) { - throw new IllegalArgumentException("value is out of range"); - } - - // split address into high and low bytes - msb = val >> 8; - lsb = val & 0xFF; - } - - /** - * Constructs a 16bit value from two bytes (high and low) - * - * @param msb - * @param lsb - */ - public DoubleByte(int msb, int lsb) { - - if (msb > 0xFF || lsb > 0xFF) { - throw new IllegalArgumentException("msb or lsb are out of range"); - } - - this.msb = msb; - this.lsb = lsb; - } - - public int getMsb() { - return msb; - } - - public int getLsb() { - return lsb; - } - - public int get16BitValue() { - return (this.msb << 8) + this.lsb; - } - - public void setMsb(int msb) { - this.msb = msb; - } - - public void setLsb(int lsb) { - this.lsb = lsb; - } - - @Override - public String toString() { - String MSB = Integer.toHexString(msb); - if (MSB.length() == 1) MSB = "0" + MSB; - String LSB = Integer.toHexString(lsb); - if (LSB.length() == 1) LSB = "0" + LSB; - - return "0x" + MSB + LSB; - - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/IIntArrayInputStream.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/IIntArrayInputStream.java deleted file mode 100644 index acda89e63a836..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/IIntArrayInputStream.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - Copyright 2008-2013 Andrew Rapp, http://code.google.com/p/xbee-api/ - - Copyright 2008-2013 ITACA-TSB, http://www.tsb.upv.es/ - Instituto Tecnologico de Aplicaciones de Comunicacion - Avanzadas - Grupo Tecnologias para la Salud y el - Bienestar (TSB) - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.util; - -import java.io.IOException; - -/** - * @author Andrew Rapp - * @author Alvaro Fides Valero - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - */ -public interface IIntArrayInputStream { - public int read() throws IOException; - - public int read(String s) throws IOException; -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/Integers.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/Integers.java deleted file mode 100644 index ec7bc59457887..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/Integers.java +++ /dev/null @@ -1,415 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.util; - - -/** - * An utility class that contains method for:
- * - creating long, int, and short from int[]
- * - extracting a byte configuration from a:long, int, and short - * - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public class Integers { - - /** - * @param x the long containing the data - * @param n the index of the byte to return - * @return return the n-th byte of the representation of x - */ - public static final byte getByte(final long x, final int n) { - switch (n) { - case 0: - return (byte) (x & 0x00000000000000FFL); - case 1: - return (byte) ((x & 0x000000000000FF00L) >> 8); - case 2: - return (byte) ((x & 0x0000000000FF0000L) >> 16); - case 3: - return (byte) ((x & 0x00000000FF000000L) >> 24); - case 4: - return (byte) ((x & 0x000000FF00000000L) >> 32); - case 5: - return (byte) ((x & 0x0000FF0000000000L) >> 40); - case 6: - return (byte) ((x & 0x00FF000000000000L) >> 48); - case 7: - return (byte) ((x & 0xFF00000000000000L) >> 56); - default: - throw new IllegalArgumentException("long is reppresented as 8 bytes," + - " hence value of n must be between 0 and 3: you have tryed to use " + n); - } - } - - /** - * @param x the long containing the data - * @param n the index of the byte to return - * @return return the n-th byte as int of the representation of x thus it returns always value between 0 and 255 - */ - public static final int getByteAsInteger(final long x, final int n) { - switch (n) { - case 0: - return (int) (x & 0x00000000000000FFL); - case 1: - return (int) ((x & 0x000000000000FF00L) >> 8); - case 2: - return (int) ((x & 0x0000000000FF0000L) >> 16); - case 3: - return (int) ((x & 0x00000000FF000000L) >> 24); - case 4: - return (int) ((x & 0x000000FF00000000L) >> 32); - case 5: - return (int) ((x & 0x0000FF0000000000L) >> 40); - case 6: - return (int) ((x & 0x00FF000000000000L) >> 48); - case 7: - return (int) (((x & 0xFF00000000000000L) >> 56) & 0xFF); - default: - throw new IllegalArgumentException("long is reppresented as 8 bytes," + - " hence value of n must be between 0 and 3: you have tryed to use " + n); - } - } - - /** - * @param x the int containing the data - * @param n the index of the byte to return - * @return return the n-th byte as int of the representation of x thus it returns always value between 0 and 255 - * @since 0.2.0 - */ - public static final int getByteAsInteger(final int x, final int n) { - switch (n) { - case 0: - return (int) (x & 0x000000FF); - case 1: - return (int) ((x & 0x0000FF00) >> 8); - case 2: - return (int) ((x & 0x00FF0000) >> 16); - case 3: - return (int) ((x & 0xFF000000) >> 24); - default: - throw new IllegalArgumentException("long is reppresented as 8 bytes," + - " hence value of n must be between 0 and 3: you have tryed to use " + n); - } - } - - /** - * @param x the int containing the data - * @param n the index of the byte to return - * @return return the n-th byte of the representation of x - */ - public static final byte getByte(final int x, final int n) { - switch (n) { - case 0: - return (byte) (x & 0x000000FF); - case 1: - return (byte) ((x & 0x0000FF00) >> 8); - case 2: - return (byte) ((x & 0x00FF0000) >> 16); - case 3: - return (byte) ((x & 0xFF000000) >> 24); - default: - throw new IllegalArgumentException("int is reppresented as 4 bytes," + - " hence value of n must be between 0 and 3: you have tryed to use " + n); - } - } - - /** - * @param x the short containing the data - * @param n the index of the byte to return - * @return return the n-th byte of the representation of x - */ - public static final byte getByte(final short x, final int n) { - switch (n) { - case 0: - return (byte) (x & 0x00FF); - case 1: - return (byte) ((x & 0xFF00) >> 8); - default: - throw new IllegalArgumentException("short is reppresented as 2 bytes," + - " hence value of n must be between 0 and 1: you have tryed to use " + n); - } - } - - /** - * @param x the short containing the data - * @param n the index of the byte to return - * @return return the n-th byte as int of the representation of x it returns always value between 0 and 255 - */ - public static final int getByteAsInteger(final short x, final int n) { - switch (n) { - case 0: - return (x & 0x00FF); - case 1: - return ((x & 0xFF00) >> 8); - default: - throw new IllegalArgumentException("short is reppresented as 2 bytes," + - " hence value of n must be between 0 and 1: you have tryed to use " + n); - } - } - - /** - * @param values the int[] array containing the data - * @param msb the index of the most significant byte - * @param lsb the index of the least significant byte - * @return the short decoded from the int[] - */ - public static short shortFromInts(int[] values, int msb, int lsb) { - int value = (values[msb] << 8) + values[lsb]; - return (short) value; - } - - /** - * @param values the byte[] array containing the data - * @param msb the index of the most significant byte - * @param lsb the index of the least significant byte - * @return the long decoded from the byte[] - */ - public static long longFromInts(byte[] values, int msb, int lsb) { - long result = (values[msb] & 0xFF); - if (msb < lsb) { - for (int i = msb + 1; i <= lsb; i++) { - result = (result << 8) + (values[i] & 0xFF); - } - } else { - for (int i = msb - 1; i >= lsb; i--) { - result = (result << 8) + (values[i] & 0xFF); - } - } - return result; - } - - /** - * @param values the int[] array containing the data - * @param msb the index of the most significant byte - * @param lsb the index of the least significant byte - * @return the long decoded from the int[] - */ - public static long longFromInts(int[] values, int msb, int lsb) { - long result = (values[msb] & 0xFF); - if (msb < lsb) { - for (int i = msb + 1; i <= lsb; i++) { - result = (result << 8) + (values[i] & 0xFF); - } - } else { - for (int i = msb - 1; i >= lsb; i--) { - result = (result << 8) + (values[i] & 0xFF); - } - } - return result; - } - - - /////////////////////////////////////////////////////////// - // serialization routines to be use for payload api - /////////////////////////////////////////////////////////// - - final public static class InvalidObject { - } - - ; - final public static InvalidObject INVALID_OBJECT = new InvalidObject(); - - - final public static int writeObject(byte[] dest, int pos, Object data) { - if (data.getClass().equals(Boolean.class)) { - return writeBooleanObject(dest, pos, (Boolean) data); - } else if (data.getClass().equals(Byte.class)) { - return writeByteObject(dest, pos, (Byte) data); - } else if (data.getClass().equals(Short.class)) { - return writeShortObject(dest, pos, (Short) data); - } else if (data.getClass().equals(Integer.class)) { - return writeIntObject(dest, pos, (Integer) data); - } else if (data.getClass().equals(Long.class)) { - return writeLongObject(dest, pos, (Long) data); - } else { - throw new IllegalArgumentException("Type " + data.getClass().getName() + " not supported!"); - } - } - - final public static int readObject(byte[] dest, int pos, Class clazz, Object[] result) { - if (clazz.equals(Boolean.class) || clazz.equals(boolean.class)) { - result[0] = readBooleanObject(dest, pos); - return 1; - } else if (clazz.equals(Byte.class) || clazz.equals(byte.class)) { - result[0] = readByteObject(dest, pos); - return 1; - } else if (clazz.equals(Short.class) || clazz.equals(short.class)) { - result[0] = readShortObject(dest, pos); - return 2; - } else if (clazz.equals(Integer.class) || clazz.equals(int.class)) { - result[0] = readIntObject(dest, pos); - return 4; - } else if (clazz.equals(Long.class) || clazz.equals(long.class)) { - result[0] = readLongObject(dest, pos); - return 8; - } else { - throw new IllegalArgumentException("Type " + clazz.getName() + " not supported!"); - } - } - - final public static int writeBooleanObject(byte[] dest, int pos, Boolean data) { - return writeBoolean(dest, pos, data.booleanValue()); - } - - final public static int writeBoolean(byte[] dest, int pos, boolean data) { - dest[pos] = (byte) (data ? 0x01 : 0x00); - return 1; - } - - final public static int writeByteObject(byte[] dest, int pos, Byte data) { - return writeByte(dest, pos, data.byteValue()); - } - - final public static int writeByte(byte[] dest, int pos, byte data) { - dest[pos] = data; - return 1; - } - - final public static int writeShortObject(byte[] dest, int pos, Short data) { - return writeShort(dest, pos, data.shortValue()); - } - - final public static int writeShort(byte[] dest, int pos, short data) { - dest[pos + 1] = (byte) (data >> 8); - dest[pos] = (byte) ((data << 8) >> 8); - return 2; - } - - final public static int writeIntObject(byte[] dest, int pos, Integer data) { - return writeInt(dest, pos, data.intValue()); - } - - final public static int writeInt(byte[] dest, int pos, int data) { - dest[pos] = (byte) (data >> 24); - dest[pos + 1] = (byte) ((data << 8) >> 24); - dest[pos + 2] = (byte) ((data << 16) >> 24); - dest[pos + 3] = (byte) ((data << 24) >> 24); - return 4; - } - - final public static int writeLongObject(byte[] dest, int pos, Long data) { - return writeLong(dest, pos, data.longValue()); - } - - final public static int writeLong(byte[] dest, int pos, long data) { - dest[pos] = (byte) (data >> 56); - dest[pos + 1] = (byte) ((data << 8) >> 56); - dest[pos + 2] = (byte) ((data << 16) >> 56); - dest[pos + 3] = (byte) ((data << 24) >> 56); - dest[pos + 4] = (byte) ((data << 32) >> 56); - dest[pos + 5] = (byte) ((data << 40) >> 56); - dest[pos + 6] = (byte) ((data << 48) >> 56); - dest[pos + 7] = (byte) ((data << 56) >> 56); - return 8; - } - - public static Object readBooleanObject(byte[] src, int pos) { - switch (src[pos]) { - case 0: - return Boolean.FALSE; - case 1: - return Boolean.TRUE; - default: - return INVALID_OBJECT; - } - } - - public static boolean readBoolean(byte[] src, int pos) { - return (src[pos] == 0x01); - } - - public static Byte readByteObject(byte[] src, int pos) { - return Byte.valueOf(readByte(src, pos)); - } - - public static byte readByte(byte[] src, int pos) { - return src[pos]; - } - - public static Short readShortObject(byte[] src, int pos) { - return Short.valueOf(readShort(src, pos)); - } - - public static short readShort(byte[] src, int pos) { - return (short) (((src[pos + 1] & 0x000000FF) << 8) - + (src[pos] & 0x000000FF)); - } - - public static Integer readIntObject(byte[] src, int pos) { - return Integer.valueOf(readInt(src, pos)); - } - - public static int readInt(byte[] src, int pos) { - return ((src[pos] & 0x000000FF) << 24) - + ((src[pos + 1] & 0x000000FF) << 16) - + ((src[pos + 2] & 0x000000FF) << 8) - + ((src[pos + 3] & 0x000000FF)); - - } - - public static Long readLongObject(byte[] src, int pos) { - return Long.valueOf(readLong(src, pos)); - } - - public static long readLong(byte[] src, int pos) { - return ((long) (src[pos] & 0x00000000000000FF) << 56) - + ((long) (src[pos + 1] & 0x00000000000000FF) << 48) - + ((long) (src[pos + 2] & 0x00000000000000FF) << 40) - + ((long) (src[pos + 3] & 0x00000000000000FF) << 32) - + ((long) (src[pos + 4] & 0x00000000000000FF) << 24) - + ((long) (src[pos + 5] & 0x00000000000000FF) << 16) - + ((long) (src[pos + 6] & 0x00000000000000FF) << 8) - + ((long) (src[pos + 7] & 0x00000000000000FF)); - - } - - /** - * @param src an array of byte that contains the encoded 24bit int - * @param pos the point where to start from reading the 24bit - * @return an int decoded from the data array - * @since 0.2.0 - */ - public static int readInt24bit(byte[] src, int pos) { - return ( - ((src[pos] & 0xFF) << 24) - + ((src[pos + 1] & 0xFF) << 16) - + ((src[pos + 2] & 0xFF) << 8) - ) >> 8; - } - - /** - * @param dest an array of byte that will store the encoded 24bit int - * @param pos the point where to start writing the 24bit - * @param data the 24bit to write on the array - * @return the number of byte wrote on the array - * @since 0.2.0 - */ - public static int writeInt24bit(byte[] dest, int pos, int data) { - dest[pos] = (byte) ((data & 0xFF0000) >> 16); - dest[pos + 1] = (byte) ((data & 0x00FF00) >> 8); - dest[pos + 2] = (byte) ((data & 0x0000FF)); - return 3; - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/MarkableInputStream.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/MarkableInputStream.java deleted file mode 100644 index f0c2ccc91d52b..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/MarkableInputStream.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -package org.bubblecloud.zigbee.util; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; -import java.io.InputStream; - - -/** - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.4.0 - Revision 62 - */ -public class MarkableInputStream - extends InputStream { - - private static final Logger logger = LoggerFactory.getLogger(MarkableInputStream.class); - - private final InputStream in; - private CircularBufferInt buffer; - private int idx; - - public MarkableInputStream(final InputStream input) { - this.in = input; - } - - @Override - public int available() - throws IOException { - - if (buffer == null || idx >= buffer.size()) { - return in.available(); - } else { - return buffer.size(); - } - } - - @Override - public synchronized void mark(int size) { - if (size == 0) { - /* - * Removing the mark, in case it was set - */ - buffer = null; - } else if (buffer == null) { - /* - * If the mark was not set we create a buffer for store it - */ - buffer = new CircularBufferInt(size, true); - idx = buffer.size(); - } else if (buffer != null && size > buffer.slots()) { - /* - * The mark was set so we have should copy unread data to the new buffer - */ - buffer = new CircularBufferInt(buffer.toArray(), size, true); - } - } - - @Override - public boolean markSupported() { - return true; - } - - @Override - public synchronized void reset() - throws IOException { - - idx = 0; - } - - - @Override - public int read() - throws IOException { - - if (buffer == null) { - /* - * No mark set so reading from the stream - */ - return in.read(); - } else if (buffer != null && idx < buffer.size()) { - /* - * Mark was set and also buffer was reset, and it has not been empty yet - */ - idx += 1; - return buffer.remove(); - } else if (buffer != null && idx >= buffer.size()) { - /* - * Mark was set, but buffer has been exhausted - */ - int val = in.read(); - idx += 1; - buffer.add(val); - return val; - } - /* - * Unreachable code - */ - return -1; - } - - @Override - public synchronized void close() - throws IOException { - - buffer = null; - in.close(); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/NetworkAddressUtil.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/NetworkAddressUtil.java deleted file mode 100644 index 70f1c76e32af8..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/NetworkAddressUtil.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.bubblecloud.zigbee.util; - -import org.bubblecloud.zigbee.network.packet.ZToolAddress16; - -/** - * Utility for address manipulation. - * @author Tommi S.E. Laukkanen - */ -public class NetworkAddressUtil { - - /** - * Converts short network address to integer format. - * @param networkAddress the network address as short - * @return the network address as integer - */ - public static int shortToInt(final short networkAddress) { - ZToolAddress16 nwk = new ZToolAddress16( - Integers.getByteAsInteger(networkAddress, 1), - Integers.getByteAsInteger(networkAddress, 0) - ); - return nwk.get16BitValue(); - } - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/RunnableThread.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/RunnableThread.java deleted file mode 100644 index 6f9581a2a9100..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/RunnableThread.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - Copyright 2013-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.util; - - -/** - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.6.0 - */ -public abstract class RunnableThread implements Stoppable, Threaded { - - private final Object threadLock = new Object(); - private boolean done = false; - - private Thread executor = null; - - public Thread getExecutorThread() { - synchronized (threadLock) { - return executor; - } - } - - public void end() { - synchronized (threadLock) { - done = true; - } - } - - protected boolean isDone() { - synchronized (threadLock) { - return done; - } - } - - public void run() { - synchronized (threadLock) { - executor = Thread.currentThread(); - } - task(); - synchronized (threadLock) { - executor = null; - } - } - - public void interrupt() { - synchronized (threadLock) { - if (executor == null) return; - executor.interrupt(); - } - } - - protected abstract void task(); -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/Stoppable.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/Stoppable.java deleted file mode 100644 index 96dab95de5fd0..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/Stoppable.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.util; - - -/** - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.1.0 - */ -public interface Stoppable extends Runnable { - - /** - * This method when invoked will ask the {@link Runnable} to terminate - */ - public void end(); - -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/ThreadUtils.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/ThreadUtils.java deleted file mode 100644 index 653fa6515fd54..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/ThreadUtils.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - Copyright 2008-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.util; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.3.0 - */ -public class ThreadUtils { - - private final static Logger logger = LoggerFactory.getLogger(ThreadUtils.class); - - /** - * Wait for x ms even if interrupt are sent to the thread waiting - * - * @param time the number of ms to wait - */ - public static final void waitNonPreemptive(long time) { - final long end = System.currentTimeMillis() + time; - do { - try { - final long delta = Math.max(end - System.currentTimeMillis(), 0); - logger.trace("{} waiting for {}ms", Thread.currentThread(), delta); - Thread.sleep(delta); - } catch (InterruptedException ignored) { - } - } while (end > System.currentTimeMillis()); - } - - /** - * Wait for up to x ms, in fact if interrupt is received it will end before the expected time - * - * @param time the number of ms to wait - * @since 0.4.0 - */ - public static final void waitingUntil(long time) { - do { - try { - final long delta = Math.max(time - System.currentTimeMillis(), 0); - logger.trace("{} waiting for {}ms", Thread.currentThread(), delta); - Thread.sleep(delta); - } catch (InterruptedException ignored) { - break; - } - } while (time > System.currentTimeMillis()); - } -} diff --git a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/Threaded.java b/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/Threaded.java deleted file mode 100644 index 34ff3f8ee3188..0000000000000 --- a/addons/binding/org.openhab.binding.zigbee/src/main/java/org/bubblecloud/zigbee/util/Threaded.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - Copyright 2013-2013 CNR-ISTI, http://isti.cnr.it - Institute of Information Science and Technologies - of the Italian National Research Council - - - See the NOTICE file distributed with this work for additional - information regarding copyright ownership - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package org.bubblecloud.zigbee.util; - - -/** - * @author Stefano "Kismet" Lenzi - * @version $LastChangedRevision: 799 $ ($LastChangedDate: 2013-08-06 19:00:05 +0300 (Tue, 06 Aug 2013) $) - * @since 0.6.0 - */ -public interface Threaded extends Runnable { - - /** - * @return the {@link Thread} if any that is executing this {@link Runnable} object - */ - public Thread getExecutorThread(); - - /** - * Sent an {@link InterruptedException} to the {@link Thread} executing the {@link Runnable} if any - */ - public void interrupt(); -}