Skip to content

Commit

Permalink
Merge pull request openhab#8 from lewie/knx-refactor-2
Browse files Browse the repository at this point in the history
KNX 2.0 code-analysis and 2.1.0.qualifier
  • Loading branch information
kgoderis authored May 19, 2017
2 parents f330819 + d6e8992 commit 77e98d2
Show file tree
Hide file tree
Showing 171 changed files with 2,252 additions and 1,168 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -415,4 +415,4 @@
</parameter>
</config-description>
</channel-type>
</thing:thing-descriptions>
</thing:thing-descriptions>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: KNX Binding
Bundle-SymbolicName: org.openhab.binding.knx;singleton:=true
Bundle-Vendor: openHAB
Bundle-Version: 2.0.0.qualifier
Bundle-Version: 2.1.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: com.google.common.base,
com.google.common.collect,
Expand Down
69 changes: 69 additions & 0 deletions addons/binding/org.openhab.binding.knx/about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>About</title>
</head>
<body lang="EN-US">
<h2>About This Content</h2>

<p>April 11, 2015</p>
<h3>License</h3>

<p>The openHAB community makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
indicated below, the Content is provided to you under the terms and conditions of the
Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>

<p>If you did not receive this Content directly from the openHAB community, the Content is
being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
apply to your use of any object code in the Content. Check the Redistributor's license that was
provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
indicated below, the terms and conditions of the EPL still apply to any source code in the Content
and such source code may be obtained at <a href="http://www.openhab.org/">openhab.org</a>.</p>


<h3>Third Party Content</h3>
<p>The Content includes items that have been sourced from third parties as set out below. If you
did not receive this Content directly from the openHAB community, the following is provided
for informational purposes only, and you should look to the Redistributor's license for
terms and conditions of use.</p>
<p><em>
<strong>Calimero 2 - A library for KNX network access</strong> <br/><br/>
Calimero 2 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

Calimero 2 is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Calimero 2; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.

As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under terms
of your choice, provided that you also meet, for each linked independent
module, the terms and conditions of the license of that module. An
independent module is a module which is not derived from or based on
this library. If you modify this library, you may extend this exception
to your version of the library, but you are not obligated to do so. If
you do not wish to do so, delete this exception statement from your
version.
</em></p>


</body>
</html>
4 changes: 2 additions & 2 deletions addons/binding/org.openhab.binding.knx/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.openhab.binding</groupId>
<artifactId>pom</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>2.1.0-SNAPSHOT</version>
</parent>

<properties>
Expand All @@ -16,7 +16,7 @@

<groupId>org.openhab.binding</groupId>
<artifactId>org.openhab.binding.knx</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>2.1.0-SNAPSHOT</version>

