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
|
@ -29,6 +29,8 @@ export const settingsStore = reactive({
|
|||
tuning_range_fmin: 0,
|
||||
tx_delay: 0,
|
||||
beacon_interval: 0,
|
||||
enable_hamc: false,
|
||||
enable_morse_identifier: false,
|
||||
},
|
||||
RADIO: {
|
||||
control: "disabled",
|
||||
|
|
|
@ -66,8 +66,6 @@ class CONFIG:
|
|||
'respond_to_cq': bool,
|
||||
'rx_buffer_size': int,
|
||||
'tx_delay': int,
|
||||
'enable_hmac': bool,
|
||||
'enable_morse_identifier': bool,
|
||||
'beacon_interval': int,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -315,7 +315,6 @@ class DATA:
|
|||
while True:
|
||||
|
||||
data = self.data_queue_transmit.get()
|
||||
print(data)
|
||||
# if we are already in ARQ_STATE, or we're receiving codec2 traffic
|
||||
# let's wait with processing data
|
||||
# this should avoid weird toggle states where both stations
|
||||
|
|
|
@ -100,7 +100,7 @@ def post_cqcqcq():
|
|||
if request.method not in ['POST']:
|
||||
return api_response({"info": "endpoint for triggering a CQ via POST"})
|
||||
if app.states.is_modem_running:
|
||||
server_commands.cqcqcq()
|
||||
server_commands.cqcqcq(request.json)
|
||||
return api_response({"cmd": "cqcqcq"})
|
||||
|
||||
@app.route('/modem/beacon', methods=['POST'])
|
||||
|
|
|
@ -3,12 +3,12 @@ import base64
|
|||
import structlog
|
||||
log = structlog.get_logger("COMMANDS")
|
||||
|
||||
def cqcqcq():
|
||||
def cqcqcq(data):
|
||||
try:
|
||||
DATA_QUEUE_TRANSMIT.put(["CQ"])
|
||||
return
|
||||
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):
|
||||
try:
|
||||
|
|
|
@ -13,8 +13,8 @@ class SM:
|
|||
|
||||
self.modem = False
|
||||
self.data_handler = False
|
||||
|
||||
self.config = app.config_manager.read()
|
||||
self.app = app
|
||||
self.config = self.app.config_manager.read()
|
||||
self.modem_events = app.modem_events
|
||||
self.modem_fft = app.modem_fft
|
||||
self.modem_service = app.modem_service
|
||||
|
@ -53,7 +53,12 @@ class SM:
|
|||
|
||||
|
||||
def start_modem(self):
|
||||
# read config
|
||||
self.config = self.app.config_manager.read()
|
||||
|
||||
# test audio devices
|
||||
audio_test = self.test_audio()
|
||||
|
||||
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.modem = modem.RF(self.config, self.modem_events, self.modem_fft, self.modem_service, self.states)
|
||||
|
|
Loading…
Reference in a new issue