public inbox for iwd@lists.linux.dev
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: James Prestwood <prestwoj@gmail.com>, iwd@lists.linux.dev
Subject: Re: [PATCH 3/5] client: add SignalStrength/Frequency properties
Date: Wed, 23 Apr 2025 09:53:47 -0500	[thread overview]
Message-ID: <cf654842-20d3-4d1d-a602-2f75ea3f204b@gmail.com> (raw)
In-Reply-To: <20250423135458.11337-3-prestwoj@gmail.com>

Hi James,

On 4/23/25 8:54 AM, James Prestwood wrote:
> ---
>   client/bss.c | 48 +++++++++++++++++++++++++++++++++++++++++++++++-
>   1 file changed, 47 insertions(+), 1 deletion(-)
> 
> diff --git a/client/bss.c b/client/bss.c
> index def4de7f..19355f0b 100644
> --- a/client/bss.c
> +++ b/client/bss.c
> @@ -32,6 +32,8 @@
>   
>   struct bss {
>   	char *address;
> +	int16_t signal;
signal_strength? or rssi?
> +	uint32_t frequency;
>   };
>   
>   static const char *get_address(const void *data)
> @@ -57,8 +59,52 @@ static void update_address(void *data, struct l_dbus_message_iter *variant)
>   	bss->address = l_strdup(value);
>   }
>   
> +static const char *get_signal(const void *data)

signal_strength?

> +{
> +	const struct bss *bss = data;
> +	static char signal_str[7];
> +
> +	sprintf(signal_str, "%d", bss->signal);
> +
> +	return signal_str;
> +}
> +
> +static void update_signal(void *data, struct l_dbus_message_iter *variant)
> +{
> +	struct bss *bss = data;
> +	int16_t value;
> +
> +	if (!l_dbus_message_iter_get_variant(variant, "n", &value))
> +		return;
> +
> +	bss->signal = value;

ditto

> +}
> +
> +static const char *get_frequency(const void *data)
> +{
> +	const struct bss *bss = data;
> +	static char freq_str[5];

There is hardware that supports frequencies in the 60G range.  Might want to 
future proof this somewhat.

> +
> +	sprintf(freq_str, "%u", bss->frequency);
> +
> +	return freq_str;
> +}
> +
> +static void update_frequency(void *data, struct l_dbus_message_iter *variant)
> +{
> +	struct bss *bss = data;
> +	uint32_t value;
> +
> +	if (!l_dbus_message_iter_get_variant(variant, "u", &value))
> +		return;
> +
> +	bss->frequency = value;
> +}
> +
>   static const struct proxy_interface_property bss_properties[] = {
> -	{ "Address",       "s", update_address, get_address },
> +	{ "Address",        "s", update_address, get_address },
> +	{ "SignalStrength", "n", update_signal, get_signal },
> +	{ "Frequency",      "u", update_frequency, get_frequency },
>   	{ }
>   };
>   

Regards,
-Denis

  reply	other threads:[~2025-04-23 14:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-23 13:54 [PATCH 1/5] network: Add SignalStrength/Frequency properties to BSS interface James Prestwood
2025-04-23 13:54 ` [PATCH 2/5] station: update SignalStrength/Frequency for " James Prestwood
2025-04-23 14:52   ` Denis Kenzior
2025-04-23 18:50     ` James Prestwood
2025-04-23 13:54 ` [PATCH 3/5] client: add SignalStrength/Frequency properties James Prestwood
2025-04-23 14:53   ` Denis Kenzior [this message]
2025-04-23 13:54 ` [PATCH 4/5] client: fix get-bss command spacing/footer James Prestwood
2025-04-23 13:54 ` [PATCH 5/5] doc: add new properties to BSS interface James Prestwood
2025-04-23 14:51 ` [PATCH 1/5] network: Add SignalStrength/Frequency " 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=cf654842-20d3-4d1d-a602-2f75ea3f204b@gmail.com \
    --to=denkenz@gmail.com \
    --cc=iwd@lists.linux.dev \
    --cc=prestwoj@gmail.com \
    /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