]>
git.zerfleddert.de Git - rigol/blob - scope.c
3152243733ee7f1869ff4f35ebdf388a11c5aa00
9 /* Just USB for now... */
10 int sendscpi(struct scope
* sc
, char* cmd
, unsigned char *resp
, int resplen
)
12 return usbtmc_sendscpi(sc
->usbdev
, cmd
, resp
, resplen
);
15 void closescope(struct scope
* sc
)
17 return usbtmc_close(sc
->usbdev
);
20 void claimscope(struct scope
* sc
)
22 return usbtmc_claim(sc
->usbdev
);
25 void releasescope(struct scope
* sc
)
27 //Disable keylock, so the user doesn't have to press the 'force'-button
28 sendscpi(sc
, ":KEY:LOCK DISABLE",NULL
,0);
29 return usbtmc_release(sc
->usbdev
);
32 struct scope
* initscope(void)
34 struct usb_dev_handle
*usbdev
;
37 usbdev
= usbtmc_initscope();
42 sc
= calloc(1, sizeof(struct scope
));
51 sendscpi(sc
, "*IDN?", (unsigned char*)sc
->idn
, sizeof(sc
->idn
));
54 printf("Scope found (%s)\n", sc
->idn
);
59 char *scope_idn(struct scope
*sc
)