{"action":"created","comment":{"url":"https://api.github.com/repos/guh/guh/pulls/comments/69375109","id":69375109,"diff_hunk":"@@ -0,0 +1,145 @@\n+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n+ *                                                                         *\n+ *  Copyright (C) 2015 Simon Stuerz <simon.stuerz@guh.guru>                *\n+ *  Copyright (C) 2016 nicc                                                *\n+ *                                                                         *\n+ *  This file is part of guh.                                              *\n+ *                                                                         *\n+ *  Guh is free software: you can redistribute it and/or modify            *\n+ *  it under the terms of the GNU General Public License as published by   *\n+ *  the Free Software Foundation, version 2 of the License.                *\n+ *                                                                         *\n+ *  Guh is distributed in the hope that it will be useful,                 *\n+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *\n+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the           *\n+ *  GNU General Public License for more details.                           *\n+ *                                                                         *\n+ *  You should have received a copy of the GNU General Public License      *\n+ *  along with guh. If not, see <http://www.gnu.org/licenses/>.            *\n+ *                                                                         *\n+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n+\n+/*!\n+    \\page multisensor.html\n+    \\title MultiSensor\n+    \\brief Plugin for TI SensorTag.\n+\n+    \\ingroup plugins\n+    \\ingroup guh-plugins\n+\n+    This plugin allows finding and controlling the Bluetooth Low Energy SensorTag from Texas Instruments.\n+\n+    \\chapter Plugin properties\n+    Following JSON file contains the definition and the description of all available\n+\\l{DeviceClass}{DeviceClasses}\n+    and \\l{Vendor}{Vendors} of this \\l{DevicePlugin}.\n+\n+    For more details on how to read this JSON file please check out the documentation fo\n+r \\l{The plugin JSON File}.\n+\n+    \\quotefile plugins/deviceplugins/multisensor/devicepluginmultisensor.json\n+*/\n+\n+#include \"plugininfo.h\"\n+#include \"devicemanager.h\"\n+#include \"bluetooth/bluetoothlowenergydevice.h\"\n+#include \"devicepluginmultisensor.h\"\n+\n+/* The constructor of this device plugin. */\n+DevicePluginMultiSensor::DevicePluginMultiSensor()\n+{\n+\n+}\n+\n+/* This method will be called from the devicemanager to get\n+ * information about this plugin which device resource will be needed.\n+ */\n+DeviceManager::HardwareResources DevicePluginMultiSensor::requiredHardware() const\n+{\n+    return DeviceManager::HardwareResourceBluetoothLE;\n+}\n+\n+DeviceManager::DeviceError DevicePluginMultiSensor::discoverDevices(const DeviceClassId &deviceClassId, const ParamList &params)\n+{\n+    Q_UNUSED(params)\n+\n+    if (deviceClassId != sensortagDeviceClassId)\n+        return DeviceManager::DeviceErrorDeviceClassNotFound;\n+\n+    if (!discoverBluetooth())\n+        return DeviceManager::DeviceErrorHardwareNotAvailable;\n+\n+    return DeviceManager::DeviceErrorAsync;\n+}\n+\n+void DevicePluginMultiSensor::bluetoothDiscoveryFinished(const QList<QBluetoothDeviceInfo> &deviceInfos)\n+{\n+    QList<DeviceDescriptor> deviceDescriptors;\n+    foreach (auto deviceInfo, deviceInfos) {\n+        if (deviceInfo.name().contains(\"SensorTag\")) {\n+            if (!verifyExistingDevices(deviceInfo)) {\n+                DeviceDescriptor descriptor(sensortagDeviceClassId, \"SensorTag\", deviceInfo.address().toString());\n+                ParamList params;\n+                params.append(Param(\"name\", deviceInfo.name()));\n+                params.append(Param(\"mac address\", deviceInfo.address().toString()));\n+                descriptor.setParams(params);\n+                deviceDescriptors.append(descriptor);\n+            }\n+        }\n+    }\n+\n+    emit devicesDiscovered(sensortagDeviceClassId, deviceDescriptors);\n+}\n+\n+/* This method will be called from the devicemanager while he\n+ * is setting up a new device. Here the developer has the chance to\n+ * perform the setup on the actual device and report the result.\n+ */\n+DeviceManager::DeviceSetupStatus DevicePluginMultiSensor::setupDevice(Device *device)\n+{\n+    qCDebug(dcMultiSensor) << \"Setting up MultiSensor\" << device->name() << device->params();\n+\n+    if (device->deviceClassId() == sensortagDeviceClassId) {\n+        auto address = QBluetoothAddress(device->paramValue(\"mac address\").toString());\n+        auto name = device->paramValue(\"name\").toString();\n+        auto deviceInfo = QBluetoothDeviceInfo(address, name, 0);\n+\n+        QSharedPointer<SensorTag> tag{new SensorTag(deviceInfo, QLowEnergyController::PublicAddress, this)};\n+        connect(tag.data(), &SensorTag::valueChanged, this, &DevicePluginMultiSensor::updateValue);\n+        m_tags.insert(tag, device);\n+\n+        tag->connectDevice();","path":"plugins/deviceplugins/multisensor/devicepluginmultisensor.cpp","position":111,"original_position":111,"commit_id":"b86573ad04de017f3f029c9c915a1f876c238e2c","original_commit_id":"b86573ad04de017f3f029c9c915a1f876c238e2c","user":{"login":"t-mon","id":6507449,"avatar_url":"https://avatars.githubusercontent.com/u/6507449?v=3","gravatar_id":"","url":"https://api.github.com/users/t-mon","html_url":"https://github.com/t-mon","followers_url":"https://api.github.com/users/t-mon/followers","following_url":"https://api.github.com/users/t-mon/following{/other_user}","gists_url":"https://api.github.com/users/t-mon/gists{/gist_id}","starred_url":"https://api.github.com/users/t-mon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/t-mon/subscriptions","organizations_url":"https://api.github.com/users/t-mon/orgs","repos_url":"https://api.github.com/users/t-mon/repos","events_url":"https://api.github.com/users/t-mon/events{/privacy}","received_events_url":"https://api.github.com/users/t-mon/received_events","type":"User","site_admin":false},"body":"There is currently no possibility to reconnect the sensor if the connection gets lost without restarting the whole server. You could use `guhTimer()` for automatic reconnect mechanism the sensor or create a `reconnect` action.","created_at":"2016-07-02T08:51:23Z","updated_at":"2016-07-02T08:51:23Z","html_url":"https://github.com/guh/guh/pull/356#discussion_r69375109","pull_request_url":"https://api.github.com/repos/guh/guh/pulls/356","_links":{"self":{"href":"https://api.github.com/repos/guh/guh/pulls/comments/69375109"},"html":{"href":"https://github.com/guh/guh/pull/356#discussion_r69375109"},"pull_request":{"href":"https://api.github.com/repos/guh/guh/pulls/356"}}},"pull_request":{"url":"https://api.github.com/repos/guh/guh/pulls/356","id":76016569,"html_url":"https://github.com/guh/guh/pull/356","diff_url":"https://github.com/guh/guh/pull/356.diff","patch_url":"https://github.com/guh/guh/pull/356.patch","issue_url":"https://api.github.com/repos/guh/guh/issues/356","number":356,"state":"open","locked":false,"title":"Multisensor plugin","user":{"login":"ni-cc","id":6788222,"avatar_url":"https://avatars.githubusercontent.com/u/6788222?v=3","gravatar_id":"","url":"https://api.github.com/users/ni-cc","html_url":"https://github.com/ni-cc","followers_url":"https://api.github.com/users/ni-cc/followers","following_url":"https://api.github.com/users/ni-cc/following{/other_user}","gists_url":"https://api.github.com/users/ni-cc/gists{/gist_id}","starred_url":"https://api.github.com/users/ni-cc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ni-cc/subscriptions","organizations_url":"https://api.github.com/users/ni-cc/orgs","repos_url":"https://api.github.com/users/ni-cc/repos","events_url":"https://api.github.com/users/ni-cc/events{/privacy}","received_events_url":"https://api.github.com/users/ni-cc/received_events","type":"User","site_admin":false},"body":"Plugin for the TI SensorTag","created_at":"2016-07-01T18:07:14Z","updated_at":"2016-07-02T08:51:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fd0c38552f8f7b225367648d7f6d6fcfdbcc4dbe","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/guh/guh/pulls/356/commits","review_comments_url":"https://api.github.com/repos/guh/guh/pulls/356/comments","review_comment_url":"https://api.github.com/repos/guh/guh/pulls/comments{/number}","comments_url":"https://api.github.com/repos/guh/guh/issues/356/comments","statuses_url":"https://api.github.com/repos/guh/guh/statuses/b86573ad04de017f3f029c9c915a1f876c238e2c","head":{"label":"ni-cc:multisensor","ref":"multisensor","sha":"b86573ad04de017f3f029c9c915a1f876c238e2c","user":{"login":"ni-cc","id":6788222,"avatar_url":"https://avatars.githubusercontent.com/u/6788222?v=3","gravatar_id":"","url":"https://api.github.com/users/ni-cc","html_url":"https://github.com/ni-cc","followers_url":"https://api.github.com/users/ni-cc/followers","following_url":"https://api.github.com/users/ni-cc/following{/other_user}","gists_url":"https://api.github.com/users/ni-cc/gists{/gist_id}","starred_url":"https://api.github.com/users/ni-cc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ni-cc/subscriptions","organizations_url":"https://api.github.com/users/ni-cc/orgs","repos_url":"https://api.github.com/users/ni-cc/repos","events_url":"https://api.github.com/users/ni-cc/events{/privacy}","received_events_url":"https://api.github.com/users/ni-cc/received_events","type":"User","site_admin":false},"repo":{"id":61990096,"name":"guh","full_name":"ni-cc/guh","owner":{"login":"ni-cc","id":6788222,"avatar_url":"https://avatars.githubusercontent.com/u/6788222?v=3","gravatar_id":"","url":"https://api.github.com/users/ni-cc","html_url":"https://github.com/ni-cc","followers_url":"https://api.github.com/users/ni-cc/followers","following_url":"https://api.github.com/users/ni-cc/following{/other_user}","gists_url":"https://api.github.com/users/ni-cc/gists{/gist_id}","starred_url":"https://api.github.com/users/ni-cc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ni-cc/subscriptions","organizations_url":"https://api.github.com/users/ni-cc/orgs","repos_url":"https://api.github.com/users/ni-cc/repos","events_url":"https://api.github.com/users/ni-cc/events{/privacy}","received_events_url":"https://api.github.com/users/ni-cc/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ni-cc/guh","description":null,"fork":true,"url":"https://api.github.com/repos/ni-cc/guh","forks_url":"https://api.github.com/repos/ni-cc/guh/forks","keys_url":"https://api.github.com/repos/ni-cc/guh/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ni-cc/guh/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ni-cc/guh/teams","hooks_url":"https://api.github.com/repos/ni-cc/guh/hooks","issue_events_url":"https://api.github.com/repos/ni-cc/guh/issues/events{/number}","events_url":"https://api.github.com/repos/ni-cc/guh/events","assignees_url":"https://api.github.com/repos/ni-cc/guh/assignees{/user}","branches_url":"https://api.github.com/repos/ni-cc/guh/branches{/branch}","tags_url":"https://api.github.com/repos/ni-cc/guh/tags","blobs_url":"https://api.github.com/repos/ni-cc/guh/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ni-cc/guh/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ni-cc/guh/git/refs{/sha}","trees_url":"https://api.github.com/repos/ni-cc/guh/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ni-cc/guh/statuses/{sha}","languages_url":"https://api.github.com/repos/ni-cc/guh/languages","stargazers_url":"https://api.github.com/repos/ni-cc/guh/stargazers","contributors_url":"https://api.github.com/repos/ni-cc/guh/contributors","subscribers_url":"https://api.github.com/repos/ni-cc/guh/subscribers","subscription_url":"https://api.github.com/repos/ni-cc/guh/subscription","commits_url":"https://api.github.com/repos/ni-cc/guh/commits{/sha}","git_commits_url":"https://api.github.com/repos/ni-cc/guh/git/commits{/sha}","comments_url":"https://api.github.com/repos/ni-cc/guh/comments{/number}","issue_comment_url":"https://api.github.com/repos/ni-cc/guh/issues/comments{/number}","contents_url":"https://api.github.com/repos/ni-cc/guh/contents/{+path}","compare_url":"https://api.github.com/repos/ni-cc/guh/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ni-cc/guh/merges","archive_url":"https://api.github.com/repos/ni-cc/guh/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ni-cc/guh/downloads","issues_url":"https://api.github.com/repos/ni-cc/guh/issues{/number}","pulls_url":"https://api.github.com/repos/ni-cc/guh/pulls{/number}","milestones_url":"https://api.github.com/repos/ni-cc/guh/milestones{/number}","notifications_url":"https://api.github.com/repos/ni-cc/guh/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ni-cc/guh/labels{/name}","releases_url":"https://api.github.com/repos/ni-cc/guh/releases{/id}","deployments_url":"https://api.github.com/repos/ni-cc/guh/deployments","created_at":"2016-06-26T13:27:26Z","updated_at":"2016-06-26T13:27:28Z","pushed_at":"2016-07-01T17:50:45Z","git_url":"git://github.com/ni-cc/guh.git","ssh_url":"git@github.com:ni-cc/guh.git","clone_url":"https://github.com/ni-cc/guh.git","svn_url":"https://github.com/ni-cc/guh","homepage":"dev.guh.guru","size":10049,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"guh:master","ref":"master","sha":"4c04ba3b640cb48cf8deefa4affa2034b24436bd","user":{"login":"guh","id":5237262,"avatar_url":"https://avatars.githubusercontent.com/u/5237262?v=3","gravatar_id":"","url":"https://api.github.com/users/guh","html_url":"https://github.com/guh","followers_url":"https://api.github.com/users/guh/followers","following_url":"https://api.github.com/users/guh/following{/other_user}","gists_url":"https://api.github.com/users/guh/gists{/gist_id}","starred_url":"https://api.github.com/users/guh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guh/subscriptions","organizations_url":"https://api.github.com/users/guh/orgs","repos_url":"https://api.github.com/users/guh/repos","events_url":"https://api.github.com/users/guh/events{/privacy}","received_events_url":"https://api.github.com/users/guh/received_events","type":"Organization","site_admin":false},"repo":{"id":12134385,"name":"guh","full_name":"guh/guh","owner":{"login":"guh","id":5237262,"avatar_url":"https://avatars.githubusercontent.com/u/5237262?v=3","gravatar_id":"","url":"https://api.github.com/users/guh","html_url":"https://github.com/guh","followers_url":"https://api.github.com/users/guh/followers","following_url":"https://api.github.com/users/guh/following{/other_user}","gists_url":"https://api.github.com/users/guh/gists{/gist_id}","starred_url":"https://api.github.com/users/guh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guh/subscriptions","organizations_url":"https://api.github.com/users/guh/orgs","repos_url":"https://api.github.com/users/guh/repos","events_url":"https://api.github.com/users/guh/events{/privacy}","received_events_url":"https://api.github.com/users/guh/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/guh/guh","description":"","fork":false,"url":"https://api.github.com/repos/guh/guh","forks_url":"https://api.github.com/repos/guh/guh/forks","keys_url":"https://api.github.com/repos/guh/guh/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guh/guh/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guh/guh/teams","hooks_url":"https://api.github.com/repos/guh/guh/hooks","issue_events_url":"https://api.github.com/repos/guh/guh/issues/events{/number}","events_url":"https://api.github.com/repos/guh/guh/events","assignees_url":"https://api.github.com/repos/guh/guh/assignees{/user}","branches_url":"https://api.github.com/repos/guh/guh/branches{/branch}","tags_url":"https://api.github.com/repos/guh/guh/tags","blobs_url":"https://api.github.com/repos/guh/guh/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guh/guh/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guh/guh/git/refs{/sha}","trees_url":"https://api.github.com/repos/guh/guh/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guh/guh/statuses/{sha}","languages_url":"https://api.github.com/repos/guh/guh/languages","stargazers_url":"https://api.github.com/repos/guh/guh/stargazers","contributors_url":"https://api.github.com/repos/guh/guh/contributors","subscribers_url":"https://api.github.com/repos/guh/guh/subscribers","subscription_url":"https://api.github.com/repos/guh/guh/subscription","commits_url":"https://api.github.com/repos/guh/guh/commits{/sha}","git_commits_url":"https://api.github.com/repos/guh/guh/git/commits{/sha}","comments_url":"https://api.github.com/repos/guh/guh/comments{/number}","issue_comment_url":"https://api.github.com/repos/guh/guh/issues/comments{/number}","contents_url":"https://api.github.com/repos/guh/guh/contents/{+path}","compare_url":"https://api.github.com/repos/guh/guh/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guh/guh/merges","archive_url":"https://api.github.com/repos/guh/guh/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guh/guh/downloads","issues_url":"https://api.github.com/repos/guh/guh/issues{/number}","pulls_url":"https://api.github.com/repos/guh/guh/pulls{/number}","milestones_url":"https://api.github.com/repos/guh/guh/milestones{/number}","notifications_url":"https://api.github.com/repos/guh/guh/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guh/guh/labels{/name}","releases_url":"https://api.github.com/repos/guh/guh/releases{/id}","deployments_url":"https://api.github.com/repos/guh/guh/deployments","created_at":"2013-08-15T12:58:58Z","updated_at":"2016-06-09T13:47:53Z","pushed_at":"2016-07-01T18:07:14Z","git_url":"git://github.com/guh/guh.git","ssh_url":"git@github.com:guh/guh.git","clone_url":"https://github.com/guh/guh.git","svn_url":"https://github.com/guh/guh","homepage":"dev.guh.guru","size":10265,"stargazers_count":46,"watchers_count":46,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":12,"mirror_url":null,"open_issues_count":23,"forks":12,"open_issues":23,"watchers":46,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/guh/guh/pulls/356"},"html":{"href":"https://github.com/guh/guh/pull/356"},"issue":{"href":"https://api.github.com/repos/guh/guh/issues/356"},"comments":{"href":"https://api.github.com/repos/guh/guh/issues/356/comments"},"review_comments":{"href":"https://api.github.com/repos/guh/guh/pulls/356/comments"},"review_comment":{"href":"https://api.github.com/repos/guh/guh/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/guh/guh/pulls/356/commits"},"statuses":{"href":"https://api.github.com/repos/guh/guh/statuses/b86573ad04de017f3f029c9c915a1f876c238e2c"}}}}
{"actor":{"display_login":"t-mon"}}