X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/rigol/blobdiff_plain/a8982973a30709b358876498572df8d2e96ef5cf..3df147113765d5a8ba192795d2be9b7e3e295749:/rigol.c diff --git a/rigol.c b/rigol.c index e7497ac..389253f 100644 --- a/rigol.c +++ b/rigol.c @@ -23,6 +23,8 @@ rmmod uhci_hcd; modprobe uhci_hcd #include #include +#include "png.h" + //This routine locates a scope by VID/PID and returns an opened handle to it. usb_dev_handle *find_scope() { @@ -304,8 +306,10 @@ void do_get_screen(struct usb_dev_handle *sc) unsigned char lut[256][3]; time_t lt; char filename[256]; + unsigned char *png; int i; int l; + int fd; FILE *fp; pid_t display; @@ -353,6 +357,12 @@ void do_get_screen(struct usb_dev_handle *sc) default: break; } + + strftime(filename, sizeof(filename), "screen_%Y%m%d-%H%M%S.png", localtime(<)); + fd=open(filename, O_CREAT|O_WRONLY, 0644); + png = lcd2png(screen, &i); + write(fd, png, i); + close(fd); } void child_reaper(int sig)