{"action":"created","comment":{"url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/pulls/comments/147634596","pull_request_review_id":72755128,"id":147634596,"diff_hunk":"@@ -147,9 +147,17 @@ int Modbus::poll() {\n     // check minimum length.\n     if (lengthIn < 8) return 0;\n \n-    // this removes the null character that sometimes\n-    // is get from the SoftwareSerial on the \"nano\"\n-    if(lengthIn > 8 && bufIn[lengthIn-1] == 0) lengthIn--;\n+    /**\n+     * this removes the null character that sometimes\n+     * is get from the SoftwareSerial on the \"nano\"\n+     * posible message length are:\n+     *   FC1..6 : length = 8  (with extra null 9)\n+     *   FC15   : length = 11 (with extra null 12)","path":"src/ModbusSlave.cpp","position":null,"original_position":12,"commit_id":"766b7a87bab02b12d2ac642d21e1f51d8af54f25","original_commit_id":"b660f6889d9d24bf713d41d7870c321c9ae3fb40","user":{"login":"raffaeler","id":5183152,"avatar_url":"https://avatars3.githubusercontent.com/u/5183152?v=4","gravatar_id":"","url":"https://api.github.com/users/raffaeler","html_url":"https://github.com/raffaeler","followers_url":"https://api.github.com/users/raffaeler/followers","following_url":"https://api.github.com/users/raffaeler/following{/other_user}","gists_url":"https://api.github.com/users/raffaeler/gists{/gist_id}","starred_url":"https://api.github.com/users/raffaeler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raffaeler/subscriptions","organizations_url":"https://api.github.com/users/raffaeler/orgs","repos_url":"https://api.github.com/users/raffaeler/repos","events_url":"https://api.github.com/users/raffaeler/events{/privacy}","received_events_url":"https://api.github.com/users/raffaeler/received_events","type":"User","site_admin":false},"body":"I don't like hardcoding the length (as I also did in the first pull request).\r\nIf anybody will ever implement new messages that are part of the modbus standard, it will be a mess again.\r\nI would prefer to isolate a function calculating the message length and trimming the nulls at the end.\r\nDo you agree?","created_at":"2017-10-30T08:00:53Z","updated_at":"2017-10-30T08:00:54Z","html_url":"https://github.com/yaacov/ArduinoModbusSlave/pull/7#discussion_r147634596","pull_request_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/pulls/7","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/pulls/comments/147634596"},"html":{"href":"https://github.com/yaacov/ArduinoModbusSlave/pull/7#discussion_r147634596"},"pull_request":{"href":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/pulls/7"}},"in_reply_to_id":147622073},"pull_request":{"url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/pulls/7","id":149433743,"html_url":"https://github.com/yaacov/ArduinoModbusSlave/pull/7","diff_url":"https://github.com/yaacov/ArduinoModbusSlave/pull/7.diff","patch_url":"https://github.com/yaacov/ArduinoModbusSlave/pull/7.patch","issue_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/issues/7","number":7,"state":"open","locked":false,"title":"Remove extra null, only if length is one byte longer then message.","user":{"login":"yaacov","id":2181522,"avatar_url":"https://avatars2.githubusercontent.com/u/2181522?v=4","gravatar_id":"","url":"https://api.github.com/users/yaacov","html_url":"https://github.com/yaacov","followers_url":"https://api.github.com/users/yaacov/followers","following_url":"https://api.github.com/users/yaacov/following{/other_user}","gists_url":"https://api.github.com/users/yaacov/gists{/gist_id}","starred_url":"https://api.github.com/users/yaacov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yaacov/subscriptions","organizations_url":"https://api.github.com/users/yaacov/orgs","repos_url":"https://api.github.com/users/yaacov/repos","events_url":"https://api.github.com/users/yaacov/events{/privacy}","received_events_url":"https://api.github.com/users/yaacov/received_events","type":"User","site_admin":false},"body":"Remove extra null, only if length is one byte longer then message.\r\n\r\nIn https://github.com/yaacov/ArduinoModbusSlave/pull/6 we remove the extra null when length is bigger then 8, this is a problem for valid messages of length 11 and 13.\r\n\r\nIn this pull request we look for specific length that can have an extra null.\r\n\r\n@raffaeler please take a look","created_at":"2017-10-30T04:20:56Z","updated_at":"2017-10-30T08:00:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6abb653418543281685b5abeb66c4b3fd3f49d4f","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/pulls/7/commits","review_comments_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/pulls/7/comments","review_comment_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/issues/7/comments","statuses_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/statuses/766b7a87bab02b12d2ac642d21e1f51d8af54f25","head":{"label":"yaacov:fix-length-check","ref":"fix-length-check","sha":"766b7a87bab02b12d2ac642d21e1f51d8af54f25","user":{"login":"yaacov","id":2181522,"avatar_url":"https://avatars2.githubusercontent.com/u/2181522?v=4","gravatar_id":"","url":"https://api.github.com/users/yaacov","html_url":"https://github.com/yaacov","followers_url":"https://api.github.com/users/yaacov/followers","following_url":"https://api.github.com/users/yaacov/following{/other_user}","gists_url":"https://api.github.com/users/yaacov/gists{/gist_id}","starred_url":"https://api.github.com/users/yaacov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yaacov/subscriptions","organizations_url":"https://api.github.com/users/yaacov/orgs","repos_url":"https://api.github.com/users/yaacov/repos","events_url":"https://api.github.com/users/yaacov/events{/privacy}","received_events_url":"https://api.github.com/users/yaacov/received_events","type":"User","site_admin":false},"repo":{"id":46258875,"name":"ArduinoModbusSlave","full_name":"yaacov/ArduinoModbusSlave","owner":{"login":"yaacov","id":2181522,"avatar_url":"https://avatars2.githubusercontent.com/u/2181522?v=4","gravatar_id":"","url":"https://api.github.com/users/yaacov","html_url":"https://github.com/yaacov","followers_url":"https://api.github.com/users/yaacov/followers","following_url":"https://api.github.com/users/yaacov/following{/other_user}","gists_url":"https://api.github.com/users/yaacov/gists{/gist_id}","starred_url":"https://api.github.com/users/yaacov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yaacov/subscriptions","organizations_url":"https://api.github.com/users/yaacov/orgs","repos_url":"https://api.github.com/users/yaacov/repos","events_url":"https://api.github.com/users/yaacov/events{/privacy}","received_events_url":"https://api.github.com/users/yaacov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yaacov/ArduinoModbusSlave","description":"Modbus slave library for Arduino","fork":false,"url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave","forks_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/forks","keys_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/teams","hooks_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/hooks","issue_events_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/issues/events{/number}","events_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/events","assignees_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/assignees{/user}","branches_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/branches{/branch}","tags_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/tags","blobs_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/git/refs{/sha}","trees_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/statuses/{sha}","languages_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/languages","stargazers_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/stargazers","contributors_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/contributors","subscribers_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/subscribers","subscription_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/subscription","commits_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/commits{/sha}","git_commits_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/git/commits{/sha}","comments_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/comments{/number}","issue_comment_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/issues/comments{/number}","contents_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/contents/{+path}","compare_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/merges","archive_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/downloads","issues_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/issues{/number}","pulls_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/pulls{/number}","milestones_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/milestones{/number}","notifications_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/labels{/name}","releases_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/releases{/id}","deployments_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/deployments","created_at":"2015-11-16T07:28:41Z","updated_at":"2017-10-13T01:05:14Z","pushed_at":"2017-10-30T06:32:46Z","git_url":"git://github.com/yaacov/ArduinoModbusSlave.git","ssh_url":"git@github.com:yaacov/ArduinoModbusSlave.git","clone_url":"https://github.com/yaacov/ArduinoModbusSlave.git","svn_url":"https://github.com/yaacov/ArduinoModbusSlave","homepage":"","size":944,"stargazers_count":11,"watchers_count":11,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":2,"forks":4,"open_issues":2,"watchers":11,"default_branch":"master"}},"base":{"label":"yaacov:master","ref":"master","sha":"696e0233d2740894f1055ec9c6c8dc29cb8b554a","user":{"login":"yaacov","id":2181522,"avatar_url":"https://avatars2.githubusercontent.com/u/2181522?v=4","gravatar_id":"","url":"https://api.github.com/users/yaacov","html_url":"https://github.com/yaacov","followers_url":"https://api.github.com/users/yaacov/followers","following_url":"https://api.github.com/users/yaacov/following{/other_user}","gists_url":"https://api.github.com/users/yaacov/gists{/gist_id}","starred_url":"https://api.github.com/users/yaacov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yaacov/subscriptions","organizations_url":"https://api.github.com/users/yaacov/orgs","repos_url":"https://api.github.com/users/yaacov/repos","events_url":"https://api.github.com/users/yaacov/events{/privacy}","received_events_url":"https://api.github.com/users/yaacov/received_events","type":"User","site_admin":false},"repo":{"id":46258875,"name":"ArduinoModbusSlave","full_name":"yaacov/ArduinoModbusSlave","owner":{"login":"yaacov","id":2181522,"avatar_url":"https://avatars2.githubusercontent.com/u/2181522?v=4","gravatar_id":"","url":"https://api.github.com/users/yaacov","html_url":"https://github.com/yaacov","followers_url":"https://api.github.com/users/yaacov/followers","following_url":"https://api.github.com/users/yaacov/following{/other_user}","gists_url":"https://api.github.com/users/yaacov/gists{/gist_id}","starred_url":"https://api.github.com/users/yaacov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yaacov/subscriptions","organizations_url":"https://api.github.com/users/yaacov/orgs","repos_url":"https://api.github.com/users/yaacov/repos","events_url":"https://api.github.com/users/yaacov/events{/privacy}","received_events_url":"https://api.github.com/users/yaacov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yaacov/ArduinoModbusSlave","description":"Modbus slave library for Arduino","fork":false,"url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave","forks_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/forks","keys_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/teams","hooks_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/hooks","issue_events_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/issues/events{/number}","events_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/events","assignees_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/assignees{/user}","branches_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/branches{/branch}","tags_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/tags","blobs_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/git/refs{/sha}","trees_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/statuses/{sha}","languages_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/languages","stargazers_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/stargazers","contributors_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/contributors","subscribers_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/subscribers","subscription_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/subscription","commits_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/commits{/sha}","git_commits_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/git/commits{/sha}","comments_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/comments{/number}","issue_comment_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/issues/comments{/number}","contents_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/contents/{+path}","compare_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/merges","archive_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/downloads","issues_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/issues{/number}","pulls_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/pulls{/number}","milestones_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/milestones{/number}","notifications_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/labels{/name}","releases_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/releases{/id}","deployments_url":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/deployments","created_at":"2015-11-16T07:28:41Z","updated_at":"2017-10-13T01:05:14Z","pushed_at":"2017-10-30T06:32:46Z","git_url":"git://github.com/yaacov/ArduinoModbusSlave.git","ssh_url":"git@github.com:yaacov/ArduinoModbusSlave.git","clone_url":"https://github.com/yaacov/ArduinoModbusSlave.git","svn_url":"https://github.com/yaacov/ArduinoModbusSlave","homepage":"","size":944,"stargazers_count":11,"watchers_count":11,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":2,"forks":4,"open_issues":2,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/pulls/7"},"html":{"href":"https://github.com/yaacov/ArduinoModbusSlave/pull/7"},"issue":{"href":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/issues/7"},"comments":{"href":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/yaacov/ArduinoModbusSlave/statuses/766b7a87bab02b12d2ac642d21e1f51d8af54f25"}},"author_association":"OWNER"}}
{"actor":{"display_login":"raffaeler"}}