]>
git.zerfleddert.de Git - rigol/blob - scope.c
862f32b396e1d93007ec084b6718d445dd03ad4a
10 /* Just USB for now... */
11 int sendscpi(struct scope
* sc
, char* cmd
, unsigned char *resp
, int resplen
)
13 return usbtmc_sendscpi(sc
->usbdev
, cmd
, resp
, resplen
);
16 void closescope(struct scope
* sc
)
18 return usbtmc_close(sc
->usbdev
);
21 void claimscope(struct scope
* sc
)
23 return usbtmc_claim(sc
->usbdev
);
26 void releasescope(struct scope
* sc
)
28 //Disable keylock, so the user doesn't have to press the 'force'-button
29 sendscpi(sc
, ":KEY:LOCK DISABLE",NULL
,0);
30 return usbtmc_release(sc
->usbdev
);
33 struct scope
* initscope(void)
35 struct usb_dev_handle
*usbdev
;
38 usbdev
= usbtmc_initscope();
41 printf("No scope found.\n");
45 sc
= calloc(1, sizeof(struct scope
));
54 sendscpi(sc
, "*IDN?", (unsigned char*)sc
->idn
, sizeof(sc
->idn
));
57 printf("Scope found (%s)\n", sc
->idn
);
62 char *scope_idn(struct scope
*sc
)