Re: [PATCH 2/5] station: update SignalStrength/Frequency for BSS interface
James Prestwood <[email protected]> Wed, 23 Apr 2025 14:50:36 -0400
| Newsgroups | dev.linux.lists.iwd |
|---|---|
| Message-ID | <[email protected]> |
On 4/23/25 10:52 AM, Denis Kenzior wrote:
> Hi James,
>
> On 4/23/25 8:54 AM, James Prestwood wrote:
>> When the BSS's signal or frequency changes, update those properties
>> ---
>> src/station.c | 15 +++++++++++++--
>> 1 file changed, 13 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/station.c b/src/station.c
>> index 14c93671..85ed2898 100644
>> --- a/src/station.c
>> +++ b/src/station.c
>> @@ -545,10 +545,21 @@ static bool station_register_bss(struct network
>> *network, struct scan_bss *bss)
>> * scan_bss pointer, as this one will be freed soon.
>> */
>> old = l_dbus_object_get_data(dbus_get_bus(), path,
>> IWD_BSS_INTERFACE);
>> - if (old)
>> - return l_dbus_object_set_data(dbus_get_bus(), path,
>> + if (old) {
>> + l_dbus_object_set_data(dbus_get_bus(), path,
>> IWD_BSS_INTERFACE, bss);
>> + if (old->signal_strength != bss->signal_strength)
>> + l_dbus_property_changed(dbus_get_bus(), path,
>> + IWD_BSS_INTERFACE, "SignalStrength");
>> +
>> + if (old->frequency != bss->frequency)
>> + l_dbus_property_changed(dbus_get_bus(), path,
>> + IWD_BSS_INTERFACE, "Frequency");
>> +
>> + return true;
>
> nit: This return probably deserves its own commit + Fixes tag.
This specifically isn't fixing anything. I just needed to set the new
BSS object prior to emitting the property changed signal. Technically
this does change the function logic but we don't actually check the
return of station_register_bss() anywhere, this could just be made into
a void return I suppose if you'd like.
>
>> + }
>> +
>> if (!l_dbus_object_add_interface(dbus_get_bus(), path,
>> IWD_BSS_INTERFACE, bss))
>> return false;
>
> Regards,
> -Denis