{"action":"created","comment":{"url":"https://api.github.com/repos/dustcloud/smartmeshsdk/pulls/comments/62026761","id":62026761,"diff_hunk":"@@ -0,0 +1,230 @@\n+#!/usr/bin/python\r\n+\r\n+#============================ adjust path =====================================\r\n+\r\n+import sys\r\n+import os\r\n+if __name__ == \"__main__\":\r\n+    here = sys.path[0]\r\n+    sys.path.insert(0, os.path.join(here, '..', '..','libs'))\r\n+    sys.path.insert(0, os.path.join(here, '..', '..','external_libs'))\r\n+\r\n+#============================ imports =========================================\r\n+\r\n+import time\r\n+import threading\r\n+import traceback\r\n+import pdb\r\n+\r\n+from SmartMeshSDK.IpMoteConnector      import IpMoteConnector\r\n+from SmartMeshSDK.ApiException         import APIError, \\\r\n+                                              ConnectionError\r\n+\r\n+from dustCli                           import DustCli\r\n+from SmartMeshSDK                      import sdk_version\r\n+\r\n+#============================ defines =========================================\r\n+\r\n+#============================ globals =========================================\r\n+\r\n+connector     = None\r\n+range_tester  = None\r\n+\r\n+#============================ helpers =========================================\r\n+\r\n+def printExcAndQuit(err):\r\n+\r\n+    output  = []\r\n+    output += [\"=\"*30]\r\n+    output += [\"error\"]\r\n+    output += [str(err)]\r\n+    output += [\"=\"*30]\r\n+    output += [\"traceback\"]\r\n+    output += [traceback.format_exc()]\r\n+    output += [\"=\"*30]\r\n+    output += [\"Script ended because of an error. Press Enter to exit.\"]\r\n+    output  = '\\n'.join(output)\r\n+\r\n+    raw_input(output)\r\n+    sys.exit(1)\r\n+\r\n+#============================ objects =========================================\r\n+\r\n+class RangeTester(object):\r\n+\r\n+    def __init__(self,connector):\r\n+\r\n+        # store params\r\n+        self.connector              = connector\r\n+        self.stationId              = 26\r\n+        self.goOn                   = True\r\n+        self.stats                  = [\"\"]*16              # a list of statistic per channel\r\n+\r\n+\r\n+\r\n+    #======================== public ==========================================\r\n+\r\n+    def start(self):\r\n+\r\n+        # set the current channel to default\r\n+        cc = 0\r\n+\r\n+        # loop to the infinite and beyond\r\n+        while(self.goOn):\r\n+            # current channel\r\n+            cc = cc % 16\r\n+\r\n+            # channel mask\r\n+            cm = 0x1<<cc\r","path":"app/RangeTest/rangetest.py","position":78,"original_position":78,"commit_id":"ebf2049f593404ccbb5773606acbdf9943b7d7be","original_commit_id":"ebf2049f593404ccbb5773606acbdf9943b7d7be","user":{"login":"twatteynelinear","id":4664633,"avatar_url":"https://avatars.githubusercontent.com/u/4664633?v=3","gravatar_id":"","url":"https://api.github.com/users/twatteynelinear","html_url":"https://github.com/twatteynelinear","followers_url":"https://api.github.com/users/twatteynelinear/followers","following_url":"https://api.github.com/users/twatteynelinear/following{/other_user}","gists_url":"https://api.github.com/users/twatteynelinear/gists{/gist_id}","starred_url":"https://api.github.com/users/twatteynelinear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twatteynelinear/subscriptions","organizations_url":"https://api.github.com/users/twatteynelinear/orgs","repos_url":"https://api.github.com/users/twatteynelinear/repos","events_url":"https://api.github.com/users/twatteynelinear/events{/privacy}","received_events_url":"https://api.github.com/users/twatteynelinear/received_events","type":"User","site_admin":false},"body":"same: `sm` -> `mask`?","created_at":"2016-05-04T11:59:25Z","updated_at":"2016-05-04T11:59:25Z","html_url":"https://github.com/dustcloud/smartmeshsdk/pull/4#discussion_r62026761","pull_request_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/dustcloud/smartmeshsdk/pulls/comments/62026761"},"html":{"href":"https://github.com/dustcloud/smartmeshsdk/pull/4#discussion_r62026761"},"pull_request":{"href":"https://api.github.com/repos/dustcloud/smartmeshsdk/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/dustcloud/smartmeshsdk/pulls/4","id":68849337,"html_url":"https://github.com/dustcloud/smartmeshsdk/pull/4","diff_url":"https://github.com/dustcloud/smartmeshsdk/pull/4.diff","patch_url":"https://github.com/dustcloud/smartmeshsdk/pull/4.patch","issue_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/issues/4","number":4,"state":"open","locked":false,"title":"Proposing application for range testing","user":{"login":"keomabrun","id":11633612,"avatar_url":"https://avatars.githubusercontent.com/u/11633612?v=3","gravatar_id":"","url":"https://api.github.com/users/keomabrun","html_url":"https://github.com/keomabrun","followers_url":"https://api.github.com/users/keomabrun/followers","following_url":"https://api.github.com/users/keomabrun/following{/other_user}","gists_url":"https://api.github.com/users/keomabrun/gists{/gist_id}","starred_url":"https://api.github.com/users/keomabrun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keomabrun/subscriptions","organizations_url":"https://api.github.com/users/keomabrun/orgs","repos_url":"https://api.github.com/users/keomabrun/repos","events_url":"https://api.github.com/users/keomabrun/events{/privacy}","received_events_url":"https://api.github.com/users/keomabrun/received_events","type":"User","site_admin":false},"body":"The application listens for 4 channels in a round-robin fashion and displays an average RSSI over 4s for each of those channels.\r\n\r\nWe assume a mode (with station id= 26 here) sending packets using the CLI radiotest mode (see CLI command on README).","created_at":"2016-05-04T11:52:10Z","updated_at":"2016-05-04T11:59:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"384b202d12c71659bcd6b59f451a5cc1d617e1c1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/pulls/4/commits","review_comments_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/pulls/4/comments","review_comment_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/issues/4/comments","statuses_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/statuses/ebf2049f593404ccbb5773606acbdf9943b7d7be","head":{"label":"realms-team:master","ref":"master","sha":"ebf2049f593404ccbb5773606acbdf9943b7d7be","user":{"login":"realms-team","id":12639869,"avatar_url":"https://avatars.githubusercontent.com/u/12639869?v=3","gravatar_id":"","url":"https://api.github.com/users/realms-team","html_url":"https://github.com/realms-team","followers_url":"https://api.github.com/users/realms-team/followers","following_url":"https://api.github.com/users/realms-team/following{/other_user}","gists_url":"https://api.github.com/users/realms-team/gists{/gist_id}","starred_url":"https://api.github.com/users/realms-team/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/realms-team/subscriptions","organizations_url":"https://api.github.com/users/realms-team/orgs","repos_url":"https://api.github.com/users/realms-team/repos","events_url":"https://api.github.com/users/realms-team/events{/privacy}","received_events_url":"https://api.github.com/users/realms-team/received_events","type":"Organization","site_admin":false},"repo":{"id":55923915,"name":"rangetest","full_name":"realms-team/rangetest","owner":{"login":"realms-team","id":12639869,"avatar_url":"https://avatars.githubusercontent.com/u/12639869?v=3","gravatar_id":"","url":"https://api.github.com/users/realms-team","html_url":"https://github.com/realms-team","followers_url":"https://api.github.com/users/realms-team/followers","following_url":"https://api.github.com/users/realms-team/following{/other_user}","gists_url":"https://api.github.com/users/realms-team/gists{/gist_id}","starred_url":"https://api.github.com/users/realms-team/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/realms-team/subscriptions","organizations_url":"https://api.github.com/users/realms-team/orgs","repos_url":"https://api.github.com/users/realms-team/repos","events_url":"https://api.github.com/users/realms-team/events{/privacy}","received_events_url":"https://api.github.com/users/realms-team/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/realms-team/rangetest","description":"Python SmartMesh SDK","fork":true,"url":"https://api.github.com/repos/realms-team/rangetest","forks_url":"https://api.github.com/repos/realms-team/rangetest/forks","keys_url":"https://api.github.com/repos/realms-team/rangetest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/realms-team/rangetest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/realms-team/rangetest/teams","hooks_url":"https://api.github.com/repos/realms-team/rangetest/hooks","issue_events_url":"https://api.github.com/repos/realms-team/rangetest/issues/events{/number}","events_url":"https://api.github.com/repos/realms-team/rangetest/events","assignees_url":"https://api.github.com/repos/realms-team/rangetest/assignees{/user}","branches_url":"https://api.github.com/repos/realms-team/rangetest/branches{/branch}","tags_url":"https://api.github.com/repos/realms-team/rangetest/tags","blobs_url":"https://api.github.com/repos/realms-team/rangetest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/realms-team/rangetest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/realms-team/rangetest/git/refs{/sha}","trees_url":"https://api.github.com/repos/realms-team/rangetest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/realms-team/rangetest/statuses/{sha}","languages_url":"https://api.github.com/repos/realms-team/rangetest/languages","stargazers_url":"https://api.github.com/repos/realms-team/rangetest/stargazers","contributors_url":"https://api.github.com/repos/realms-team/rangetest/contributors","subscribers_url":"https://api.github.com/repos/realms-team/rangetest/subscribers","subscription_url":"https://api.github.com/repos/realms-team/rangetest/subscription","commits_url":"https://api.github.com/repos/realms-team/rangetest/commits{/sha}","git_commits_url":"https://api.github.com/repos/realms-team/rangetest/git/commits{/sha}","comments_url":"https://api.github.com/repos/realms-team/rangetest/comments{/number}","issue_comment_url":"https://api.github.com/repos/realms-team/rangetest/issues/comments{/number}","contents_url":"https://api.github.com/repos/realms-team/rangetest/contents/{+path}","compare_url":"https://api.github.com/repos/realms-team/rangetest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/realms-team/rangetest/merges","archive_url":"https://api.github.com/repos/realms-team/rangetest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/realms-team/rangetest/downloads","issues_url":"https://api.github.com/repos/realms-team/rangetest/issues{/number}","pulls_url":"https://api.github.com/repos/realms-team/rangetest/pulls{/number}","milestones_url":"https://api.github.com/repos/realms-team/rangetest/milestones{/number}","notifications_url":"https://api.github.com/repos/realms-team/rangetest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/realms-team/rangetest/labels{/name}","releases_url":"https://api.github.com/repos/realms-team/rangetest/releases{/id}","deployments_url":"https://api.github.com/repos/realms-team/rangetest/deployments","created_at":"2016-04-10T21:39:14Z","updated_at":"2016-04-10T21:39:43Z","pushed_at":"2016-04-14T01:26:32Z","git_url":"git://github.com/realms-team/rangetest.git","ssh_url":"git@github.com:realms-team/rangetest.git","clone_url":"https://github.com/realms-team/rangetest.git","svn_url":"https://github.com/realms-team/rangetest","homepage":null,"size":708,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"dustcloud:develop","ref":"develop","sha":"bfea7867ae3dd43668f4ec94ed72411bb8843cc7","user":{"login":"dustcloud","id":4751524,"avatar_url":"https://avatars.githubusercontent.com/u/4751524?v=3","gravatar_id":"","url":"https://api.github.com/users/dustcloud","html_url":"https://github.com/dustcloud","followers_url":"https://api.github.com/users/dustcloud/followers","following_url":"https://api.github.com/users/dustcloud/following{/other_user}","gists_url":"https://api.github.com/users/dustcloud/gists{/gist_id}","starred_url":"https://api.github.com/users/dustcloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dustcloud/subscriptions","organizations_url":"https://api.github.com/users/dustcloud/orgs","repos_url":"https://api.github.com/users/dustcloud/repos","events_url":"https://api.github.com/users/dustcloud/events{/privacy}","received_events_url":"https://api.github.com/users/dustcloud/received_events","type":"Organization","site_admin":false},"repo":{"id":12114317,"name":"smartmeshsdk","full_name":"dustcloud/smartmeshsdk","owner":{"login":"dustcloud","id":4751524,"avatar_url":"https://avatars.githubusercontent.com/u/4751524?v=3","gravatar_id":"","url":"https://api.github.com/users/dustcloud","html_url":"https://github.com/dustcloud","followers_url":"https://api.github.com/users/dustcloud/followers","following_url":"https://api.github.com/users/dustcloud/following{/other_user}","gists_url":"https://api.github.com/users/dustcloud/gists{/gist_id}","starred_url":"https://api.github.com/users/dustcloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dustcloud/subscriptions","organizations_url":"https://api.github.com/users/dustcloud/orgs","repos_url":"https://api.github.com/users/dustcloud/repos","events_url":"https://api.github.com/users/dustcloud/events{/privacy}","received_events_url":"https://api.github.com/users/dustcloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dustcloud/smartmeshsdk","description":"Python SmartMesh SDK","fork":false,"url":"https://api.github.com/repos/dustcloud/smartmeshsdk","forks_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/forks","keys_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/teams","hooks_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/hooks","issue_events_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/issues/events{/number}","events_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/events","assignees_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/assignees{/user}","branches_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/branches{/branch}","tags_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/tags","blobs_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/statuses/{sha}","languages_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/languages","stargazers_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/stargazers","contributors_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/contributors","subscribers_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/subscribers","subscription_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/subscription","commits_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/contents/{+path}","compare_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/merges","archive_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/downloads","issues_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/issues{/number}","pulls_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/pulls{/number}","milestones_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/milestones{/number}","notifications_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/labels{/name}","releases_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/releases{/id}","deployments_url":"https://api.github.com/repos/dustcloud/smartmeshsdk/deployments","created_at":"2013-08-14T16:56:32Z","updated_at":"2016-02-19T14:46:42Z","pushed_at":"2016-05-04T11:52:10Z","git_url":"git://github.com/dustcloud/smartmeshsdk.git","ssh_url":"git@github.com:dustcloud/smartmeshsdk.git","clone_url":"https://github.com/dustcloud/smartmeshsdk.git","svn_url":"https://github.com/dustcloud/smartmeshsdk","homepage":null,"size":701,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":2,"forks":5,"open_issues":2,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dustcloud/smartmeshsdk/pulls/4"},"html":{"href":"https://github.com/dustcloud/smartmeshsdk/pull/4"},"issue":{"href":"https://api.github.com/repos/dustcloud/smartmeshsdk/issues/4"},"comments":{"href":"https://api.github.com/repos/dustcloud/smartmeshsdk/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/dustcloud/smartmeshsdk/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/dustcloud/smartmeshsdk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dustcloud/smartmeshsdk/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/dustcloud/smartmeshsdk/statuses/ebf2049f593404ccbb5773606acbdf9943b7d7be"}}}}