{"action":"created","comment":{"url":"https://api.github.com/repos/openthread/openthread/pulls/comments/87727069","pull_request_review_id":8327097,"id":87727069,"diff_hunk":"@@ -0,0 +1,237 @@\n+/*\n+ *  Copyright (c) 2016, The OpenThread Authors.\n+ *  All rights reserved.\n+ *\n+ *  Redistribution and use in source and binary forms, with or without\n+ *  modification, are permitted provided that the following conditions are met:\n+ *  1. Redistributions of source code must retain the above copyright\n+ *     notice, this list of conditions and the following disclaimer.\n+ *  2. Redistributions in binary form must reproduce the above copyright\n+ *     notice, this list of conditions and the following disclaimer in the\n+ *     documentation and/or other materials provided with the distribution.\n+ *  3. Neither the name of the copyright holder nor the\n+ *     names of its contributors may be used to endorse or promote products\n+ *     derived from this software without specific prior written permission.\n+ *\n+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n+ *  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n+ *  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+ *  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n+ *  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n+ *  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n+ *  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n+ *  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n+ *  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ *  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+ *  POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+/**\n+ * @file\n+ *   This file implements the jam detector feature.\n+ */\n+\n+#ifdef OPENTHREAD_CONFIG_FILE\n+#include OPENTHREAD_CONFIG_FILE\n+#else\n+#include <openthread-config.h>\n+#endif\n+\n+#include <openthread.h>\n+#include <openthread-types.h>\n+#include <thread/thread_netif.hpp>\n+#include <common/code_utils.hpp>\n+#include <platform/random.h>\n+#include <utils/jam_detector.hpp>\n+\n+namespace Thread {\n+namespace Utils {\n+\n+JamDetector::JamDetector(ThreadNetif &aNetif) :\n+    mNetif(aNetif),\n+    mTimer(aNetif.GetIp6().mTimerScheduler, &JamDetector::HandleTimer, this)\n+{\n+    mWindow = kMaxWindow;","path":"src/core/utils/jam_detector.cpp","position":54,"original_position":54,"commit_id":"07d4ef3b0775615a47ffa1fd7826d89c71ed61bf","original_commit_id":"07d4ef3b0775615a47ffa1fd7826d89c71ed61bf","user":{"login":"jwhui","id":16142208,"avatar_url":"https://avatars.githubusercontent.com/u/16142208?v=3","gravatar_id":"","url":"https://api.github.com/users/jwhui","html_url":"https://github.com/jwhui","followers_url":"https://api.github.com/users/jwhui/followers","following_url":"https://api.github.com/users/jwhui/following{/other_user}","gists_url":"https://api.github.com/users/jwhui/gists{/gist_id}","starred_url":"https://api.github.com/users/jwhui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwhui/subscriptions","organizations_url":"https://api.github.com/users/jwhui/orgs","repos_url":"https://api.github.com/users/jwhui/repos","events_url":"https://api.github.com/users/jwhui/events{/privacy}","received_events_url":"https://api.github.com/users/jwhui/received_events","type":"User","site_admin":false},"body":"nit: let's start using constructor lists for new code","created_at":"2016-11-14T00:40:04Z","updated_at":"2016-11-14T01:01:03Z","html_url":"https://github.com/openthread/openthread/pull/966#discussion_r87727069","pull_request_url":"https://api.github.com/repos/openthread/openthread/pulls/966","_links":{"self":{"href":"https://api.github.com/repos/openthread/openthread/pulls/comments/87727069"},"html":{"href":"https://github.com/openthread/openthread/pull/966#discussion_r87727069"},"pull_request":{"href":"https://api.github.com/repos/openthread/openthread/pulls/966"}}},"pull_request":{"url":"https://api.github.com/repos/openthread/openthread/pulls/966","id":93257679,"html_url":"https://github.com/openthread/openthread/pull/966","diff_url":"https://github.com/openthread/openthread/pull/966.diff","patch_url":"https://github.com/openthread/openthread/pull/966.patch","issue_url":"https://api.github.com/repos/openthread/openthread/issues/966","number":966,"state":"open","locked":false,"title":"Implementation of \"signal jamming detection\" feature","user":{"login":"abtink","id":17729664,"avatar_url":"https://avatars.githubusercontent.com/u/17729664?v=3","gravatar_id":"","url":"https://api.github.com/users/abtink","html_url":"https://github.com/abtink","followers_url":"https://api.github.com/users/abtink/followers","following_url":"https://api.github.com/users/abtink/following{/other_user}","gists_url":"https://api.github.com/users/abtink/gists{/gist_id}","starred_url":"https://api.github.com/users/abtink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abtink/subscriptions","organizations_url":"https://api.github.com/users/abtink/orgs","repos_url":"https://api.github.com/users/abtink/repos","events_url":"https://api.github.com/users/abtink/events{/privacy}","received_events_url":"https://api.github.com/users/abtink/received_events","type":"User","site_admin":false},"body":"This commit contains the following changes:\r\n\r\n- Introducing `JamDetector` class as the core of signal jamming  detection.\r\n- Adding new OpenThread APIs related to jamming detection.\r\n- Adding support in `NcpBase` for jamming detection spinel properties.\r\n\r\nThe counter-part of this PR in wpantund is https://github.com/openthread/wpantund/pull/102\r\n","created_at":"2016-11-11T00:17:19Z","updated_at":"2016-11-14T01:01:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"880cee11dd4b7ba1831f3f1ffaff0fda4c865e5e","assignee":{"login":"darconeous","id":686678,"avatar_url":"https://avatars.githubusercontent.com/u/686678?v=3","gravatar_id":"","url":"https://api.github.com/users/darconeous","html_url":"https://github.com/darconeous","followers_url":"https://api.github.com/users/darconeous/followers","following_url":"https://api.github.com/users/darconeous/following{/other_user}","gists_url":"https://api.github.com/users/darconeous/gists{/gist_id}","starred_url":"https://api.github.com/users/darconeous/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darconeous/subscriptions","organizations_url":"https://api.github.com/users/darconeous/orgs","repos_url":"https://api.github.com/users/darconeous/repos","events_url":"https://api.github.com/users/darconeous/events{/privacy}","received_events_url":"https://api.github.com/users/darconeous/received_events","type":"User","site_admin":false},"assignees":[{"login":"darconeous","id":686678,"avatar_url":"https://avatars.githubusercontent.com/u/686678?v=3","gravatar_id":"","url":"https://api.github.com/users/darconeous","html_url":"https://github.com/darconeous","followers_url":"https://api.github.com/users/darconeous/followers","following_url":"https://api.github.com/users/darconeous/following{/other_user}","gists_url":"https://api.github.com/users/darconeous/gists{/gist_id}","starred_url":"https://api.github.com/users/darconeous/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darconeous/subscriptions","organizations_url":"https://api.github.com/users/darconeous/orgs","repos_url":"https://api.github.com/users/darconeous/repos","events_url":"https://api.github.com/users/darconeous/events{/privacy}","received_events_url":"https://api.github.com/users/darconeous/received_events","type":"User","site_admin":false},{"login":"jwhui","id":16142208,"avatar_url":"https://avatars.githubusercontent.com/u/16142208?v=3","gravatar_id":"","url":"https://api.github.com/users/jwhui","html_url":"https://github.com/jwhui","followers_url":"https://api.github.com/users/jwhui/followers","following_url":"https://api.github.com/users/jwhui/following{/other_user}","gists_url":"https://api.github.com/users/jwhui/gists{/gist_id}","starred_url":"https://api.github.com/users/jwhui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwhui/subscriptions","organizations_url":"https://api.github.com/users/jwhui/orgs","repos_url":"https://api.github.com/users/jwhui/repos","events_url":"https://api.github.com/users/jwhui/events{/privacy}","received_events_url":"https://api.github.com/users/jwhui/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/openthread/openthread/pulls/966/commits","review_comments_url":"https://api.github.com/repos/openthread/openthread/pulls/966/comments","review_comment_url":"https://api.github.com/repos/openthread/openthread/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openthread/openthread/issues/966/comments","statuses_url":"https://api.github.com/repos/openthread/openthread/statuses/07d4ef3b0775615a47ffa1fd7826d89c71ed61bf","head":{"label":"abtink:usr/abtink/jam-det","ref":"usr/abtink/jam-det","sha":"07d4ef3b0775615a47ffa1fd7826d89c71ed61bf","user":{"login":"abtink","id":17729664,"avatar_url":"https://avatars.githubusercontent.com/u/17729664?v=3","gravatar_id":"","url":"https://api.github.com/users/abtink","html_url":"https://github.com/abtink","followers_url":"https://api.github.com/users/abtink/followers","following_url":"https://api.github.com/users/abtink/following{/other_user}","gists_url":"https://api.github.com/users/abtink/gists{/gist_id}","starred_url":"https://api.github.com/users/abtink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abtink/subscriptions","organizations_url":"https://api.github.com/users/abtink/orgs","repos_url":"https://api.github.com/users/abtink/repos","events_url":"https://api.github.com/users/abtink/events{/privacy}","received_events_url":"https://api.github.com/users/abtink/received_events","type":"User","site_admin":false},"repo":{"id":60545666,"name":"openthread","full_name":"abtink/openthread","owner":{"login":"abtink","id":17729664,"avatar_url":"https://avatars.githubusercontent.com/u/17729664?v=3","gravatar_id":"","url":"https://api.github.com/users/abtink","html_url":"https://github.com/abtink","followers_url":"https://api.github.com/users/abtink/followers","following_url":"https://api.github.com/users/abtink/following{/other_user}","gists_url":"https://api.github.com/users/abtink/gists{/gist_id}","starred_url":"https://api.github.com/users/abtink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abtink/subscriptions","organizations_url":"https://api.github.com/users/abtink/orgs","repos_url":"https://api.github.com/users/abtink/repos","events_url":"https://api.github.com/users/abtink/events{/privacy}","received_events_url":"https://api.github.com/users/abtink/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/abtink/openthread","description":"OpenThread released by Nest is an open-source implementation of the Thread networking protocol","fork":true,"url":"https://api.github.com/repos/abtink/openthread","forks_url":"https://api.github.com/repos/abtink/openthread/forks","keys_url":"https://api.github.com/repos/abtink/openthread/keys{/key_id}","collaborators_url":"https://api.github.com/repos/abtink/openthread/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/abtink/openthread/teams","hooks_url":"https://api.github.com/repos/abtink/openthread/hooks","issue_events_url":"https://api.github.com/repos/abtink/openthread/issues/events{/number}","events_url":"https://api.github.com/repos/abtink/openthread/events","assignees_url":"https://api.github.com/repos/abtink/openthread/assignees{/user}","branches_url":"https://api.github.com/repos/abtink/openthread/branches{/branch}","tags_url":"https://api.github.com/repos/abtink/openthread/tags","blobs_url":"https://api.github.com/repos/abtink/openthread/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/abtink/openthread/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/abtink/openthread/git/refs{/sha}","trees_url":"https://api.github.com/repos/abtink/openthread/git/trees{/sha}","statuses_url":"https://api.github.com/repos/abtink/openthread/statuses/{sha}","languages_url":"https://api.github.com/repos/abtink/openthread/languages","stargazers_url":"https://api.github.com/repos/abtink/openthread/stargazers","contributors_url":"https://api.github.com/repos/abtink/openthread/contributors","subscribers_url":"https://api.github.com/repos/abtink/openthread/subscribers","subscription_url":"https://api.github.com/repos/abtink/openthread/subscription","commits_url":"https://api.github.com/repos/abtink/openthread/commits{/sha}","git_commits_url":"https://api.github.com/repos/abtink/openthread/git/commits{/sha}","comments_url":"https://api.github.com/repos/abtink/openthread/comments{/number}","issue_comment_url":"https://api.github.com/repos/abtink/openthread/issues/comments{/number}","contents_url":"https://api.github.com/repos/abtink/openthread/contents/{+path}","compare_url":"https://api.github.com/repos/abtink/openthread/compare/{base}...{head}","merges_url":"https://api.github.com/repos/abtink/openthread/merges","archive_url":"https://api.github.com/repos/abtink/openthread/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/abtink/openthread/downloads","issues_url":"https://api.github.com/repos/abtink/openthread/issues{/number}","pulls_url":"https://api.github.com/repos/abtink/openthread/pulls{/number}","milestones_url":"https://api.github.com/repos/abtink/openthread/milestones{/number}","notifications_url":"https://api.github.com/repos/abtink/openthread/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/abtink/openthread/labels{/name}","releases_url":"https://api.github.com/repos/abtink/openthread/releases{/id}","deployments_url":"https://api.github.com/repos/abtink/openthread/deployments","created_at":"2016-06-06T17:04:09Z","updated_at":"2016-10-22T15:04:31Z","pushed_at":"2016-11-12T00:11:04Z","git_url":"git://github.com/abtink/openthread.git","ssh_url":"git@github.com:abtink/openthread.git","clone_url":"https://github.com/abtink/openthread.git","svn_url":"https://github.com/abtink/openthread","homepage":"","size":95385,"stargazers_count":0,"watchers_count":0,"language":"C++","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":"openthread:master","ref":"master","sha":"0254cde9865f4c76ec5a4d1236c19fab58c408c4","user":{"login":"openthread","id":16142269,"avatar_url":"https://avatars.githubusercontent.com/u/16142269?v=3","gravatar_id":"","url":"https://api.github.com/users/openthread","html_url":"https://github.com/openthread","followers_url":"https://api.github.com/users/openthread/followers","following_url":"https://api.github.com/users/openthread/following{/other_user}","gists_url":"https://api.github.com/users/openthread/gists{/gist_id}","starred_url":"https://api.github.com/users/openthread/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openthread/subscriptions","organizations_url":"https://api.github.com/users/openthread/orgs","repos_url":"https://api.github.com/users/openthread/repos","events_url":"https://api.github.com/users/openthread/events{/privacy}","received_events_url":"https://api.github.com/users/openthread/received_events","type":"Organization","site_admin":false},"repo":{"id":55808787,"name":"openthread","full_name":"openthread/openthread","owner":{"login":"openthread","id":16142269,"avatar_url":"https://avatars.githubusercontent.com/u/16142269?v=3","gravatar_id":"","url":"https://api.github.com/users/openthread","html_url":"https://github.com/openthread","followers_url":"https://api.github.com/users/openthread/followers","following_url":"https://api.github.com/users/openthread/following{/other_user}","gists_url":"https://api.github.com/users/openthread/gists{/gist_id}","starred_url":"https://api.github.com/users/openthread/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openthread/subscriptions","organizations_url":"https://api.github.com/users/openthread/orgs","repos_url":"https://api.github.com/users/openthread/repos","events_url":"https://api.github.com/users/openthread/events{/privacy}","received_events_url":"https://api.github.com/users/openthread/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openthread/openthread","description":"OpenThread released by Nest is an open-source implementation of the Thread networking protocol","fork":false,"url":"https://api.github.com/repos/openthread/openthread","forks_url":"https://api.github.com/repos/openthread/openthread/forks","keys_url":"https://api.github.com/repos/openthread/openthread/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openthread/openthread/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openthread/openthread/teams","hooks_url":"https://api.github.com/repos/openthread/openthread/hooks","issue_events_url":"https://api.github.com/repos/openthread/openthread/issues/events{/number}","events_url":"https://api.github.com/repos/openthread/openthread/events","assignees_url":"https://api.github.com/repos/openthread/openthread/assignees{/user}","branches_url":"https://api.github.com/repos/openthread/openthread/branches{/branch}","tags_url":"https://api.github.com/repos/openthread/openthread/tags","blobs_url":"https://api.github.com/repos/openthread/openthread/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openthread/openthread/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openthread/openthread/git/refs{/sha}","trees_url":"https://api.github.com/repos/openthread/openthread/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openthread/openthread/statuses/{sha}","languages_url":"https://api.github.com/repos/openthread/openthread/languages","stargazers_url":"https://api.github.com/repos/openthread/openthread/stargazers","contributors_url":"https://api.github.com/repos/openthread/openthread/contributors","subscribers_url":"https://api.github.com/repos/openthread/openthread/subscribers","subscription_url":"https://api.github.com/repos/openthread/openthread/subscription","commits_url":"https://api.github.com/repos/openthread/openthread/commits{/sha}","git_commits_url":"https://api.github.com/repos/openthread/openthread/git/commits{/sha}","comments_url":"https://api.github.com/repos/openthread/openthread/comments{/number}","issue_comment_url":"https://api.github.com/repos/openthread/openthread/issues/comments{/number}","contents_url":"https://api.github.com/repos/openthread/openthread/contents/{+path}","compare_url":"https://api.github.com/repos/openthread/openthread/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openthread/openthread/merges","archive_url":"https://api.github.com/repos/openthread/openthread/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openthread/openthread/downloads","issues_url":"https://api.github.com/repos/openthread/openthread/issues{/number}","pulls_url":"https://api.github.com/repos/openthread/openthread/pulls{/number}","milestones_url":"https://api.github.com/repos/openthread/openthread/milestones{/number}","notifications_url":"https://api.github.com/repos/openthread/openthread/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openthread/openthread/labels{/name}","releases_url":"https://api.github.com/repos/openthread/openthread/releases{/id}","deployments_url":"https://api.github.com/repos/openthread/openthread/deployments","created_at":"2016-04-08T20:47:41Z","updated_at":"2016-11-13T17:46:55Z","pushed_at":"2016-11-14T00:37:16Z","git_url":"git://github.com/openthread/openthread.git","ssh_url":"git@github.com:openthread/openthread.git","clone_url":"https://github.com/openthread/openthread.git","svn_url":"https://github.com/openthread/openthread","homepage":"","size":565065,"stargazers_count":1022,"watchers_count":1022,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":233,"mirror_url":null,"open_issues_count":41,"forks":233,"open_issues":41,"watchers":1022,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openthread/openthread/pulls/966"},"html":{"href":"https://github.com/openthread/openthread/pull/966"},"issue":{"href":"https://api.github.com/repos/openthread/openthread/issues/966"},"comments":{"href":"https://api.github.com/repos/openthread/openthread/issues/966/comments"},"review_comments":{"href":"https://api.github.com/repos/openthread/openthread/pulls/966/comments"},"review_comment":{"href":"https://api.github.com/repos/openthread/openthread/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openthread/openthread/pulls/966/commits"},"statuses":{"href":"https://api.github.com/repos/openthread/openthread/statuses/07d4ef3b0775615a47ffa1fd7826d89c71ed61bf"}}}}
{"actor":{"display_login":"jwhui"}}