mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
hamlib compatibility
improved hamlib compatibility between v 3 and v 4.
This commit is contained in:
parent
fa01bd2bd1
commit
6f9a34b0d6
1933
gui/src/index.html
1933
gui/src/index.html
File diff suppressed because it is too large
Load diff
|
@ -284,8 +284,17 @@ class CMDTCPRequestHandler(socketserver.BaseRequestHandler):
|
|||
|
||||
# try to init hamlib
|
||||
try:
|
||||
|
||||
Hamlib.rig_set_debug(Hamlib.RIG_DEBUG_NONE)
|
||||
my_rig = Hamlib.Rig(int(deviceid))
|
||||
|
||||
# get devicenumber by looking for deviceobject in Hamlib module
|
||||
try:
|
||||
devicenumber = getattr(Hamlib, deviceid)
|
||||
except:
|
||||
structlog.get_logger("structlog").error("[DMN] Hamlib: rig not supported...")
|
||||
devicenumber = 0
|
||||
|
||||
my_rig = Hamlib.Rig(int(devicenumber))
|
||||
my_rig.set_conf("rig_pathname", deviceport)
|
||||
my_rig.set_conf("retry", "1")
|
||||
my_rig.set_conf("serial_speed", serialspeed)
|
||||
|
@ -345,8 +354,7 @@ class CMDTCPRequestHandler(socketserver.BaseRequestHandler):
|
|||
self.request.sendall(bytes(jsondata, encoding))
|
||||
|
||||
except:
|
||||
structlog.get_logger("structlog").error("[DMN] Hamlib: Can't open rig")
|
||||
structlog.get_logger("structlog").error("[DMN] Unexpected error", e = sys.exc_info()[0])
|
||||
structlog.get_logger("structlog").error("[DMN] Hamlib: Can't open rig", e = sys.exc_info()[0])
|
||||
|
||||
# exception, if JSON cant be decoded
|
||||
# except Exception as e:
|
||||
|
|
12
tnc/modem.py
12
tnc/modem.py
|
@ -185,7 +185,15 @@ class RF():
|
|||
# try to init hamlib
|
||||
try:
|
||||
Hamlib.rig_set_debug(Hamlib.RIG_DEBUG_NONE)
|
||||
self.my_rig = Hamlib.Rig(int(static.HAMLIB_DEVICE_ID))
|
||||
|
||||
# get devicenumber by looking for deviceobject in Hamlib module
|
||||
try:
|
||||
devicenumber = getattr(Hamlib, static.HAMLIB_DEVICE_ID)
|
||||
except:
|
||||
structlog.get_logger("structlog").error("[DMN] Hamlib: rig not supported...")
|
||||
devicenumber = 0
|
||||
|
||||
self.my_rig = Hamlib.Rig(int(devicenumber))
|
||||
self.my_rig.set_conf("rig_pathname", static.HAMLIB_DEVICE_PORT)
|
||||
self.my_rig.set_conf("retry", "5")
|
||||
self.my_rig.set_conf("serial_speed", static.HAMLIB_SERIAL_SPEED)
|
||||
|
@ -234,9 +242,7 @@ class RF():
|
|||
HAMLIB_THREAD.start()
|
||||
|
||||
except:
|
||||
structlog.get_logger("structlog").error("[TNC] Network error", e=sys.exc_info()[0])
|
||||
structlog.get_logger("structlog").error("[TNC] Hamlib - can't open rig", e=sys.exc_info()[0])
|
||||
sys.exit("hamlib error")
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in a new issue