diff --git a/op25/gr-op25_repeater/apps/http.py b/op25/gr-op25_repeater/apps/http.py
index 4a66596..9196005 100644
--- a/op25/gr-op25_repeater/apps/http.py
+++ b/op25/gr-op25_repeater/apps/http.py
@@ -67,8 +67,9 @@ def post_req(environ, start_response, postdata):
global my_input_q, my_output_q, my_recv_q, my_port
try:
data = json.loads(postdata)
- msg = gr.message().make_from_string(str(data['command']), -2, data['data'], 0)
- my_output_q.insert_tail(msg)
+ for d in data:
+ msg = gr.message().make_from_string(str(d['command']), -2, d['data'], 0)
+ my_output_q.insert_tail(msg)
time.sleep(0.2)
except:
sys.stderr.write('post_req: error processing input: %s:\n' % (postdata))
diff --git a/op25/gr-op25_repeater/www/www-static/index.html b/op25/gr-op25_repeater/www/www-static/index.html
index 75603db..b6c00bd 100644
--- a/op25/gr-op25_repeater/www/www-static/index.html
+++ b/op25/gr-op25_repeater/www/www-static/index.html
@@ -24,6 +24,9 @@
+
+
+
diff --git a/op25/gr-op25_repeater/www/www-static/main.js b/op25/gr-op25_repeater/www/www-static/main.js
index 2ad23cb..bf7d2ab 100644
--- a/op25/gr-op25_repeater/www/www-static/main.js
+++ b/op25/gr-op25_repeater/www/www-static/main.js
@@ -18,6 +18,22 @@
// Software Foundation, Inc., 51 Franklin Street, Boston, MA
// 02110-1301, USA.
+var d_debug = 1;
+
+var http_req = new XMLHttpRequest();
+var counter1 = 0;
+var error_val = null;
+var current_tgid = null;
+var send_busy = 0;
+var send_qfull = 0;
+var send_queue = [];
+var req_cb_count = 0;
+var request_count = 0;
+var nfinal_count = 0;
+var n200_count = 0;
+var r200_count = 0;
+var SEND_QLIMIT = 5;
+
function find_parent(ele, tagname) {
while (ele) {
if (ele.nodeName == tagname)
@@ -85,12 +101,6 @@ function f_select(command) {
nav_update(command);
}
-var http_req = new XMLHttpRequest();
-
-var counter1 = 0;
-var error_val = null;
-var current_tgid = null;
-
function is_digit(s) {
if (s >= "0" && s <= "9")
return true;
@@ -188,7 +198,7 @@ function trunk_update(d) {
html += "
";
}
if (error_val != null) {
- html += "
Frequency error: " + error_val + " Hz. (approx) ";
+ html += "
Frequency error: " + error_val + " Hz. (approx) ";
}
// system frequencies table
@@ -220,11 +230,17 @@ function trunk_update(d) {
function http_req_cb() {
+ req_cb_count += 1;
s = http_req.readyState;
- if (s != 4)
+ if (s != 4) {
+ nfinal_count += 1;
return;
- if (http_req.status != 200)
+ }
+ if (http_req.status != 200) {
+ n200_count += 1;
return;
+ }
+ r200_count += 1;
var dl = JSON.parse(http_req.responseText);
var dispatch = {'trunk_update': trunk_update, 'change_freq': change_freq, 'rx_update': rx_update}
for (var i=0; i
= SEND_QLIMIT) {
+ send_qfull += 1;
+ send_queue.unshift();
+ }
+ send_queue.push( {"command": command, "data": data} );
+ send_process();
+}
+
+function send_process() {
s = http_req.readyState;
if (s != 0 && s != 4) {
+ send_busy += 1;
return;
}
http_req.open("POST", "/");
http_req.onreadystatechange = http_req_cb;
http_req.setRequestHeader("Content-type", "application/json");
- cmd = JSON.stringify( {"command": command, "data": data} );
+ cmd = JSON.stringify( send_queue );
+ send_queue = [];
http_req.send(cmd);
}
@@ -267,3 +296,19 @@ function f_scan_button(command) {
else
send_command(command, current_tgid);
}
+
+function f_debug() {
+ if (!d_debug) return;
+ var html = "busy " + send_busy;
+ html += " qfull " + send_qfull;
+ html += " sendq size " + send_queue.length;
+ html += " requests " + request_count;
+ html += "
callbacks:";
+ html += " total=" + req_cb_count;
+ html += " incomplete=" + nfinal_count;
+ html += " error=" + n200_count;
+ html += " OK=" + r200_count;
+ html += "
";
+ var div_debug = document.getElementById("div_debug");
+ div_debug.innerHTML = html;
+}