mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
read config after hot reload
This commit is contained in:
parent
e1bb03f4d9
commit
6670f36ad8
6 changed files with 12 additions and 8 deletions
|
@ -29,6 +29,8 @@ export const settingsStore = reactive({
|
||||||
tuning_range_fmin: 0,
|
tuning_range_fmin: 0,
|
||||||
tx_delay: 0,
|
tx_delay: 0,
|
||||||
beacon_interval: 0,
|
beacon_interval: 0,
|
||||||
|
enable_hamc: false,
|
||||||
|
enable_morse_identifier: false,
|
||||||
},
|
},
|
||||||
RADIO: {
|
RADIO: {
|
||||||
control: "disabled",
|
control: "disabled",
|
||||||
|
|
|
@ -66,8 +66,6 @@ class CONFIG:
|
||||||
'respond_to_cq': bool,
|
'respond_to_cq': bool,
|
||||||
'rx_buffer_size': int,
|
'rx_buffer_size': int,
|
||||||
'tx_delay': int,
|
'tx_delay': int,
|
||||||
'enable_hmac': bool,
|
|
||||||
'enable_morse_identifier': bool,
|
|
||||||
'beacon_interval': int,
|
'beacon_interval': int,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -315,7 +315,6 @@ class DATA:
|
||||||
while True:
|
while True:
|
||||||
|
|
||||||
data = self.data_queue_transmit.get()
|
data = self.data_queue_transmit.get()
|
||||||
print(data)
|
|
||||||
# if we are already in ARQ_STATE, or we're receiving codec2 traffic
|
# if we are already in ARQ_STATE, or we're receiving codec2 traffic
|
||||||
# let's wait with processing data
|
# let's wait with processing data
|
||||||
# this should avoid weird toggle states where both stations
|
# this should avoid weird toggle states where both stations
|
||||||
|
|
|
@ -100,7 +100,7 @@ def post_cqcqcq():
|
||||||
if request.method not in ['POST']:
|
if request.method not in ['POST']:
|
||||||
return api_response({"info": "endpoint for triggering a CQ via POST"})
|
return api_response({"info": "endpoint for triggering a CQ via POST"})
|
||||||
if app.states.is_modem_running:
|
if app.states.is_modem_running:
|
||||||
server_commands.cqcqcq()
|
server_commands.cqcqcq(request.json)
|
||||||
return api_response({"cmd": "cqcqcq"})
|
return api_response({"cmd": "cqcqcq"})
|
||||||
|
|
||||||
@app.route('/modem/beacon', methods=['POST'])
|
@app.route('/modem/beacon', methods=['POST'])
|
||||||
|
|
|
@ -3,12 +3,12 @@ import base64
|
||||||
import structlog
|
import structlog
|
||||||
log = structlog.get_logger("COMMANDS")
|
log = structlog.get_logger("COMMANDS")
|
||||||
|
|
||||||
def cqcqcq():
|
def cqcqcq(data):
|
||||||
try:
|
try:
|
||||||
DATA_QUEUE_TRANSMIT.put(["CQ"])
|
DATA_QUEUE_TRANSMIT.put(["CQ"])
|
||||||
return
|
return
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
log.warning("[CMD] error while transmiting CQ", e=err)
|
log.warning("[CMD] error while transmiting CQ", e=err, command=data)
|
||||||
|
|
||||||
def ping_ping(data):
|
def ping_ping(data):
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -13,8 +13,8 @@ class SM:
|
||||||
|
|
||||||
self.modem = False
|
self.modem = False
|
||||||
self.data_handler = False
|
self.data_handler = False
|
||||||
|
self.app = app
|
||||||
self.config = app.config_manager.read()
|
self.config = self.app.config_manager.read()
|
||||||
self.modem_events = app.modem_events
|
self.modem_events = app.modem_events
|
||||||
self.modem_fft = app.modem_fft
|
self.modem_fft = app.modem_fft
|
||||||
self.modem_service = app.modem_service
|
self.modem_service = app.modem_service
|
||||||
|
@ -53,7 +53,12 @@ class SM:
|
||||||
|
|
||||||
|
|
||||||
def start_modem(self):
|
def start_modem(self):
|
||||||
|
# read config
|
||||||
|
self.config = self.app.config_manager.read()
|
||||||
|
|
||||||
|
# test audio devices
|
||||||
audio_test = self.test_audio()
|
audio_test = self.test_audio()
|
||||||
|
|
||||||
if False not in audio_test and None not in audio_test and not self.states.is_modem_running:
|
if False not in audio_test and None not in audio_test and not self.states.is_modem_running:
|
||||||
self.log.info("starting modem....")
|
self.log.info("starting modem....")
|
||||||
self.modem = modem.RF(self.config, self.modem_events, self.modem_fft, self.modem_service, self.states)
|
self.modem = modem.RF(self.config, self.modem_events, self.modem_fft, self.modem_service, self.states)
|
||||||
|
|
Loading…
Reference in a new issue