From 1a42177fa5f3beddb8805cb676d50acbc5e8ed01 Mon Sep 17 00:00:00 2001 From: Alan Ott Date: Fri, 1 Nov 2013 09:38:31 -0400 Subject: [PATCH] header: Clarify comment on hid_read() and hid_read_timeout() Clarify that a return value of zero means no packet was available. --- hidapi/hidapi.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hidapi/hidapi.h b/hidapi/hidapi.h index 6faf186..5730f86 100644 --- a/hidapi/hidapi.h +++ b/hidapi/hidapi.h @@ -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); @@ -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);