Skip to content

Commit

Permalink
Retain hotspot/tether: Initialize after modem is configured (commaai#295
Browse files Browse the repository at this point in the history
)
  • Loading branch information
sunnyhaibin authored Sep 25, 2023
1 parent 8d75ca9 commit 7445c42
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 0 additions & 3 deletions selfdrive/manager/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,6 @@ def main() -> None:
# SystemExit on sigterm
signal.signal(signal.SIGTERM, lambda signum, frame: sys.exit(1))

if Params().get_bool("HotspotOnBoot") and Params().get_bool("HotspotOnBootConfirmed"):
os.system('nmcli con up Hotspot')

try:
manager_thread()
except Exception:
Expand Down
2 changes: 2 additions & 0 deletions selfdrive/thermald/thermald.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ def hw_state_thread(end_event, hw_queue):
cloudlog.warning("configuring modem")
HARDWARE.configure_modem()
modem_configured = True
if Params().get_bool("HotspotOnBoot") and Params().get_bool("HotspotOnBootConfirmed"):
os.system('nmcli con up Hotspot')

prev_hw_state = hw_state
except Exception:
Expand Down
3 changes: 2 additions & 1 deletion selfdrive/ui/qt/network/networking.cc
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ AdvancedNetworking::AdvancedNetworking(QWidget* parent, WifiManager* wifi): QWid

ListWidget *list = new ListWidget(this);
// Enable tethering layout
tetheringToggle = new ToggleControl(tr("Enable Tethering"), "", "", wifi->isTetheringEnabled());
const bool set_hotspot_on_boot = params.getBool("HotspotOnBootConfirmed");
tetheringToggle = new ToggleControl(tr("Enable Tethering"), "", "", wifi->isTetheringEnabled() || set_hotspot_on_boot);
list->addItem(tetheringToggle);
QObject::connect(tetheringToggle, &ToggleControl::toggleFlipped, this, &AdvancedNetworking::toggleTethering);

Expand Down

0 comments on commit 7445c42

Please sign in to comment.