X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/rigol/blobdiff_plain/121b4233e9098232769fb8844cf4caba8a5a5194..c399a4575976d9f60f2fa8b70939413c9afdf3ae:/usbtmc.c diff --git a/usbtmc.c b/usbtmc.c index 419d100..85842ec 100644 --- a/usbtmc.c +++ b/usbtmc.c @@ -47,8 +47,8 @@ static struct scope* usbtmc_find_scope() { /* TODO: FIXME */ sc->usb.brokenRigol = 1; - sc->usb.ep_bulk_out = 1; - sc->usb.ep_bulk_in = 2; + sc->usb.ep_bulk_out = 0x01; + sc->usb.ep_bulk_in = 0x82; sc->usb.wMaxPacketSize_in = 0x40; return sc; @@ -215,7 +215,7 @@ void usbtmc_release(struct scope *sc) //Initialize the scope. struct scope* usbtmc_initscope(void) { int r; - unsigned char buff[10]; + uint32_t vidpid; struct scope *sc; /* Init libusb */ @@ -229,7 +229,7 @@ struct scope* usbtmc_initscope(void) { usbtmc_claim(sc); /* The following code isn't really necessary, the program works OK without it too. */ - r=usb_control_msg(sc->usb.dev, 0xC8, 9, 0, 0, (char*)buff, 4, USB_TIMEOUT); + r=usb_control_msg(sc->usb.dev, 0xC8, 9, 0, 0, (char*)&vidpid, 4, USB_TIMEOUT); usbtmc_release(sc); if (r < 0) { fprintf (stderr, "Error %d sending init message: %s\n", @@ -237,8 +237,8 @@ struct scope* usbtmc_initscope(void) { fprintf (stderr, "Do you have permission on the USB device?\n"); exit (1); } - if (LE32((*(uint32_t*)buff))!=0x40005dc) { - fprintf(stderr,"Init: buff[%i]=%x\n",r,LE32((*(uint32_t*)buff))); + if (LE32(vidpid)!=0x40005dc) { + fprintf(stderr,"Init: buff[%i]=%x\n",r,LE32(vidpid)); } return sc; }