From 6c63684929a8d9a039968d2a0390a6ce4a276d2d Mon Sep 17 00:00:00 2001 From: mvoelkel Date: Tue, 28 Jun 2016 20:35:41 +0200 Subject: [PATCH] Stream and tuner status converted to ajax --- octoserve/http.c | 10 +-- octoserve/var/www/streamstatus.html | 116 ++++++++++++++----------- octoserve/var/www/tunerstatus.html | 127 +++++++++++++++------------- 3 files changed, 138 insertions(+), 115 deletions(-) diff --git a/octoserve/http.c b/octoserve/http.c index a7b6ad6..40083e5 100644 --- a/octoserve/http.c +++ b/octoserve/http.c @@ -373,10 +373,10 @@ void send_json_tunerstatus(struct os_ssdp *ss) sendstr(fd, "{\"Input\":\"%u\"", i); sendstr(fd, ",\"Status\":\"%s\"", fe->state ? "Active" : "Inactive"); sendstr(fd, ",\"Lock\":%s", fe->lock ? "true" : "false"); - sendstr(fd, ",\"Strength\":\"%d\"", fe->strength); - sendstr(fd, ",\"SNR\":\"%d\"", fe->snr); - sendstr(fd, ",\"Quality\":\"%u\"", fe->quality); - sendstr(fd, ",\"Level\":\"%u\"", fe->level); + sendstr(fd, ",\"Strength\":%d", fe->strength); + sendstr(fd, ",\"SNR\":%d", fe->snr); + sendstr(fd, ",\"Quality\":%u", fe->quality); + sendstr(fd, ",\"Level\":%u", fe->level); sendstr(fd, "}"); } sendstr(fd, "\r\n]}\r\n"); @@ -455,7 +455,7 @@ static void send_json_streamstatus(struct os_ssdp *ss) clock_gettime(CLOCK_MONOTONIC, &tp); gettimeofday(&tval, NULL); sendlen(fd, httpjson, sizeof(httpjson) - 1); - sendstr(fd, "{\"Timestamp\":%u,\r\n", (uint32_t) (tp.tv_sec * 1000 + tp.tv_nsec / 1000000)); + sendstr(fd, "{\"TimeStamp\":%u,\r\n", (uint32_t) (tp.tv_sec * 1000 + tp.tv_nsec / 1000000)); sendstr(fd, "\"StreamList\":[\r\n"); for (i = 0; i < MAX_STREAM; i++) { uint32_t ctrl = ddreg(dd, 0x400 + i*0x20); diff --git a/octoserve/var/www/streamstatus.html b/octoserve/var/www/streamstatus.html index 4fe059b..828d7da 100644 --- a/octoserve/var/www/streamstatus.html +++ b/octoserve/var/www/streamstatus.html @@ -1,4 +1,4 @@ - + @@ -7,13 +7,35 @@ - diff --git a/octoserve/var/www/tunerstatus.html b/octoserve/var/www/tunerstatus.html index 8952e00..087459e 100644 --- a/octoserve/var/www/tunerstatus.html +++ b/octoserve/var/www/tunerstatus.html @@ -1,4 +1,4 @@ - + @@ -7,58 +7,75 @@ - - - + + @@ -75,35 +92,25 @@ function renew()
- - - - - - - - + + + + + + + +
- Tuner - - Lock - - Strength - - Quality -
TunerLockStrengthSNRQuality