misc
This commit is contained in:
parent
6eb37b989f
commit
bd627d77b7
@ -144,7 +144,7 @@ class WebSocketMessageHandler(object):
|
|||||||
if message["type"] == "config":
|
if message["type"] == "config":
|
||||||
for key, value in message["params"].items():
|
for key, value in message["params"].items():
|
||||||
# only the keys in the protected property manager can be overridden from the web
|
# only the keys in the protected property manager can be overridden from the web
|
||||||
protected = pm.collect("samp_rate", "center_freq", "rf_gain")
|
protected = pm.collect("samp_rate", "center_freq", "rf_gain", "rtl_type")
|
||||||
protected[key] = value
|
protected[key] = value
|
||||||
|
|
||||||
except json.JSONDecodeError:
|
except json.JSONDecodeError:
|
||||||
|
@ -29,7 +29,8 @@ class WebSocketConnection(object):
|
|||||||
def send(self, data):
|
def send(self, data):
|
||||||
# convenience
|
# convenience
|
||||||
if (type(data) == dict):
|
if (type(data) == dict):
|
||||||
data = json.dumps(data)
|
# allow_nan = False disallows NaN and Infinty to be encoded. Browser JSON will not parse them anyway.
|
||||||
|
data = json.dumps(data, allow_nan = False)
|
||||||
|
|
||||||
# string-type messages are sent as text frames
|
# string-type messages are sent as text frames
|
||||||
if (type(data) == str):
|
if (type(data) == str):
|
||||||
|
Loading…
Reference in New Issue
Block a user