{"action":"created","comment":{"url":"https://api.github.com/repos/maximkulkin/esp-homekit/pulls/comments/173647069","pull_request_review_id":102874620,"id":173647069,"diff_hunk":"@@ -3174,6 +3256,41 @@ void homekit_server_task(void *args) {\n         INFO(\"Using existing accessory ID: %s\", server->accessory_id);\n     }\n \n+    if (!server->config->setupId) {\n+\n+      char *setupIdentifier = malloc(5);\n+\n+        for (int i=0; i<4; i++) {\n+            setupIdentifier[i] = base36Table[(hwrand() % 36)];\n+        }\n+\n+        setupIdentifier[4] = 0;\n+        server->config->setupId = setupIdentifier;\n+\n+        DEBUG(\"Using random setup identifier: %s\", setupIdentifier);\n+    }\n+\n+    if (!server->config->password) {","path":"src/server.c","position":196,"original_position":211,"commit_id":"088e3c1a9c3c056298d834055d04b4831a22bf20","original_commit_id":"8fe7ea5a8e2798f74bcaa5234ea04ac5c294a71c","user":{"login":"maximkulkin","id":10785,"avatar_url":"https://avatars2.githubusercontent.com/u/10785?v=4","gravatar_id":"","url":"https://api.github.com/users/maximkulkin","html_url":"https://github.com/maximkulkin","followers_url":"https://api.github.com/users/maximkulkin/followers","following_url":"https://api.github.com/users/maximkulkin/following{/other_user}","gists_url":"https://api.github.com/users/maximkulkin/gists{/gist_id}","starred_url":"https://api.github.com/users/maximkulkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maximkulkin/subscriptions","organizations_url":"https://api.github.com/users/maximkulkin/orgs","repos_url":"https://api.github.com/users/maximkulkin/repos","events_url":"https://api.github.com/users/maximkulkin/events{/privacy}","received_events_url":"https://api.github.com/users/maximkulkin/received_events","type":"User","site_admin":false},"body":"Yes, that was the case: the presence of callback means that accessory should be able to communicate password to user. Although, if static password is present, then that one should be used instead of a random password. It is incorrect to not have a static password and callback at the same time.\r\n\r\nNow, having all this your PR breaks support for \"must generate a new Setup Code each time it is needed\"","created_at":"2018-03-11T08:30:49Z","updated_at":"2018-03-11T08:30:49Z","html_url":"https://github.com/maximkulkin/esp-homekit/pull/33#discussion_r173647069","pull_request_url":"https://api.github.com/repos/maximkulkin/esp-homekit/pulls/33","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/maximkulkin/esp-homekit/pulls/comments/173647069"},"html":{"href":"https://github.com/maximkulkin/esp-homekit/pull/33#discussion_r173647069"},"pull_request":{"href":"https://api.github.com/repos/maximkulkin/esp-homekit/pulls/33"}},"in_reply_to_id":172319709},"pull_request":{"url":"https://api.github.com/repos/maximkulkin/esp-homekit/pulls/33","id":171247490,"html_url":"https://github.com/maximkulkin/esp-homekit/pull/33","diff_url":"https://github.com/maximkulkin/esp-homekit/pull/33.diff","patch_url":"https://github.com/maximkulkin/esp-homekit/pull/33.patch","issue_url":"https://api.github.com/repos/maximkulkin/esp-homekit/issues/33","number":33,"state":"open","locked":false,"title":"Add auto configuration via QRcode.","user":{"login":"cduvenhorst","id":5629202,"avatar_url":"https://avatars2.githubusercontent.com/u/5629202?v=4","gravatar_id":"","url":"https://api.github.com/users/cduvenhorst","html_url":"https://github.com/cduvenhorst","followers_url":"https://api.github.com/users/cduvenhorst/followers","following_url":"https://api.github.com/users/cduvenhorst/following{/other_user}","gists_url":"https://api.github.com/users/cduvenhorst/gists{/gist_id}","starred_url":"https://api.github.com/users/cduvenhorst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cduvenhorst/subscriptions","organizations_url":"https://api.github.com/users/cduvenhorst/orgs","repos_url":"https://api.github.com/users/cduvenhorst/repos","events_url":"https://api.github.com/users/cduvenhorst/events{/privacy}","received_events_url":"https://api.github.com/users/cduvenhorst/received_events","type":"User","site_admin":false},"body":"This adds support for the auto configuration via QRCode scanning. Therefore it calculates and advertises a setup hash, which is based on the accessory identifier and an setupID.\r\n\r\nTo support QRCode creation and display, a setup URI is generated and passed to a new callback function.\r\n\r\nThe main use case however will be to set the password and the setupID and use a pre-rendered qrcode.\r\n ","created_at":"2018-02-25T19:47:33Z","updated_at":"2018-03-11T08:30:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a1bc04d397f88e1a4c58bb25243ad9e01d828ebc","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/maximkulkin/esp-homekit/pulls/33/commits","review_comments_url":"https://api.github.com/repos/maximkulkin/esp-homekit/pulls/33/comments","review_comment_url":"https://api.github.com/repos/maximkulkin/esp-homekit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/maximkulkin/esp-homekit/issues/33/comments","statuses_url":"https://api.github.com/repos/maximkulkin/esp-homekit/statuses/088e3c1a9c3c056298d834055d04b4831a22bf20","head":{"label":"cduvenhorst:master","ref":"master","sha":"088e3c1a9c3c056298d834055d04b4831a22bf20","user":{"login":"cduvenhorst","id":5629202,"avatar_url":"https://avatars2.githubusercontent.com/u/5629202?v=4","gravatar_id":"","url":"https://api.github.com/users/cduvenhorst","html_url":"https://github.com/cduvenhorst","followers_url":"https://api.github.com/users/cduvenhorst/followers","following_url":"https://api.github.com/users/cduvenhorst/following{/other_user}","gists_url":"https://api.github.com/users/cduvenhorst/gists{/gist_id}","starred_url":"https://api.github.com/users/cduvenhorst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cduvenhorst/subscriptions","organizations_url":"https://api.github.com/users/cduvenhorst/orgs","repos_url":"https://api.github.com/users/cduvenhorst/repos","events_url":"https://api.github.com/users/cduvenhorst/events{/privacy}","received_events_url":"https://api.github.com/users/cduvenhorst/received_events","type":"User","site_admin":false},"repo":{"id":120348668,"name":"esp-homekit","full_name":"cduvenhorst/esp-homekit","owner":{"login":"cduvenhorst","id":5629202,"avatar_url":"https://avatars2.githubusercontent.com/u/5629202?v=4","gravatar_id":"","url":"https://api.github.com/users/cduvenhorst","html_url":"https://github.com/cduvenhorst","followers_url":"https://api.github.com/users/cduvenhorst/followers","following_url":"https://api.github.com/users/cduvenhorst/following{/other_user}","gists_url":"https://api.github.com/users/cduvenhorst/gists{/gist_id}","starred_url":"https://api.github.com/users/cduvenhorst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cduvenhorst/subscriptions","organizations_url":"https://api.github.com/users/cduvenhorst/orgs","repos_url":"https://api.github.com/users/cduvenhorst/repos","events_url":"https://api.github.com/users/cduvenhorst/events{/privacy}","received_events_url":"https://api.github.com/users/cduvenhorst/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cduvenhorst/esp-homekit","description":"Apple HomeKit accessory server library for ESP-OPEN-RTOS","fork":true,"url":"https://api.github.com/repos/cduvenhorst/esp-homekit","forks_url":"https://api.github.com/repos/cduvenhorst/esp-homekit/forks","keys_url":"https://api.github.com/repos/cduvenhorst/esp-homekit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cduvenhorst/esp-homekit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cduvenhorst/esp-homekit/teams","hooks_url":"https://api.github.com/repos/cduvenhorst/esp-homekit/hooks","issue_events_url":"https://api.github.com/repos/cduvenhorst/esp-homekit/issues/events{/number}","events_url":"https://api.github.com/repos/cduvenhorst/esp-homekit/events","assignees_url":"https://api.github.com/repos/cduvenhorst/esp-homekit/assignees{/user}","branches_url":"https://api.github.com/repos/cduvenhorst/esp-homekit/branches{/branch}","tags_url":"https://api.github.com/repos/cduvenhorst/esp-homekit/tags","blobs_url":"https://api.github.com/repos/cduvenhorst/esp-homekit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cduvenhorst/esp-homekit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cduvenhorst/esp-homekit/git/refs{/sha}","trees_url":"https://api.github.com/repos/cduvenhorst/esp-homekit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cduvenhorst/esp-homekit/statuses/{sha}","languages_url":"https://api.github.com/repos/cduvenhorst/esp-homekit/languages","stargazers_url":"https://api.github.com/repos/cduvenhorst/esp-homekit/stargazers","contributors_url":"https://api.github.com/repos/cduvenhorst/esp-homekit/contributors","subscribers_url":"https://api.github.com/repos/cduvenhorst/esp-homekit/subscribers","subscription_url":"https://api.github.com/repos/cduvenhorst/esp-homekit/subscription","commits_url":"https://api.github.com/repos/cduvenhorst/esp-homekit/commits{/sha}","git_commits_url":"https://api.github.com/repos/cduvenhorst/esp-homekit/git/commits{/sha}","comments_url":"https://api.github.com/repos/cduvenhorst/esp-homekit/comments{/number}","issue_comment_url":"https://api.github.com/repos/cduvenhorst/esp-homekit/issues/comments{/number}","contents_url":"https://api.github.com/repos/cduvenhorst/esp-homekit/contents/{+path}","compare_url":"https://api.github.com/repos/cduvenhorst/esp-homekit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cduvenhorst/esp-homekit/merges","archive_url":"https://api.github.com/repos/cduvenhorst/esp-homekit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cduvenhorst/esp-homekit/downloads","issues_url":"https://api.github.com/repos/cduvenhorst/esp-homekit/issues{/number}","pulls_url":"https://api.github.com/repos/cduvenhorst/esp-homekit/pulls{/number}","milestones_url":"https://api.github.com/repos/cduvenhorst/esp-homekit/milestones{/number}","notifications_url":"https://api.github.com/repos/cduvenhorst/esp-homekit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cduvenhorst/esp-homekit/labels{/name}","releases_url":"https://api.github.com/repos/cduvenhorst/esp-homekit/releases{/id}","deployments_url":"https://api.github.com/repos/cduvenhorst/esp-homekit/deployments","created_at":"2018-02-05T19:06:33Z","updated_at":"2018-02-05T19:06:35Z","pushed_at":"2018-03-10T17:38:04Z","git_url":"git://github.com/cduvenhorst/esp-homekit.git","ssh_url":"git@github.com:cduvenhorst/esp-homekit.git","clone_url":"https://github.com/cduvenhorst/esp-homekit.git","svn_url":"https://github.com/cduvenhorst/esp-homekit","homepage":"","size":203,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"maximkulkin:master","ref":"master","sha":"825e3857c64d83f55af70ff29d7dadaa18c032a3","user":{"login":"maximkulkin","id":10785,"avatar_url":"https://avatars2.githubusercontent.com/u/10785?v=4","gravatar_id":"","url":"https://api.github.com/users/maximkulkin","html_url":"https://github.com/maximkulkin","followers_url":"https://api.github.com/users/maximkulkin/followers","following_url":"https://api.github.com/users/maximkulkin/following{/other_user}","gists_url":"https://api.github.com/users/maximkulkin/gists{/gist_id}","starred_url":"https://api.github.com/users/maximkulkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maximkulkin/subscriptions","organizations_url":"https://api.github.com/users/maximkulkin/orgs","repos_url":"https://api.github.com/users/maximkulkin/repos","events_url":"https://api.github.com/users/maximkulkin/events{/privacy}","received_events_url":"https://api.github.com/users/maximkulkin/received_events","type":"User","site_admin":false},"repo":{"id":113219787,"name":"esp-homekit","full_name":"maximkulkin/esp-homekit","owner":{"login":"maximkulkin","id":10785,"avatar_url":"https://avatars2.githubusercontent.com/u/10785?v=4","gravatar_id":"","url":"https://api.github.com/users/maximkulkin","html_url":"https://github.com/maximkulkin","followers_url":"https://api.github.com/users/maximkulkin/followers","following_url":"https://api.github.com/users/maximkulkin/following{/other_user}","gists_url":"https://api.github.com/users/maximkulkin/gists{/gist_id}","starred_url":"https://api.github.com/users/maximkulkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maximkulkin/subscriptions","organizations_url":"https://api.github.com/users/maximkulkin/orgs","repos_url":"https://api.github.com/users/maximkulkin/repos","events_url":"https://api.github.com/users/maximkulkin/events{/privacy}","received_events_url":"https://api.github.com/users/maximkulkin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/maximkulkin/esp-homekit","description":"Apple HomeKit accessory server library for ESP-OPEN-RTOS","fork":false,"url":"https://api.github.com/repos/maximkulkin/esp-homekit","forks_url":"https://api.github.com/repos/maximkulkin/esp-homekit/forks","keys_url":"https://api.github.com/repos/maximkulkin/esp-homekit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/maximkulkin/esp-homekit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/maximkulkin/esp-homekit/teams","hooks_url":"https://api.github.com/repos/maximkulkin/esp-homekit/hooks","issue_events_url":"https://api.github.com/repos/maximkulkin/esp-homekit/issues/events{/number}","events_url":"https://api.github.com/repos/maximkulkin/esp-homekit/events","assignees_url":"https://api.github.com/repos/maximkulkin/esp-homekit/assignees{/user}","branches_url":"https://api.github.com/repos/maximkulkin/esp-homekit/branches{/branch}","tags_url":"https://api.github.com/repos/maximkulkin/esp-homekit/tags","blobs_url":"https://api.github.com/repos/maximkulkin/esp-homekit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/maximkulkin/esp-homekit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/maximkulkin/esp-homekit/git/refs{/sha}","trees_url":"https://api.github.com/repos/maximkulkin/esp-homekit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/maximkulkin/esp-homekit/statuses/{sha}","languages_url":"https://api.github.com/repos/maximkulkin/esp-homekit/languages","stargazers_url":"https://api.github.com/repos/maximkulkin/esp-homekit/stargazers","contributors_url":"https://api.github.com/repos/maximkulkin/esp-homekit/contributors","subscribers_url":"https://api.github.com/repos/maximkulkin/esp-homekit/subscribers","subscription_url":"https://api.github.com/repos/maximkulkin/esp-homekit/subscription","commits_url":"https://api.github.com/repos/maximkulkin/esp-homekit/commits{/sha}","git_commits_url":"https://api.github.com/repos/maximkulkin/esp-homekit/git/commits{/sha}","comments_url":"https://api.github.com/repos/maximkulkin/esp-homekit/comments{/number}","issue_comment_url":"https://api.github.com/repos/maximkulkin/esp-homekit/issues/comments{/number}","contents_url":"https://api.github.com/repos/maximkulkin/esp-homekit/contents/{+path}","compare_url":"https://api.github.com/repos/maximkulkin/esp-homekit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/maximkulkin/esp-homekit/merges","archive_url":"https://api.github.com/repos/maximkulkin/esp-homekit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/maximkulkin/esp-homekit/downloads","issues_url":"https://api.github.com/repos/maximkulkin/esp-homekit/issues{/number}","pulls_url":"https://api.github.com/repos/maximkulkin/esp-homekit/pulls{/number}","milestones_url":"https://api.github.com/repos/maximkulkin/esp-homekit/milestones{/number}","notifications_url":"https://api.github.com/repos/maximkulkin/esp-homekit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/maximkulkin/esp-homekit/labels{/name}","releases_url":"https://api.github.com/repos/maximkulkin/esp-homekit/releases{/id}","deployments_url":"https://api.github.com/repos/maximkulkin/esp-homekit/deployments","created_at":"2017-12-05T18:44:00Z","updated_at":"2018-03-05T11:19:40Z","pushed_at":"2018-03-10T17:38:05Z","git_url":"git://github.com/maximkulkin/esp-homekit.git","ssh_url":"git@github.com:maximkulkin/esp-homekit.git","clone_url":"https://github.com/maximkulkin/esp-homekit.git","svn_url":"https://github.com/maximkulkin/esp-homekit","homepage":"","size":119,"stargazers_count":65,"watchers_count":65,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"archived":false,"open_issues_count":6,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":13,"open_issues":6,"watchers":65,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/maximkulkin/esp-homekit/pulls/33"},"html":{"href":"https://github.com/maximkulkin/esp-homekit/pull/33"},"issue":{"href":"https://api.github.com/repos/maximkulkin/esp-homekit/issues/33"},"comments":{"href":"https://api.github.com/repos/maximkulkin/esp-homekit/issues/33/comments"},"review_comments":{"href":"https://api.github.com/repos/maximkulkin/esp-homekit/pulls/33/comments"},"review_comment":{"href":"https://api.github.com/repos/maximkulkin/esp-homekit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/maximkulkin/esp-homekit/pulls/33/commits"},"statuses":{"href":"https://api.github.com/repos/maximkulkin/esp-homekit/statuses/088e3c1a9c3c056298d834055d04b4831a22bf20"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"maximkulkin"}}