mirror of
https://github.com/liberatedsystems/openCom-Companion.git
synced 2024-11-22 13:30:36 +01:00
Added support for USB-connected RNodes on Android
This commit is contained in:
parent
ae941218bc
commit
e991d54def
@ -193,6 +193,23 @@ class SidebandCore():
|
|||||||
self.config["connect_rnode"] = False
|
self.config["connect_rnode"] = False
|
||||||
self.config["connect_rnode_ifac_netname"] = ""
|
self.config["connect_rnode_ifac_netname"] = ""
|
||||||
self.config["connect_rnode_ifac_passphrase"] = ""
|
self.config["connect_rnode_ifac_passphrase"] = ""
|
||||||
|
# Hardware
|
||||||
|
self.config["hw_rnode_frequency"] = None
|
||||||
|
self.config["hw_rnode_modulation"] = "LoRa"
|
||||||
|
self.config["hw_rnode_bandwidth"] = 62500
|
||||||
|
self.config["hw_rnode_spreading_factor"] = 8
|
||||||
|
self.config["hw_rnode_coding_rate"] = 6
|
||||||
|
self.config["hw_rnode_tx_power"] = 0
|
||||||
|
self.config["hw_rnode_beaconinterval"] = None
|
||||||
|
self.config["hw_rnode_beacondata"] = None
|
||||||
|
self.config["hw_modem_preamble"] = 150
|
||||||
|
self.config["hw_modem_tail"] = 20
|
||||||
|
self.config["hw_modem_persistence"] = 220
|
||||||
|
self.config["hw_modem_slottime"] = 20
|
||||||
|
self.config["hw_serial_baudrate"] = 57600
|
||||||
|
self.config["hw_serial_databits"] = 8
|
||||||
|
self.config["hw_serial_stopbits"] = 1
|
||||||
|
self.config["hw_serial_parity"] = "none"
|
||||||
|
|
||||||
if not os.path.isfile(self.db_path):
|
if not os.path.isfile(self.db_path):
|
||||||
self.__db_init()
|
self.__db_init()
|
||||||
@ -233,6 +250,41 @@ class SidebandCore():
|
|||||||
if not "connect_rnode_ifac_passphrase" in self.config:
|
if not "connect_rnode_ifac_passphrase" in self.config:
|
||||||
self.config["connect_rnode_ifac_passphrase"] = ""
|
self.config["connect_rnode_ifac_passphrase"] = ""
|
||||||
|
|
||||||
|
if not "hw_rnode_frequency" in self.config:
|
||||||
|
self.config["hw_rnode_frequency"] = None
|
||||||
|
if not "hw_rnode_modulation" in self.config:
|
||||||
|
self.config["hw_rnode_modulation"] = "LoRa"
|
||||||
|
if not "hw_rnode_bandwidth" in self.config:
|
||||||
|
self.config["hw_rnode_bandwidth"] = 62500
|
||||||
|
if not "hw_rnode_spreading_factor" in self.config:
|
||||||
|
self.config["hw_rnode_spreading_factor"] = 8
|
||||||
|
if not "hw_rnode_coding_rate" in self.config:
|
||||||
|
self.config["hw_rnode_coding_rate"] = 6
|
||||||
|
if not "hw_rnode_tx_power" in self.config:
|
||||||
|
self.config["hw_rnode_tx_power"] = 0
|
||||||
|
if not "hw_rnode_beaconinterval" in self.config:
|
||||||
|
self.config["hw_rnode_beaconinterval"] = None
|
||||||
|
if not "hw_rnode_beacondata" in self.config:
|
||||||
|
self.config["hw_rnode_beacondata"] = None
|
||||||
|
|
||||||
|
if not "hw_modem_preamble" in self.config:
|
||||||
|
self.config["hw_modem_preamble"] = 150
|
||||||
|
if not "hw_modem_tail" in self.config:
|
||||||
|
self.config["hw_modem_tail"] = 20
|
||||||
|
if not "hw_modem_persistence" in self.config:
|
||||||
|
self.config["hw_modem_persistence"] = 220
|
||||||
|
if not "hw_modem_slottime" in self.config:
|
||||||
|
self.config["hw_modem_slottime"] = 20
|
||||||
|
|
||||||
|
if not "hw_serial_baudrate" in self.config:
|
||||||
|
self.config["hw_serial_baudrate"] = 57600
|
||||||
|
if not "hw_serial_databits" in self.config:
|
||||||
|
self.config["hw_serial_databits"] = 8
|
||||||
|
if not "hw_serial_stopbits" in self.config:
|
||||||
|
self.config["hw_serial_stopbits"] = 1
|
||||||
|
if not "hw_serial_parity" in self.config:
|
||||||
|
self.config["hw_serial_parity"] = "none"
|
||||||
|
|
||||||
# Make sure we have a database
|
# Make sure we have a database
|
||||||
if not os.path.isfile(self.db_path):
|
if not os.path.isfile(self.db_path):
|
||||||
self.__db_init()
|
self.__db_init()
|
||||||
@ -1010,7 +1062,8 @@ class SidebandCore():
|
|||||||
self.periodic_thread.start()
|
self.periodic_thread.start()
|
||||||
|
|
||||||
def __start_jobs_immediate(self):
|
def __start_jobs_immediate(self):
|
||||||
if self.log_verbose:
|
# TODO: Reset
|
||||||
|
if True or self.log_verbose:
|
||||||
selected_level = 7
|
selected_level = 7
|
||||||
else:
|
else:
|
||||||
selected_level = 2
|
selected_level = 2
|
||||||
@ -1142,13 +1195,6 @@ class SidebandCore():
|
|||||||
target_device = self.owner_app.usb_devices[0]
|
target_device = self.owner_app.usb_devices[0]
|
||||||
|
|
||||||
if target_device:
|
if target_device:
|
||||||
rnode_port = target_device["port"]
|
|
||||||
rnode_frequency = None
|
|
||||||
rnode_bw = None
|
|
||||||
rnode_sf = None
|
|
||||||
rnode_cr = None
|
|
||||||
rnode_txp = None
|
|
||||||
|
|
||||||
if self.config["connect_rnode_ifac_netname"] == "":
|
if self.config["connect_rnode_ifac_netname"] == "":
|
||||||
ifac_netname = None
|
ifac_netname = None
|
||||||
else:
|
else:
|
||||||
@ -1162,15 +1208,15 @@ class SidebandCore():
|
|||||||
rnodeinterface = RNS.Interfaces.Android.RNodeInterface.RNodeInterface(
|
rnodeinterface = RNS.Interfaces.Android.RNodeInterface.RNodeInterface(
|
||||||
RNS.Transport,
|
RNS.Transport,
|
||||||
"RNodeInterface",
|
"RNodeInterface",
|
||||||
rnode_port,
|
target_device["port"],
|
||||||
frequency = rnode_frequency,
|
frequency = self.config["hw_rnode_frequency"],
|
||||||
bandwidth = rnode_bw,
|
bandwidth = self.config["hw_rnode_bandwidth"],
|
||||||
txpower = rnode_txp,
|
txpower = self.config["hw_rnode_tx_power"],
|
||||||
sf = rnode_sf,
|
sf = self.config["hw_rnode_spreading_factor"],
|
||||||
cr = rnode_cr,
|
cr = self.config["hw_rnode_coding_rate"],
|
||||||
flow_control = None,
|
flow_control = None,
|
||||||
id_interval = None,
|
id_interval = self.config["hw_rnode_beaconinterval"],
|
||||||
id_callsign = None,
|
id_callsign = self.config["hw_rnode_beacondata"],
|
||||||
)
|
)
|
||||||
|
|
||||||
rnodeinterface.OUT = True
|
rnodeinterface.OUT = True
|
||||||
|
Loading…
Reference in New Issue
Block a user