{"action":"created","comment":{"url":"https://api.github.com/repos/Sensirion/lin-bus-rs/pulls/comments/196769299","pull_request_review_id":130383066,"id":196769299,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5Njc2OTI5OQ==","diff_hunk":"@@ -18,13 +61,54 @@ where\n         Driver::send_wakeup(self)\n     }\n \n-    fn write_frame(&mut self, pid: u8, data: &[u8]) -> Result<(), Driver::Error> {\n-        self.send_header(pid)?;\n-        self.write(data)\n+    fn write_frame(&mut self, frame: &Frame) -> Result<(), Driver::Error> {\n+        self.send_header(frame.get_pid())?;\n+        self.write(frame.get_data_with_checksum())\n     }\n \n-    fn read_frame(&mut self, pid: u8, buf: &mut [u8]) -> Result<(), Driver::Error> {\n+    fn read_frame(&mut self, pid: u8, data: &mut [u8]) -> Result<(), Driver::Error> {\n+        assert!(data.len() <= 8, \"Maximum data length is 8 bytes\");\n         self.send_header(pid)?;\n-        self.read(buf)\n+        let mut buf = [0u8; 9];\n+        let data_len = data.len();\n+        self.read(&mut buf[0..data_len + 1])?;","path":"src/master.rs","position":77,"original_position":77,"commit_id":"8abe739455c75948dda1e7ce6b4ac8ec3e140b13","original_commit_id":"8abe739455c75948dda1e7ce6b4ac8ec3e140b13","user":{"login":"psachs","id":864231,"node_id":"MDQ6VXNlcjg2NDIzMQ==","avatar_url":"https://avatars0.githubusercontent.com/u/864231?v=4","gravatar_id":"","url":"https://api.github.com/users/psachs","html_url":"https://github.com/psachs","followers_url":"https://api.github.com/users/psachs/followers","following_url":"https://api.github.com/users/psachs/following{/other_user}","gists_url":"https://api.github.com/users/psachs/gists{/gist_id}","starred_url":"https://api.github.com/users/psachs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psachs/subscriptions","organizations_url":"https://api.github.com/users/psachs/orgs","repos_url":"https://api.github.com/users/psachs/repos","events_url":"https://api.github.com/users/psachs/events{/privacy}","received_events_url":"https://api.github.com/users/psachs/received_events","type":"User","site_admin":false},"body":"same here `self.read(&mut buf[0...data_len])?;`","created_at":"2018-06-20T13:08:56Z","updated_at":"2018-06-20T13:22:53Z","html_url":"https://github.com/Sensirion/lin-bus-rs/pull/4#discussion_r196769299","pull_request_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/pulls/4","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/Sensirion/lin-bus-rs/pulls/comments/196769299"},"html":{"href":"https://github.com/Sensirion/lin-bus-rs/pull/4#discussion_r196769299"},"pull_request":{"href":"https://api.github.com/repos/Sensirion/lin-bus-rs/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/Sensirion/lin-bus-rs/pulls/4","id":196120466,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2MTIwNDY2","html_url":"https://github.com/Sensirion/lin-bus-rs/pull/4","diff_url":"https://github.com/Sensirion/lin-bus-rs/pull/4.diff","patch_url":"https://github.com/Sensirion/lin-bus-rs/pull/4.patch","issue_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/issues/4","number":4,"state":"open","locked":false,"title":"Use a Frame type and calculate / check checksum","user":{"login":"rnestler","id":1435346,"node_id":"MDQ6VXNlcjE0MzUzNDY=","avatar_url":"https://avatars3.githubusercontent.com/u/1435346?v=4","gravatar_id":"","url":"https://api.github.com/users/rnestler","html_url":"https://github.com/rnestler","followers_url":"https://api.github.com/users/rnestler/followers","following_url":"https://api.github.com/users/rnestler/following{/other_user}","gists_url":"https://api.github.com/users/rnestler/gists{/gist_id}","starred_url":"https://api.github.com/users/rnestler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rnestler/subscriptions","organizations_url":"https://api.github.com/users/rnestler/orgs","repos_url":"https://api.github.com/users/rnestler/repos","events_url":"https://api.github.com/users/rnestler/events{/privacy}","received_events_url":"https://api.github.com/users/rnestler/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-06-20T12:26:03Z","updated_at":"2018-06-20T13:22:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4dc66312b30113509c48b248254b94864457b719","assignee":null,"assignees":[],"requested_reviewers":[{"login":"abrauchli","id":216562,"node_id":"MDQ6VXNlcjIxNjU2Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/216562?v=4","gravatar_id":"","url":"https://api.github.com/users/abrauchli","html_url":"https://github.com/abrauchli","followers_url":"https://api.github.com/users/abrauchli/followers","following_url":"https://api.github.com/users/abrauchli/following{/other_user}","gists_url":"https://api.github.com/users/abrauchli/gists{/gist_id}","starred_url":"https://api.github.com/users/abrauchli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abrauchli/subscriptions","organizations_url":"https://api.github.com/users/abrauchli/orgs","repos_url":"https://api.github.com/users/abrauchli/repos","events_url":"https://api.github.com/users/abrauchli/events{/privacy}","received_events_url":"https://api.github.com/users/abrauchli/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/pulls/4/commits","review_comments_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/pulls/4/comments","review_comment_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/issues/4/comments","statuses_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/statuses/8abe739455c75948dda1e7ce6b4ac8ec3e140b13","head":{"label":"Sensirion:use-frame-type","ref":"use-frame-type","sha":"8abe739455c75948dda1e7ce6b4ac8ec3e140b13","user":{"login":"Sensirion","id":2580116,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1ODAxMTY=","avatar_url":"https://avatars3.githubusercontent.com/u/2580116?v=4","gravatar_id":"","url":"https://api.github.com/users/Sensirion","html_url":"https://github.com/Sensirion","followers_url":"https://api.github.com/users/Sensirion/followers","following_url":"https://api.github.com/users/Sensirion/following{/other_user}","gists_url":"https://api.github.com/users/Sensirion/gists{/gist_id}","starred_url":"https://api.github.com/users/Sensirion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sensirion/subscriptions","organizations_url":"https://api.github.com/users/Sensirion/orgs","repos_url":"https://api.github.com/users/Sensirion/repos","events_url":"https://api.github.com/users/Sensirion/events{/privacy}","received_events_url":"https://api.github.com/users/Sensirion/received_events","type":"Organization","site_admin":false},"repo":{"id":137223960,"node_id":"MDEwOlJlcG9zaXRvcnkxMzcyMjM5NjA=","name":"lin-bus-rs","full_name":"Sensirion/lin-bus-rs","owner":{"login":"Sensirion","id":2580116,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1ODAxMTY=","avatar_url":"https://avatars3.githubusercontent.com/u/2580116?v=4","gravatar_id":"","url":"https://api.github.com/users/Sensirion","html_url":"https://github.com/Sensirion","followers_url":"https://api.github.com/users/Sensirion/followers","following_url":"https://api.github.com/users/Sensirion/following{/other_user}","gists_url":"https://api.github.com/users/Sensirion/gists{/gist_id}","starred_url":"https://api.github.com/users/Sensirion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sensirion/subscriptions","organizations_url":"https://api.github.com/users/Sensirion/orgs","repos_url":"https://api.github.com/users/Sensirion/repos","events_url":"https://api.github.com/users/Sensirion/events{/privacy}","received_events_url":"https://api.github.com/users/Sensirion/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Sensirion/lin-bus-rs","description":"Rust LIN bus driver traits and protocol implementation","fork":false,"url":"https://api.github.com/repos/Sensirion/lin-bus-rs","forks_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/forks","keys_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/teams","hooks_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/hooks","issue_events_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/issues/events{/number}","events_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/events","assignees_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/assignees{/user}","branches_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/branches{/branch}","tags_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/tags","blobs_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/git/refs{/sha}","trees_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/statuses/{sha}","languages_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/languages","stargazers_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/stargazers","contributors_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/contributors","subscribers_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/subscribers","subscription_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/subscription","commits_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/commits{/sha}","git_commits_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/git/commits{/sha}","comments_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/comments{/number}","issue_comment_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/issues/comments{/number}","contents_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/contents/{+path}","compare_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/merges","archive_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/downloads","issues_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/issues{/number}","pulls_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/pulls{/number}","milestones_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/milestones{/number}","notifications_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/labels{/name}","releases_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/releases{/id}","deployments_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/deployments","created_at":"2018-06-13T14:04:41Z","updated_at":"2018-06-18T14:24:36Z","pushed_at":"2018-06-20T12:26:04Z","git_url":"git://github.com/Sensirion/lin-bus-rs.git","ssh_url":"git@github.com:Sensirion/lin-bus-rs.git","clone_url":"https://github.com/Sensirion/lin-bus-rs.git","svn_url":"https://github.com/Sensirion/lin-bus-rs","homepage":"","size":11,"stargazers_count":0,"watchers_count":0,"language":"Rust","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":1,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Sensirion:master","ref":"master","sha":"bdaac753989585f44a6802a1ed8e1687ab4dd971","user":{"login":"Sensirion","id":2580116,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1ODAxMTY=","avatar_url":"https://avatars3.githubusercontent.com/u/2580116?v=4","gravatar_id":"","url":"https://api.github.com/users/Sensirion","html_url":"https://github.com/Sensirion","followers_url":"https://api.github.com/users/Sensirion/followers","following_url":"https://api.github.com/users/Sensirion/following{/other_user}","gists_url":"https://api.github.com/users/Sensirion/gists{/gist_id}","starred_url":"https://api.github.com/users/Sensirion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sensirion/subscriptions","organizations_url":"https://api.github.com/users/Sensirion/orgs","repos_url":"https://api.github.com/users/Sensirion/repos","events_url":"https://api.github.com/users/Sensirion/events{/privacy}","received_events_url":"https://api.github.com/users/Sensirion/received_events","type":"Organization","site_admin":false},"repo":{"id":137223960,"node_id":"MDEwOlJlcG9zaXRvcnkxMzcyMjM5NjA=","name":"lin-bus-rs","full_name":"Sensirion/lin-bus-rs","owner":{"login":"Sensirion","id":2580116,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1ODAxMTY=","avatar_url":"https://avatars3.githubusercontent.com/u/2580116?v=4","gravatar_id":"","url":"https://api.github.com/users/Sensirion","html_url":"https://github.com/Sensirion","followers_url":"https://api.github.com/users/Sensirion/followers","following_url":"https://api.github.com/users/Sensirion/following{/other_user}","gists_url":"https://api.github.com/users/Sensirion/gists{/gist_id}","starred_url":"https://api.github.com/users/Sensirion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sensirion/subscriptions","organizations_url":"https://api.github.com/users/Sensirion/orgs","repos_url":"https://api.github.com/users/Sensirion/repos","events_url":"https://api.github.com/users/Sensirion/events{/privacy}","received_events_url":"https://api.github.com/users/Sensirion/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Sensirion/lin-bus-rs","description":"Rust LIN bus driver traits and protocol implementation","fork":false,"url":"https://api.github.com/repos/Sensirion/lin-bus-rs","forks_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/forks","keys_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/teams","hooks_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/hooks","issue_events_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/issues/events{/number}","events_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/events","assignees_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/assignees{/user}","branches_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/branches{/branch}","tags_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/tags","blobs_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/git/refs{/sha}","trees_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/statuses/{sha}","languages_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/languages","stargazers_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/stargazers","contributors_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/contributors","subscribers_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/subscribers","subscription_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/subscription","commits_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/commits{/sha}","git_commits_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/git/commits{/sha}","comments_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/comments{/number}","issue_comment_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/issues/comments{/number}","contents_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/contents/{+path}","compare_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/merges","archive_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/downloads","issues_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/issues{/number}","pulls_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/pulls{/number}","milestones_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/milestones{/number}","notifications_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/labels{/name}","releases_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/releases{/id}","deployments_url":"https://api.github.com/repos/Sensirion/lin-bus-rs/deployments","created_at":"2018-06-13T14:04:41Z","updated_at":"2018-06-18T14:24:36Z","pushed_at":"2018-06-20T12:26:04Z","git_url":"git://github.com/Sensirion/lin-bus-rs.git","ssh_url":"git@github.com:Sensirion/lin-bus-rs.git","clone_url":"https://github.com/Sensirion/lin-bus-rs.git","svn_url":"https://github.com/Sensirion/lin-bus-rs","homepage":"","size":11,"stargazers_count":0,"watchers_count":0,"language":"Rust","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":1,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Sensirion/lin-bus-rs/pulls/4"},"html":{"href":"https://github.com/Sensirion/lin-bus-rs/pull/4"},"issue":{"href":"https://api.github.com/repos/Sensirion/lin-bus-rs/issues/4"},"comments":{"href":"https://api.github.com/repos/Sensirion/lin-bus-rs/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/Sensirion/lin-bus-rs/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/Sensirion/lin-bus-rs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Sensirion/lin-bus-rs/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/Sensirion/lin-bus-rs/statuses/8abe739455c75948dda1e7ce6b4ac8ec3e140b13"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"psachs"}}