mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
import time
forgot this line....
This commit is contained in:
parent
77e1194b22
commit
4b429f7c66
1 changed files with 8 additions and 6 deletions
|
@ -12,6 +12,7 @@ import sys
|
||||||
import re
|
import re
|
||||||
import logging, structlog, log_handler
|
import logging, structlog, log_handler
|
||||||
import atexit
|
import atexit
|
||||||
|
import time
|
||||||
# for rig_model -> rig_number only
|
# for rig_model -> rig_number only
|
||||||
|
|
||||||
|
|
||||||
|
@ -48,7 +49,7 @@ class radio:
|
||||||
if int(self.devicename):
|
if int(self.devicename):
|
||||||
self.devicenumber = int(self.devicename)
|
self.devicenumber = int(self.devicename)
|
||||||
else:
|
else:
|
||||||
self.devicenumber = 6
|
self.devicenumber = 6 #dummy
|
||||||
structlog.get_logger("structlog").warning("[TNC] RADIO NOT FOUND USING DUMMY!", error=e)
|
structlog.get_logger("structlog").warning("[TNC] RADIO NOT FOUND USING DUMMY!", error=e)
|
||||||
|
|
||||||
|
|
||||||
|
@ -65,8 +66,9 @@ class radio:
|
||||||
def get_frequency(self):
|
def get_frequency(self):
|
||||||
cmd = self.cmd + ' f'
|
cmd = self.cmd + ' f'
|
||||||
sw_proc = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, text=True)
|
sw_proc = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, text=True)
|
||||||
command_channel = sw_proc.stdout
|
time.sleep(0.5)
|
||||||
freq = command_channel.readline()
|
freq = sw_proc.communicate()[0]
|
||||||
|
#print('get_frequency', freq, sw_proc.communicate())
|
||||||
return int(freq)
|
return int(freq)
|
||||||
|
|
||||||
def get_mode(self):
|
def get_mode(self):
|
||||||
|
@ -86,8 +88,8 @@ class radio:
|
||||||
def get_ptt(self):
|
def get_ptt(self):
|
||||||
cmd = self.cmd + ' t'
|
cmd = self.cmd + ' t'
|
||||||
sw_proc = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, text=True)
|
sw_proc = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, text=True)
|
||||||
command_channel = sw_proc.stdout
|
time.sleep(0.5)
|
||||||
status = command_channel.readline()
|
status = sw_proc.communicate()[0]
|
||||||
return status
|
return status
|
||||||
|
|
||||||
def set_ptt(self, state):
|
def set_ptt(self, state):
|
||||||
|
|
Loading…
Reference in a new issue