README: Add warning about writing data to HID products

In response to https://github.com/libusb/hidapi/issues/105
This commit is contained in:
Filip Kubicz
2019-10-18 09:33:10 +02:00
parent faaf22cba2
commit 1750cc8373

View File

@@ -68,12 +68,15 @@ which HIDAPI supports. Since it relies on a 3rd party library, building it
is optional but recommended because it is so useful when debugging hardware.
## What Does the API Look Like?
The API provides the the most commonly used HID functions including sending
and receiving of input, output, and feature reports. The sample program,
The API provides the most commonly used HID functions including sending
and receiving of input, output, and feature reports. The sample program,
which communicates with a heavily hacked up version of the Microchip USB
Generic HID sample looks like this (with error checking removed for
simplicity):
**Warning: Only run the code you understand, and only when it conforms to the
device spec. Writing data at random to your HID devices can break them.**
```c
#ifdef WIN32
#include <windows.h>
@@ -139,6 +142,10 @@ int main(int argc, char* argv[])
}
```
You can also use [hidtest/hidtest.c](https://github.com/libusb/hidapi/blob/master/hidtest/hidtest.c)
as a starting point for your applications.
## License
HIDAPI may be used by one of three licenses as outlined in [LICENSE.txt](LICENSE.txt).