{"action":"created","comment":{"url":"https://api.github.com/repos/SkyhookWireless/embedded-client/pulls/comments/231198341","pull_request_review_id":172114321,"id":231198341,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMTE5ODM0MQ==","diff_hunk":"@@ -0,0 +1,231 @@\n+/*\n+ * Copyright 2015-present Skyhook Inc.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+#include <stdio.h>\n+#include <stdlib.h>\n+#include <string.h>\n+#include <unistd.h>\n+#include \"ap_filter.h\"\n+#include \"sky_protocol.h\"\n+#include \"sky_util.h\"\n+\n+#define MAC_HEX_STR_SIZE (2*MAC_SIZE)\n+\n+void remove_ap(struct ap_t scanned_aps[], size_t num_scanned_aps, size_t index)\n+{\n+    size_t i;\n+\n+    for (i=index; i < num_scanned_aps-1; i++)\n+    {\n+        memcpy(&scanned_aps[i], &scanned_aps[i+1], sizeof(struct ap_t));\n+    }\n+}\n+\n+int mac_cmp(const void* a, const void* b)\n+{\n+    // Sort on MAC address, high-to-low.\n+    uint8_t* macA = ((struct ap_t*) a)->MAC;\n+    uint8_t* macB = ((struct ap_t*) b)->MAC;\n+\n+    return memcmp(macB, macA, MAC_SIZE);\n+}\n+\n+int rssi_cmp(const void* a, const void* b)\n+{\n+    // Sort on RSSI, low-to-high.\n+    int8_t rssiA = ((struct ap_t*) a)->rssi;\n+    int8_t rssiB = ((struct ap_t*) b)->rssi;\n+\n+    return rssiA < rssiB ? -1 : rssiA > rssiB;\n+}\n+\n+void mac_to_hex_str(uint8_t mac_str[MAC_HEX_STR_SIZE], uint8_t mac[])\n+{","path":"src/client/ap_filter.c","position":55,"original_position":55,"commit_id":"80a5588e9bd4aa857f3b54830fe5ad3e52f72dbf","original_commit_id":"80a5588e9bd4aa857f3b54830fe5ad3e52f72dbf","user":{"login":"syarramsetty-skyhook","id":19493290,"node_id":"MDQ6VXNlcjE5NDkzMjkw","avatar_url":"https://avatars1.githubusercontent.com/u/19493290?v=4","gravatar_id":"","url":"https://api.github.com/users/syarramsetty-skyhook","html_url":"https://github.com/syarramsetty-skyhook","followers_url":"https://api.github.com/users/syarramsetty-skyhook/followers","following_url":"https://api.github.com/users/syarramsetty-skyhook/following{/other_user}","gists_url":"https://api.github.com/users/syarramsetty-skyhook/gists{/gist_id}","starred_url":"https://api.github.com/users/syarramsetty-skyhook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/syarramsetty-skyhook/subscriptions","organizations_url":"https://api.github.com/users/syarramsetty-skyhook/orgs","repos_url":"https://api.github.com/users/syarramsetty-skyhook/repos","events_url":"https://api.github.com/users/syarramsetty-skyhook/events{/privacy}","received_events_url":"https://api.github.com/users/syarramsetty-skyhook/received_events","type":"User","site_admin":false},"body":"Just curious, what is the difference between declaring a fixed array size vs variable array size as an arg to a function? \r\n`uint8_t mac_str[MAC_HEX_STR_SIZE] vs uint8_t mac[]`","created_at":"2018-11-06T16:38:17Z","updated_at":"2018-11-06T16:38:17Z","html_url":"https://github.com/SkyhookWireless/embedded-client/pull/7#discussion_r231198341","pull_request_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/pulls/7","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/SkyhookWireless/embedded-client/pulls/comments/231198341"},"html":{"href":"https://github.com/SkyhookWireless/embedded-client/pull/7#discussion_r231198341"},"pull_request":{"href":"https://api.github.com/repos/SkyhookWireless/embedded-client/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/SkyhookWireless/embedded-client/pulls/7","id":228381183,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI4MzgxMTgz","html_url":"https://github.com/SkyhookWireless/embedded-client/pull/7","diff_url":"https://github.com/SkyhookWireless/embedded-client/pull/7.diff","patch_url":"https://github.com/SkyhookWireless/embedded-client/pull/7.patch","issue_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/issues/7","number":7,"state":"open","locked":false,"title":"[EC-54][EC-55] Code cleanup, support for scan filtering/down-selection","user":{"login":"tboinske-skyhook","id":19479145,"node_id":"MDQ6VXNlcjE5NDc5MTQ1","avatar_url":"https://avatars0.githubusercontent.com/u/19479145?v=4","gravatar_id":"","url":"https://api.github.com/users/tboinske-skyhook","html_url":"https://github.com/tboinske-skyhook","followers_url":"https://api.github.com/users/tboinske-skyhook/followers","following_url":"https://api.github.com/users/tboinske-skyhook/following{/other_user}","gists_url":"https://api.github.com/users/tboinske-skyhook/gists{/gist_id}","starred_url":"https://api.github.com/users/tboinske-skyhook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tboinske-skyhook/subscriptions","organizations_url":"https://api.github.com/users/tboinske-skyhook/orgs","repos_url":"https://api.github.com/users/tboinske-skyhook/repos","events_url":"https://api.github.com/users/tboinske-skyhook/events{/privacy}","received_events_url":"https://api.github.com/users/tboinske-skyhook/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-11-05T15:00:33Z","updated_at":"2018-11-06T16:38:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ed61492ecc96a2b1d1c8b1961c73bd298637260e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/pulls/7/commits","review_comments_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/pulls/7/comments","review_comment_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/issues/7/comments","statuses_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/statuses/80a5588e9bd4aa857f3b54830fe5ad3e52f72dbf","head":{"label":"SkyhookWireless:tboinske-ec-54-55","ref":"tboinske-ec-54-55","sha":"80a5588e9bd4aa857f3b54830fe5ad3e52f72dbf","user":{"login":"SkyhookWireless","id":7999844,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc5OTk4NDQ=","avatar_url":"https://avatars3.githubusercontent.com/u/7999844?v=4","gravatar_id":"","url":"https://api.github.com/users/SkyhookWireless","html_url":"https://github.com/SkyhookWireless","followers_url":"https://api.github.com/users/SkyhookWireless/followers","following_url":"https://api.github.com/users/SkyhookWireless/following{/other_user}","gists_url":"https://api.github.com/users/SkyhookWireless/gists{/gist_id}","starred_url":"https://api.github.com/users/SkyhookWireless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SkyhookWireless/subscriptions","organizations_url":"https://api.github.com/users/SkyhookWireless/orgs","repos_url":"https://api.github.com/users/SkyhookWireless/repos","events_url":"https://api.github.com/users/SkyhookWireless/events{/privacy}","received_events_url":"https://api.github.com/users/SkyhookWireless/received_events","type":"Organization","site_admin":false},"repo":{"id":71483259,"node_id":"MDEwOlJlcG9zaXRvcnk3MTQ4MzI1OQ==","name":"embedded-client","full_name":"SkyhookWireless/embedded-client","private":false,"owner":{"login":"SkyhookWireless","id":7999844,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc5OTk4NDQ=","avatar_url":"https://avatars3.githubusercontent.com/u/7999844?v=4","gravatar_id":"","url":"https://api.github.com/users/SkyhookWireless","html_url":"https://github.com/SkyhookWireless","followers_url":"https://api.github.com/users/SkyhookWireless/followers","following_url":"https://api.github.com/users/SkyhookWireless/following{/other_user}","gists_url":"https://api.github.com/users/SkyhookWireless/gists{/gist_id}","starred_url":"https://api.github.com/users/SkyhookWireless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SkyhookWireless/subscriptions","organizations_url":"https://api.github.com/users/SkyhookWireless/orgs","repos_url":"https://api.github.com/users/SkyhookWireless/repos","events_url":"https://api.github.com/users/SkyhookWireless/events{/privacy}","received_events_url":"https://api.github.com/users/SkyhookWireless/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/SkyhookWireless/embedded-client","description":"Public ELG Embedded Client Repo ","fork":false,"url":"https://api.github.com/repos/SkyhookWireless/embedded-client","forks_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/forks","keys_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/teams","hooks_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/hooks","issue_events_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/issues/events{/number}","events_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/events","assignees_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/assignees{/user}","branches_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/branches{/branch}","tags_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/tags","blobs_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/statuses/{sha}","languages_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/languages","stargazers_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/stargazers","contributors_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/contributors","subscribers_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/subscribers","subscription_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/subscription","commits_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/contents/{+path}","compare_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/merges","archive_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/downloads","issues_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/issues{/number}","pulls_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/pulls{/number}","milestones_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/milestones{/number}","notifications_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/labels{/name}","releases_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/releases{/id}","deployments_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/deployments","created_at":"2016-10-20T16:38:19Z","updated_at":"2018-08-21T14:17:14Z","pushed_at":"2018-11-05T18:55:51Z","git_url":"git://github.com/SkyhookWireless/embedded-client.git","ssh_url":"git@github.com:SkyhookWireless/embedded-client.git","clone_url":"https://github.com/SkyhookWireless/embedded-client.git","svn_url":"https://github.com/SkyhookWireless/embedded-client","homepage":null,"size":196,"stargazers_count":2,"watchers_count":2,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":2,"watchers":2,"default_branch":"master"}},"base":{"label":"SkyhookWireless:master","ref":"master","sha":"9dbe2070531d0743b603008a3cd8e230be19a47e","user":{"login":"SkyhookWireless","id":7999844,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc5OTk4NDQ=","avatar_url":"https://avatars3.githubusercontent.com/u/7999844?v=4","gravatar_id":"","url":"https://api.github.com/users/SkyhookWireless","html_url":"https://github.com/SkyhookWireless","followers_url":"https://api.github.com/users/SkyhookWireless/followers","following_url":"https://api.github.com/users/SkyhookWireless/following{/other_user}","gists_url":"https://api.github.com/users/SkyhookWireless/gists{/gist_id}","starred_url":"https://api.github.com/users/SkyhookWireless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SkyhookWireless/subscriptions","organizations_url":"https://api.github.com/users/SkyhookWireless/orgs","repos_url":"https://api.github.com/users/SkyhookWireless/repos","events_url":"https://api.github.com/users/SkyhookWireless/events{/privacy}","received_events_url":"https://api.github.com/users/SkyhookWireless/received_events","type":"Organization","site_admin":false},"repo":{"id":71483259,"node_id":"MDEwOlJlcG9zaXRvcnk3MTQ4MzI1OQ==","name":"embedded-client","full_name":"SkyhookWireless/embedded-client","private":false,"owner":{"login":"SkyhookWireless","id":7999844,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc5OTk4NDQ=","avatar_url":"https://avatars3.githubusercontent.com/u/7999844?v=4","gravatar_id":"","url":"https://api.github.com/users/SkyhookWireless","html_url":"https://github.com/SkyhookWireless","followers_url":"https://api.github.com/users/SkyhookWireless/followers","following_url":"https://api.github.com/users/SkyhookWireless/following{/other_user}","gists_url":"https://api.github.com/users/SkyhookWireless/gists{/gist_id}","starred_url":"https://api.github.com/users/SkyhookWireless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SkyhookWireless/subscriptions","organizations_url":"https://api.github.com/users/SkyhookWireless/orgs","repos_url":"https://api.github.com/users/SkyhookWireless/repos","events_url":"https://api.github.com/users/SkyhookWireless/events{/privacy}","received_events_url":"https://api.github.com/users/SkyhookWireless/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/SkyhookWireless/embedded-client","description":"Public ELG Embedded Client Repo ","fork":false,"url":"https://api.github.com/repos/SkyhookWireless/embedded-client","forks_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/forks","keys_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/teams","hooks_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/hooks","issue_events_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/issues/events{/number}","events_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/events","assignees_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/assignees{/user}","branches_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/branches{/branch}","tags_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/tags","blobs_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/statuses/{sha}","languages_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/languages","stargazers_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/stargazers","contributors_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/contributors","subscribers_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/subscribers","subscription_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/subscription","commits_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/contents/{+path}","compare_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/merges","archive_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/downloads","issues_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/issues{/number}","pulls_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/pulls{/number}","milestones_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/milestones{/number}","notifications_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/labels{/name}","releases_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/releases{/id}","deployments_url":"https://api.github.com/repos/SkyhookWireless/embedded-client/deployments","created_at":"2016-10-20T16:38:19Z","updated_at":"2018-08-21T14:17:14Z","pushed_at":"2018-11-05T18:55:51Z","git_url":"git://github.com/SkyhookWireless/embedded-client.git","ssh_url":"git@github.com:SkyhookWireless/embedded-client.git","clone_url":"https://github.com/SkyhookWireless/embedded-client.git","svn_url":"https://github.com/SkyhookWireless/embedded-client","homepage":null,"size":196,"stargazers_count":2,"watchers_count":2,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":2,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SkyhookWireless/embedded-client/pulls/7"},"html":{"href":"https://github.com/SkyhookWireless/embedded-client/pull/7"},"issue":{"href":"https://api.github.com/repos/SkyhookWireless/embedded-client/issues/7"},"comments":{"href":"https://api.github.com/repos/SkyhookWireless/embedded-client/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/SkyhookWireless/embedded-client/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/SkyhookWireless/embedded-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SkyhookWireless/embedded-client/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/SkyhookWireless/embedded-client/statuses/80a5588e9bd4aa857f3b54830fe5ad3e52f72dbf"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"syarramsetty-skyhook"}}