-
Notifications
You must be signed in to change notification settings - Fork 89
ks: Add support for libusb communication #100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Marek Mojík <[email protected]>
cc @quic-jhugo |
(commenting before I actually have a look at the code) |
@@ -62,6 +52,7 @@ int main(int argc, char **argv) | |||
{"version", no_argument, 0, 'v'}, | |||
{"port", required_argument, 0, 'p'}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still listed as required, but the documentation changes above suggest that this PR is making it optional
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats the has_args
field, which states that the flag requires argument not that the flag itself is required
{ | ||
|
||
return write(qdl->fd, buf, len); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does removing these definitions not cause a compile error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These functions are defined in qdl.h
and already implemented in usb.c
, I edited the usb.c
implementation so that if the fd
field in qdl
struct is defined the file descriptor is used instead of libusb. This solution is not ideal, but its the best I could come up with without more extensive changes to the codebase, which seem pointless as only ks
uses file descriptors.
This patch adds support for libusb communication with devices in edl mode, while retaining the existing implementation using file descriptors. It's unclear to me if the file descriptor implementation is actively used by anyone (it doesn't work very well for me), so feedback on its usage and potential deletion is welcome.