Skip to content

Commit

Permalink
header: Clarify comment on hid_read() and hid_read_timeout()
Browse files Browse the repository at this point in the history
Clarify that a return value of zero means no packet was available.
  • Loading branch information
signal11 committed Nov 1, 2013
1 parent 40cf516 commit 1a42177
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hidapi/hidapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ extern "C" {
@returns
This function returns the actual number of bytes read and
-1 on error.
-1 on error. If no packet was available to be read within
the timeout period, this function returns 0.
*/
int HID_API_EXPORT HID_API_CALL hid_read_timeout(hid_device *dev, unsigned char *data, size_t length, int milliseconds);

Expand All @@ -237,7 +238,8 @@ extern "C" {
@returns
This function returns the actual number of bytes read and
-1 on error.
-1 on error. If no packet was available to be read and
the handle is in non-blocking mode, this function returns 0.
*/
int HID_API_EXPORT HID_API_CALL hid_read(hid_device *device, unsigned char *data, size_t length);

Expand Down

0 comments on commit 1a42177

Please sign in to comment.