commit 5370fefdad39b90aa959fe3b786bdb90f59fa866
parent c3e160880f32f8e7ce7e3aa10b7a8dd9bf6bbe34
Author: James Prestwood <prestwoj@gmail.com>
Date: Wed, 3 Feb 2021 11:07:05 -0800
client: update to work with diagnostic changes
The diagnostic interface will now only come up when station is
connected. This avoids the need for display station to return
a 'connected' out parameter. We can instead just see that
the diagnostic interface doesn't exist.
Diffstat:
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/client/station.c b/client/station.c
@@ -142,8 +142,7 @@ static void check_errors_method_callback(struct l_dbus_message *message,
}
static void display_station(const char *device_name,
- const struct proxy_interface *proxy,
- bool *connected)
+ const struct proxy_interface *proxy)
{
const struct station *station = proxy_interface_get_data(proxy);
char *caption = l_strdup_printf("%s: %s", "Station", device_name);
@@ -155,12 +154,13 @@ static void display_station(const char *device_name,
display("%s%*s %-*s%-*s\n", MARGIN, 8, "", 20,
"Connected network", 47,
network_get_name(station->connected_network));
- *connected = true;
+ /*
+ * If connected the diagnostic interface is presumably up so
+ * don't add the table footer just yet.
+ */
return;
}
- *connected = false;
-
display_table_footer();
}
@@ -623,20 +623,19 @@ static enum cmd_status cmd_show(const char *device_name,
const struct proxy_interface *diagnostic =
device_proxy_find(device_name,
IWD_STATION_DIAGNOSTIC_INTERFACE);
- bool connected;
if (!station) {
display("No station on device: '%s'\n", device_name);
return CMD_STATUS_INVALID_VALUE;
}
- display_station(device_name, station, &connected);
+ display_station(device_name, station);
/*
- * No need to query additional diagnostic information if not connected,
- * or IWD has no diagnostic interface.
+ * No need to query additional diagnostic information if IWD has
+ * no diagnostic interface.
*/
- if (!connected || !diagnostic) {
+ if (!diagnostic) {
display_table_footer();
display_refresh_reset();
return CMD_STATUS_DONE;