{"action":"opened","issue":{"url":"https://api.github.com/repos/gary-rowe/hid4java/issues/41","repository_url":"https://api.github.com/repos/gary-rowe/hid4java","labels_url":"https://api.github.com/repos/gary-rowe/hid4java/issues/41/labels{/name}","comments_url":"https://api.github.com/repos/gary-rowe/hid4java/issues/41/comments","events_url":"https://api.github.com/repos/gary-rowe/hid4java/issues/41/events","html_url":"https://github.com/gary-rowe/hid4java/issues/41","id":155523322,"number":41,"title":"1-byte Reports do not get written correctly","user":{"login":"StefanKrupop","id":12464991,"avatar_url":"https://avatars.githubusercontent.com/u/12464991?v=3","gravatar_id":"","url":"https://api.github.com/users/StefanKrupop","html_url":"https://github.com/StefanKrupop","followers_url":"https://api.github.com/users/StefanKrupop/followers","following_url":"https://api.github.com/users/StefanKrupop/following{/other_user}","gists_url":"https://api.github.com/users/StefanKrupop/gists{/gist_id}","starred_url":"https://api.github.com/users/StefanKrupop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StefanKrupop/subscriptions","organizations_url":"https://api.github.com/users/StefanKrupop/orgs","repos_url":"https://api.github.com/users/StefanKrupop/repos","events_url":"https://api.github.com/users/StefanKrupop/events{/privacy}","received_events_url":"https://api.github.com/users/StefanKrupop/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-18T14:56:48Z","updated_at":"2016-05-18T14:56:48Z","closed_at":null,"body":"I think there is an off-by-one error in the \"write\" method of org.hid4java.jna.HidApi:\r\n\r\nThe JavaDoc says the Report data should not include the Report ID. It will get prepended to the data automatically.\r\nHowever, both the Windows- and regular code path execute the arraycopy only if the data length is larger than 1. Thus, a 1-byte Report gets written out, but not including the supplied data...\r\nI think it should be \"if (len >= 1) {\".\r\n\r\nKind regards,\r\nStefan"}}