<name>KNX Binding</name>
<packaging>eclipse-plugin</packaging>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2014-2016 by the respective copyright holders.
* Copyright (c) 2010-2017 by the respective copyright holders.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2014-2016 by the respective copyright holders.
* Copyright (c) 2010-2017 by the respective copyright holders.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2014-2016 by the respective copyright holders.
* Copyright (c) 2010-2017 by the respective copyright holders.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
Expand All @@ -18,85 +18,85 @@
*/
public class KNXBindingConstants {

public final static String BINDING_ID = "knx";
public static final String BINDING_ID = "knx";

// List of all Thing Type UIDs
public final static ThingTypeUID THING_TYPE_IP_BRIDGE = new ThingTypeUID(BINDING_ID, "ip");
public final static ThingTypeUID THING_TYPE_SERIAL_BRIDGE = new ThingTypeUID(BINDING_ID, "serial");
public final static ThingTypeUID THING_TYPE_GENERIC = new ThingTypeUID(BINDING_ID, "generic");
public static final ThingTypeUID THING_TYPE_IP_BRIDGE = new ThingTypeUID(BINDING_ID, "ip");
public static final ThingTypeUID THING_TYPE_SERIAL_BRIDGE = new ThingTypeUID(BINDING_ID, "serial");
public static final ThingTypeUID THING_TYPE_GENERIC = new ThingTypeUID(BINDING_ID, "generic");

// List of all Channel ids
public final static String CHANNEL_CURRENT = "current";
public final static String CHANNEL_DIMMER = "dimmer";
public final static String CHANNEL_ENERGY = "energy";
public final static String CHANNEL_NUMBER = "number";
public final static String CHANNEL_STRING = "string";
public final static String CHANNEL_CONTACT = "contact";
public final static String CHANNEL_DATETIME = "datetime";
public final static String CHANNEL_OPERATING_HOURS = "operatinghours";
public final static String CHANNEL_RESET = "reset";
public final static String CHANNEL_ROLLERSHUTTER = "rollershutter";
public final static String CHANNEL_SETPOINT = "setpoint";
public final static String CHANNEL_STATUSSWITCH = "statusswitch";
public final static String CHANNEL_SWITCH = "switch";
public final static String CHANNEL_GENERIC = "generic";
public final static String ERRORS_INTERVAL = "errors5min";
public final static String ERRORS_STARTUP = "errorsall";
public static final String CHANNEL_CURRENT = "current";
public static final String CHANNEL_DIMMER = "dimmer";
public static final String CHANNEL_ENERGY = "energy";
public static final String CHANNEL_NUMBER = "number";
public static final String CHANNEL_STRING = "string";
public static final String CHANNEL_CONTACT = "contact";
public static final String CHANNEL_DATETIME = "datetime";
public static final String CHANNEL_OPERATING_HOURS = "operatinghours";
public static final String CHANNEL_RESET = "reset";
public static final String CHANNEL_ROLLERSHUTTER = "rollershutter";
public static final String CHANNEL_SETPOINT = "setpoint";
public static final String CHANNEL_STATUSSWITCH = "statusswitch";
public static final String CHANNEL_SWITCH = "switch";
public static final String CHANNEL_GENERIC = "generic";
public static final String ERRORS_INTERVAL = "errors5min";
public static final String ERRORS_STARTUP = "errorsall";

// List of Property ids
public final static String FIRMWARE_TYPE = "firmwaretype";
public final static String FIRMWARE_VERSION = "firmwareversion";
public final static String FIRMWARE_SUBVERSION = "firmwaresubversion";
public final static String MANUFACTURER_NAME = "manfacturername";
public final static String MANUFACTURER_SERIAL_NO = "manfacturerserialnumber";
public final static String MANUFACTURER_HARDWARE_TYPE = "manfacturerhardwaretype";
public final static String MANUFACTURER_FIRMWARE_REVISION = "manfacturerfirmwarerevision";
public static final String FIRMWARE_TYPE = "firmwaretype";
public static final String FIRMWARE_VERSION = "firmwareversion";
public static final String FIRMWARE_SUBVERSION = "firmwaresubversion";
public static final String MANUFACTURER_NAME = "manfacturername";
public static final String MANUFACTURER_SERIAL_NO = "manfacturerserialnumber";
public static final String MANUFACTURER_HARDWARE_TYPE = "manfacturerhardwaretype";
public static final String MANUFACTURER_FIRMWARE_REVISION = "manfacturerfirmwarerevision";

// List of all Configuration parameters
public final static String ADDRESS = "address";
public final static String CURRENT_GA = "currentGA";
public final static String DPT = "dpt";
public final static String DESCRIPTION = "description";
public final static String ENERGY_GA = "energyGA";
public final static String FETCH = "fetch";
public final static String GROUPADDRESS = "groupaddress";
public final static String INCREASE_DECREASE_ADDRESS = "increasedecreaseGA";
public final static String INCREASE_DECREASE_DPT = "increasedecreaseDPT";
public final static String INCREASE_DECREASE_GA = "increaseDecreaseGA";
public final static String INTERVAL = "interval";
public final static String IP_ADDRESS = "ipAddress";
public final static String IP_CONNECTION_TYPE = "ipConnectionType";
public final static String LOCAL_IP = "localIp";
public final static String LOCAL_SOURCE_ADDRESS = "localSourceAddr";
public final static String OPERATING_HOURS_GA = "operatingGA";
public final static String PERCENT_DPT = "percentDPT";
public final static String PERCENT_GA = "percentGA";
public final static String PORT_NUMBER = "portNumber";
public final static String POSITION_GA = "positionGA";
public final static String POSITION_STATUS_GA = "positionStatusGA";
public final static String READ = "read";
public final static String SERIAL_PORT = "serialPort";
public final static String SETPOINT_GA = "setpointGA";
public final static String STATUS_GA = "statusGA";
public final static String STOP_MOVE_GA = "stopMoveGA";
public final static String STOP_MOVE_STATUS_GA = "stopMoveStatusGA";
public final static String SWITCH_GA = "switchGA";
public final static String TRANSMIT = "transmit";
public final static String UNIT = "unit";
public final static String UP_DOWN_GA = "upDownGA";
public final static String UP_DOWN_STATUS_GA = "upDownStatusGA";
public final static String UPDATE = "update";
public final static String WRITE = "write";
public static final String ADDRESS = "address";
public static final String CURRENT_GA = "currentGA";
public static final String DPT = "dpt";
public static final String DESCRIPTION = "description";
public static final String ENERGY_GA = "energyGA";
public static final String FETCH = "fetch";
public static final String GROUPADDRESS = "groupaddress";
public static final String INCREASE_DECREASE_ADDRESS = "increasedecreaseGA";
public static final String INCREASE_DECREASE_DPT = "increasedecreaseDPT";
public static final String INCREASE_DECREASE_GA = "increaseDecreaseGA";
public static final String INTERVAL = "interval";
public static final String IP_ADDRESS = "ipAddress";
public static final String IP_CONNECTION_TYPE = "ipConnectionType";
public static final String LOCAL_IP = "localIp";
public static final String LOCAL_SOURCE_ADDRESS = "localSourceAddr";
public static final String OPERATING_HOURS_GA = "operatingGA";
public static final String PERCENT_DPT = "percentDPT";
public static final String PERCENT_GA = "percentGA";
public static final String PORT_NUMBER = "portNumber";
public static final String POSITION_GA = "positionGA";
public static final String POSITION_STATUS_GA = "positionStatusGA";
public static final String READ = "read";
public static final String SERIAL_PORT = "serialPort";
public static final String SETPOINT_GA = "setpointGA";
public static final String STATUS_GA = "statusGA";
public static final String STOP_MOVE_GA = "stopMoveGA";
public static final String STOP_MOVE_STATUS_GA = "stopMoveStatusGA";
public static final String SWITCH_GA = "switchGA";
public static final String TRANSMIT = "transmit";
public static final String UNIT = "unit";
public static final String UP_DOWN_GA = "upDownGA";
public static final String UP_DOWN_STATUS_GA = "upDownStatusGA";
public static final String UPDATE = "update";
public static final String WRITE = "write";

// List of all knxproj Namespace Identifierss
public final static String KNX_PROJECT_12 = "http://knx.org/xml/project/12";
public final static String KNX_PROJECT_13 = "http://knx.org/xml/project/13";
public static final String KNX_PROJECT_12 = "http://knx.org/xml/project/12";
public static final String KNX_PROJECT_13 = "http://knx.org/xml/project/13";

// The default multicast ip address (see <a
// href="http://www.iana.org/assignments/multicast-addresses/multicast-addresses.xml">iana</a> EIBnet/IP
public final static String DEFAULT_MULTICAST_IP = "224.0.23.12";
public static final String DEFAULT_MULTICAST_IP = "224.0.23.12";

// The group address for identification of this KNX/IP gateway within the KNX bus. Default is 0.0.0
public final static String DEFAULT_LOCAL_SOURCE_ADDRESS = "0.0.0";
public static final String DEFAULT_LOCAL_SOURCE_ADDRESS = "0.0.0";

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2014-2016 by the respective copyright holders.
* Copyright (c) 2010-2017 by the respective copyright holders.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2014-2016 by the respective copyright holders.
* Copyright (c) 2010-2017 by the respective copyright holders.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2014-2016 by the respective copyright holders.
* Copyright (c) 2010-2017 by the respective copyright holders.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/**
* Copyright (c) 2014-2016 by the respective copyright holders.
* Copyright (c) 2010-2017 by the respective copyright holders.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/

package org.openhab.binding.knx.discovery;

import static org.openhab.binding.knx.KNXBindingConstants.ADDRESS;
Expand Down Expand Up @@ -41,12 +42,12 @@
*/
public class IndividualAddressDiscoveryService extends AbstractDiscoveryService implements KNXBusListener {

public final static Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Sets
public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Sets
.newHashSet(KNXBindingConstants.THING_TYPE_GENERIC);

private Logger logger = LoggerFactory.getLogger(KNXBridgeBaseThingHandler.class);

private final static int SEARCH_TIME = 600;
private static final int SEARCH_TIME = 600;
private boolean searchOngoing = false;

private KNXBridgeBaseThingHandler bridgeHandler;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2014-2016 by the respective copyright holders.
* Copyright (c) 2010-2017 by the respective copyright holders.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2014-2016 by the respective copyright holders.
* Copyright (c) 2010-2017 by the respective copyright holders.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
Expand Down Expand Up @@ -520,7 +520,7 @@ public final Type getType(GroupAddress destination, String dpt, byte[] asdu) {
return getType(datapoint, asdu);
}

public synchronized final boolean isReachable(IndividualAddress address) {
public final synchronized boolean isReachable(IndividualAddress address) {
if (managementProcedures == null || address == null) {
return false;
}
Expand All @@ -535,7 +535,7 @@ public synchronized final boolean isReachable(IndividualAddress address) {
return false;
}

public synchronized final void restartNetworkDevice(IndividualAddress address) {
public final synchronized void restartNetworkDevice(IndividualAddress address) {
if (address == null) {
return;
}
Expand Down Expand Up @@ -650,7 +650,7 @@ public void linkClosed(CloseEvent e) {
if (!link.isOpen() && !(CloseEvent.USER_REQUEST == e.getInitiator()) && !shutdown) {
logger.warn("KNX link has been lost (reason: {} on object {})", e.getReason(), e.getSource().toString());
if (config.getAutoReconnectPeriod().intValue() > 0) {
logger.info("KNX link will be retried in " + config.getAutoReconnectPeriod().intValue() + " seconds");
logger.info("KNX link will be retried in '{}' seconds", config.getAutoReconnectPeriod().intValue());
if (connectJob.isDone()) {
scheduleConnectJob();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2014-2016 by the respective copyright holders.
* Copyright (c) 2010-2017 by the respective copyright holders.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2014-2016 by the respective copyright holders.
* Copyright (c) 2010-2017 by the respective copyright holders.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2014-2016 by the respective copyright holders.
* Copyright (c) 2010-2017 by the respective copyright holders.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
Expand Down
Loading

0 comments on commit 77e98d2

Please sign in to comment.