]> git.zerfleddert.de Git - rigol/blobdiff - rigol.c
unlock keyboard on release
[rigol] / rigol.c
diff --git a/rigol.c b/rigol.c
index 22a5ceac242f798215b7eaf0003200f5a1c83b68..3386fbfd46527fa4854afe5184e162a1085c3db6 100644 (file)
--- a/rigol.c
+++ b/rigol.c
@@ -104,6 +104,7 @@ int main(int argc, char **argv)
 
        //Initialize scope
        sc = usbtmc_initscope();
+       usbtmc_claim(sc);
        buff = malloc (1024*1024); 
        if (buff == NULL) {
                perror("malloc");
@@ -135,11 +136,15 @@ int main(int argc, char **argv)
                        continue;
                }
                if (strncmp (scpi, "databuf", 7) == 0) {
-                       do_get_buf (sc);
+                       do_get_buf(sc);
                        continue;
                }
                if (strncmp (scpi, "screen", 6) == 0) {
-                       do_get_screen (sc);
+                       do_get_screen(sc);
+                       continue;
+               }
+               if (strncmp (scpi, "display", 7) == 0) {
+                       do_display_screen(sc);
                        continue;
                }
 
@@ -158,11 +163,7 @@ int main(int argc, char **argv)
                }
                free (scpi);
        }
-       //Disable keylock, so the user doesn't have to press the 'force'-button
-       l=usbtmc_sendscpi(sc, ":KEY:LOCK DISABLE",NULL,0); 
-
-       //Free up and exit
-       usb_release_interface(sc,0);
-       usb_close(sc);
+       usbtmc_release(sc);
+       usbtmc_close(sc);
        return 0;
 }
Impressum, Datenschutz