fixed callsign detection and default config

This commit is contained in:
dj2ls 2022-02-17 08:32:19 +01:00
parent 90ed365045
commit 7a93f0a824
3 changed files with 24 additions and 24 deletions

View file

@ -30,17 +30,17 @@ var configContent = `
"mygrid": "JN40aa",
"deviceid": "RIG_MODEL_DUMMY_NOVFO",
"deviceport": "/dev/ttyACM1",
"serialspeed": "9600",
"ptt": "USB",
"serialspeed_direct": "9600",
"spectrum": "waterfall",
"tnclocation": "localhost",
"stop_bits" : "1",
"data_bits" : "8",
"handshake" : "None",
"radiocontrol" : "direct",
"stop_bits_direct" : "1",
"data_bits_direct" : "8",
"handshake_direct" : "None",
"radiocontrol" : "disabled",
"deviceport_rigctl" : "3",
"deviceid_rigctl" : "3",
"serialspeed_rigctl" : "9600",
"pttprotocol_direct" : "USB",
"pttprotocol_rigctl" : "USB",
"rigctld_port" : "4532",
"rigctld_ip" : "127.0.0.1",
@ -48,8 +48,8 @@ var configContent = `
"enable_fft" : "False",
"low_bandwith_mode" : "False",
"theme" : "default",
"screen_height" : 1050,
"screen_width" : 430
"screen_height" : 430,
"screen_width" : 1050
}
`;
if (!fs.existsSync(configPath)) {

View file

@ -64,8 +64,8 @@ window.addEventListener('DOMContentLoaded', () => {
document.getElementById("myGrid").value = config.mygrid;
document.getElementById('hamlib_deviceid').value = config.deviceid;
document.getElementById('hamlib_serialspeed').value = config.serialspeed;
document.getElementById('hamlib_ptt_protocol').value = config.pttprotocol;
document.getElementById('hamlib_serialspeed').value = config.serialspeed_direct;
document.getElementById('hamlib_ptt_protocol').value = config.pttprotocol_direct;
document.getElementById("hamlib_rigctld_ip").value = config.rigctld_ip;
document.getElementById("hamlib_rigctld_port").value = config.rigctld_port;
@ -74,11 +74,11 @@ window.addEventListener('DOMContentLoaded', () => {
document.getElementById("hamlib_serialspeed_rigctl").value = config.serialspeed_rigctl;
document.getElementById("hamlib_ptt_protocol_rigctl").value = config.pttprotocol_rigctl;
document.getElementById('hamlib_serialspeed_advanced').value = config.serialspeed;
document.getElementById('hamlib_ptt_protocol_advanced').value = config.pttprotocol;
document.getElementById('hamlib_databits_advanced').value = config.data_bits;
document.getElementById('hamlib_stopbits_advanced').value = config.stop_bits;
document.getElementById('hamlib_handshake_advanced').value = config.handshake;
document.getElementById('hamlib_serialspeed_advanced').value = config.serialspeed_direct;
document.getElementById('hamlib_ptt_protocol_advanced').value = config.pttprotocol_direct;
document.getElementById('hamlib_databits_advanced').value = config.data_bits_direct;
document.getElementById('hamlib_stopbits_advanced').value = config.stop_bits_direct;
document.getElementById('hamlib_handshake_advanced').value = config.handshake_direct;
document.getElementById("beaconInterval").value = config.beacon_interval;
@ -550,12 +550,12 @@ window.addEventListener('DOMContentLoaded', () => {
config.mygrid = mygrid;
config.deviceid = deviceid;
config.deviceport = deviceport;
config.serialspeed = serialspeed;
config.pttprotocol = pttprotocol;
config.serialspeed_direct = serialspeed;
config.pttprotocol_direct = pttprotocol;
config.pttport = pttport;
config.data_bits = data_bits;
config.stop_bits = stop_bits;
config.handshake = handshake;
config.data_bits_direct = data_bits;
config.stop_bits_direct = stop_bits;
config.handshake_direct = handshake;
config.deviceid_rigctl = deviceid_rigctl;
config.serialspeed_rigctl = serialspeed_rigctl;
config.pttprotocol_rigctl = pttprotocol_rigctl;

View file

@ -156,12 +156,12 @@ class DATA():
def process_data(self, bytes_out, freedv, bytes_per_frame):
# forward data only if broadcast or we are the receiver
# bytes_out[1:3] == callsign check for signalling frames,
# bytes_out[1:2] == b'\x01' --> broadcasts like CQ with n frames per_burst = 1
# bytes_out[2:4] == transmission
# we could also create an own function, which returns True.
frametype = int.from_bytes(bytes(bytes_out[:1]), "big")
if bytes(bytes_out[1:3]) == static.MYCALLSIGN_CRC or frametype == 200 or frametype == 250:
if bytes(bytes_out[1:3]) == static.MYCALLSIGN_CRC or bytes(bytes_out[2:4]) == static.MYCALLSIGN_CRC or frametype == 200 or frametype == 250:
# CHECK IF FRAMETYPE IS BETWEEN 10 and 50 ------------------------
frame = frametype - 10
@ -1125,8 +1125,8 @@ class DATA():
def received_cq(self, data_in:bytes):
# here we add the received station to the heard stations buffer
dxcallsign = bytes(data_in[2:8]).rstrip(b'\x00')
dxgrid = bytes(data_in[8:14]).rstrip(b'\x00')
dxcallsign = bytes(data_in[1:7]).rstrip(b'\x00')
dxgrid = bytes(data_in[7:13]).rstrip(b'\x00')
static.INFO.append("CQ;RECEIVING")
structlog.get_logger("structlog").info("[TNC] CQ RCVD [" + str(dxcallsign, 'utf-8') + "]["+ str(dxgrid, 'utf-8') +"] ", snr=static.SNR)
helpers.add_to_heard_stations(dxcallsign,dxgrid, 'CQ CQ CQ', static.SNR, static.FREQ_OFFSET, static.HAMLIB_FREQUENCY)