send a log message to the client when a device fails
This commit is contained in:
parent
46b5e9034f
commit
11cfca5211
@ -1142,6 +1142,9 @@ function on_ws_recv(evt) {
|
||||
case 'secondary_demod':
|
||||
secondary_demod_push_data(json['value']);
|
||||
break;
|
||||
case 'log_message':
|
||||
divlog(json['value'], true);
|
||||
break;
|
||||
default:
|
||||
console.warn('received message of unknown type: ' + json['type']);
|
||||
}
|
||||
|
@ -185,7 +185,9 @@ class OpenWebRxReceiverClient(Client):
|
||||
self.startDsp()
|
||||
|
||||
# keep trying until we find a suitable SDR
|
||||
if self.sdr.getState() != SdrSource.STATE_FAILED:
|
||||
if self.sdr.getState() == SdrSource.STATE_FAILED:
|
||||
self.write_log_message("SDR device \"{0}\" has failed, selecting new device".format(self.sdr.getName()))
|
||||
else:
|
||||
break
|
||||
|
||||
# send initial config
|
||||
@ -308,6 +310,9 @@ class OpenWebRxReceiverClient(Client):
|
||||
def write_aprs_data(self, data):
|
||||
self.send({"type": "aprs_data", "value": data})
|
||||
|
||||
def write_log_message(self, message):
|
||||
self.send({"type": "log_message", "value": message})
|
||||
|
||||
def write_sdr_error(self, message):
|
||||
self.send({"type": "sdr_error", "value": message})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user