attempt getting frequency

This commit is contained in:
DJ2LS 2023-03-29 12:53:56 +02:00
parent 7031077dab
commit fb3fcf0c1d

View file

@ -130,19 +130,26 @@ class TCI:
audio_data = message[64:] audio_data = message[64:]
self.audio_received_queue.put(audio_data) self.audio_received_queue.put(audio_data)
# find frequency
if message.startswith("TX_FREQUENCY:"):
splitted_message = message.split("TX_FREQUENCY:")
self.frequency = splitted_message[1][:-1]
# find bandwidth if len(message)< 64:
#if message.startswith("rx_filter_band:0,"): # find frequency
# splitted_message = message.split("rx_filter_band:0,") if bytes(message, "utf-8").startswith(b"vfo:0,0,"):
# bandwidths = splitted_message[1] splitted_message = message.split("vfo:0,0,")
# splitted_bandwidths = bandwidths.split(",") self.frequency = splitted_message[1][:-1]
# lower_bandwidth = int(splitted_bandwidths[0])
# upper_bandwidth = int(splitted_bandwidths[1][:-1]) # find mode
# self.bandwidth = upper_bandwidth - lower_bandwidth if bytes(message, "utf-8").startswith(b"modulation:0,"):
splitted_message = message.split("modulation:0,")
self.mode = splitted_message[1][:-1]
# find bandwidth
#if message.startswith("rx_filter_band:0,"):
# splitted_message = message.split("rx_filter_band:0,")
# bandwidths = splitted_message[1]
# splitted_bandwidths = bandwidths.split(",")
# lower_bandwidth = int(splitted_bandwidths[0])
# upper_bandwidth = int(splitted_bandwidths[1][:-1])
# self.bandwidth = upper_bandwidth - lower_bandwidth
@ -237,11 +244,12 @@ class TCI:
def get_frequency(self): def get_frequency(self):
""" """ """ """
self.ws.send('TX_FREQUENCY;') self.ws.send('VFO:0,0;')
return self.frequency return self.frequency
def get_mode(self): def get_mode(self):
""" """ """ """
self.ws.send('MODULATION:0;')
return self.mode return self.mode
def get_level(self): def get_level(self):
@ -277,6 +285,7 @@ class TCI:
Returns: Returns:
""" """
self.ws.send('MODULATION:0,' + mode + ';')
return None return None
def set_frequency(self, frequency): def set_frequency(self, frequency):
@ -288,6 +297,7 @@ class TCI:
Returns: Returns:
""" """
self.ws.send('VFO:0,0' + frequency + ';')
return None return None
def get_status(self): def get_status(self):