Skip to content

Commit

Permalink
Prepare interface modularity
Browse files Browse the repository at this point in the history
  • Loading branch information
markqvist committed Nov 21, 2024
1 parent a762af0 commit 8a50528
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion RNS/Interfaces/Android/KISSInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def __init__(self, owner, configuration):
databits = int(c["databits"]) if "databits" in c else 8
parity = c["parity"] if "parity" in c else "N"
stopbits = int(c["stopbits"]) if "stopbits" in c else 1
beacon_interval = int(c["beacon_interval"]) if "beacon_interval" in c else None
beacon_interval = int(c["beacon_interval"]) if "beacon_interval" in c and c["beacon_interval"] != None else None
beacon_data = c["beacon_data"] if "beacon_data" in c else None

self.HW_MTU = 564
Expand Down
28 changes: 14 additions & 14 deletions RNS/Interfaces/Android/RNodeInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,22 +345,22 @@ def bluetooth_control(device_serial = None, port = None, enable_bluetooth = Fals
def __init__(self, owner, configuration):
c = Interface.get_config_obj(configuration)
name = c["name"]
allow_bluetooth = c["allow_bluetooth"]
target_device_name = c["target_device_name"]
target_device_address = c["target_device_address"]
ble_name = c["ble_name"]
ble_addr = c["ble_addr"]
force_ble = c["force_ble"]
frequency = int(c["frequency"]) if "frequency" in c else None
bandwidth = int(c["bandwidth"]) if "bandwidth" in c else None
txpower = int(c["txpower"]) if "txpower" in c else None
sf = int(c["spreadingfactor"]) if "spreadingfactor" in c else None
cr = int(c["codingrate"]) if "codingrate" in c else None
allow_bluetooth = c.as_bool("allow_bluetooth") if "allow_bluetooth" in c else False
target_device_name = c["target_device_name"] if "target_device_name" in c else None
target_device_address = c["target_device_address"] if "target_device_address" in c else None
ble_name = c["ble_name"] if "ble_name" in c else None
ble_addr = c["ble_addr"] if "ble_addr" in c else None
force_ble = c["force_ble"] if "force_ble" in c else False
frequency = int(c["frequency"]) if "frequency" in c else 0
bandwidth = int(c["bandwidth"]) if "bandwidth" in c else 0
txpower = int(c["txpower"]) if "txpower" in c else 0
sf = int(c["spreadingfactor"]) if "spreadingfactor" in c else 0
cr = int(c["codingrate"]) if "codingrate" in c else 0
flow_control = c.as_bool("flow_control") if "flow_control" in c else False
id_interval = int(c["id_interval"]) if "id_interval" in c else None
id_interval = int(c["id_interval"]) if "id_interval" in c and c["id_interval"] != None else None
id_callsign = c["id_callsign"] if "id_callsign" in c else None
st_alock = float(c["airtime_limit_short"]) if "airtime_limit_short" in c else None
lt_alock = float(c["airtime_limit_long"]) if "airtime_limit_long" in c else None
st_alock = float(c["airtime_limit_short"]) if "airtime_limit_short" in c and c["airtime_limit_short"] != None else None
lt_alock = float(c["airtime_limit_long"]) if "airtime_limit_long" in c and c["airtime_limit_long"] != None else None
port = c["port"] if "port" in c else None

import importlib
Expand Down
10 changes: 5 additions & 5 deletions RNS/Interfaces/RNodeInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@ def __init__(self, owner, configuration):

c = Interface.get_config_obj(configuration)
name = c["name"]
frequency = int(c["frequency"]) if "frequency" in c else None
bandwidth = int(c["bandwidth"]) if "bandwidth" in c else None
txpower = int(c["txpower"]) if "txpower" in c else None
sf = int(c["spreadingfactor"]) if "spreadingfactor" in c else None
cr = int(c["codingrate"]) if "codingrate" in c else None
frequency = int(c["frequency"]) if "frequency" in c else 0
bandwidth = int(c["bandwidth"]) if "bandwidth" in c else 0
txpower = int(c["txpower"]) if "txpower" in c else 0
sf = int(c["spreadingfactor"]) if "spreadingfactor" in c else 0
cr = int(c["codingrate"]) if "codingrate" in c else 0
flow_control = c.as_bool("flow_control") if "flow_control" in c else False
id_interval = int(c["id_interval"]) if "id_interval" in c else None
id_callsign = c["id_callsign"] if "id_callsign" in c else None
Expand Down

0 comments on commit 8a50528

Please sign in to comment.