{"action":"created","comment":{"url":"https://api.github.com/repos/openhab/openhab2/pulls/comments/29767450","id":29767450,"diff_hunk":"@@ -0,0 +1,430 @@\n+/**\n+ * Copyright (c) 2014-2015 openHAB UG (haftungsbeschraenkt) and others.\n+ *\n+ * All rights reserved. This program and the accompanying materials\n+ * are made available under the terms of the Eclipse Public License v1.0\n+ * which accompanies this distribution, and is available at\n+ * http://www.eclipse.org/legal/epl-v10.html\n+ */\n+package org.openhab.binding.rfxcom.handler;\n+\n+import java.io.IOException;\n+import java.util.EventObject;\n+import java.util.List;\n+import java.util.concurrent.CopyOnWriteArrayList;\n+\n+import javax.xml.bind.DatatypeConverter;\n+\n+import org.eclipse.smarthome.core.thing.Bridge;\n+import org.eclipse.smarthome.core.thing.ChannelUID;\n+import org.eclipse.smarthome.core.thing.ThingStatus;\n+import org.eclipse.smarthome.core.thing.binding.BaseBridgeHandler;\n+import org.eclipse.smarthome.core.types.Command;\n+import org.eclipse.smarthome.core.types.RefreshType;\n+import org.openhab.binding.rfxcom.RFXComBindingConstants;\n+import org.openhab.binding.rfxcom.internal.DeviceMessageListener;\n+import org.openhab.binding.rfxcom.internal.RFXComException;\n+import org.openhab.binding.rfxcom.internal.config.RFXComConfiguration;\n+import org.openhab.binding.rfxcom.internal.connector.RFXComConnectorInterface;\n+import org.openhab.binding.rfxcom.internal.connector.RFXComEventListener;\n+import org.openhab.binding.rfxcom.internal.connector.RFXComJD2XXConnector;\n+import org.openhab.binding.rfxcom.internal.connector.RFXComSerialConnector;\n+import org.openhab.binding.rfxcom.internal.messages.RFXComInterfaceMessage;\n+import org.openhab.binding.rfxcom.internal.messages.RFXComInterfaceMessage.Commands;\n+import org.openhab.binding.rfxcom.internal.messages.RFXComInterfaceMessage.TransceiverType;\n+import org.openhab.binding.rfxcom.internal.messages.RFXComBaseMessage;\n+import org.openhab.binding.rfxcom.internal.messages.RFXComMessageFactory;\n+import org.openhab.binding.rfxcom.internal.messages.RFXComMessage;\n+import org.openhab.binding.rfxcom.internal.messages.RFXComTransmitterMessage;\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+\n+/**\n+ * {@link RFXComBridgeHandler} is the handler for a RFXCOM transceivers. All\n+ * {@link RFXComHandler}s use the {@link RFXComBridgeHandler} to execute the\n+ * actual commands.\n+ * \n+ * @author Pauli Anttila - Initial contribution\n+ */\n+public class RFXComBridgeHandler extends BaseBridgeHandler {\n+\n+\tprivate Logger logger = LoggerFactory.getLogger(RFXComBridgeHandler.class);\n+\n+\tRFXComConnectorInterface connector = null;\n+\tprivate MessageLister eventLister = new MessageLister();\n+\n+\tprivate List<DeviceMessageListener> deviceStatusListeners = new CopyOnWriteArrayList<>();\n+\n+\tprivate static final int timeout = 5000;\n+\tprivate static byte seqNbr = 0;\n+\tprivate static RFXComTransmitterMessage responseMessage = null;\n+\tprivate Object notifierObject = new Object();\n+\tprivate RFXComConfiguration configuration = null;\n+\n+\tpublic RFXComBridgeHandler(Bridge br) {\n+\t\tsuper(br);\n+\t}\n+\n+\t@Override\n+\tpublic void handleCommand(ChannelUID channelUID, Command command) {\n+\t\tif (command instanceof RefreshType) {\n+\t\t\tlogger.debug(\"Refresh command received.\");\n+","path":"addons/binding/org.openhab.binding.rfxcom/src/main/java/org/openhab/binding/rfxcom/handler/RFXComBridgeHandler.java","position":72,"original_position":72,"commit_id":"5a183a61086d1c04ffce37a036e59184fccc4ed7","original_commit_id":"5a183a61086d1c04ffce37a036e59184fccc4ed7","user":{"login":"kaikreuzer","id":3244965,"avatar_url":"https://avatars.githubusercontent.com/u/3244965?v=3","gravatar_id":"","url":"https://api.github.com/users/kaikreuzer","html_url":"https://github.com/kaikreuzer","followers_url":"https://api.github.com/users/kaikreuzer/followers","following_url":"https://api.github.com/users/kaikreuzer/following{/other_user}","gists_url":"https://api.github.com/users/kaikreuzer/gists{/gist_id}","starred_url":"https://api.github.com/users/kaikreuzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaikreuzer/subscriptions","organizations_url":"https://api.github.com/users/kaikreuzer/orgs","repos_url":"https://api.github.com/users/kaikreuzer/repos","events_url":"https://api.github.com/users/kaikreuzer/events{/privacy}","received_events_url":"https://api.github.com/users/kaikreuzer/received_events","type":"User","site_admin":false},"body":"Should anything happen here? Otherwise I would completely remove the \"if\".","created_at":"2015-05-06T15:11:23Z","updated_at":"2015-05-06T15:11:23Z","html_url":"https://github.com/openhab/openhab2/pull/143#discussion_r29767450","pull_request_url":"https://api.github.com/repos/openhab/openhab2/pulls/143","_links":{"self":{"href":"https://api.github.com/repos/openhab/openhab2/pulls/comments/29767450"},"html":{"href":"https://github.com/openhab/openhab2/pull/143#discussion_r29767450"},"pull_request":{"href":"https://api.github.com/repos/openhab/openhab2/pulls/143"}}},"pull_request":{"url":"https://api.github.com/repos/openhab/openhab2/pulls/143","id":29828291,"html_url":"https://github.com/openhab/openhab2/pull/143","diff_url":"https://github.com/openhab/openhab2/pull/143.diff","patch_url":"https://github.com/openhab/openhab2/pull/143.patch","issue_url":"https://api.github.com/repos/openhab/openhab2/issues/143","number":143,"state":"open","locked":false,"title":"Initial contribution of the RFXCOM binding","user":{"login":"paulianttila","id":5506533,"avatar_url":"https://avatars.githubusercontent.com/u/5506533?v=3","gravatar_id":"","url":"https://api.github.com/users/paulianttila","html_url":"https://github.com/paulianttila","followers_url":"https://api.github.com/users/paulianttila/followers","following_url":"https://api.github.com/users/paulianttila/following{/other_user}","gists_url":"https://api.github.com/users/paulianttila/gists{/gist_id}","starred_url":"https://api.github.com/users/paulianttila/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulianttila/subscriptions","organizations_url":"https://api.github.com/users/paulianttila/orgs","repos_url":"https://api.github.com/users/paulianttila/repos","events_url":"https://api.github.com/users/paulianttila/events{/privacy}","received_events_url":"https://api.github.com/users/paulianttila/received_events","type":"User","site_admin":false},"body":"Signed-off-by: Pauli Anttila <pauli.anttila@gmail.com> (github: paulianttila)","created_at":"2015-02-23T17:34:09Z","updated_at":"2015-05-06T15:11:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"46ea3448c66cd2124934f5e4ce5a574e7bad0a58","assignee":{"login":"kaikreuzer","id":3244965,"avatar_url":"https://avatars.githubusercontent.com/u/3244965?v=3","gravatar_id":"","url":"https://api.github.com/users/kaikreuzer","html_url":"https://github.com/kaikreuzer","followers_url":"https://api.github.com/users/kaikreuzer/followers","following_url":"https://api.github.com/users/kaikreuzer/following{/other_user}","gists_url":"https://api.github.com/users/kaikreuzer/gists{/gist_id}","starred_url":"https://api.github.com/users/kaikreuzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaikreuzer/subscriptions","organizations_url":"https://api.github.com/users/kaikreuzer/orgs","repos_url":"https://api.github.com/users/kaikreuzer/repos","events_url":"https://api.github.com/users/kaikreuzer/events{/privacy}","received_events_url":"https://api.github.com/users/kaikreuzer/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/openhab/openhab2/milestones/1","html_url":"https://github.com/openhab/openhab2/milestones/2.0.0%20alpha2","labels_url":"https://api.github.com/repos/openhab/openhab2/milestones/1/labels","id":1052966,"number":1,"title":"2.0.0 alpha2","description":"This is the milestone for all issues that will be part of the [openHAB 2 alpha 2 release](https://github.com/openhab/openhab2/releases/tag/untagged-3d0b532233e628529db3).","creator":{"login":"kaikreuzer","id":3244965,"avatar_url":"https://avatars.githubusercontent.com/u/3244965?v=3","gravatar_id":"","url":"https://api.github.com/users/kaikreuzer","html_url":"https://github.com/kaikreuzer","followers_url":"https://api.github.com/users/kaikreuzer/followers","following_url":"https://api.github.com/users/kaikreuzer/following{/other_user}","gists_url":"https://api.github.com/users/kaikreuzer/gists{/gist_id}","starred_url":"https://api.github.com/users/kaikreuzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaikreuzer/subscriptions","organizations_url":"https://api.github.com/users/kaikreuzer/orgs","repos_url":"https://api.github.com/users/kaikreuzer/repos","events_url":"https://api.github.com/users/kaikreuzer/events{/privacy}","received_events_url":"https://api.github.com/users/kaikreuzer/received_events","type":"User","site_admin":false},"open_issues":11,"closed_issues":53,"state":"open","created_at":"2015-04-04T19:33:02Z","updated_at":"2015-05-04T20:49:45Z","due_on":"2015-05-24T22:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/openhab/openhab2/pulls/143/commits","review_comments_url":"https://api.github.com/repos/openhab/openhab2/pulls/143/comments","review_comment_url":"https://api.github.com/repos/openhab/openhab2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openhab/openhab2/issues/143/comments","statuses_url":"https://api.github.com/repos/openhab/openhab2/statuses/5a183a61086d1c04ffce37a036e59184fccc4ed7","head":{"label":"paulianttila:rfxcom","ref":"rfxcom","sha":"5a183a61086d1c04ffce37a036e59184fccc4ed7","user":{"login":"paulianttila","id":5506533,"avatar_url":"https://avatars.githubusercontent.com/u/5506533?v=3","gravatar_id":"","url":"https://api.github.com/users/paulianttila","html_url":"https://github.com/paulianttila","followers_url":"https://api.github.com/users/paulianttila/followers","following_url":"https://api.github.com/users/paulianttila/following{/other_user}","gists_url":"https://api.github.com/users/paulianttila/gists{/gist_id}","starred_url":"https://api.github.com/users/paulianttila/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulianttila/subscriptions","organizations_url":"https://api.github.com/users/paulianttila/orgs","repos_url":"https://api.github.com/users/paulianttila/repos","events_url":"https://api.github.com/users/paulianttila/events{/privacy}","received_events_url":"https://api.github.com/users/paulianttila/received_events","type":"User","site_admin":false},"repo":{"id":25420617,"name":"openhab2","full_name":"paulianttila/openhab2","owner":{"login":"paulianttila","id":5506533,"avatar_url":"https://avatars.githubusercontent.com/u/5506533?v=3","gravatar_id":"","url":"https://api.github.com/users/paulianttila","html_url":"https://github.com/paulianttila","followers_url":"https://api.github.com/users/paulianttila/followers","following_url":"https://api.github.com/users/paulianttila/following{/other_user}","gists_url":"https://api.github.com/users/paulianttila/gists{/gist_id}","starred_url":"https://api.github.com/users/paulianttila/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulianttila/subscriptions","organizations_url":"https://api.github.com/users/paulianttila/orgs","repos_url":"https://api.github.com/users/paulianttila/repos","events_url":"https://api.github.com/users/paulianttila/events{/privacy}","received_events_url":"https://api.github.com/users/paulianttila/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/paulianttila/openhab2","description":"The next-generation open Home Automation Bus (openHAB)","fork":true,"url":"https://api.github.com/repos/paulianttila/openhab2","forks_url":"https://api.github.com/repos/paulianttila/openhab2/forks","keys_url":"https://api.github.com/repos/paulianttila/openhab2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paulianttila/openhab2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paulianttila/openhab2/teams","hooks_url":"https://api.github.com/repos/paulianttila/openhab2/hooks","issue_events_url":"https://api.github.com/repos/paulianttila/openhab2/issues/events{/number}","events_url":"https://api.github.com/repos/paulianttila/openhab2/events","assignees_url":"https://api.github.com/repos/paulianttila/openhab2/assignees{/user}","branches_url":"https://api.github.com/repos/paulianttila/openhab2/branches{/branch}","tags_url":"https://api.github.com/repos/paulianttila/openhab2/tags","blobs_url":"https://api.github.com/repos/paulianttila/openhab2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paulianttila/openhab2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paulianttila/openhab2/git/refs{/sha}","trees_url":"https://api.github.com/repos/paulianttila/openhab2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paulianttila/openhab2/statuses/{sha}","languages_url":"https://api.github.com/repos/paulianttila/openhab2/languages","stargazers_url":"https://api.github.com/repos/paulianttila/openhab2/stargazers","contributors_url":"https://api.github.com/repos/paulianttila/openhab2/contributors","subscribers_url":"https://api.github.com/repos/paulianttila/openhab2/subscribers","subscription_url":"https://api.github.com/repos/paulianttila/openhab2/subscription","commits_url":"https://api.github.com/repos/paulianttila/openhab2/commits{/sha}","git_commits_url":"https://api.github.com/repos/paulianttila/openhab2/git/commits{/sha}","comments_url":"https://api.github.com/repos/paulianttila/openhab2/comments{/number}","issue_comment_url":"https://api.github.com/repos/paulianttila/openhab2/issues/comments{/number}","contents_url":"https://api.github.com/repos/paulianttila/openhab2/contents/{+path}","compare_url":"https://api.github.com/repos/paulianttila/openhab2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paulianttila/openhab2/merges","archive_url":"https://api.github.com/repos/paulianttila/openhab2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paulianttila/openhab2/downloads","issues_url":"https://api.github.com/repos/paulianttila/openhab2/issues{/number}","pulls_url":"https://api.github.com/repos/paulianttila/openhab2/pulls{/number}","milestones_url":"https://api.github.com/repos/paulianttila/openhab2/milestones{/number}","notifications_url":"https://api.github.com/repos/paulianttila/openhab2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paulianttila/openhab2/labels{/name}","releases_url":"https://api.github.com/repos/paulianttila/openhab2/releases{/id}","created_at":"2014-10-19T07:26:43Z","updated_at":"2015-03-23T17:55:15Z","pushed_at":"2015-05-01T06:59:36Z","git_url":"git://github.com/paulianttila/openhab2.git","ssh_url":"git@github.com:paulianttila/openhab2.git","clone_url":"https://github.com/paulianttila/openhab2.git","svn_url":"https://github.com/paulianttila/openhab2","homepage":null,"size":4149,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openhab:master","ref":"master","sha":"df790934eeb42f524496233e0cfd6a17e9763040","user":{"login":"openhab","id":1007353,"avatar_url":"https://avatars.githubusercontent.com/u/1007353?v=3","gravatar_id":"","url":"https://api.github.com/users/openhab","html_url":"https://github.com/openhab","followers_url":"https://api.github.com/users/openhab/followers","following_url":"https://api.github.com/users/openhab/following{/other_user}","gists_url":"https://api.github.com/users/openhab/gists{/gist_id}","starred_url":"https://api.github.com/users/openhab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openhab/subscriptions","organizations_url":"https://api.github.com/users/openhab/orgs","repos_url":"https://api.github.com/users/openhab/repos","events_url":"https://api.github.com/users/openhab/events{/privacy}","received_events_url":"https://api.github.com/users/openhab/received_events","type":"Organization","site_admin":false},"repo":{"id":19753195,"name":"openhab2","full_name":"openhab/openhab2","owner":{"login":"openhab","id":1007353,"avatar_url":"https://avatars.githubusercontent.com/u/1007353?v=3","gravatar_id":"","url":"https://api.github.com/users/openhab","html_url":"https://github.com/openhab","followers_url":"https://api.github.com/users/openhab/followers","following_url":"https://api.github.com/users/openhab/following{/other_user}","gists_url":"https://api.github.com/users/openhab/gists{/gist_id}","starred_url":"https://api.github.com/users/openhab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openhab/subscriptions","organizations_url":"https://api.github.com/users/openhab/orgs","repos_url":"https://api.github.com/users/openhab/repos","events_url":"https://api.github.com/users/openhab/events{/privacy}","received_events_url":"https://api.github.com/users/openhab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openhab/openhab2","description":"The next-generation open Home Automation Bus (openHAB)","fork":false,"url":"https://api.github.com/repos/openhab/openhab2","forks_url":"https://api.github.com/repos/openhab/openhab2/forks","keys_url":"https://api.github.com/repos/openhab/openhab2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openhab/openhab2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openhab/openhab2/teams","hooks_url":"https://api.github.com/repos/openhab/openhab2/hooks","issue_events_url":"https://api.github.com/repos/openhab/openhab2/issues/events{/number}","events_url":"https://api.github.com/repos/openhab/openhab2/events","assignees_url":"https://api.github.com/repos/openhab/openhab2/assignees{/user}","branches_url":"https://api.github.com/repos/openhab/openhab2/branches{/branch}","tags_url":"https://api.github.com/repos/openhab/openhab2/tags","blobs_url":"https://api.github.com/repos/openhab/openhab2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openhab/openhab2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openhab/openhab2/git/refs{/sha}","trees_url":"https://api.github.com/repos/openhab/openhab2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openhab/openhab2/statuses/{sha}","languages_url":"https://api.github.com/repos/openhab/openhab2/languages","stargazers_url":"https://api.github.com/repos/openhab/openhab2/stargazers","contributors_url":"https://api.github.com/repos/openhab/openhab2/contributors","subscribers_url":"https://api.github.com/repos/openhab/openhab2/subscribers","subscription_url":"https://api.github.com/repos/openhab/openhab2/subscription","commits_url":"https://api.github.com/repos/openhab/openhab2/commits{/sha}","git_commits_url":"https://api.github.com/repos/openhab/openhab2/git/commits{/sha}","comments_url":"https://api.github.com/repos/openhab/openhab2/comments{/number}","issue_comment_url":"https://api.github.com/repos/openhab/openhab2/issues/comments{/number}","contents_url":"https://api.github.com/repos/openhab/openhab2/contents/{+path}","compare_url":"https://api.github.com/repos/openhab/openhab2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openhab/openhab2/merges","archive_url":"https://api.github.com/repos/openhab/openhab2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openhab/openhab2/downloads","issues_url":"https://api.github.com/repos/openhab/openhab2/issues{/number}","pulls_url":"https://api.github.com/repos/openhab/openhab2/pulls{/number}","milestones_url":"https://api.github.com/repos/openhab/openhab2/milestones{/number}","notifications_url":"https://api.github.com/repos/openhab/openhab2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openhab/openhab2/labels{/name}","releases_url":"https://api.github.com/repos/openhab/openhab2/releases{/id}","created_at":"2014-05-13T19:41:58Z","updated_at":"2015-05-05T21:13:26Z","pushed_at":"2015-05-06T13:24:00Z","git_url":"git://github.com/openhab/openhab2.git","ssh_url":"git@github.com:openhab/openhab2.git","clone_url":"https://github.com/openhab/openhab2.git","svn_url":"https://github.com/openhab/openhab2","homepage":null,"size":27791,"stargazers_count":137,"watchers_count":137,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":276,"mirror_url":null,"open_issues_count":45,"forks":276,"open_issues":45,"watchers":137,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openhab/openhab2/pulls/143"},"html":{"href":"https://github.com/openhab/openhab2/pull/143"},"issue":{"href":"https://api.github.com/repos/openhab/openhab2/issues/143"},"comments":{"href":"https://api.github.com/repos/openhab/openhab2/issues/143/comments"},"review_comments":{"href":"https://api.github.com/repos/openhab/openhab2/pulls/143/comments"},"review_comment":{"href":"https://api.github.com/repos/openhab/openhab2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openhab/openhab2/pulls/143/commits"},"statuses":{"href":"https://api.github.com/repos/openhab/openhab2/statuses/5a183a61086d1c04ffce37a036e59184fccc4ed7"}}}}