]>
git.zerfleddert.de Git - rigol/blob - scope.c
806ba3475ca2f417479df1272c6180d29a9e285d
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();
40 printf("No scope found.\n");
44 sc
= calloc(1, sizeof(struct scope
));
53 sendscpi(sc
, "*IDN?", (unsigned char*)sc
->idn
, sizeof(sc
->idn
));
56 printf("Scope found (%s)\n", sc
->idn
);
61 char *scope_idn(struct scope
*sc
)