C   7

usb-monitor.c

Guest on 14th May 2021 12:45:36 AM

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <assert.h>
  5. #include <signal.h>
  6. #include <ctype.h>
  7. #include <usb.h>
  8.  
  9. struct usb_dev_handle *devh;
  10.  
  11. void release_usb_device(int dummy) {
  12.     int ret;
  13.     ret = usb_release_interface(devh, 0);
  14.     if (!ret)
  15.     printf("failed to release interface: %d\n", ret);
  16.     usb_close(devh);
  17.     if (!ret)
  18.     printf("failed to close interface: %d\n", ret);
  19.     exit(1);
  20. }
  21.  
  22. void list_devices() {
  23.     struct usb_bus *bus;
  24.     for (bus = usb_get_busses(); bus; bus = bus->next) {
  25.     struct usb_device *dev;
  26.    
  27.     for (dev = bus->devices; dev; dev = dev->next)
  28.         printf("0x%04x 0x%04x\n",
  29.            dev->descriptor.idVendor,
  30.            dev->descriptor.idProduct);
  31.     }
  32. }    
  33.  
  34. struct usb_device *find_device(int vendor, int product) {
  35.     struct usb_bus *bus;
  36.    
  37.     for (bus = usb_get_busses(); bus; bus = bus->next) {
  38.     struct usb_device *dev;
  39.    
  40.     for (dev = bus->devices; dev; dev = dev->next) {
  41.         if (dev->descriptor.idVendor == vendor
  42.         && dev->descriptor.idProduct == product)
  43.         return dev;
  44.     }
  45.     }
  46.     return NULL;
  47. }
  48.  
  49. void print_bytes(char *bytes, int len) {
  50.     int i;
  51.     if (len > 0) {
  52.     for (i=0; i<len; i++) {
  53.         printf("%02x ", (int)((unsigned char)bytes[i]));
  54.     }
  55.     printf("\"");
  56.         for (i=0; i<len; i++) {
  57.         printf("%c", isprint(bytes[i]) ? bytes[i] : '.');
  58.         }
  59.         printf("\"");
  60.     }
  61. }
  62.  
  63.  
  64. int main(int argc, char **argv) {
  65.     int ret, vendor, product;
  66.     struct usb_device *dev;
  67.     char buf[65535];
  68.  
  69.     usb_init();
  70.     usb_set_debug(255);
  71.     usb_find_busses();
  72.     usb_find_devices();
  73.  
  74.     if (argc!=3) {
  75.     printf("usage: %s vendorID productID\n", argv[0]);
  76.     printf("ID numbers of currently attached devices:\n");
  77.     list_devices();
  78.     exit(1);
  79.     }
  80.     vendor = strtol(argv[1], NULL, 16);
  81.     product = strtol(argv[2], NULL, 16);
  82.     if (vendor <= 1 || product <= 1) {
  83.     printf("invalid vendor or product id\n");
  84.     exit(1);
  85.     }
  86.     dev = find_device(vendor, product);
  87.     assert(dev);
  88.  
  89.     devh = usb_open(dev);
  90.     assert(devh);
  91.    
  92.     signal(SIGTERM, release_usb_device);
  93.  
  94.     ret = usb_claim_interface(devh, 0);
  95.     if (ret != 0) {
  96.     printf("claim failed with error %d\n", ret);
  97.         exit(1);
  98.     }
  99.    
  100.     ret = usb_set_altinterface(devh, 0);
  101.     assert(ret >= 0);
  102.  
  103. // USAGE_PAGE (Monitor VESA Virtual Controls) 05 82
  104. // USAGE (Degauss) 09 01
  105. // COLLECTION (Application) A1 01
  106. // REPORT_ID (1) 85 01
  107.    
  108. // 0x81 interrupt
  109.    
  110.    
  111.    
  112. ret = usb_get_descriptor(devh, 0x0000001, 0x0000000, buf, 0x0000012);
  113. printf("1 get descriptor returned %d, bytes: ", ret);
  114. print_bytes(buf, ret);
  115. printf("\n");
  116. usleep(1*1000);
  117. ret = usb_get_descriptor(devh, 0x0000002, 0x0000000, buf, 0x0000009);
  118. printf("2 get descriptor returned %d, bytes: ", ret);
  119. print_bytes(buf, ret);
  120. printf("\n");
  121. usleep(1*1000);
  122. ret = usb_get_descriptor(devh, 0x0000002, 0x0000000, buf, 0x0000022);
  123. printf("3 get descriptor returned %d, bytes: ", ret);
  124. print_bytes(buf, ret);
  125. printf("\n");
  126. usleep(2*1000);
  127. ret = usb_set_configuration(devh, 0x0000001);
  128. printf("4 set configuration returned %d\n", ret);
  129. ret = usb_set_altinterface(devh, 0);
  130. printf("4 set alternate setting returned %d\n", ret);
  131. usleep(25*1000);
  132. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x000000a, 0x0000000, 0x0000000, buf, 0x0000000, 1000);
  133. printf("5 control msg returned %d, bytes: ", ret);
  134. print_bytes(buf, ret);
  135. printf("\n");
  136. usleep(1*1000);
  137. ret = usb_get_descriptor(devh, 0x0000022, 0x0000000, buf, 0x0000063);
  138. printf("6 get descriptor returned %d, bytes: ", ret);
  139. print_bytes(buf, ret);
  140. printf("\n");
  141. usleep(3*1000);
  142. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  143. printf("7 interrupt read returned %d, bytes: ", ret);
  144. print_bytes(buf, ret);
  145. printf("\n");
  146. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  147. printf("8 interrupt read returned %d, bytes: ", ret);
  148. print_bytes(buf, ret);
  149. printf("\n");
  150. usleep(2500*1000);
  151. memcpy(buf, "\x46\x0d\x4d\x6f\xf1\xcf\x11\x88", 0x0000008);
  152. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  153. printf("9 control msg returned %d, bytes: ", ret);
  154. print_bytes(buf, ret);
  155. printf("\n");
  156. usleep(133*1000);
  157. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  158. printf("10 interrupt read returned %d, bytes: ", ret);
  159. print_bytes(buf, ret);
  160. printf("\n");
  161. usleep(32*1000);
  162. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  163. printf("11 interrupt read returned %d, bytes: ", ret);
  164. print_bytes(buf, ret);
  165. printf("\n");
  166. usleep(32*1000);
  167. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  168. printf("12 interrupt read returned %d, bytes: ", ret);
  169. print_bytes(buf, ret);
  170. printf("\n");
  171. usleep(820*1000);
  172. memcpy(buf, "\x51\x31\x0d\x6f\xf1\xcf\x11\x88", 0x0000008);
  173. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  174. printf("13 control msg returned %d, bytes: ", ret);
  175. print_bytes(buf, ret);
  176. printf("\n");
  177. usleep(140*1000);
  178. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  179. printf("14 interrupt read returned %d, bytes: ", ret);
  180. print_bytes(buf, ret);
  181. printf("\n");
  182. usleep(96*1000);
  183. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  184. printf("15 interrupt read returned %d, bytes: ", ret);
  185. print_bytes(buf, ret);
  186. printf("\n");
  187. usleep(32*1000);
  188. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  189. printf("16 interrupt read returned %d, bytes: ", ret);
  190. print_bytes(buf, ret);
  191. printf("\n");
  192. usleep(32*1000);
  193. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  194. printf("17 interrupt read returned %d, bytes: ", ret);
  195. print_bytes(buf, ret);
  196. printf("\n");
  197. usleep(32*1000);
  198. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  199. printf("18 interrupt read returned %d, bytes: ", ret);
  200. print_bytes(buf, ret);
  201. printf("\n");
  202. usleep(32*1000);
  203. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  204. printf("19 interrupt read returned %d, bytes: ", ret);
  205. print_bytes(buf, ret);
  206. printf("\n");
  207. usleep(810*1000);
  208. memcpy(buf, "\x46\x0d\x4d\x6f\xf1\xcf\x11\x88", 0x0000008);
  209. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  210. printf("20 control msg returned %d, bytes: ", ret);
  211. print_bytes(buf, ret);
  212. printf("\n");
  213. usleep(119*1000);
  214. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  215. printf("21 interrupt read returned %d, bytes: ", ret);
  216. print_bytes(buf, ret);
  217. printf("\n");
  218. usleep(31*1000);
  219. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  220. printf("22 interrupt read returned %d, bytes: ", ret);
  221. print_bytes(buf, ret);
  222. printf("\n");
  223. usleep(33*1000);
  224. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  225. printf("23 interrupt read returned %d, bytes: ", ret);
  226. print_bytes(buf, ret);
  227. printf("\n");
  228. usleep(813*1000);
  229. memcpy(buf, "\x51\x31\x0d\x6f\xf1\xcf\x11\x88", 0x0000008);
  230. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  231. printf("24 control msg returned %d, bytes: ", ret);
  232. print_bytes(buf, ret);
  233. printf("\n");
  234. usleep(115*1000);
  235. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  236. printf("25 interrupt read returned %d, bytes: ", ret);
  237. print_bytes(buf, ret);
  238. printf("\n");
  239. usleep(128*1000);
  240. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  241. printf("26 interrupt read returned %d, bytes: ", ret);
  242. print_bytes(buf, ret);
  243. printf("\n");
  244. usleep(32*1000);
  245. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  246. printf("27 interrupt read returned %d, bytes: ", ret);
  247. print_bytes(buf, ret);
  248. printf("\n");
  249. usleep(32*1000);
  250. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  251. printf("28 interrupt read returned %d, bytes: ", ret);
  252. print_bytes(buf, ret);
  253. printf("\n");
  254. usleep(32*1000);
  255. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  256. printf("29 interrupt read returned %d, bytes: ", ret);
  257. print_bytes(buf, ret);
  258. printf("\n");
  259. usleep(32*1000);
  260. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  261. printf("30 interrupt read returned %d, bytes: ", ret);
  262. print_bytes(buf, ret);
  263. printf("\n");
  264. usleep(819*1000);
  265. memcpy(buf, "\x46\x0d\x4d\x6f\xf1\xcf\x11\x88", 0x0000008);
  266. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  267. printf("31 control msg returned %d, bytes: ", ret);
  268. print_bytes(buf, ret);
  269. printf("\n");
  270. usleep(109*1000);
  271. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  272. printf("32 interrupt read returned %d, bytes: ", ret);
  273. print_bytes(buf, ret);
  274. printf("\n");
  275. usleep(32*1000);
  276. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  277. printf("33 interrupt read returned %d, bytes: ", ret);
  278. print_bytes(buf, ret);
  279. printf("\n");
  280. usleep(32*1000);
  281. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  282. printf("34 interrupt read returned %d, bytes: ", ret);
  283. print_bytes(buf, ret);
  284. printf("\n");
  285. usleep(810*1000);
  286. memcpy(buf, "\x51\x31\x0d\x6f\xf1\xcf\x11\x88", 0x0000008);
  287. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  288. printf("35 control msg returned %d, bytes: ", ret);
  289. print_bytes(buf, ret);
  290. printf("\n");
  291. usleep(118*1000);
  292. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  293. printf("36 interrupt read returned %d, bytes: ", ret);
  294. print_bytes(buf, ret);
  295. printf("\n");
  296. usleep(96*1000);
  297. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  298. printf("37 interrupt read returned %d, bytes: ", ret);
  299. print_bytes(buf, ret);
  300. printf("\n");
  301. usleep(32*1000);
  302. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  303. printf("38 interrupt read returned %d, bytes: ", ret);
  304. print_bytes(buf, ret);
  305. printf("\n");
  306. usleep(64*1000);
  307. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  308. printf("39 interrupt read returned %d, bytes: ", ret);
  309. print_bytes(buf, ret);
  310. printf("\n");
  311. usleep(32*1000);
  312. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  313. printf("40 interrupt read returned %d, bytes: ", ret);
  314. print_bytes(buf, ret);
  315. printf("\n");
  316. usleep(32*1000);
  317. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  318. printf("41 interrupt read returned %d, bytes: ", ret);
  319. print_bytes(buf, ret);
  320. printf("\n");
  321. usleep(815*1000);
  322. memcpy(buf, "\x46\x0d\x4d\x6f\xf1\xcf\x11\x88", 0x0000008);
  323. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  324. printf("42 control msg returned %d, bytes: ", ret);
  325. print_bytes(buf, ret);
  326. printf("\n");
  327. usleep(114*1000);
  328. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  329. printf("43 interrupt read returned %d, bytes: ", ret);
  330. print_bytes(buf, ret);
  331. printf("\n");
  332. usleep(32*1000);
  333. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  334. printf("44 interrupt read returned %d, bytes: ", ret);
  335. print_bytes(buf, ret);
  336. printf("\n");
  337. usleep(32*1000);
  338. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  339. printf("45 interrupt read returned %d, bytes: ", ret);
  340. print_bytes(buf, ret);
  341. printf("\n");
  342. usleep(805*1000);
  343. memcpy(buf, "\x51\x31\x0d\x6f\xf1\xcf\x11\x88", 0x0000008);
  344. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  345. printf("46 control msg returned %d, bytes: ", ret);
  346. print_bytes(buf, ret);
  347. printf("\n");
  348. usleep(123*1000);
  349. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  350. printf("47 interrupt read returned %d, bytes: ", ret);
  351. print_bytes(buf, ret);
  352. printf("\n");
  353. usleep(96*1000);
  354. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  355. printf("48 interrupt read returned %d, bytes: ", ret);
  356. print_bytes(buf, ret);
  357. printf("\n");
  358. usleep(32*1000);
  359. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  360. printf("49 interrupt read returned %d, bytes: ", ret);
  361. print_bytes(buf, ret);
  362. printf("\n");
  363. usleep(32*1000);
  364. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  365. printf("50 interrupt read returned %d, bytes: ", ret);
  366. print_bytes(buf, ret);
  367. printf("\n");
  368. usleep(32*1000);
  369. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  370. printf("51 interrupt read returned %d, bytes: ", ret);
  371. print_bytes(buf, ret);
  372. printf("\n");
  373. usleep(32*1000);
  374. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  375. printf("52 interrupt read returned %d, bytes: ", ret);
  376. print_bytes(buf, ret);
  377. printf("\n");
  378. usleep(826*1000);
  379. memcpy(buf, "\x46\x0d\x4d\x6f\xf1\xcf\x11\x88", 0x0000008);
  380. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  381. printf("53 control msg returned %d, bytes: ", ret);
  382. print_bytes(buf, ret);
  383. printf("\n");
  384. usleep(134*1000);
  385. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  386. printf("54 interrupt read returned %d, bytes: ", ret);
  387. print_bytes(buf, ret);
  388. printf("\n");
  389. usleep(32*1000);
  390. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  391. printf("55 interrupt read returned %d, bytes: ", ret);
  392. print_bytes(buf, ret);
  393. printf("\n");
  394. usleep(32*1000);
  395. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  396. printf("56 interrupt read returned %d, bytes: ", ret);
  397. print_bytes(buf, ret);
  398. printf("\n");
  399. usleep(817*1000);
  400. memcpy(buf, "\x51\x31\x0d\x6f\xf1\xcf\x11\x88", 0x0000008);
  401. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  402. printf("57 control msg returned %d, bytes: ", ret);
  403. print_bytes(buf, ret);
  404. printf("\n");
  405. usleep(144*1000);
  406. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  407. printf("58 interrupt read returned %d, bytes: ", ret);
  408. print_bytes(buf, ret);
  409. printf("\n");
  410. usleep(96*1000);
  411. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  412. printf("59 interrupt read returned %d, bytes: ", ret);
  413. print_bytes(buf, ret);
  414. printf("\n");
  415. usleep(32*1000);
  416. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  417. printf("60 interrupt read returned %d, bytes: ", ret);
  418. print_bytes(buf, ret);
  419. printf("\n");
  420. usleep(32*1000);
  421. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  422. printf("61 interrupt read returned %d, bytes: ", ret);
  423. print_bytes(buf, ret);
  424. printf("\n");
  425. usleep(32*1000);
  426. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  427. printf("62 interrupt read returned %d, bytes: ", ret);
  428. print_bytes(buf, ret);
  429. printf("\n");
  430. usleep(32*1000);
  431. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  432. printf("63 interrupt read returned %d, bytes: ", ret);
  433. print_bytes(buf, ret);
  434. printf("\n");
  435. usleep(821*1000);
  436. memcpy(buf, "\x46\x0d\x4d\x6f\xf1\xcf\x11\x88", 0x0000008);
  437. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  438. printf("64 control msg returned %d, bytes: ", ret);
  439. print_bytes(buf, ret);
  440. printf("\n");
  441. usleep(107*1000);
  442. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  443. printf("65 interrupt read returned %d, bytes: ", ret);
  444. print_bytes(buf, ret);
  445. printf("\n");
  446. usleep(32*1000);
  447. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  448. printf("66 interrupt read returned %d, bytes: ", ret);
  449. print_bytes(buf, ret);
  450. printf("\n");
  451. usleep(32*1000);
  452. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  453. printf("67 interrupt read returned %d, bytes: ", ret);
  454. print_bytes(buf, ret);
  455. printf("\n");
  456. usleep(813*1000);
  457. memcpy(buf, "\x51\x31\x0d\x6f\xf1\xcf\x11\x88", 0x0000008);
  458. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  459. printf("68 control msg returned %d, bytes: ", ret);
  460. print_bytes(buf, ret);
  461. printf("\n");
  462. usleep(115*1000);
  463. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  464. printf("69 interrupt read returned %d, bytes: ", ret);
  465. print_bytes(buf, ret);
  466. printf("\n");
  467. usleep(128*1000);
  468. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  469. printf("70 interrupt read returned %d, bytes: ", ret);
  470. print_bytes(buf, ret);
  471. printf("\n");
  472. usleep(32*1000);
  473. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  474. printf("71 interrupt read returned %d, bytes: ", ret);
  475. print_bytes(buf, ret);
  476. printf("\n");
  477. usleep(32*1000);
  478. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  479. printf("72 interrupt read returned %d, bytes: ", ret);
  480. print_bytes(buf, ret);
  481. printf("\n");
  482. usleep(32*1000);
  483. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  484. printf("73 interrupt read returned %d, bytes: ", ret);
  485. print_bytes(buf, ret);
  486. printf("\n");
  487. usleep(32*1000);
  488. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  489. printf("74 interrupt read returned %d, bytes: ", ret);
  490. print_bytes(buf, ret);
  491. printf("\n");
  492. usleep(819*1000);
  493. memcpy(buf, "\x46\x0d\x4d\x6f\xf1\xcf\x11\x88", 0x0000008);
  494. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  495. printf("75 control msg returned %d, bytes: ", ret);
  496. print_bytes(buf, ret);
  497. printf("\n");
  498. usleep(110*1000);
  499. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  500. printf("76 interrupt read returned %d, bytes: ", ret);
  501. print_bytes(buf, ret);
  502. printf("\n");
  503. usleep(32*1000);
  504. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  505. printf("77 interrupt read returned %d, bytes: ", ret);
  506. print_bytes(buf, ret);
  507. printf("\n");
  508. usleep(32*1000);
  509. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  510. printf("78 interrupt read returned %d, bytes: ", ret);
  511. print_bytes(buf, ret);
  512. printf("\n");
  513. usleep(807*1000);
  514. memcpy(buf, "\x51\x31\x0d\x6f\xf1\xcf\x11\x88", 0x0000008);
  515. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  516. printf("79 control msg returned %d, bytes: ", ret);
  517. print_bytes(buf, ret);
  518. printf("\n");
  519. usleep(121*1000);
  520. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  521. printf("80 interrupt read returned %d, bytes: ", ret);
  522. print_bytes(buf, ret);
  523. printf("\n");
  524. usleep(96*1000);
  525. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  526. printf("81 interrupt read returned %d, bytes: ", ret);
  527. print_bytes(buf, ret);
  528. printf("\n");
  529. usleep(32*1000);
  530. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  531. printf("82 interrupt read returned %d, bytes: ", ret);
  532. print_bytes(buf, ret);
  533. printf("\n");
  534. usleep(32*1000);
  535. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  536. printf("83 interrupt read returned %d, bytes: ", ret);
  537. print_bytes(buf, ret);
  538. printf("\n");
  539. usleep(32*1000);
  540. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  541. printf("84 interrupt read returned %d, bytes: ", ret);
  542. print_bytes(buf, ret);
  543. printf("\n");
  544. usleep(32*1000);
  545. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  546. printf("85 interrupt read returned %d, bytes: ", ret);
  547. print_bytes(buf, ret);
  548. printf("\n");
  549. usleep(813*1000);
  550. memcpy(buf, "\x46\x0d\x4d\x6f\xf1\xcf\x11\x88", 0x0000008);
  551. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  552. printf("86 control msg returned %d, bytes: ", ret);
  553. print_bytes(buf, ret);
  554. printf("\n");
  555. usleep(115*1000);
  556. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  557. printf("87 interrupt read returned %d, bytes: ", ret);
  558. print_bytes(buf, ret);
  559. printf("\n");
  560. usleep(32*1000);
  561. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  562. printf("88 interrupt read returned %d, bytes: ", ret);
  563. print_bytes(buf, ret);
  564. printf("\n");
  565. usleep(32*1000);
  566. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  567. printf("89 interrupt read returned %d, bytes: ", ret);
  568. print_bytes(buf, ret);
  569. printf("\n");
  570. usleep(805*1000);
  571. memcpy(buf, "\x51\x31\x0d\x6f\xf1\xcf\x11\x88", 0x0000008);
  572. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  573. printf("90 control msg returned %d, bytes: ", ret);
  574. print_bytes(buf, ret);
  575. printf("\n");
  576. usleep(123*1000);
  577. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  578. printf("91 interrupt read returned %d, bytes: ", ret);
  579. print_bytes(buf, ret);
  580. printf("\n");
  581. usleep(96*1000);
  582. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  583. printf("92 interrupt read returned %d, bytes: ", ret);
  584. print_bytes(buf, ret);
  585. printf("\n");
  586. usleep(32*1000);
  587. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  588. printf("93 interrupt read returned %d, bytes: ", ret);
  589. print_bytes(buf, ret);
  590. printf("\n");
  591. usleep(32*1000);
  592. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  593. printf("94 interrupt read returned %d, bytes: ", ret);
  594. print_bytes(buf, ret);
  595. printf("\n");
  596. usleep(32*1000);
  597. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  598. printf("95 interrupt read returned %d, bytes: ", ret);
  599. print_bytes(buf, ret);
  600. printf("\n");
  601. usleep(32*1000);
  602. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  603. printf("96 interrupt read returned %d, bytes: ", ret);
  604. print_bytes(buf, ret);
  605. printf("\n");
  606. usleep(810*1000);
  607. memcpy(buf, "\x46\x0d\x4d\x6f\xf1\xcf\x11\x88", 0x0000008);
  608. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  609. printf("97 control msg returned %d, bytes: ", ret);
  610. print_bytes(buf, ret);
  611. printf("\n");
  612. usleep(119*1000);
  613. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  614. printf("98 interrupt read returned %d, bytes: ", ret);
  615. print_bytes(buf, ret);
  616. printf("\n");
  617. usleep(32*1000);
  618. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  619. printf("99 interrupt read returned %d, bytes: ", ret);
  620. print_bytes(buf, ret);
  621. printf("\n");
  622. usleep(32*1000);
  623. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  624. printf("100 interrupt read returned %d, bytes: ", ret);
  625. print_bytes(buf, ret);
  626. printf("\n");
  627. usleep(816*1000);
  628. memcpy(buf, "\x51\x31\x0d\x6f\xf1\xcf\x11\x88", 0x0000008);
  629. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  630. printf("101 control msg returned %d, bytes: ", ret);
  631. print_bytes(buf, ret);
  632. printf("\n");
  633. usleep(144*1000);
  634. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  635. printf("102 interrupt read returned %d, bytes: ", ret);
  636. print_bytes(buf, ret);
  637. printf("\n");
  638. usleep(96*1000);
  639. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  640. printf("103 interrupt read returned %d, bytes: ", ret);
  641. print_bytes(buf, ret);
  642. printf("\n");
  643. usleep(32*1000);
  644. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  645. printf("104 interrupt read returned %d, bytes: ", ret);
  646. print_bytes(buf, ret);
  647. printf("\n");
  648. usleep(32*1000);
  649. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  650. printf("105 interrupt read returned %d, bytes: ", ret);
  651. print_bytes(buf, ret);
  652. printf("\n");
  653. usleep(32*1000);
  654. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  655. printf("106 interrupt read returned %d, bytes: ", ret);
  656. print_bytes(buf, ret);
  657. printf("\n");
  658. usleep(32*1000);
  659. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  660. printf("107 interrupt read returned %d, bytes: ", ret);
  661. print_bytes(buf, ret);
  662. printf("\n");
  663. usleep(821*1000);
  664. memcpy(buf, "\x46\x0d\x4d\x6f\xf1\xcf\x11\x88", 0x0000008);
  665. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  666. printf("108 control msg returned %d, bytes: ", ret);
  667. print_bytes(buf, ret);
  668. printf("\n");
  669. usleep(107*1000);
  670. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  671. printf("109 interrupt read returned %d, bytes: ", ret);
  672. print_bytes(buf, ret);
  673. printf("\n");
  674. usleep(32*1000);
  675. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  676. printf("110 interrupt read returned %d, bytes: ", ret);
  677. print_bytes(buf, ret);
  678. printf("\n");
  679. usleep(32*1000);
  680. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  681. printf("111 interrupt read returned %d, bytes: ", ret);
  682. print_bytes(buf, ret);
  683. printf("\n");
  684. usleep(813*1000);
  685. memcpy(buf, "\x51\x31\x0d\x6f\xf1\xcf\x11\x88", 0x0000008);
  686. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  687. printf("112 control msg returned %d, bytes: ", ret);
  688. print_bytes(buf, ret);
  689. printf("\n");
  690. usleep(116*1000);
  691. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  692. printf("113 interrupt read returned %d, bytes: ", ret);
  693. print_bytes(buf, ret);
  694. printf("\n");
  695. usleep(128*1000);
  696. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  697. printf("114 interrupt read returned %d, bytes: ", ret);
  698. print_bytes(buf, ret);
  699. printf("\n");
  700. usleep(32*1000);
  701. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  702. printf("115 interrupt read returned %d, bytes: ", ret);
  703. print_bytes(buf, ret);
  704. printf("\n");
  705. usleep(32*1000);
  706. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  707. printf("116 interrupt read returned %d, bytes: ", ret);
  708. print_bytes(buf, ret);
  709. printf("\n");
  710. usleep(32*1000);
  711. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  712. printf("117 interrupt read returned %d, bytes: ", ret);
  713. print_bytes(buf, ret);
  714. printf("\n");
  715. usleep(32*1000);
  716. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  717. printf("118 interrupt read returned %d, bytes: ", ret);
  718. print_bytes(buf, ret);
  719. printf("\n");
  720. usleep(817*1000);
  721. memcpy(buf, "\x46\x0d\x4d\x6f\xf1\xcf\x11\x88", 0x0000008);
  722. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  723. printf("119 control msg returned %d, bytes: ", ret);
  724. print_bytes(buf, ret);
  725. printf("\n");
  726. usleep(111*1000);
  727. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  728. printf("120 interrupt read returned %d, bytes: ", ret);
  729. print_bytes(buf, ret);
  730. printf("\n");
  731. usleep(32*1000);
  732. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  733. printf("121 interrupt read returned %d, bytes: ", ret);
  734. print_bytes(buf, ret);
  735. printf("\n");
  736. usleep(32*1000);
  737. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  738. printf("122 interrupt read returned %d, bytes: ", ret);
  739. print_bytes(buf, ret);
  740. printf("\n");
  741. usleep(809*1000);
  742. memcpy(buf, "\x51\x31\x0d\x6f\xf1\xcf\x11\x88", 0x0000008);
  743. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  744. printf("123 control msg returned %d, bytes: ", ret);
  745. print_bytes(buf, ret);
  746. printf("\n");
  747. usleep(119*1000);
  748. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  749. printf("124 interrupt read returned %d, bytes: ", ret);
  750. print_bytes(buf, ret);
  751. printf("\n");
  752. usleep(96*1000);
  753. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  754. printf("125 interrupt read returned %d, bytes: ", ret);
  755. print_bytes(buf, ret);
  756. printf("\n");
  757. usleep(32*1000);
  758. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  759. printf("126 interrupt read returned %d, bytes: ", ret);
  760. print_bytes(buf, ret);
  761. printf("\n");
  762. usleep(32*1000);
  763. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  764. printf("127 interrupt read returned %d, bytes: ", ret);
  765. print_bytes(buf, ret);
  766. printf("\n");
  767. usleep(32*1000);
  768. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  769. printf("128 interrupt read returned %d, bytes: ", ret);
  770. print_bytes(buf, ret);
  771. printf("\n");
  772. usleep(64*1000);
  773. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  774. printf("129 interrupt read returned %d, bytes: ", ret);
  775. print_bytes(buf, ret);
  776. printf("\n");
  777. usleep(813*1000);
  778. memcpy(buf, "\x46\x0d\x4d\x6f\xf1\xcf\x11\x88", 0x0000008);
  779. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  780. printf("130 control msg returned %d, bytes: ", ret);
  781. print_bytes(buf, ret);
  782. printf("\n");
  783. usleep(116*1000);
  784. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  785. printf("131 interrupt read returned %d, bytes: ", ret);
  786. print_bytes(buf, ret);
  787. printf("\n");
  788. usleep(32*1000);
  789. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  790. printf("132 interrupt read returned %d, bytes: ", ret);
  791. print_bytes(buf, ret);
  792. printf("\n");
  793. usleep(31*1000);
  794. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  795. printf("133 interrupt read returned %d, bytes: ", ret);
  796. print_bytes(buf, ret);
  797. printf("\n");
  798. usleep(805*1000);
  799. memcpy(buf, "\x51\x31\x0d\x6f\xf1\xcf\x11\x88", 0x0000008);
  800. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  801. printf("134 control msg returned %d, bytes: ", ret);
  802. print_bytes(buf, ret);
  803. printf("\n");
  804. usleep(124*1000);
  805. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  806. printf("135 interrupt read returned %d, bytes: ", ret);
  807. print_bytes(buf, ret);
  808. printf("\n");
  809. usleep(96*1000);
  810. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  811. printf("136 interrupt read returned %d, bytes: ", ret);
  812. print_bytes(buf, ret);
  813. printf("\n");
  814. usleep(32*1000);
  815. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  816. printf("137 interrupt read returned %d, bytes: ", ret);
  817. print_bytes(buf, ret);
  818. printf("\n");
  819. usleep(32*1000);
  820. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  821. printf("138 interrupt read returned %d, bytes: ", ret);
  822. print_bytes(buf, ret);
  823. printf("\n");
  824. usleep(32*1000);
  825. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  826. printf("139 interrupt read returned %d, bytes: ", ret);
  827. print_bytes(buf, ret);
  828. printf("\n");
  829. usleep(32*1000);
  830. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  831. printf("140 interrupt read returned %d, bytes: ", ret);
  832. print_bytes(buf, ret);
  833. printf("\n");
  834. usleep(811*1000);
  835. memcpy(buf, "\x46\x0d\x4d\x6f\xf1\xcf\x11\x88", 0x0000008);
  836. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  837. printf("141 control msg returned %d, bytes: ", ret);
  838. print_bytes(buf, ret);
  839. printf("\n");
  840. usleep(117*1000);
  841. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  842. printf("142 interrupt read returned %d, bytes: ", ret);
  843. print_bytes(buf, ret);
  844. printf("\n");
  845. usleep(32*1000);
  846. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  847. printf("143 interrupt read returned %d, bytes: ", ret);
  848. print_bytes(buf, ret);
  849. printf("\n");
  850. usleep(32*1000);
  851. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  852. printf("144 interrupt read returned %d, bytes: ", ret);
  853. print_bytes(buf, ret);
  854. printf("\n");
  855. usleep(816*1000);
  856. memcpy(buf, "\x51\x31\x0d\x6f\xf1\xcf\x11\x88", 0x0000008);
  857. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  858. printf("145 control msg returned %d, bytes: ", ret);
  859. print_bytes(buf, ret);
  860. printf("\n");
  861. usleep(112*1000);
  862. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  863. printf("146 interrupt read returned %d, bytes: ", ret);
  864. print_bytes(buf, ret);
  865. printf("\n");
  866. usleep(128*1000);
  867. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  868. printf("147 interrupt read returned %d, bytes: ", ret);
  869. print_bytes(buf, ret);
  870. printf("\n");
  871. usleep(32*1000);
  872. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  873. printf("148 interrupt read returned %d, bytes: ", ret);
  874. print_bytes(buf, ret);
  875. printf("\n");
  876. usleep(32*1000);
  877. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  878. printf("149 interrupt read returned %d, bytes: ", ret);
  879. print_bytes(buf, ret);
  880. printf("\n");
  881. usleep(32*1000);
  882. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  883. printf("150 interrupt read returned %d, bytes: ", ret);
  884. print_bytes(buf, ret);
  885. printf("\n");
  886. usleep(32*1000);
  887. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  888. printf("151 interrupt read returned %d, bytes: ", ret);
  889. print_bytes(buf, ret);
  890. printf("\n");
  891. usleep(821*1000);
  892. memcpy(buf, "\x46\x0d\x4d\x6f\xf1\xcf\x11\x88", 0x0000008);
  893. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  894. printf("152 control msg returned %d, bytes: ", ret);
  895. print_bytes(buf, ret);
  896. printf("\n");
  897. usleep(108*1000);
  898. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  899. printf("153 interrupt read returned %d, bytes: ", ret);
  900. print_bytes(buf, ret);
  901. printf("\n");
  902. usleep(32*1000);
  903. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  904. printf("154 interrupt read returned %d, bytes: ", ret);
  905. print_bytes(buf, ret);
  906. printf("\n");
  907. usleep(32*1000);
  908. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  909. printf("155 interrupt read returned %d, bytes: ", ret);
  910. print_bytes(buf, ret);
  911. printf("\n");
  912. usleep(812*1000);
  913. memcpy(buf, "\x51\x31\x0d\x6f\xf1\xcf\x11\x88", 0x0000008);
  914. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  915. printf("156 control msg returned %d, bytes: ", ret);
  916. print_bytes(buf, ret);
  917. printf("\n");
  918. usleep(116*1000);
  919. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  920. printf("157 interrupt read returned %d, bytes: ", ret);
  921. print_bytes(buf, ret);
  922. printf("\n");
  923. usleep(128*1000);
  924. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  925. printf("158 interrupt read returned %d, bytes: ", ret);
  926. print_bytes(buf, ret);
  927. printf("\n");
  928. usleep(32*1000);
  929. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  930. printf("159 interrupt read returned %d, bytes: ", ret);
  931. print_bytes(buf, ret);
  932. printf("\n");
  933. usleep(32*1000);
  934. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  935. printf("160 interrupt read returned %d, bytes: ", ret);
  936. print_bytes(buf, ret);
  937. printf("\n");
  938. usleep(32*1000);
  939. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  940. printf("161 interrupt read returned %d, bytes: ", ret);
  941. print_bytes(buf, ret);
  942. printf("\n");
  943. usleep(32*1000);
  944. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  945. printf("162 interrupt read returned %d, bytes: ", ret);
  946. print_bytes(buf, ret);
  947. printf("\n");
  948. usleep(833*1000);
  949. memcpy(buf, "\x46\x0d\x4d\x6f\xf1\xcf\x11\x88", 0x0000008);
  950. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  951. printf("163 control msg returned %d, bytes: ", ret);
  952. print_bytes(buf, ret);
  953. printf("\n");
  954. usleep(127*1000);
  955. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  956. printf("164 interrupt read returned %d, bytes: ", ret);
  957. print_bytes(buf, ret);
  958. printf("\n");
  959. usleep(32*1000);
  960. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  961. printf("165 interrupt read returned %d, bytes: ", ret);
  962. print_bytes(buf, ret);
  963. printf("\n");
  964. usleep(32*1000);
  965. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  966. printf("166 interrupt read returned %d, bytes: ", ret);
  967. print_bytes(buf, ret);
  968. printf("\n");
  969. usleep(807*1000);
  970. memcpy(buf, "\x51\x31\x0d\x6f\xf1\xcf\x11\x88", 0x0000008);
  971. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  972. printf("167 control msg returned %d, bytes: ", ret);
  973. print_bytes(buf, ret);
  974. printf("\n");
  975. usleep(122*1000);
  976. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  977. printf("168 interrupt read returned %d, bytes: ", ret);
  978. print_bytes(buf, ret);
  979. printf("\n");
  980. usleep(96*1000);
  981. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  982. printf("169 interrupt read returned %d, bytes: ", ret);
  983. print_bytes(buf, ret);
  984. printf("\n");
  985. usleep(32*1000);
  986. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  987. printf("170 interrupt read returned %d, bytes: ", ret);
  988. print_bytes(buf, ret);
  989. printf("\n");
  990. usleep(32*1000);
  991. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  992. printf("171 interrupt read returned %d, bytes: ", ret);
  993. print_bytes(buf, ret);
  994. printf("\n");
  995. usleep(32*1000);
  996. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  997. printf("172 interrupt read returned %d, bytes: ", ret);
  998. print_bytes(buf, ret);
  999. printf("\n");
  1000. usleep(32*1000);
  1001. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1002. printf("173 interrupt read returned %d, bytes: ", ret);
  1003. print_bytes(buf, ret);
  1004. printf("\n");
  1005. usleep(812*1000);
  1006. memcpy(buf, "\x46\x0d\x4d\x6f\xf1\xcf\x11\x88", 0x0000008);
  1007. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  1008. printf("174 control msg returned %d, bytes: ", ret);
  1009. print_bytes(buf, ret);
  1010. printf("\n");
  1011. usleep(116*1000);
  1012. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1013. printf("175 interrupt read returned %d, bytes: ", ret);
  1014. print_bytes(buf, ret);
  1015. printf("\n");
  1016. usleep(32*1000);
  1017. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1018. printf("176 interrupt read returned %d, bytes: ", ret);
  1019. print_bytes(buf, ret);
  1020. printf("\n");
  1021. usleep(32*1000);
  1022. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1023. printf("177 interrupt read returned %d, bytes: ", ret);
  1024. print_bytes(buf, ret);
  1025. printf("\n");
  1026. usleep(804*1000);
  1027. memcpy(buf, "\x51\x31\x0d\x6f\xf1\xcf\x11\x88", 0x0000008);
  1028. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  1029. printf("178 control msg returned %d, bytes: ", ret);
  1030. print_bytes(buf, ret);
  1031. printf("\n");
  1032. usleep(124*1000);
  1033. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1034. printf("179 interrupt read returned %d, bytes: ", ret);
  1035. print_bytes(buf, ret);
  1036. printf("\n");
  1037. usleep(96*1000);
  1038. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1039. printf("180 interrupt read returned %d, bytes: ", ret);
  1040. print_bytes(buf, ret);
  1041. printf("\n");
  1042. usleep(32*1000);
  1043. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1044. printf("181 interrupt read returned %d, bytes: ", ret);
  1045. print_bytes(buf, ret);
  1046. printf("\n");
  1047. usleep(32*1000);
  1048. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1049. printf("182 interrupt read returned %d, bytes: ", ret);
  1050. print_bytes(buf, ret);
  1051. printf("\n");
  1052. usleep(32*1000);
  1053. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1054. printf("183 interrupt read returned %d, bytes: ", ret);
  1055. print_bytes(buf, ret);
  1056. printf("\n");
  1057. usleep(32*1000);
  1058. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1059. printf("184 interrupt read returned %d, bytes: ", ret);
  1060. print_bytes(buf, ret);
  1061. printf("\n");
  1062. usleep(809*1000);
  1063. memcpy(buf, "\x46\x0d\x4d\x6f\xf1\xcf\x11\x88", 0x0000008);
  1064. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  1065. printf("185 control msg returned %d, bytes: ", ret);
  1066. print_bytes(buf, ret);
  1067. printf("\n");
  1068. usleep(119*1000);
  1069. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1070. printf("186 interrupt read returned %d, bytes: ", ret);
  1071. print_bytes(buf, ret);
  1072. printf("\n");
  1073. usleep(33*1000);
  1074. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1075. printf("187 interrupt read returned %d, bytes: ", ret);
  1076. print_bytes(buf, ret);
  1077. printf("\n");
  1078. usleep(31*1000);
  1079. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1080. printf("188 interrupt read returned %d, bytes: ", ret);
  1081. print_bytes(buf, ret);
  1082. printf("\n");
  1083. usleep(819*1000);
  1084. memcpy(buf, "\x51\x31\x0d\x6f\xf1\xcf\x11\x88", 0x0000008);
  1085. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  1086. printf("189 control msg returned %d, bytes: ", ret);
  1087. print_bytes(buf, ret);
  1088. printf("\n");
  1089. usleep(142*1000);
  1090. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1091. printf("190 interrupt read returned %d, bytes: ", ret);
  1092. print_bytes(buf, ret);
  1093. printf("\n");
  1094. usleep(96*1000);
  1095. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1096. printf("191 interrupt read returned %d, bytes: ", ret);
  1097. print_bytes(buf, ret);
  1098. printf("\n");
  1099. usleep(32*1000);
  1100. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1101. printf("192 interrupt read returned %d, bytes: ", ret);
  1102. print_bytes(buf, ret);
  1103. printf("\n");
  1104. usleep(32*1000);
  1105. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1106. printf("193 interrupt read returned %d, bytes: ", ret);
  1107. print_bytes(buf, ret);
  1108. printf("\n");
  1109. usleep(32*1000);
  1110. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1111. printf("194 interrupt read returned %d, bytes: ", ret);
  1112. print_bytes(buf, ret);
  1113. printf("\n");
  1114. usleep(32*1000);
  1115. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1116. printf("195 interrupt read returned %d, bytes: ", ret);
  1117. print_bytes(buf, ret);
  1118. printf("\n");
  1119. usleep(822*1000);
  1120. memcpy(buf, "\x46\x0d\x4d\x6f\xf1\xcf\x11\x88", 0x0000008);
  1121. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  1122. printf("196 control msg returned %d, bytes: ", ret);
  1123. print_bytes(buf, ret);
  1124. printf("\n");
  1125. usleep(106*1000);
  1126. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1127. printf("197 interrupt read returned %d, bytes: ", ret);
  1128. print_bytes(buf, ret);
  1129. printf("\n");
  1130. usleep(32*1000);
  1131. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1132. printf("198 interrupt read returned %d, bytes: ", ret);
  1133. print_bytes(buf, ret);
  1134. printf("\n");
  1135. usleep(32*1000);
  1136. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1137. printf("199 interrupt read returned %d, bytes: ", ret);
  1138. print_bytes(buf, ret);
  1139. printf("\n");
  1140. usleep(812*1000);
  1141. memcpy(buf, "\x51\x31\x0d\x6f\xf1\xcf\x11\x88", 0x0000008);
  1142. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  1143. printf("200 control msg returned %d, bytes: ", ret);
  1144. print_bytes(buf, ret);
  1145. printf("\n");
  1146. usleep(116*1000);
  1147. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1148. printf("201 interrupt read returned %d, bytes: ", ret);
  1149. print_bytes(buf, ret);
  1150. printf("\n");
  1151. usleep(128*1000);
  1152. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1153. printf("202 interrupt read returned %d, bytes: ", ret);
  1154. print_bytes(buf, ret);
  1155. printf("\n");
  1156. usleep(32*1000);
  1157. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1158. printf("203 interrupt read returned %d, bytes: ", ret);
  1159. print_bytes(buf, ret);
  1160. printf("\n");
  1161. usleep(32*1000);
  1162. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1163. printf("204 interrupt read returned %d, bytes: ", ret);
  1164. print_bytes(buf, ret);
  1165. printf("\n");
  1166. usleep(32*1000);
  1167. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1168. printf("205 interrupt read returned %d, bytes: ", ret);
  1169. print_bytes(buf, ret);
  1170. printf("\n");
  1171. usleep(32*1000);
  1172. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1173. printf("206 interrupt read returned %d, bytes: ", ret);
  1174. print_bytes(buf, ret);
  1175. printf("\n");
  1176. usleep(816*1000);
  1177. memcpy(buf, "\x46\x0d\x4d\x6f\xf1\xcf\x11\x88", 0x0000008);
  1178. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  1179. printf("207 control msg returned %d, bytes: ", ret);
  1180. print_bytes(buf, ret);
  1181. printf("\n");
  1182. usleep(113*1000);
  1183. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1184. printf("208 interrupt read returned %d, bytes: ", ret);
  1185. print_bytes(buf, ret);
  1186. printf("\n");
  1187. usleep(32*1000);
  1188. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1189. printf("209 interrupt read returned %d, bytes: ", ret);
  1190. print_bytes(buf, ret);
  1191. printf("\n");
  1192. usleep(32*1000);
  1193. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1194. printf("210 interrupt read returned %d, bytes: ", ret);
  1195. print_bytes(buf, ret);
  1196. printf("\n");
  1197. usleep(807*1000);
  1198. memcpy(buf, "\x51\x31\x0d\x6f\xf1\xcf\x11\x88", 0x0000008);
  1199. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  1200. printf("211 control msg returned %d, bytes: ", ret);
  1201. print_bytes(buf, ret);
  1202. printf("\n");
  1203. usleep(121*1000);
  1204. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1205. printf("212 interrupt read returned %d, bytes: ", ret);
  1206. print_bytes(buf, ret);
  1207. printf("\n");
  1208. usleep(96*1000);
  1209. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1210. printf("213 interrupt read returned %d, bytes: ", ret);
  1211. print_bytes(buf, ret);
  1212. printf("\n");
  1213. usleep(32*1000);
  1214. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1215. printf("214 interrupt read returned %d, bytes: ", ret);
  1216. print_bytes(buf, ret);
  1217. printf("\n");
  1218. usleep(32*1000);
  1219. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1220. printf("215 interrupt read returned %d, bytes: ", ret);
  1221. print_bytes(buf, ret);
  1222. printf("\n");
  1223. usleep(32*1000);
  1224. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1225. printf("216 interrupt read returned %d, bytes: ", ret);
  1226. print_bytes(buf, ret);
  1227. printf("\n");
  1228. usleep(32*1000);
  1229. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1230. printf("217 interrupt read returned %d, bytes: ", ret);
  1231. print_bytes(buf, ret);
  1232. printf("\n");
  1233. usleep(812*1000);
  1234. memcpy(buf, "\x46\x0d\x4d\x6f\xf1\xcf\x11\x88", 0x0000008);
  1235. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  1236. printf("218 control msg returned %d, bytes: ", ret);
  1237. print_bytes(buf, ret);
  1238. printf("\n");
  1239. usleep(116*1000);
  1240. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1241. printf("219 interrupt read returned %d, bytes: ", ret);
  1242. print_bytes(buf, ret);
  1243. printf("\n");
  1244. usleep(32*1000);
  1245. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1246. printf("220 interrupt read returned %d, bytes: ", ret);
  1247. print_bytes(buf, ret);
  1248. printf("\n");
  1249. usleep(32*1000);
  1250. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1251. printf("221 interrupt read returned %d, bytes: ", ret);
  1252. print_bytes(buf, ret);
  1253. printf("\n");
  1254. usleep(804*1000);
  1255. memcpy(buf, "\x51\x31\x0d\x6f\xf1\xcf\x11\x88", 0x0000008);
  1256. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  1257. printf("222 control msg returned %d, bytes: ", ret);
  1258. print_bytes(buf, ret);
  1259. printf("\n");
  1260. usleep(125*1000);
  1261. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1262. printf("223 interrupt read returned %d, bytes: ", ret);
  1263. print_bytes(buf, ret);
  1264. printf("\n");
  1265. usleep(96*1000);
  1266. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1267. printf("224 interrupt read returned %d, bytes: ", ret);
  1268. print_bytes(buf, ret);
  1269. printf("\n");
  1270. usleep(32*1000);
  1271. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1272. printf("225 interrupt read returned %d, bytes: ", ret);
  1273. print_bytes(buf, ret);
  1274. printf("\n");
  1275. usleep(32*1000);
  1276. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1277. printf("226 interrupt read returned %d, bytes: ", ret);
  1278. print_bytes(buf, ret);
  1279. printf("\n");
  1280. usleep(32*1000);
  1281. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1282. printf("227 interrupt read returned %d, bytes: ", ret);
  1283. print_bytes(buf, ret);
  1284. printf("\n");
  1285. usleep(32*1000);
  1286. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1287. printf("228 interrupt read returned %d, bytes: ", ret);
  1288. print_bytes(buf, ret);
  1289. printf("\n");
  1290. usleep(808*1000);
  1291. memcpy(buf, "\x46\x0d\x4d\x6f\xf1\xcf\x11\x88", 0x0000008);
  1292. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  1293. printf("229 control msg returned %d, bytes: ", ret);
  1294. print_bytes(buf, ret);
  1295. printf("\n");
  1296. usleep(120*1000);
  1297. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1298. printf("230 interrupt read returned %d, bytes: ", ret);
  1299. print_bytes(buf, ret);
  1300. printf("\n");
  1301. usleep(32*1000);
  1302. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1303. printf("231 interrupt read returned %d, bytes: ", ret);
  1304. print_bytes(buf, ret);
  1305. printf("\n");
  1306. usleep(32*1000);
  1307. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1308. printf("232 interrupt read returned %d, bytes: ", ret);
  1309. print_bytes(buf, ret);
  1310. printf("\n");
  1311. usleep(816*1000);
  1312. memcpy(buf, "\x51\x31\x0d\x6f\xf1\xcf\x11\x88", 0x0000008);
  1313. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  1314. printf("233 control msg returned %d, bytes: ", ret);
  1315. print_bytes(buf, ret);
  1316. printf("\n");
  1317. usleep(112*1000);
  1318. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1319. printf("234 interrupt read returned %d, bytes: ", ret);
  1320. print_bytes(buf, ret);
  1321. printf("\n");
  1322. usleep(128*1000);
  1323. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1324. printf("235 interrupt read returned %d, bytes: ", ret);
  1325. print_bytes(buf, ret);
  1326. printf("\n");
  1327. usleep(32*1000);
  1328. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1329. printf("236 interrupt read returned %d, bytes: ", ret);
  1330. print_bytes(buf, ret);
  1331. printf("\n");
  1332. usleep(32*1000);
  1333. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1334. printf("237 interrupt read returned %d, bytes: ", ret);
  1335. print_bytes(buf, ret);
  1336. printf("\n");
  1337. usleep(32*1000);
  1338. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1339. printf("238 interrupt read returned %d, bytes: ", ret);
  1340. print_bytes(buf, ret);
  1341. printf("\n");
  1342. usleep(32*1000);
  1343. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1344. printf("239 interrupt read returned %d, bytes: ", ret);
  1345. print_bytes(buf, ret);
  1346. printf("\n");
  1347. usleep(823*1000);
  1348. memcpy(buf, "\x46\x0d\x4d\x6f\xf1\xcf\x11\x88", 0x0000008);
  1349. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  1350. printf("240 control msg returned %d, bytes: ", ret);
  1351. print_bytes(buf, ret);
  1352. printf("\n");
  1353. usleep(105*1000);
  1354. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1355. printf("241 interrupt read returned %d, bytes: ", ret);
  1356. print_bytes(buf, ret);
  1357. printf("\n");
  1358. usleep(32*1000);
  1359. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1360. printf("242 interrupt read returned %d, bytes: ", ret);
  1361. print_bytes(buf, ret);
  1362. printf("\n");
  1363. usleep(32*1000);
  1364. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1365. printf("243 interrupt read returned %d, bytes: ", ret);
  1366. print_bytes(buf, ret);
  1367. printf("\n");
  1368. usleep(813*1000);
  1369. memcpy(buf, "\x51\x31\x0d\x6f\xf1\xcf\x11\x88", 0x0000008);
  1370. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  1371. printf("244 control msg returned %d, bytes: ", ret);
  1372. print_bytes(buf, ret);
  1373. printf("\n");
  1374. usleep(116*1000);
  1375. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1376. printf("245 interrupt read returned %d, bytes: ", ret);
  1377. print_bytes(buf, ret);
  1378. printf("\n");
  1379. usleep(128*1000);
  1380. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1381. printf("246 interrupt read returned %d, bytes: ", ret);
  1382. print_bytes(buf, ret);
  1383. printf("\n");
  1384. usleep(32*1000);
  1385. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1386. printf("247 interrupt read returned %d, bytes: ", ret);
  1387. print_bytes(buf, ret);
  1388. printf("\n");
  1389. usleep(32*1000);
  1390. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1391. printf("248 interrupt read returned %d, bytes: ", ret);
  1392. print_bytes(buf, ret);
  1393. printf("\n");
  1394. usleep(32*1000);
  1395. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1396. printf("249 interrupt read returned %d, bytes: ", ret);
  1397. print_bytes(buf, ret);
  1398. printf("\n");
  1399. usleep(32*1000);
  1400. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1401. printf("250 interrupt read returned %d, bytes: ", ret);
  1402. print_bytes(buf, ret);
  1403. printf("\n");
  1404. usleep(816*1000);
  1405. memcpy(buf, "\x46\x0d\x4d\x6f\xf1\xcf\x11\x88", 0x0000008);
  1406. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  1407. printf("251 control msg returned %d, bytes: ", ret);
  1408. print_bytes(buf, ret);
  1409. printf("\n");
  1410. usleep(112*1000);
  1411. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1412. printf("252 interrupt read returned %d, bytes: ", ret);
  1413. print_bytes(buf, ret);
  1414. printf("\n");
  1415. usleep(32*1000);
  1416. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1417. printf("253 interrupt read returned %d, bytes: ", ret);
  1418. print_bytes(buf, ret);
  1419. printf("\n");
  1420. usleep(32*1000);
  1421. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1422. printf("254 interrupt read returned %d, bytes: ", ret);
  1423. print_bytes(buf, ret);
  1424. printf("\n");
  1425. usleep(808*1000);
  1426. memcpy(buf, "\x51\x31\x0d\x6f\xf1\xcf\x11\x88", 0x0000008);
  1427. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  1428. printf("255 control msg returned %d, bytes: ", ret);
  1429. print_bytes(buf, ret);
  1430. printf("\n");
  1431. usleep(120*1000);
  1432. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1433. printf("256 interrupt read returned %d, bytes: ", ret);
  1434. print_bytes(buf, ret);
  1435. printf("\n");
  1436. usleep(96*1000);
  1437. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1438. printf("257 interrupt read returned %d, bytes: ", ret);
  1439. print_bytes(buf, ret);
  1440. printf("\n");
  1441. usleep(32*1000);
  1442. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1443. printf("258 interrupt read returned %d, bytes: ", ret);
  1444. print_bytes(buf, ret);
  1445. printf("\n");
  1446. usleep(32*1000);
  1447. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1448. printf("259 interrupt read returned %d, bytes: ", ret);
  1449. print_bytes(buf, ret);
  1450. printf("\n");
  1451. usleep(32*1000);
  1452. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1453. printf("260 interrupt read returned %d, bytes: ", ret);
  1454. print_bytes(buf, ret);
  1455. printf("\n");
  1456. usleep(32*1000);
  1457. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1458. printf("261 interrupt read returned %d, bytes: ", ret);
  1459. print_bytes(buf, ret);
  1460. printf("\n");
  1461. usleep(860*1000);
  1462. memcpy(buf, "\x46\x0d\x4d\x6f\xf1\xcf\x11\x88", 0x0000008);
  1463. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  1464. printf("262 control msg returned %d, bytes: ", ret);
  1465. print_bytes(buf, ret);
  1466. printf("\n");
  1467. usleep(133*1000);
  1468. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1469. printf("263 interrupt read returned %d, bytes: ", ret);
  1470. print_bytes(buf, ret);
  1471. printf("\n");
  1472. usleep(32*1000);
  1473. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1474. printf("264 interrupt read returned %d, bytes: ", ret);
  1475. print_bytes(buf, ret);
  1476. printf("\n");
  1477. usleep(32*1000);
  1478. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1479. printf("265 interrupt read returned %d, bytes: ", ret);
  1480. print_bytes(buf, ret);
  1481. printf("\n");
  1482. usleep(803*1000);
  1483. memcpy(buf, "\x51\x31\x0d\x6f\xf1\xcf\x11\x88", 0x0000008);
  1484. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  1485. printf("266 control msg returned %d, bytes: ", ret);
  1486. print_bytes(buf, ret);
  1487. printf("\n");
  1488. usleep(125*1000);
  1489. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1490. printf("267 interrupt read returned %d, bytes: ", ret);
  1491. print_bytes(buf, ret);
  1492. printf("\n");
  1493. usleep(96*1000);
  1494. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1495. printf("268 interrupt read returned %d, bytes: ", ret);
  1496. print_bytes(buf, ret);
  1497. printf("\n");
  1498. usleep(32*1000);
  1499. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1500. printf("269 interrupt read returned %d, bytes: ", ret);
  1501. print_bytes(buf, ret);
  1502. printf("\n");
  1503. usleep(32*1000);
  1504. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1505. printf("270 interrupt read returned %d, bytes: ", ret);
  1506. print_bytes(buf, ret);
  1507. printf("\n");
  1508. usleep(32*1000);
  1509. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1510. printf("271 interrupt read returned %d, bytes: ", ret);
  1511. print_bytes(buf, ret);
  1512. printf("\n");
  1513. usleep(32*1000);
  1514. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1515. printf("272 interrupt read returned %d, bytes: ", ret);
  1516. print_bytes(buf, ret);
  1517. printf("\n");
  1518. usleep(810*1000);
  1519. memcpy(buf, "\x46\x0d\x4d\x6f\xf1\xcf\x11\x88", 0x0000008);
  1520. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  1521. printf("273 control msg returned %d, bytes: ", ret);
  1522. print_bytes(buf, ret);
  1523. printf("\n");
  1524. usleep(118*1000);
  1525. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1526. printf("274 interrupt read returned %d, bytes: ", ret);
  1527. print_bytes(buf, ret);
  1528. printf("\n");
  1529. usleep(32*1000);
  1530. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1531. printf("275 interrupt read returned %d, bytes: ", ret);
  1532. print_bytes(buf, ret);
  1533. printf("\n");
  1534. usleep(32*1000);
  1535. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1536. printf("276 interrupt read returned %d, bytes: ", ret);
  1537. print_bytes(buf, ret);
  1538. printf("\n");
  1539. usleep(815*1000);
  1540. memcpy(buf, "\x51\x31\x0d\x6f\xf1\xcf\x11\x88", 0x0000008);
  1541. ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
  1542. printf("277 control msg returned %d, bytes: ", ret);
  1543. print_bytes(buf, ret);
  1544. printf("\n");
  1545. usleep(114*1000);
  1546. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1547. printf("278 interrupt read returned %d, bytes: ", ret);
  1548. print_bytes(buf, ret);
  1549. printf("\n");
  1550. usleep(128*1000);
  1551. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1552. printf("279 interrupt read returned %d, bytes: ", ret);
  1553. print_bytes(buf, ret);
  1554. printf("\n");
  1555. usleep(32*1000);
  1556. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1557. printf("280 interrupt read returned %d, bytes: ", ret);
  1558. print_bytes(buf, ret);
  1559. printf("\n");
  1560. usleep(32*1000);
  1561. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1562. printf("281 interrupt read returned %d, bytes: ", ret);
  1563. print_bytes(buf, ret);
  1564. printf("\n");
  1565. usleep(32*1000);
  1566. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1567. printf("282 interrupt read returned %d, bytes: ", ret);
  1568. print_bytes(buf, ret);
  1569. printf("\n");
  1570. usleep(32*1000);
  1571. ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000008, 1000);
  1572. printf("283 interrupt read returned %d, bytes: ", ret);
  1573. print_bytes(buf, ret);
  1574. printf("\n");
  1575.     ret = usb_release_interface(devh, 0);
  1576.     assert(ret == 0);
  1577.     ret = usb_close(devh);
  1578.     assert(ret == 0);
  1579.     return 0;
  1580. }

Raw Paste


Login or Register to edit or fork this paste. It's free.