{"action":"created","comment":{"url":"https://api.github.com/repos/ARMmbed/DAPLink/pulls/comments/183729935","pull_request_review_id":114779245,"id":183729935,"diff_hunk":"@@ -62,10 +65,47 @@ uint32_t DAP_ProcessVendorCommand(const uint8_t *request, uint8_t *response) {\n         num += (len + 1); // increment response count by ID length + length byte\n         break;\n     }\n-    case ID_DAP_Vendor1:  break;\n-    case ID_DAP_Vendor2:  break;\n-    case ID_DAP_Vendor3:  break;\n-    case ID_DAP_Vendor4:  break;\n+    case ID_DAP_Vendor1: {\n+        // get line coding\n+        int32_t read_len = sizeof(CDC_LINE_CODING);\n+        CDC_LINE_CODING cdc_line_coding;\n+        USBD_CDC_ACM_PortGetLineCoding(&cdc_line_coding);\n+        memcpy(response, &cdc_line_coding, read_len);\n+        num += (read_len + 1);\n+        break;\n+    }\n+    case ID_DAP_Vendor2: {\n+        // set uart configuration\n+        CDC_LINE_CODING cdc_line_coding;\n+        USBD_CDC_ACM_PortGetLineCoding(&cdc_line_coding);\n+        //set BaudRate\n+        uint32_t baud_rate = 0;\n+        memcpy(&baud_rate, request, sizeof(uint32_t));\n+        cdc_line_coding.dwDTERate = baud_rate;\n+        USBD_CDC_ACM_PortSetLineCoding(&cdc_line_coding);\n+        USBD_CDC_ACM_SendBreak(0);\n+        *response = 1;\n+        num += (sizeof(uint32_t) << 16) | 1;\n+        break;\n+    }\n+    case ID_DAP_Vendor3:  {\n+        // uart read\n+        int32_t read_len = 64 - 1;\n+        uint8_t read_data[64];\n+        read_len = uart_read_data(read_data, read_len);\n+        memcpy(response, read_data, read_len);\n+        // increment request and response count\n+        num += (read_len + 1);\n+        break;\n+    }\n+    case ID_DAP_Vendor4:  {\n+        // uart write\n+        int32_t write_len = 64 - 1;\n+        uart_write_data((uint8_t *)request, write_len);\n+        *response = 1;\n+        num += (write_len << 16) | 1;\n+        break;","path":"source/daplink/cmsis-dap/DAP_vendor.c","position":61,"original_position":61,"commit_id":"f01831d177811f2aca55fdce8bc8ed93a8119776","original_commit_id":"f01831d177811f2aca55fdce8bc8ed93a8119776","user":{"login":"c1728p9","id":2916772,"avatar_url":"https://avatars2.githubusercontent.com/u/2916772?v=4","gravatar_id":"","url":"https://api.github.com/users/c1728p9","html_url":"https://github.com/c1728p9","followers_url":"https://api.github.com/users/c1728p9/followers","following_url":"https://api.github.com/users/c1728p9/following{/other_user}","gists_url":"https://api.github.com/users/c1728p9/gists{/gist_id}","starred_url":"https://api.github.com/users/c1728p9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/c1728p9/subscriptions","organizations_url":"https://api.github.com/users/c1728p9/orgs","repos_url":"https://api.github.com/users/c1728p9/repos","events_url":"https://api.github.com/users/c1728p9/events{/privacy}","received_events_url":"https://api.github.com/users/c1728p9/received_events","type":"User","site_admin":false},"body":"@arekzaluski any luck with adding the vendor commands for flashing?","created_at":"2018-04-24T13:30:56Z","updated_at":"2018-04-24T13:35:24Z","html_url":"https://github.com/ARMmbed/DAPLink/pull/409#discussion_r183729935","pull_request_url":"https://api.github.com/repos/ARMmbed/DAPLink/pulls/409","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/ARMmbed/DAPLink/pulls/comments/183729935"},"html":{"href":"https://github.com/ARMmbed/DAPLink/pull/409#discussion_r183729935"},"pull_request":{"href":"https://api.github.com/repos/ARMmbed/DAPLink/pulls/409"}}},"pull_request":{"url":"https://api.github.com/repos/ARMmbed/DAPLink/pulls/409","id":175339584,"html_url":"https://github.com/ARMmbed/DAPLink/pull/409","diff_url":"https://github.com/ARMmbed/DAPLink/pull/409.diff","patch_url":"https://github.com/ARMmbed/DAPLink/pull/409.patch","issue_url":"https://api.github.com/repos/ARMmbed/DAPLink/issues/409","number":409,"state":"open","locked":false,"title":"Add WebUSB functionality","user":{"login":"arekzaluski","id":13417215,"avatar_url":"https://avatars2.githubusercontent.com/u/13417215?v=4","gravatar_id":"","url":"https://api.github.com/users/arekzaluski","html_url":"https://github.com/arekzaluski","followers_url":"https://api.github.com/users/arekzaluski/followers","following_url":"https://api.github.com/users/arekzaluski/following{/other_user}","gists_url":"https://api.github.com/users/arekzaluski/gists{/gist_id}","starred_url":"https://api.github.com/users/arekzaluski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arekzaluski/subscriptions","organizations_url":"https://api.github.com/users/arekzaluski/orgs","repos_url":"https://api.github.com/users/arekzaluski/repos","events_url":"https://api.github.com/users/arekzaluski/events{/privacy}","received_events_url":"https://api.github.com/users/arekzaluski/received_events","type":"User","site_admin":false},"body":"Flash programs on mbed boards using WebUSB: https://developers.google.com/web/updates/2016/03/access-usb-devices-on-the-web\r\n\r\nAdd new interface - 0xFF (Vendor specific) that it used to send/get hid commands using control transfer to endpoint 0.\r\nIn the future this interface will also be used to access serial data.\r\n\r\n## Added\r\n- WebUSB descriptor\r\n- WinUSB 2.0 descriptor\r\n- Landing page that points to os.mbed.com\r\n\r\n## Tested boards\r\n- BBC micro:bit\r\n- FRDM-K64F\r\n- Nordic nRF51-DK\r\n\r\n## Tested platforms\r\n### Android\r\n- 5.1\r\n- 6.0\r\n* requirements:\r\n  * OTG cable\r\n### Linux\r\n- Ubuntu 16.04\r\n* notes:\r\n  * udev rule modified: https://developers.google.com/web/updates/2016/03/access-usb-devices-on-the-web#tips\r\n### Mac OS\r\n- Mac OS 10.10\r\n- Mac OS 10.12\r\n- Mac OS 10.13\r\n* notes\r\n  * None\r\n### Windows\r\n- Windows 8.1\r\n- Windows 10\r\n* notes\r\n  * landing page is disabled, more info here: https://github.com/WICG/webusb#implementation-status\r\n### Requirements\r\n- Google Chrome version 65+","created_at":"2018-03-15T18:23:44Z","updated_at":"2018-04-24T13:35:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ee03dc71ab6d2d2e2e4980552c91e68825a1e857","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ARMmbed/DAPLink/pulls/409/commits","review_comments_url":"https://api.github.com/repos/ARMmbed/DAPLink/pulls/409/comments","review_comment_url":"https://api.github.com/repos/ARMmbed/DAPLink/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ARMmbed/DAPLink/issues/409/comments","statuses_url":"https://api.github.com/repos/ARMmbed/DAPLink/statuses/f01831d177811f2aca55fdce8bc8ed93a8119776","head":{"label":"arekzaluski:f/webusb_hid_serial","ref":"f/webusb_hid_serial","sha":"f01831d177811f2aca55fdce8bc8ed93a8119776","user":{"login":"arekzaluski","id":13417215,"avatar_url":"https://avatars2.githubusercontent.com/u/13417215?v=4","gravatar_id":"","url":"https://api.github.com/users/arekzaluski","html_url":"https://github.com/arekzaluski","followers_url":"https://api.github.com/users/arekzaluski/followers","following_url":"https://api.github.com/users/arekzaluski/following{/other_user}","gists_url":"https://api.github.com/users/arekzaluski/gists{/gist_id}","starred_url":"https://api.github.com/users/arekzaluski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arekzaluski/subscriptions","organizations_url":"https://api.github.com/users/arekzaluski/orgs","repos_url":"https://api.github.com/users/arekzaluski/repos","events_url":"https://api.github.com/users/arekzaluski/events{/privacy}","received_events_url":"https://api.github.com/users/arekzaluski/received_events","type":"User","site_admin":false},"repo":{"id":109270171,"name":"DAPLink","full_name":"arekzaluski/DAPLink","owner":{"login":"arekzaluski","id":13417215,"avatar_url":"https://avatars2.githubusercontent.com/u/13417215?v=4","gravatar_id":"","url":"https://api.github.com/users/arekzaluski","html_url":"https://github.com/arekzaluski","followers_url":"https://api.github.com/users/arekzaluski/followers","following_url":"https://api.github.com/users/arekzaluski/following{/other_user}","gists_url":"https://api.github.com/users/arekzaluski/gists{/gist_id}","starred_url":"https://api.github.com/users/arekzaluski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arekzaluski/subscriptions","organizations_url":"https://api.github.com/users/arekzaluski/orgs","repos_url":"https://api.github.com/users/arekzaluski/repos","events_url":"https://api.github.com/users/arekzaluski/events{/privacy}","received_events_url":"https://api.github.com/users/arekzaluski/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/arekzaluski/DAPLink","description":null,"fork":true,"url":"https://api.github.com/repos/arekzaluski/DAPLink","forks_url":"https://api.github.com/repos/arekzaluski/DAPLink/forks","keys_url":"https://api.github.com/repos/arekzaluski/DAPLink/keys{/key_id}","collaborators_url":"https://api.github.com/repos/arekzaluski/DAPLink/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/arekzaluski/DAPLink/teams","hooks_url":"https://api.github.com/repos/arekzaluski/DAPLink/hooks","issue_events_url":"https://api.github.com/repos/arekzaluski/DAPLink/issues/events{/number}","events_url":"https://api.github.com/repos/arekzaluski/DAPLink/events","assignees_url":"https://api.github.com/repos/arekzaluski/DAPLink/assignees{/user}","branches_url":"https://api.github.com/repos/arekzaluski/DAPLink/branches{/branch}","tags_url":"https://api.github.com/repos/arekzaluski/DAPLink/tags","blobs_url":"https://api.github.com/repos/arekzaluski/DAPLink/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/arekzaluski/DAPLink/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/arekzaluski/DAPLink/git/refs{/sha}","trees_url":"https://api.github.com/repos/arekzaluski/DAPLink/git/trees{/sha}","statuses_url":"https://api.github.com/repos/arekzaluski/DAPLink/statuses/{sha}","languages_url":"https://api.github.com/repos/arekzaluski/DAPLink/languages","stargazers_url":"https://api.github.com/repos/arekzaluski/DAPLink/stargazers","contributors_url":"https://api.github.com/repos/arekzaluski/DAPLink/contributors","subscribers_url":"https://api.github.com/repos/arekzaluski/DAPLink/subscribers","subscription_url":"https://api.github.com/repos/arekzaluski/DAPLink/subscription","commits_url":"https://api.github.com/repos/arekzaluski/DAPLink/commits{/sha}","git_commits_url":"https://api.github.com/repos/arekzaluski/DAPLink/git/commits{/sha}","comments_url":"https://api.github.com/repos/arekzaluski/DAPLink/comments{/number}","issue_comment_url":"https://api.github.com/repos/arekzaluski/DAPLink/issues/comments{/number}","contents_url":"https://api.github.com/repos/arekzaluski/DAPLink/contents/{+path}","compare_url":"https://api.github.com/repos/arekzaluski/DAPLink/compare/{base}...{head}","merges_url":"https://api.github.com/repos/arekzaluski/DAPLink/merges","archive_url":"https://api.github.com/repos/arekzaluski/DAPLink/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/arekzaluski/DAPLink/downloads","issues_url":"https://api.github.com/repos/arekzaluski/DAPLink/issues{/number}","pulls_url":"https://api.github.com/repos/arekzaluski/DAPLink/pulls{/number}","milestones_url":"https://api.github.com/repos/arekzaluski/DAPLink/milestones{/number}","notifications_url":"https://api.github.com/repos/arekzaluski/DAPLink/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/arekzaluski/DAPLink/labels{/name}","releases_url":"https://api.github.com/repos/arekzaluski/DAPLink/releases{/id}","deployments_url":"https://api.github.com/repos/arekzaluski/DAPLink/deployments","created_at":"2017-11-02T13:44:02Z","updated_at":"2017-11-02T13:44:05Z","pushed_at":"2018-04-23T09:12:16Z","git_url":"git://github.com/arekzaluski/DAPLink.git","ssh_url":"git@github.com:arekzaluski/DAPLink.git","clone_url":"https://github.com/arekzaluski/DAPLink.git","svn_url":"https://github.com/arekzaluski/DAPLink","homepage":null,"size":11852,"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":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ARMmbed:master","ref":"master","sha":"bc159f8d88b2cb69c99522052318dcb3b40b3bb0","user":{"login":"ARMmbed","id":8916057,"avatar_url":"https://avatars3.githubusercontent.com/u/8916057?v=4","gravatar_id":"","url":"https://api.github.com/users/ARMmbed","html_url":"https://github.com/ARMmbed","followers_url":"https://api.github.com/users/ARMmbed/followers","following_url":"https://api.github.com/users/ARMmbed/following{/other_user}","gists_url":"https://api.github.com/users/ARMmbed/gists{/gist_id}","starred_url":"https://api.github.com/users/ARMmbed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ARMmbed/subscriptions","organizations_url":"https://api.github.com/users/ARMmbed/orgs","repos_url":"https://api.github.com/users/ARMmbed/repos","events_url":"https://api.github.com/users/ARMmbed/events{/privacy}","received_events_url":"https://api.github.com/users/ARMmbed/received_events","type":"Organization","site_admin":false},"repo":{"id":24571059,"name":"DAPLink","full_name":"ARMmbed/DAPLink","owner":{"login":"ARMmbed","id":8916057,"avatar_url":"https://avatars3.githubusercontent.com/u/8916057?v=4","gravatar_id":"","url":"https://api.github.com/users/ARMmbed","html_url":"https://github.com/ARMmbed","followers_url":"https://api.github.com/users/ARMmbed/followers","following_url":"https://api.github.com/users/ARMmbed/following{/other_user}","gists_url":"https://api.github.com/users/ARMmbed/gists{/gist_id}","starred_url":"https://api.github.com/users/ARMmbed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ARMmbed/subscriptions","organizations_url":"https://api.github.com/users/ARMmbed/orgs","repos_url":"https://api.github.com/users/ARMmbed/repos","events_url":"https://api.github.com/users/ARMmbed/events{/privacy}","received_events_url":"https://api.github.com/users/ARMmbed/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ARMmbed/DAPLink","description":null,"fork":false,"url":"https://api.github.com/repos/ARMmbed/DAPLink","forks_url":"https://api.github.com/repos/ARMmbed/DAPLink/forks","keys_url":"https://api.github.com/repos/ARMmbed/DAPLink/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ARMmbed/DAPLink/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ARMmbed/DAPLink/teams","hooks_url":"https://api.github.com/repos/ARMmbed/DAPLink/hooks","issue_events_url":"https://api.github.com/repos/ARMmbed/DAPLink/issues/events{/number}","events_url":"https://api.github.com/repos/ARMmbed/DAPLink/events","assignees_url":"https://api.github.com/repos/ARMmbed/DAPLink/assignees{/user}","branches_url":"https://api.github.com/repos/ARMmbed/DAPLink/branches{/branch}","tags_url":"https://api.github.com/repos/ARMmbed/DAPLink/tags","blobs_url":"https://api.github.com/repos/ARMmbed/DAPLink/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ARMmbed/DAPLink/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ARMmbed/DAPLink/git/refs{/sha}","trees_url":"https://api.github.com/repos/ARMmbed/DAPLink/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ARMmbed/DAPLink/statuses/{sha}","languages_url":"https://api.github.com/repos/ARMmbed/DAPLink/languages","stargazers_url":"https://api.github.com/repos/ARMmbed/DAPLink/stargazers","contributors_url":"https://api.github.com/repos/ARMmbed/DAPLink/contributors","subscribers_url":"https://api.github.com/repos/ARMmbed/DAPLink/subscribers","subscription_url":"https://api.github.com/repos/ARMmbed/DAPLink/subscription","commits_url":"https://api.github.com/repos/ARMmbed/DAPLink/commits{/sha}","git_commits_url":"https://api.github.com/repos/ARMmbed/DAPLink/git/commits{/sha}","comments_url":"https://api.github.com/repos/ARMmbed/DAPLink/comments{/number}","issue_comment_url":"https://api.github.com/repos/ARMmbed/DAPLink/issues/comments{/number}","contents_url":"https://api.github.com/repos/ARMmbed/DAPLink/contents/{+path}","compare_url":"https://api.github.com/repos/ARMmbed/DAPLink/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ARMmbed/DAPLink/merges","archive_url":"https://api.github.com/repos/ARMmbed/DAPLink/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ARMmbed/DAPLink/downloads","issues_url":"https://api.github.com/repos/ARMmbed/DAPLink/issues{/number}","pulls_url":"https://api.github.com/repos/ARMmbed/DAPLink/pulls{/number}","milestones_url":"https://api.github.com/repos/ARMmbed/DAPLink/milestones{/number}","notifications_url":"https://api.github.com/repos/ARMmbed/DAPLink/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ARMmbed/DAPLink/labels{/name}","releases_url":"https://api.github.com/repos/ARMmbed/DAPLink/releases{/id}","deployments_url":"https://api.github.com/repos/ARMmbed/DAPLink/deployments","created_at":"2014-09-28T21:38:24Z","updated_at":"2018-04-24T13:12:30Z","pushed_at":"2018-04-24T13:12:26Z","git_url":"git://github.com/ARMmbed/DAPLink.git","ssh_url":"git@github.com:ARMmbed/DAPLink.git","clone_url":"https://github.com/ARMmbed/DAPLink.git","svn_url":"https://github.com/ARMmbed/DAPLink","homepage":null,"size":17688,"stargazers_count":265,"watchers_count":265,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":196,"mirror_url":null,"archived":false,"open_issues_count":57,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":196,"open_issues":57,"watchers":265,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ARMmbed/DAPLink/pulls/409"},"html":{"href":"https://github.com/ARMmbed/DAPLink/pull/409"},"issue":{"href":"https://api.github.com/repos/ARMmbed/DAPLink/issues/409"},"comments":{"href":"https://api.github.com/repos/ARMmbed/DAPLink/issues/409/comments"},"review_comments":{"href":"https://api.github.com/repos/ARMmbed/DAPLink/pulls/409/comments"},"review_comment":{"href":"https://api.github.com/repos/ARMmbed/DAPLink/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ARMmbed/DAPLink/pulls/409/commits"},"statuses":{"href":"https://api.github.com/repos/ARMmbed/DAPLink/statuses/f01831d177811f2aca55fdce8bc8ed93a8119776"}},"author_association":"NONE"}}
{"actor":{"display_login":"c1728p9"}}