1 /* This file is generated with usbsnoop2libusb.pl from a usbsnoop log file. */
2 /* Latest version of the script should be in http://iki.fi/lindi/usb/usbsnoop2libusb.pl */
10 #include "alphamote.h"
12 int main(int argc
, char **argv
) {
18 ret
= usb_get_descriptor(devh
, 0x0000001, 0x0000000, buf
, 0x0000012);
20 ret
= usb_get_descriptor(devh
, 0x0000002, 0x0000000, buf
, 0x0000009);
22 ret
= usb_get_descriptor(devh
, 0x0000002, 0x0000000, buf
, 0x0000027);
24 ret
= usb_release_interface(devh
, 0);
25 if (ret
!= 0) printf("failed to release interface before set_configuration: %d\n", ret
);
26 ret
= usb_set_configuration(devh
, 0x0000001);
27 ret
= usb_claim_interface(devh
, 0);
28 if (ret
!= 0) printf("claim after set_configuration failed with error %d\n", ret
);
29 ret
= usb_set_altinterface(devh
, 0);
31 // 9207: open up aperture
33 memcpy(buf
, "\x10\x00\x00\x00\x01\x00\x07\x92\x78\x00\x00\x00\x07\x50\x00\x00", 0x0000010);
34 ret
= usb_bulk_write(devh
, 0x00000001, buf
, 0x0000010, 1000);
36 memcpy(buf
, "\x0d\x00\x00\x00\x02\x00\x07\x92\x78\x00\x00\x00\xff", 0x000000d);
37 ret
= usb_bulk_write(devh
, 0x00000001, buf
, 0x000000d, 1000);
38 ret
= usb_release_interface(devh
, 0);
40 ret
= usb_close(devh
);