/* usb write */
printf("-> ");
hexdump(txbuf,size);
- usb_clear_halt(gh->handle,0x02);
+ if(usb_clear_halt(gh->handle,0x02))
+ perror("clear halt (out)");
ret=usb_bulk_write(gh->handle,0x02,txbuf,size,0);
if(ret<=0) {
perror("usb bulk write");
}
/* usb read */
- usb_clear_halt(gh->handle,0x81);
+ if(usb_clear_halt(gh->handle,0x81))
+ perror("clear halt (in)");
ret=usb_bulk_read(gh->handle,0x81,rxbuf,sizeof(rxbuf),0);
size=ret;
if(ret<=0) {
perror("usb bulk read");
return ret;
}
- printf("-> ");
+ printf("<- ");
hexdump(rxbuf,ret);
if(rxhdr->seq!=txhdr->seq)