mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
enable / disable morse identifier
This commit is contained in:
parent
4a47c3f58c
commit
5d111cac5b
5 changed files with 29 additions and 5 deletions
|
@ -77,14 +77,15 @@ class CONFIG:
|
||||||
'explorer': data[17],
|
'explorer': data[17],
|
||||||
'stats': data[19],
|
'stats': data[19],
|
||||||
'fsk': data[13],
|
'fsk': data[13],
|
||||||
'tx_delay': data[21]
|
'tx_delay': data[21],
|
||||||
}
|
'transmit_morse_identifier' : data[25]
|
||||||
|
}
|
||||||
self.config['TCI'] = {'#TCI settings': None,
|
self.config['TCI'] = {'#TCI settings': None,
|
||||||
'ip': data[22],
|
'ip': data[22],
|
||||||
'port': data[23]
|
'port': data[23]
|
||||||
}
|
}
|
||||||
|
|
||||||
self.config['MESH'] = {'#TCI settings': None,
|
self.config['MESH'] = {'#Mesh settings': None,
|
||||||
'enable_protocol': data[24]
|
'enable_protocol': data[24]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -496,6 +496,12 @@ class DAEMON:
|
||||||
if data[24] == "True":
|
if data[24] == "True":
|
||||||
options.append("--mesh")
|
options.append("--mesh")
|
||||||
|
|
||||||
|
#Morse identifier
|
||||||
|
print(data[25])
|
||||||
|
if data[25] == "True":
|
||||||
|
options.append("--morse")
|
||||||
|
|
||||||
|
|
||||||
# safe data to config file
|
# safe data to config file
|
||||||
config.write_entire_config(data)
|
config.write_entire_config(data)
|
||||||
|
|
||||||
|
|
|
@ -1966,6 +1966,10 @@ class DATA:
|
||||||
# we need to send disconnect frame before doing arq cleanup
|
# we need to send disconnect frame before doing arq cleanup
|
||||||
# we would lose our session id then
|
# we would lose our session id then
|
||||||
self.send_disconnect_frame()
|
self.send_disconnect_frame()
|
||||||
|
|
||||||
|
# transmit morse identifier if configured
|
||||||
|
if Modem.transmit_morse_identifier:
|
||||||
|
modem.MODEM_TRANSMIT_QUEUE.put(["morse", 1, 0, self.mycallsign])
|
||||||
self.arq_cleanup()
|
self.arq_cleanup()
|
||||||
|
|
||||||
def received_session_close(self, data_in: bytes):
|
def received_session_close(self, data_in: bytes):
|
||||||
|
@ -2856,7 +2860,8 @@ class DATA:
|
||||||
self.enqueue_frame_for_tx([cq_frame], c2_mode=FREEDV_MODE.fsk_ldpc_0.value)
|
self.enqueue_frame_for_tx([cq_frame], c2_mode=FREEDV_MODE.fsk_ldpc_0.value)
|
||||||
else:
|
else:
|
||||||
self.enqueue_frame_for_tx([cq_frame], c2_mode=FREEDV_MODE.sig0.value, copies=1, repeat_delay=0)
|
self.enqueue_frame_for_tx([cq_frame], c2_mode=FREEDV_MODE.sig0.value, copies=1, repeat_delay=0)
|
||||||
#modem.MODEM_TRANSMIT_QUEUE.put(["morse", 1, 0, self.mycallsign])
|
if Modem.transmit_morse_identifier:
|
||||||
|
modem.MODEM_TRANSMIT_QUEUE.put(["morse", 1, 0, self.mycallsign])
|
||||||
|
|
||||||
def received_cq(self, data_in: bytes) -> None:
|
def received_cq(self, data_in: bytes) -> None:
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -261,6 +261,15 @@ if __name__ == "__main__":
|
||||||
help="Enable and set hmac message salt",
|
help="Enable and set hmac message salt",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
PARSER.add_argument(
|
||||||
|
"--morse",
|
||||||
|
dest="transmit_morse_identifier",
|
||||||
|
action="store_true",
|
||||||
|
default=True,
|
||||||
|
help="Enable and send a morse identifier on disconnect an beacon",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
ARGS = PARSER.parse_args()
|
ARGS = PARSER.parse_args()
|
||||||
|
|
||||||
# set save to folder state for allowing downloading files to local file system
|
# set save to folder state for allowing downloading files to local file system
|
||||||
|
@ -316,7 +325,7 @@ if __name__ == "__main__":
|
||||||
ModemParam.tx_delay = ARGS.tx_delay
|
ModemParam.tx_delay = ARGS.tx_delay
|
||||||
MeshParam.enable_protocol = ARGS.enable_mesh
|
MeshParam.enable_protocol = ARGS.enable_mesh
|
||||||
Modem.enable_hmac = ARGS.enable_hmac
|
Modem.enable_hmac = ARGS.enable_hmac
|
||||||
|
Modem.transmit_morse_identifier = ARGS.transmit_morse_identifier
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.error("[DMN] Error reading config file", exception=e)
|
log.error("[DMN] Error reading config file", exception=e)
|
||||||
|
@ -368,6 +377,8 @@ if __name__ == "__main__":
|
||||||
TCIParam.port = int(conf.get('TCI', 'tci_port', '50001'))
|
TCIParam.port = int(conf.get('TCI', 'tci_port', '50001'))
|
||||||
ModemParam.tx_delay = int(conf.get('Modem', 'tx_delay', '0'))
|
ModemParam.tx_delay = int(conf.get('Modem', 'tx_delay', '0'))
|
||||||
MeshParam.enable_protocol = conf.get('MESH','mesh_enable','False')
|
MeshParam.enable_protocol = conf.get('MESH','mesh_enable','False')
|
||||||
|
MeshParam.transmit_morse_identifier = conf.get('Modem','transmit_morse_identifier','False')
|
||||||
|
|
||||||
except KeyError as e:
|
except KeyError as e:
|
||||||
log.warning("[CFG] Error reading config file near", key=str(e))
|
log.warning("[CFG] Error reading config file near", key=str(e))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
|
@ -151,6 +151,7 @@ class Modem:
|
||||||
heard_stations = []
|
heard_stations = []
|
||||||
listen: bool = True
|
listen: bool = True
|
||||||
enable_hmac: bool = True
|
enable_hmac: bool = True
|
||||||
|
transmit_morse_identifier: bool = False
|
||||||
|
|
||||||
# ------------
|
# ------------
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue