|
|
@ -16,7 +16,6 @@ from jeepney.low_level import MessageType |
|
|
|
from jeepney.wrappers import Properties |
|
|
|
from jeepney.wrappers import Properties |
|
|
|
|
|
|
|
|
|
|
|
from openpilot.common.swaglog import cloudlog |
|
|
|
from openpilot.common.swaglog import cloudlog |
|
|
|
from openpilot.common.params import Params |
|
|
|
|
|
|
|
from openpilot.system.ui.lib.networkmanager import (NM, NM_WIRELESS_IFACE, NM_802_11_AP_SEC_PAIR_WEP40, |
|
|
|
from openpilot.system.ui.lib.networkmanager import (NM, NM_WIRELESS_IFACE, NM_802_11_AP_SEC_PAIR_WEP40, |
|
|
|
NM_802_11_AP_SEC_PAIR_WEP104, NM_802_11_AP_SEC_GROUP_WEP40, |
|
|
|
NM_802_11_AP_SEC_PAIR_WEP104, NM_802_11_AP_SEC_GROUP_WEP40, |
|
|
|
NM_802_11_AP_SEC_GROUP_WEP104, NM_802_11_AP_SEC_KEY_MGMT_PSK, |
|
|
|
NM_802_11_AP_SEC_GROUP_WEP104, NM_802_11_AP_SEC_KEY_MGMT_PSK, |
|
|
@ -28,6 +27,11 @@ from openpilot.system.ui.lib.networkmanager import (NM, NM_WIRELESS_IFACE, NM_80 |
|
|
|
NM_DEVICE_STATE_REASON_NEW_ACTIVATION, NM_ACTIVE_CONNECTION_IFACE, |
|
|
|
NM_DEVICE_STATE_REASON_NEW_ACTIVATION, NM_ACTIVE_CONNECTION_IFACE, |
|
|
|
NM_IP4_CONFIG_IFACE, NMDeviceState) |
|
|
|
NM_IP4_CONFIG_IFACE, NMDeviceState) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try: |
|
|
|
|
|
|
|
from openpilot.common.params import Params |
|
|
|
|
|
|
|
except Exception: |
|
|
|
|
|
|
|
Params = None |
|
|
|
|
|
|
|
|
|
|
|
TETHERING_IP_ADDRESS = "192.168.43.1" |
|
|
|
TETHERING_IP_ADDRESS = "192.168.43.1" |
|
|
|
DEFAULT_TETHERING_PASSWORD = "swagswagcomma" |
|
|
|
DEFAULT_TETHERING_PASSWORD = "swagswagcomma" |
|
|
|
SIGNAL_QUEUE_SIZE = 10 |
|
|
|
SIGNAL_QUEUE_SIZE = 10 |
|
|
@ -149,9 +153,10 @@ class WifiManager: |
|
|
|
self._callback_queue: list[Callable] = [] |
|
|
|
self._callback_queue: list[Callable] = [] |
|
|
|
|
|
|
|
|
|
|
|
self._tethering_ssid = "weedle" |
|
|
|
self._tethering_ssid = "weedle" |
|
|
|
dongle_id = Params().get("DongleId") |
|
|
|
if Params is not None: |
|
|
|
if dongle_id: |
|
|
|
dongle_id = Params().get("DongleId") |
|
|
|
self._tethering_ssid += "-" + dongle_id[:4] |
|
|
|
if dongle_id: |
|
|
|
|
|
|
|
self._tethering_ssid += "-" + dongle_id[:4] |
|
|
|
|
|
|
|
|
|
|
|
# Callbacks |
|
|
|
# Callbacks |
|
|
|
self._need_auth: list[Callable[[str], None]] = [] |
|
|
|
self._need_auth: list[Callable[[str], None]] = [] |
|
|
@ -173,7 +178,7 @@ class WifiManager: |
|
|
|
self._scan_thread.start() |
|
|
|
self._scan_thread.start() |
|
|
|
self._state_thread.start() |
|
|
|
self._state_thread.start() |
|
|
|
|
|
|
|
|
|
|
|
if self._tethering_ssid not in self._get_connections(): |
|
|
|
if Params is not None and self._tethering_ssid not in self._get_connections(): |
|
|
|
self._add_tethering_connection() |
|
|
|
self._add_tethering_connection() |
|
|
|
|
|
|
|
|
|
|
|
self._tethering_password = self._get_tethering_password() |
|
|
|
self._tethering_password = self._get_tethering_password() |
|
|
|