README: Add warning about writing data to HID products #106
No reviewers
Labels
No labels
3rdparty
Android
API
Author does not respond
bsd
bug
build system/CI
ci-virtual-device
CMake
Contributions Welcome
Core
dependencies
device-specific
documentation
don't_merge
duplicate
enhancement
Example
Haiku
hidraw
hotplug
info required
invalid
libusb
macOS
Misc
Not an issue
question
Release
Test
Test GUI
Windows
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-libusb/hidapi!106
Loading…
Reference in a new issue
No description provided.
Delete branch "sample-code-warning"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In response to https://github.com/libusb/hidapi/issues/105
@Youw @z3ntu @amosbird can you review?
@ -135,2 +139,4 @@hid_close(handle);// Finalize the hidapi libraryres = hid_exit();programsinstead ofprogrammes? I know it's a bit British vs American English but it's more fitting in this context.@ -68,12 +68,15 @@ which HIDAPI supports. Since it relies on a 3rd party library, building itis optional but recommended because it is so useful when debugging hardware.I would use *s instead of `s, so to make it bold because it looks a bit weird in this preformatted style.
This statement is a bit too strong - you may not nesessary control the FW, but safely write, e.g. if you have official spec, etc.
I was thinking, maybe add explicit check for dev/ven before hid_write in the example
@ -135,2 +139,4 @@hid_close(handle);// Finalize the hidapi libraryres = hid_exit();applications;)@ -68,12 +68,15 @@ which HIDAPI supports. Since it relies on a 3rd party library, building itis optional but recommended because it is so useful when debugging hardware.done
@Youw done.
I think that would be too much, since to write to the device in the sample you have to enumerate devices, check vid/pid and hardcode it to the sample. Or do you mean interactive check like with
gets()?I was thinking something like:
So we can include #14 and a little more, like explicitly encourage to
hid_closewhich is not in an example.Maybe this is a little too large change, but anyway nice to have.
@Youw thanks for your comments, I added
hid_close()call to the sample as you suggested, so this is now explicitly visible.and let's merge it after #115
@ -132,6 +135,9 @@ int main(int argc, char* argv[])for (i = 0; i < 4; i++)