move usb_close to usbtmc, fix memory leak
[rigol] / usbtmc.c
index 483014f58e51fa7de953e717323204bd791772cb..d652494ffe39ffa60d71f75a29e4142daa11b3e6 100644 (file)
--- a/usbtmc.c
+++ b/usbtmc.c
@@ -129,8 +129,15 @@ usb_dev_handle* usbtmc_initscope(void) {
                fprintf (stderr, "Do you have permission on the USB device?\n");
                exit (1);
        }
-       if (chars2int(buff)!=0x40004dc) {
+       if (chars2int(buff)!=0x40005dc) {
                fprintf(stderr,"Init: buff[%i]=%x\n",r,chars2int(buff));
        }
        return dev;
 }
+
+void usbtmc_close(usb_dev_handle *sc)
+{
+       //Free up and exit
+       usb_release_interface(sc,0);
+       usb_close(sc);
+}
Impressum, Datenschutz