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 */
11 #include "alphamote.h"
13 void print_bytes(char *bytes
, int len
) {
16 for (i
=0; i
<len
; i
++) {
17 printf("%02x ", (int)((unsigned char)bytes
[i
]));
20 for (i
=0; i
<len
; i
++) {
21 printf("%c", isprint(bytes
[i
]) ? bytes
[i
] : '.');
28 int main(int argc
, char **argv
) {
36 memcpy(buf
, "\x10\x00\x00\x00\x01\x00\x07\x92\x0e\x05\x00\x00\xc7\xd2\x00\x00", 0x0000010);
37 ret
= usb_bulk_write(devh
, 0x00000001, buf
, 0x0000010, 1000);
38 printf("3982 bulk write returned %d, bytes: ", ret
);
39 print_bytes(buf
, ret
);
42 memcpy(buf
, "\x0e\x00\x00\x00\x02\x00\x07\x92\x0e\x05\x00\x00\x02\x00", 0x000000e);
43 ret
= usb_bulk_write(devh
, 0x00000001, buf
, 0x000000e, 1000);
44 printf("3983 bulk write returned %d, bytes: ", ret
);
45 print_bytes(buf
, ret
);
48 ret
= usb_bulk_read(devh
, 0x00000082, buf
, 0x0000200, 1030);
49 printf("3984 bulk read returned %d, bytes: ", ret
);
50 print_bytes(buf
, ret
);
53 memcpy(buf
, "\x0c\x00\x00\x00\x01\x00\x08\x92\x0f\x05\x00\x00", 0x000000c);
54 ret
= usb_bulk_write(devh
, 0x00000001, buf
, 0x000000c, 1000);
55 printf("3985 bulk write returned %d, bytes: ", ret
);
56 print_bytes(buf
, ret
);
59 ret
= usb_bulk_read(devh
, 0x00000082, buf
, 0x0000200, 1030);
60 printf("3986 bulk read returned %d, bytes: ", ret
);
61 print_bytes(buf
, ret
);
64 ret
= usb_bulk_read(devh
, 0x00000082, buf
, 0x0000200, 1030);
65 printf("3987 bulk read returned %d, bytes: ", ret
);
66 print_bytes(buf
, ret
);
70 memcpy(buf
, "\x10\x00\x00\x00\x01\x00\x07\x92\x10\x05\x00\x00\xc2\xd2\x00\x00", 0x0000010);
71 ret
= usb_bulk_write(devh
, 0x00000001, buf
, 0x0000010, 1000);
72 printf("3988 bulk write returned %d, bytes: ", ret
);
73 print_bytes(buf
, ret
);
76 memcpy(buf
, "\x0e\x00\x00\x00\x02\x00\x07\x92\x10\x05\x00\x00\x01\x00", 0x000000e);
77 ret
= usb_bulk_write(devh
, 0x00000001, buf
, 0x000000e, 1000);
78 printf("3989 bulk write returned %d, bytes: ", ret
);
79 print_bytes(buf
, ret
);
82 ret
= usb_bulk_read(devh
, 0x00000082, buf
, 0x0000200, 1030);
83 printf("3990 bulk read returned %d, bytes: ", ret
);
84 print_bytes(buf
, ret
);
87 memcpy(buf
, "\x10\x00\x00\x00\x01\x00\x07\x92\x11\x05\x00\x00\xc1\xd2\x00\x00", 0x0000010);
88 ret
= usb_bulk_write(devh
, 0x00000001, buf
, 0x0000010, 1000);
89 printf("3991 bulk write returned %d, bytes: ", ret
);
90 print_bytes(buf
, ret
);
93 memcpy(buf
, "\x0e\x00\x00\x00\x02\x00\x07\x92\x11\x05\x00\x00\x01\x00", 0x000000e);
94 ret
= usb_bulk_write(devh
, 0x00000001, buf
, 0x000000e, 1000);
95 printf("3992 bulk write returned %d, bytes: ", ret
);
96 print_bytes(buf
, ret
);
99 ret
= usb_bulk_read(devh
, 0x00000082, buf
, 0x0000200, 1030);
100 printf("3993 bulk read returned %d, bytes: ", ret
);
101 print_bytes(buf
, ret
);
105 ret
= usb_release_interface(devh
, 0);
107 ret
= usb_close(devh
);