{"action":"opened","number":38,"pull_request":{"url":"https://api.github.com/repos/flipback/rmodbus/pulls/38","id":40804766,"html_url":"https://github.com/flipback/rmodbus/pull/38","diff_url":"https://github.com/flipback/rmodbus/pull/38.diff","patch_url":"https://github.com/flipback/rmodbus/pull/38.patch","issue_url":"https://api.github.com/repos/flipback/rmodbus/issues/38","number":38,"state":"open","locked":false,"title":"Validate unit identifier","user":{"login":"jhart-r7","id":3869433,"avatar_url":"https://avatars.githubusercontent.com/u/3869433?v=3","gravatar_id":"","url":"https://api.github.com/users/jhart-r7","html_url":"https://github.com/jhart-r7","followers_url":"https://api.github.com/users/jhart-r7/followers","following_url":"https://api.github.com/users/jhart-r7/following{/other_user}","gists_url":"https://api.github.com/users/jhart-r7/gists{/gist_id}","starred_url":"https://api.github.com/users/jhart-r7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhart-r7/subscriptions","organizations_url":"https://api.github.com/users/jhart-r7/orgs","repos_url":"https://api.github.com/users/jhart-r7/repos","events_url":"https://api.github.com/users/jhart-r7/events{/privacy}","received_events_url":"https://api.github.com/users/jhart-r7/received_events","type":"User","site_admin":false},"body":"I've been doing some work with MODBUS and stumbled upon this gem.  Very helpful -- thank you!\r\n\r\nI've read the [documentation for MODBUS TCP/IP](http://www.modbus.org/docs/Modbus_Messaging_Implementation_Guide_V1_0b.pdf) several times and can't seem to determine definitively how/when the unit identifier is supposed to be used.  It seems to indicate in some situations it must be validated, and in others it need not be.  In `rmodbus`, it appears as if the _intent_ was to validate the unit identifier when using TCP/IP, however that functionality and the corresponding unit test were disabled.  I've fixed this.  In doing so I also had to clean up some of the header parsing and added new tests.\r\n\r\nIf this is wrong, I'd love to learn why :smile: ","created_at":"2015-07-24T18:54:57Z","updated_at":"2015-07-24T18:54:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/flipback/rmodbus/pulls/38/commits","review_comments_url":"https://api.github.com/repos/flipback/rmodbus/pulls/38/comments","review_comment_url":"https://api.github.com/repos/flipback/rmodbus/pulls/comments{/number}","comments_url":"https://api.github.com/repos/flipback/rmodbus/issues/38/comments","statuses_url":"https://api.github.com/repos/flipback/rmodbus/statuses/419df2aa4305d39a094c215be21c719cfc2d29a3","head":{"label":"jhart-r7:bug/validate-header","ref":"bug/validate-header","sha":"419df2aa4305d39a094c215be21c719cfc2d29a3","user":{"login":"jhart-r7","id":3869433,"avatar_url":"https://avatars.githubusercontent.com/u/3869433?v=3","gravatar_id":"","url":"https://api.github.com/users/jhart-r7","html_url":"https://github.com/jhart-r7","followers_url":"https://api.github.com/users/jhart-r7/followers","following_url":"https://api.github.com/users/jhart-r7/following{/other_user}","gists_url":"https://api.github.com/users/jhart-r7/gists{/gist_id}","starred_url":"https://api.github.com/users/jhart-r7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhart-r7/subscriptions","organizations_url":"https://api.github.com/users/jhart-r7/orgs","repos_url":"https://api.github.com/users/jhart-r7/repos","events_url":"https://api.github.com/users/jhart-r7/events{/privacy}","received_events_url":"https://api.github.com/users/jhart-r7/received_events","type":"User","site_admin":false},"repo":{"id":39478757,"name":"rmodbus","full_name":"jhart-r7/rmodbus","owner":{"login":"jhart-r7","id":3869433,"avatar_url":"https://avatars.githubusercontent.com/u/3869433?v=3","gravatar_id":"","url":"https://api.github.com/users/jhart-r7","html_url":"https://github.com/jhart-r7","followers_url":"https://api.github.com/users/jhart-r7/followers","following_url":"https://api.github.com/users/jhart-r7/following{/other_user}","gists_url":"https://api.github.com/users/jhart-r7/gists{/gist_id}","starred_url":"https://api.github.com/users/jhart-r7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhart-r7/subscriptions","organizations_url":"https://api.github.com/users/jhart-r7/orgs","repos_url":"https://api.github.com/users/jhart-r7/repos","events_url":"https://api.github.com/users/jhart-r7/events{/privacy}","received_events_url":"https://api.github.com/users/jhart-r7/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jhart-r7/rmodbus","description":"RModBus - free implementation of ModBus protocol in pure Ruby","fork":true,"url":"https://api.github.com/repos/jhart-r7/rmodbus","forks_url":"https://api.github.com/repos/jhart-r7/rmodbus/forks","keys_url":"https://api.github.com/repos/jhart-r7/rmodbus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jhart-r7/rmodbus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jhart-r7/rmodbus/teams","hooks_url":"https://api.github.com/repos/jhart-r7/rmodbus/hooks","issue_events_url":"https://api.github.com/repos/jhart-r7/rmodbus/issues/events{/number}","events_url":"https://api.github.com/repos/jhart-r7/rmodbus/events","assignees_url":"https://api.github.com/repos/jhart-r7/rmodbus/assignees{/user}","branches_url":"https://api.github.com/repos/jhart-r7/rmodbus/branches{/branch}","tags_url":"https://api.github.com/repos/jhart-r7/rmodbus/tags","blobs_url":"https://api.github.com/repos/jhart-r7/rmodbus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jhart-r7/rmodbus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jhart-r7/rmodbus/git/refs{/sha}","trees_url":"https://api.github.com/repos/jhart-r7/rmodbus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jhart-r7/rmodbus/statuses/{sha}","languages_url":"https://api.github.com/repos/jhart-r7/rmodbus/languages","stargazers_url":"https://api.github.com/repos/jhart-r7/rmodbus/stargazers","contributors_url":"https://api.github.com/repos/jhart-r7/rmodbus/contributors","subscribers_url":"https://api.github.com/repos/jhart-r7/rmodbus/subscribers","subscription_url":"https://api.github.com/repos/jhart-r7/rmodbus/subscription","commits_url":"https://api.github.com/repos/jhart-r7/rmodbus/commits{/sha}","git_commits_url":"https://api.github.com/repos/jhart-r7/rmodbus/git/commits{/sha}","comments_url":"https://api.github.com/repos/jhart-r7/rmodbus/comments{/number}","issue_comment_url":"https://api.github.com/repos/jhart-r7/rmodbus/issues/comments{/number}","contents_url":"https://api.github.com/repos/jhart-r7/rmodbus/contents/{+path}","compare_url":"https://api.github.com/repos/jhart-r7/rmodbus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jhart-r7/rmodbus/merges","archive_url":"https://api.github.com/repos/jhart-r7/rmodbus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jhart-r7/rmodbus/downloads","issues_url":"https://api.github.com/repos/jhart-r7/rmodbus/issues{/number}","pulls_url":"https://api.github.com/repos/jhart-r7/rmodbus/pulls{/number}","milestones_url":"https://api.github.com/repos/jhart-r7/rmodbus/milestones{/number}","notifications_url":"https://api.github.com/repos/jhart-r7/rmodbus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jhart-r7/rmodbus/labels{/name}","releases_url":"https://api.github.com/repos/jhart-r7/rmodbus/releases{/id}","created_at":"2015-07-22T01:33:00Z","updated_at":"2015-07-22T01:33:02Z","pushed_at":"2015-07-24T18:32:56Z","git_url":"git://github.com/jhart-r7/rmodbus.git","ssh_url":"git@github.com:jhart-r7/rmodbus.git","clone_url":"https://github.com/jhart-r7/rmodbus.git","svn_url":"https://github.com/jhart-r7/rmodbus","homepage":"rmodbus.flipback.net","size":479,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"flipback:master","ref":"master","sha":"932939a3d7f0c69768b981609f053a1d32920bd2","user":{"login":"flipback","id":67068,"avatar_url":"https://avatars.githubusercontent.com/u/67068?v=3","gravatar_id":"","url":"https://api.github.com/users/flipback","html_url":"https://github.com/flipback","followers_url":"https://api.github.com/users/flipback/followers","following_url":"https://api.github.com/users/flipback/following{/other_user}","gists_url":"https://api.github.com/users/flipback/gists{/gist_id}","starred_url":"https://api.github.com/users/flipback/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flipback/subscriptions","organizations_url":"https://api.github.com/users/flipback/orgs","repos_url":"https://api.github.com/users/flipback/repos","events_url":"https://api.github.com/users/flipback/events{/privacy}","received_events_url":"https://api.github.com/users/flipback/received_events","type":"User","site_admin":false},"repo":{"id":462277,"name":"rmodbus","full_name":"flipback/rmodbus","owner":{"login":"flipback","id":67068,"avatar_url":"https://avatars.githubusercontent.com/u/67068?v=3","gravatar_id":"","url":"https://api.github.com/users/flipback","html_url":"https://github.com/flipback","followers_url":"https://api.github.com/users/flipback/followers","following_url":"https://api.github.com/users/flipback/following{/other_user}","gists_url":"https://api.github.com/users/flipback/gists{/gist_id}","starred_url":"https://api.github.com/users/flipback/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flipback/subscriptions","organizations_url":"https://api.github.com/users/flipback/orgs","repos_url":"https://api.github.com/users/flipback/repos","events_url":"https://api.github.com/users/flipback/events{/privacy}","received_events_url":"https://api.github.com/users/flipback/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/flipback/rmodbus","description":"RModBus - free implementation of ModBus protocol in pure Ruby","fork":false,"url":"https://api.github.com/repos/flipback/rmodbus","forks_url":"https://api.github.com/repos/flipback/rmodbus/forks","keys_url":"https://api.github.com/repos/flipback/rmodbus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/flipback/rmodbus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/flipback/rmodbus/teams","hooks_url":"https://api.github.com/repos/flipback/rmodbus/hooks","issue_events_url":"https://api.github.com/repos/flipback/rmodbus/issues/events{/number}","events_url":"https://api.github.com/repos/flipback/rmodbus/events","assignees_url":"https://api.github.com/repos/flipback/rmodbus/assignees{/user}","branches_url":"https://api.github.com/repos/flipback/rmodbus/branches{/branch}","tags_url":"https://api.github.com/repos/flipback/rmodbus/tags","blobs_url":"https://api.github.com/repos/flipback/rmodbus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/flipback/rmodbus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/flipback/rmodbus/git/refs{/sha}","trees_url":"https://api.github.com/repos/flipback/rmodbus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/flipback/rmodbus/statuses/{sha}","languages_url":"https://api.github.com/repos/flipback/rmodbus/languages","stargazers_url":"https://api.github.com/repos/flipback/rmodbus/stargazers","contributors_url":"https://api.github.com/repos/flipback/rmodbus/contributors","subscribers_url":"https://api.github.com/repos/flipback/rmodbus/subscribers","subscription_url":"https://api.github.com/repos/flipback/rmodbus/subscription","commits_url":"https://api.github.com/repos/flipback/rmodbus/commits{/sha}","git_commits_url":"https://api.github.com/repos/flipback/rmodbus/git/commits{/sha}","comments_url":"https://api.github.com/repos/flipback/rmodbus/comments{/number}","issue_comment_url":"https://api.github.com/repos/flipback/rmodbus/issues/comments{/number}","contents_url":"https://api.github.com/repos/flipback/rmodbus/contents/{+path}","compare_url":"https://api.github.com/repos/flipback/rmodbus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/flipback/rmodbus/merges","archive_url":"https://api.github.com/repos/flipback/rmodbus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/flipback/rmodbus/downloads","issues_url":"https://api.github.com/repos/flipback/rmodbus/issues{/number}","pulls_url":"https://api.github.com/repos/flipback/rmodbus/pulls{/number}","milestones_url":"https://api.github.com/repos/flipback/rmodbus/milestones{/number}","notifications_url":"https://api.github.com/repos/flipback/rmodbus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/flipback/rmodbus/labels{/name}","releases_url":"https://api.github.com/repos/flipback/rmodbus/releases{/id}","created_at":"2010-01-07T12:28:29Z","updated_at":"2015-07-21T14:53:18Z","pushed_at":"2015-07-10T17:56:34Z","git_url":"git://github.com/flipback/rmodbus.git","ssh_url":"git@github.com:flipback/rmodbus.git","clone_url":"https://github.com/flipback/rmodbus.git","svn_url":"https://github.com/flipback/rmodbus","homepage":"rmodbus.flipback.net","size":737,"stargazers_count":61,"watchers_count":61,"language":"Ruby","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":5,"forks":24,"open_issues":5,"watchers":61,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/flipback/rmodbus/pulls/38"},"html":{"href":"https://github.com/flipback/rmodbus/pull/38"},"issue":{"href":"https://api.github.com/repos/flipback/rmodbus/issues/38"},"comments":{"href":"https://api.github.com/repos/flipback/rmodbus/issues/38/comments"},"review_comments":{"href":"https://api.github.com/repos/flipback/rmodbus/pulls/38/comments"},"review_comment":{"href":"https://api.github.com/repos/flipback/rmodbus/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/flipback/rmodbus/pulls/38/commits"},"statuses":{"href":"https://api.github.com/repos/flipback/rmodbus/statuses/419df2aa4305d39a094c215be21c719cfc2d29a3"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":3,"additions":35,"deletions":24,"changed_files":2}}