X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/rigol/blobdiff_plain/1574729632acebdcdf8caa025dcb67c6ac3804fc..8e60ee60c04ec12ceac8f3cbc04cebe7a9c1efd8:/rigold.c?ds=sidebyside diff --git a/rigold.c b/rigold.c index d8e4b19..955975a 100644 --- a/rigold.c +++ b/rigold.c @@ -192,6 +192,16 @@ static void serve_index(int s, struct scope *sc, char *param) sc->status.timebase.scale, sc->status.timebase.format); + send_text(s, "
Math: Math Displayed: %d, FFT Displayed: %d
\n", + sc->status.math.displayed, + sc->status.fft.displayed); + + send_text(s, "
Data: "); + send_text(s, "Channel 1 "); + send_text(s, "Channel 2 "); + send_text(s, "Digital "); + send_text(s, "Math "); + send_text(s, "FFT
"); send_text(s, "
\n"); send_text(s, "
\n"); @@ -246,6 +256,28 @@ static void serve_lcd(int s, struct scope *sc) free(png); } +static void serve_data(int s, struct scope *sc, char *source) +{ + char *data; + int len; + int i; + + send_text(s, "HTTP/1.0 200 OK\n"); + send_text(s, "Content-type: text/plain\n\n"); + + claimscope(sc); + data = scope_get_data(sc, source, &len); + releasescope(sc); + + if (data != NULL) { + for (i = 0; i < (len-1); i++) { + send_text(s, "%d,", data[i]); + } + send_text(s, "%d", data[len-1]); + free(data); + } +} + static void serve_404(int s) { send_text(s, "HTTP/1.0 404 Not found\n"); @@ -346,6 +378,8 @@ static void parse_request(int s, struct scope *sc) serve_index(s, sc, param); } else if (strcmp("/cgi-bin/lcd", file) == 0) { serve_lcd(s, sc); + } else if (strcmp("/cgi-bin/data", file) == 0) { + serve_data(s, sc, param); } else { serve_404(s); }