This commit is contained in:
Your Name
2024-04-27 13:43:16 -05:00
parent 21363ce751
commit ea1aad5ed1
128 changed files with 3533 additions and 1918 deletions

12
selfdrive/ui/qt/network/networking.cc Executable file → Normal file
View File

@@ -82,11 +82,11 @@ void Networking::connectToNetwork(const Network n) {
if (wifi->isKnownConnection(n.ssid)) {
wifi->activateWifiConnection(n.ssid);
} else if (n.security_type == SecurityType::OPEN) {
wifi->connect(n);
wifi->connect(n, false);
} else if (n.security_type == SecurityType::WPA) {
QString pass = InputDialog::getText(tr("Enter password"), this, tr("for \"%1\"").arg(QString::fromUtf8(n.ssid)), true, 8);
if (!pass.isEmpty()) {
wifi->connect(n, pass);
wifi->connect(n, false, pass);
}
}
}
@@ -96,7 +96,7 @@ void Networking::wrongPassword(const QString &ssid) {
const Network &n = wifi->seenNetworks.value(ssid);
QString pass = InputDialog::getText(tr("Wrong password"), this, tr("for \"%1\"").arg(QString::fromUtf8(n.ssid)), true, 8);
if (!pass.isEmpty()) {
wifi->connect(n, pass);
wifi->connect(n, false, pass);
}
}
}
@@ -131,7 +131,7 @@ AdvancedNetworking::AdvancedNetworking(QWidget* parent, WifiManager* wifi): QWid
list->addItem(tetheringToggle);
QObject::connect(tetheringToggle, &ToggleControl::toggleFlipped, this, &AdvancedNetworking::toggleTethering);
if (params.getBool("TetheringEnabled")) {
tetheringToggle->setVisualOn();
tetheringToggle->refresh();
uiState()->scene.tethering_enabled = true;
}
@@ -196,9 +196,9 @@ AdvancedNetworking::AdvancedNetworking(QWidget* parent, WifiManager* wifi): QWid
hidden_network.ssid = ssid.toUtf8();
if (!pass.isEmpty()) {
hidden_network.security_type = SecurityType::WPA;
wifi->connect(hidden_network, pass);
wifi->connect(hidden_network, true, pass);
} else {
wifi->connect(hidden_network);
wifi->connect(hidden_network, true);
}
emit requestWifiScreen();
}

0
selfdrive/ui/qt/network/networking.h Executable file → Normal file
View File

0
selfdrive/ui/qt/network/networkmanager.h Executable file → Normal file
View File

3
selfdrive/ui/qt/network/wifi_manager.cc Executable file → Normal file
View File

@@ -166,7 +166,7 @@ SecurityType WifiManager::getSecurityType(const QVariantMap &properties) {
}
}
void WifiManager::connect(const Network &n, const QString &password, const QString &username) {
void WifiManager::connect(const Network &n, const bool is_hidden, const QString &password, const QString &username) {
setCurrentConnecting(n.ssid);
forgetConnection(n.ssid); // Clear all connections that may already exist to the network we are connecting
Connection connection;
@@ -176,6 +176,7 @@ void WifiManager::connect(const Network &n, const QString &password, const QStri
connection["connection"]["autoconnect-retries"] = 0;
connection["802-11-wireless"]["ssid"] = n.ssid;
connection["802-11-wireless"]["hidden"] = is_hidden;
connection["802-11-wireless"]["mode"] = "infrastructure";
if (n.security_type == SecurityType::WPA) {

2
selfdrive/ui/qt/network/wifi_manager.h Executable file → Normal file
View File

@@ -52,7 +52,7 @@ public:
std::optional<QDBusPendingCall> activateWifiConnection(const QString &ssid);
NetworkType currentNetworkType();
void updateGsmSettings(bool roaming, QString apn, bool metered);
void connect(const Network &ssid, const QString &password = {}, const QString &username = {});
void connect(const Network &ssid, const bool is_hidden = false, const QString &password = {}, const QString &username = {});
// Tethering functions
void setTetheringEnabled(bool enabled);