do not pass invalid commands coming from ws

This commit is contained in:
ha7ilm 2014-12-02 00:55:30 +01:00
parent dc28a1b803
commit 7b680a8ed3

View File

@ -300,12 +300,12 @@ class WebRXHandler(BaseHTTPRequestHandler):
param_name, param_value = pair.split("=") param_name, param_value = pair.split("=")
if param_name == "low_cut" and -filter_limit <= float(param_value) <= filter_limit: if param_name == "low_cut" and -filter_limit <= float(param_value) <= filter_limit:
bpf_set=True bpf_set=True
new_bpf[0]=param_value new_bpf[0]=int(param_value)
elif param_name == "high_cut" and -filter_limit <= float(param_value) <= filter_limit: elif param_name == "high_cut" and -filter_limit <= float(param_value) <= filter_limit:
bpf_set=True bpf_set=True
new_bpf[1]=param_value new_bpf[1]=int(param_value)
elif param_name == "offset_freq" and -cfg.samp_rate/2 <= float(param_value) <= cfg.samp_rate/2: elif param_name == "offset_freq" and -cfg.samp_rate/2 <= float(param_value) <= cfg.samp_rate/2:
dsp.set_offset_freq(param_value) dsp.set_offset_freq(int(param_value))
elif param_name=="mod": elif param_name=="mod":
dsp.stop() dsp.stop()
dsp.set_demodulator(param_value) dsp.set_demodulator(param_value)