Fix active AP (#21511)

* Revert "Qt logging through cloudlog (#21452)"

This reverts commit 54b6a9f121.

* set activeAp after scan so it's not blocking

* Revert "Revert "Qt logging through cloudlog (#21452)""

This reverts commit d9689a5505.

* clean up

* move to another PR
pull/21521/head
sshane 4 years ago committed by GitHub
parent b7f8c6ad03
commit 648639787c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      selfdrive/ui/qt/offroad/wifiManager.cc
  2. 1
      selfdrive/ui/qt/offroad/wifiManager.h

@ -335,6 +335,7 @@ void WifiManager::stateChange(unsigned int new_state, unsigned int previous_stat
void WifiManager::propertyChange(const QString &interface, const QVariantMap &props, const QStringList &invalidated_props) {
if (interface == NM_DBUS_INTERFACE_DEVICE_WIRELESS && props.contains("LastScan")) {
if (this->isVisible() || firstScan) {
activeAp = getActiveAp();
refreshNetworks();
emit refreshSignal();
firstScan = false;
@ -449,6 +450,16 @@ void WifiManager::setTetheringEnabled(bool enabled) {
}
}
QString WifiManager::getActiveAp() {
QDBusInterface device_props(NM_DBUS_SERVICE, adapter, NM_DBUS_INTERFACE_PROPERTIES, bus);
device_props.setTimeout(DBUS_TIMEOUT);
QDBusMessage response = device_props.call("Get", NM_DBUS_INTERFACE_DEVICE_WIRELESS, "ActiveAccessPoint");
QDBusObjectPath r = get_response<QDBusObjectPath>(response);
return r.path();
}
bool WifiManager::isTetheringEnabled() {
if (activeAp != "" && activeAp != "/") {
return get_property(activeAp, "Ssid") == tethering_ssid;

@ -70,6 +70,7 @@ private:
QList<Network> get_networks();
void connect(const QByteArray &ssid, const QString &username, const QString &password, SecurityType security_type);
QString activeAp;
QString getActiveAp();
void deactivateConnection(const QString &ssid);
QVector<QDBusObjectPath> get_active_connections();
uint get_wifi_device_state();

Loading…
Cancel
Save