Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <libusb.h>
- #include <assert.h>
- #include <stdio.h>
- #include <string.h>
- int main()
- {
- libusb_init(NULL);
- libusb_device_handle *handle;
- assert(handle = libusb_open_device_with_vid_pid(NULL, 0x0483, 0x5740));
- assert(libusb_claim_interface(handle, 0));
- char request[] = "Test", response[8];
- memset(response, 0, sizeof(response));
- int transferred;
- libusb_bulk_transfer(handle, 0x01, request, sizeof(request), &transferred, 0);
- libusb_bulk_transfer(handle, 0x82, response, sizeof(response), &transferred, 0);
- printf("Response=%s\n", response);
- libusb_close(handle);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement