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

[freeboxos] Handle null WifiInformation in Access Point Manager #16700

Merged
merged 1 commit into from
Apr 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,16 @@ public static record LanAccessPoint(String mac, String type, String uid, @Nullab
long txBytes, // transmitted bytes (from Freebox to station)
long txRate, // reception data rate (in bytes/s)
long rxRate, // transmission data rate (in bytes/s)
WifiInformation wifiInformation) {
@Nullable WifiInformation wifiInformation) {

public int getSignal() {
return wifiInformation.signal();
public int getRSSI() {
WifiInformation local = wifiInformation;
return local != null ? local.signal : 1;
}

public @Nullable String getSsid() {
return wifiInformation().ssid();
WifiInformation local = wifiInformation;
return local != null ? local.ssid : null;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ protected void internalPoll() throws FreeboxException {
LanAccessPoint lanAp = wifiHost.get().accessPoint();
if (lanAp != null) {
updateChannelString(GROUP_WIFI, WIFI_HOST, "%s-%s".formatted(lanAp.type(), lanAp.uid()));
updateWifiStationChannels(lanAp.getSignal(), lanAp.getSsid(), lanAp.rxRate(), lanAp.txRate());
updateWifiStationChannels(lanAp.getRSSI(), lanAp.getSsid(), lanAp.rxRate(), lanAp.txRate());
return;
}
}
Expand Down