Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

networking: cleanup&optimize WifiManager #23455

Closed
wants to merge 49 commits into from
Closed
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
3299454
refactor&cleanup
deanlee Jan 8, 2022
a489586
check response's size
deanlee Jan 8, 2022
2ab5ce5
tiny cleanup
deanlee Jan 8, 2022
495e814
simplify getConnectionPath
deanlee Jan 8, 2022
8a5662d
cleanup
deanlee Jan 8, 2022
8f81b48
emit refreshSignal in refreshNetworkds
deanlee Jan 8, 2022
6f9923b
better erro logging
deanlee Jan 9, 2022
9f97295
trigger ci
deanlee Jan 9, 2022
19445a5
don't quire ssid,compare with path
deanlee Jan 10, 2022
42ab0d4
query Ip4Config in if statement
deanlee Jan 10, 2022
bfc0352
cache security type
deanlee Jan 10, 2022
b787120
async refresh
deanlee Jan 10, 2022
917e0c5
async scan
deanlee Jan 10, 2022
6c71e2c
use getAll.it's faster than multiple call to get
deanlee Jan 10, 2022
b70738a
don't need to wait to refresh now
deanlee Jan 10, 2022
3dc9c58
only update ipv4_address when it changes
deanlee Jan 10, 2022
6bcff0d
always do refresh after scan
deanlee Jan 10, 2022
9c7e182
remove variable stop_
deanlee Jan 10, 2022
60d01bc
cleanup
deanlee Jan 10, 2022
eae4b6e
cleanup header file
deanlee Jan 10, 2022
0e82e18
fix sort
deanlee Jan 10, 2022
0a0ad63
break loop
deanlee Jan 11, 2022
b41d143
async active/deactive
deanlee Jan 11, 2022
dc9a9ae
revert 'update ipv4_address when it changed'
deanlee Jan 12, 2022
1a0b26c
Scan immediately if the interval is greater than 5s
deanlee Jan 12, 2022
14c9b5d
rename to refreshFinished
deanlee Jan 12, 2022
bb5878a
don't call isTetheringEnabled in loop
deanlee Jan 12, 2022
764614f
Merge branch 'master' into ui_network
deanlee Jan 12, 2022
ba532cc
remove dbus-call in isTetheringEnabled
deanlee Jan 12, 2022
c2cdc26
don't rebuild layout everytime
deanlee Jan 12, 2022
b954fd1
connect with signal/slot
deanlee Jan 12, 2022
3956dc2
fix layout
deanlee Jan 12, 2022
42bf355
rename to n
deanlee Jan 12, 2022
303f0cc
use QString().arg()
deanlee Jan 12, 2022
bfad33a
rename variables
deanlee Jan 12, 2022
7b1b8ef
cleanup
deanlee Jan 12, 2022
036def9
move comment down
deanlee Jan 12, 2022
84c51b9
local main_layout
deanlee Jan 12, 2022
a76ab9d
fix build docs
deanlee Jan 13, 2022
8630250
tiny cleanup
deanlee Jan 13, 2022
9e6ee1d
Merge branch 'master' into ui_network
deanlee Jan 13, 2022
b5fe540
continue
deanlee Jan 13, 2022
ea455a7
show connecting in async mode
deanlee Jan 13, 2022
d0d98e2
use return
deanlee Jan 13, 2022
fe2a842
merge master
deanlee Jan 14, 2022
a48b7b7
merge master
deanlee Jan 14, 2022
26f386e
simplify getipaddress
deanlee Jan 14, 2022
5fd6d21
reuse getConnectionSettings
deanlee Jan 14, 2022
f7c07e2
merge master
deanlee Jan 14, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions selfdrive/ui/qt/offroad/networking.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,11 @@ void Networking::wrongPassword(const QString &ssid) {
}

void Networking::showEvent(QShowEvent* event) {
// Wait to refresh to avoid delay when showing Networking widget
QTimer::singleShot(300, this, [=]() {
if (this->isVisible()) {
wifi->refreshNetworks();
refresh();
}
});
wifi->start();
}

void Networking::hideEvent(QHideEvent* event) {
wifi->stop();
}

// AdvancedNetworking functions
Expand Down Expand Up @@ -141,7 +139,7 @@ AdvancedNetworking::AdvancedNetworking(QWidget* parent, WifiManager* wifi): QWid
list->addItem(editPasswordButton);

// IP address
ipLabel = new LabelControl("IP Address", wifi->ipv4_address);
ipLabel = new LabelControl("IP Address");
list->addItem(ipLabel);

// SSH keys
Expand Down Expand Up @@ -266,7 +264,7 @@ void WifiUI::refresh() {
return;
}
QList<Network> sortedNetworks = wifi->seenNetworks.values();
std::sort(sortedNetworks.begin(), sortedNetworks.end(), compare_by_strength);
std::sort(sortedNetworks.begin(), sortedNetworks.end(), compare_network);

// add networks
ListWidget *list = new ListWidget(this);
Expand Down
1 change: 1 addition & 0 deletions selfdrive/ui/qt/offroad/networking.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class Networking : public QFrame {

protected:
void showEvent(QShowEvent* event) override;
void hideEvent(QHideEvent* event) override;

public slots:
void refresh();
Expand Down
Loading