Wireless Daemon for Linux
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.01.org
Subject: Re: [PATCH 6/8] client: implement "ap <wlan> show"
Date: Wed, 20 Jan 2021 12:36:21 -0800	[thread overview]
Message-ID: <896e748bf1bbad8359c353d8d63e29ba6e25bb9a.camel@gmail.com> (raw)
In-Reply-To: <25b40ae4-958d-5d4c-722d-a3d3bb578512@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2814 bytes --]

On Wed, 2021-01-20 at 14:16 -0600, Denis Kenzior wrote:
> Hi James,
> 
> On 1/20/21 12:30 PM, James Prestwood wrote:
> > This command uses GetDiagnostics to show a list of connected
> > clients and some information about them. The information
> > contained for each connected station nearly maps 1:1 with the
> > station diagnostics information shown in "station <wlan> show"
> > apart from "ConnectedBss" which is now "Address".
> > ---
> >   client/ap.c | 97
> > +++++++++++++++++++++++++++++++++++++++++++++++++++++
> >   1 file changed, 97 insertions(+)
> > 
> 
> <snip>
> 
> > +static void display_client(struct l_dbus_message_iter *iter)
> > +{
> > +	struct l_dbus_message_iter variant;
> > +	const char *key;
> > +
> > +	while (l_dbus_message_iter_next_entry(iter, &key, &variant)) {
> > +		const char *s_value;
> > +		uint32_t u_value;
> > +		int16_t i_value;
> > +		uint8_t y_value;
> > +
> > +		if (!strcmp(key, "Address") || !strcmp(key, "RxMode")
> > ||
> > +				!strcmp(key, "TxMode")) {
> > +			/* String variants with no special handling */
> > +
> > +			l_dbus_message_iter_get_variant(&variant, "s",
> > +							&s_value);
> > +
> > +			display("%-*s%-*s\n", 20, key, 47, s_value);
> > +		} else if (!strcmp(key, "RxBitrate") ||
> > +				!strcmp(key, "TxBitrate")) {
> > +			/* Bitrates expressed in 100Kbit/s */
> > +
> > +			l_dbus_message_iter_get_variant(&variant, "u",
> > +							&u_value);
> > +			display("%-*s%u Kbit/s\n", 20, key, u_value *
> > 100);
> > +		} else if (!strcmp(key, "ExpectedThroughput")) {
> > +			/* ExpectedThroughput expressed in Kbit/s */
> > +
> > +			l_dbus_message_iter_get_variant(&variant, "u",
> > +							&u_value);
> > +			display("%*s  %-*s%u Kbit/s\n", 0, "", 20,
> > +				key, u_value);
> > +		} else if (!strcmp(key, "RSSI")) {
> > +			/* RSSI expressed in dBm */
> > +
> > +			l_dbus_message_iter_get_variant(&variant, "n",
> > +							&i_value);
> > +			display("%-*s%i dBm\n", 20, key, i_value);
> > +		} else if (!strcmp(key, "RxMCS") || !strcmp(key,
> > "TxMCS")) {
> > +			/* MCS index's are single byte integers */
> > +
> > +			l_dbus_message_iter_get_variant(&variant, "y",
> > +							&y_value);
> > +			display("%-*s%u\n", 20, key, y_value);
> > +		}
> 
> Along the lines of comment to patch 4, should the display of these
> attributes be 
> forked out to a utility  function given that they're the same between
> station / 
> ap for the most part?

Yeah I'll come up with something. I think we need some kind of
name/function mapping for these since there is at least one difference
betweens station/ap (ConnectedBss/Address). Anyways, I'll do this for
iwctl and commonize the processing in IWD core as well.

> 
> > +	}
> > +}
> > +
> 
> Regards,
> -Denis

  reply	other threads:[~2021-01-20 20:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-20 18:30 [PATCH 1/8] doc: document AccessPointDiagnostic interface James Prestwood
2021-01-20 18:30 ` [PATCH 2/8] netdev: add netdev_get_all_stations James Prestwood
2021-01-20 20:06   ` Denis Kenzior
2021-01-20 18:30 ` [PATCH 3/8] dbus: add AccessPointDiagnostic interface James Prestwood
2021-01-20 18:30 ` [PATCH 4/8] ap: add AP diagnostic interface James Prestwood
2021-01-20 20:11   ` Denis Kenzior
2021-01-20 18:30 ` [PATCH 5/8] client: add AccessPointDiagnostic interface definition James Prestwood
2021-01-20 20:14   ` Denis Kenzior
2021-01-20 18:30 ` [PATCH 6/8] client: implement "ap <wlan> show" James Prestwood
2021-01-20 20:16   ` Denis Kenzior
2021-01-20 20:36     ` James Prestwood [this message]
2021-01-20 18:30 ` [PATCH 7/8] test: add AccessPointDiagnostics to monitor-iwd James Prestwood
2021-01-20 18:30 ` [PATCH 8/8] test: add StationDiagnostic interface " James Prestwood
2021-01-20 20:00 ` [PATCH 1/8] doc: document AccessPointDiagnostic interface Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=896e748bf1bbad8359c353d8d63e29ba6e25bb9a.camel@gmail.com \
    --to=prestwoj@gmail.com \
    --cc=iwd@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox