Force BLE by default

This commit is contained in:
jacob.eva 2024-12-07 20:54:25 +00:00
parent d639ffcf9a
commit fc09ac1cf7
No known key found for this signature in database
GPG Key ID: 0B92E083BBCCAA1E
3 changed files with 15 additions and 29 deletions

View File

@ -4096,14 +4096,14 @@ class SidebandApp(MDApp):
self.sideband.save_configuration() self.sideband.save_configuration()
def hardware_rnode_ble_toggle_action(self, sender=None, event=None): #def hardware_rnode_ble_toggle_action(self, sender=None, event=None):
if sender.active: # if sender.active:
self.sideband.config["hw_rnode_ble"] = True # self.sideband.config["hw_rnode_ble"] = True
self.request_bluetooth_permissions() # self.request_bluetooth_permissions()
else: # else:
self.sideband.config["hw_rnode_ble"] = False # self.sideband.config["hw_rnode_ble"] = False
self.sideband.save_configuration() # self.sideband.save_configuration()
def hardware_rnode_framebuffer_toggle_action(self, sender=None, event=None): def hardware_rnode_framebuffer_toggle_action(self, sender=None, event=None):
if sender.active: if sender.active:
@ -4210,7 +4210,7 @@ class SidebandApp(MDApp):
t_btd = "" t_btd = ""
self.hardware_rnode_screen.ids.hardware_rnode_bluetooth.active = self.sideband.config["hw_rnode_bluetooth"] self.hardware_rnode_screen.ids.hardware_rnode_bluetooth.active = self.sideband.config["hw_rnode_bluetooth"]
self.hardware_rnode_screen.ids.hardware_rnode_ble.active = self.sideband.config["hw_rnode_ble"] #self.hardware_rnode_screen.ids.hardware_rnode_ble.active = self.sideband.config["hw_rnode_ble"]
self.hardware_rnode_screen.ids.hardware_rnode_framebuffer.active = self.sideband.config["hw_rnode_enable_framebuffer"] self.hardware_rnode_screen.ids.hardware_rnode_framebuffer.active = self.sideband.config["hw_rnode_enable_framebuffer"]
self.hardware_rnode_screen.ids.hardware_rnode_advanced_cfg.active = self.sideband.config["hw_rnode_advanced_cfg"] self.hardware_rnode_screen.ids.hardware_rnode_advanced_cfg.active = self.sideband.config["hw_rnode_advanced_cfg"]
@ -4277,7 +4277,7 @@ class SidebandApp(MDApp):
self.hardware_rnode_screen.ids.hardware_rnode_beaconinterval.bind(on_text_validate=save_connectivity) self.hardware_rnode_screen.ids.hardware_rnode_beaconinterval.bind(on_text_validate=save_connectivity)
self.hardware_rnode_screen.ids.hardware_rnode_beacondata.bind(on_text_validate=save_connectivity) self.hardware_rnode_screen.ids.hardware_rnode_beacondata.bind(on_text_validate=save_connectivity)
self.hardware_rnode_screen.ids.hardware_rnode_bluetooth.bind(active=self.hardware_rnode_bt_toggle_action) self.hardware_rnode_screen.ids.hardware_rnode_bluetooth.bind(active=self.hardware_rnode_bt_toggle_action)
self.hardware_rnode_screen.ids.hardware_rnode_ble.bind(active=self.hardware_rnode_ble_toggle_action) #self.hardware_rnode_screen.ids.hardware_rnode_ble.bind(active=self.hardware_rnode_ble_toggle_action)
self.hardware_rnode_screen.ids.hardware_rnode_framebuffer.bind(active=self.hardware_rnode_framebuffer_toggle_action) self.hardware_rnode_screen.ids.hardware_rnode_framebuffer.bind(active=self.hardware_rnode_framebuffer_toggle_action)
self.hardware_rnode_screen.ids.hardware_rnode_advanced_cfg.bind(active=self.hardware_rnode_advanced_cfg_toggle_action) self.hardware_rnode_screen.ids.hardware_rnode_advanced_cfg.bind(active=self.hardware_rnode_advanced_cfg_toggle_action)

View File

@ -3542,7 +3542,6 @@ class SidebandCore():
if self.config["hw_rnode_bluetooth"]: if self.config["hw_rnode_bluetooth"]:
RNS.log("Allowing RNode bluetooth", RNS.LOG_DEBUG) RNS.log("Allowing RNode bluetooth", RNS.LOG_DEBUG)
rnode_allow_bluetooth = True rnode_allow_bluetooth = True
ble_dispatcher = RNS.Interfaces.Android.RNodeMultiInterface.AndroidBLEDispatcher()
if self.config["hw_rnode_bt_device"] != None: if self.config["hw_rnode_bt_device"] != None:
bt_device_name = self.config["hw_rnode_bt_device"] bt_device_name = self.config["hw_rnode_bt_device"]
@ -3617,8 +3616,9 @@ class SidebandCore():
"RNodeInterface", "RNodeInterface",
target_port, target_port,
subint_config, subint_config,
ble_dispatcher = ble_dispatcher, allow_bluetooth = False,
allow_bluetooth = rnode_allow_bluetooth, force_ble = rnode_allow_bluetooth,
ble_name = bt_device_name,
target_device_name = bt_device_name, target_device_name = bt_device_name,
) )
@ -3636,8 +3636,9 @@ class SidebandCore():
flow_control = None, flow_control = None,
id_interval = self.config["hw_rnode_beaconinterval"], id_interval = self.config["hw_rnode_beaconinterval"],
id_callsign = self.config["hw_rnode_beacondata"], id_callsign = self.config["hw_rnode_beacondata"],
allow_bluetooth = rnode_allow_bluetooth, allow_bluetooth = False,
target_device_name = bt_device_name, force_ble = rnode_allow_bluetooth,
ble_name = bt_device_name,
st_alock = atl_short, st_alock = atl_short,
lt_alock = atl_long, lt_alock = atl_long,
) )

View File

@ -2603,21 +2603,6 @@ MDScreen:
pos_hint: {"center_y": 0.3} pos_hint: {"center_y": 0.3}
active: False active: False
MDBoxLayout:
orientation: "horizontal"
size_hint_y: None
padding: [0,0,dp(24),dp(0)]
height: dp(48)
MDLabel:
text: "Device requires BLE"
font_style: "H6"
MDSwitch:
id: hardware_rnode_ble
pos_hint: {"center_y": 0.3}
active: False
MDLabel: MDLabel:
id: hardware_rnode_info id: hardware_rnode_info
markup: True markup: True