added bandwith and mode reading

This commit is contained in:
DJ2LS 2021-05-29 23:19:50 +02:00 committed by GitHub
parent 08f73d0382
commit 52c27c7276
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 4 deletions

View file

@ -399,9 +399,9 @@ class RF():
while static.FREEDV_RECEIVE == True:
time.sleep(0.01)
# lets update the frequency
static.HAMLIB_FREQUENCY = int(self.my_rig.get_freq())
# lets get the frequency, mode and bandwith
self.get_radio_stats()
# demod loop
while (static.CHANNEL_STATE == 'RECEIVING_DATA' and static.ARQ_DATA_CHANNEL_MODE == mode) or (static.CHANNEL_STATE == 'RECEIVING_SIGNALLING' and static.FREEDV_SIGNALLING_MODE == mode):
time.sleep(0.01)
@ -563,6 +563,11 @@ class RF():
except:
static.SNR = 0
def get_radio_stats(self):
static.HAMLIB_FREQUENCY = int(self.my_rig.get_freq())
(hamlib_mode, static.HAMLIB_BANDWITH) = self.my_rig.get_mode()
static.HAMLIB_MODE = Hamlib.rig_strrmode(hamlib_mode)

View file

@ -189,7 +189,9 @@ class CMDTCPRequestHandler(socketserver.BaseRequestHandler):
"AUDIO_RMS": str(static.AUDIO_RMS),
"BER": str(static.BER),
"SNR": str(static.SNR),
"FREQUENCY" : str(static.HAMLIB_FREQUENCY)
"FREQUENCY" : str(static.HAMLIB_FREQUENCY),
"MODE" : str(static.HAMLIB_MODE),
"BANDWITH" : str(static.HAMLIB_BANDWITH)
}
jsondata = json.dumps(output)

View file

@ -54,6 +54,8 @@ HAMLIB_DEVICE_ID = 0
HAMLIB_DEVICE_PORT = '/dev/ttyUSB0'
HAMLIB_FREQUENCY = 0
HAMLIB_MODE = ''
HAMLIB_BANDWITH = 0
# -------------------------
# FreeDV Defaults
FREEDV_RECEIVE = True