Re: [PATCH BlueZ 6/9] client: Rename set-filter-transport to transport

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Eramoto,

On Thu, Dec 14, 2017 at 7:12 AM, ERAMOTO Masaya
<eramoto.masaya@xxxxxxxxxxxxxx> wrote:
> Hi Luiz,
>
> On 12/13/2017 09:36 PM, Luiz Augusto von Dentz wrote:
>> From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>
>>
>> All commands under scan submenu are related to set-filter so remove its
>> portion from it and make the command return the current value if no
>> parameters:
>>
>> [bluetooth]# transport le
>> SetDiscoveryFilter success
>> [bluetooth]# transport
>> Transport: le
>> ---
>>  client/main.c | 19 +++++++++++--------
>>  1 file changed, 11 insertions(+), 8 deletions(-)
>>
>> diff --git a/client/main.c b/client/main.c
>> index 1728a4d82..d8d911a37 100644
>> --- a/client/main.c
>> +++ b/client/main.c
>> @@ -1356,14 +1356,17 @@ static void cmd_scan_filter_pathloss(int argc, char *argv[])
>>       cmd_set_scan_filter_commit();
>>  }
>>
>> -static void cmd_set_scan_filter_transport(int argc, char *argv[])
>> +static void cmd_scan_filter_transport(int argc, char *argv[])
>>  {
>> -     g_free(filtered_scan_transport);
>> +     if (argc < 2 || !strlen(argv[1])) {
>> +             if (filtered_scan_transport)
>> +                     bt_shell_printf("Transport: %s\n",
>> +                                     filtered_scan_transport);
>> +             return;
>> +     }
>>
>> -     if (argc < 2 || !strlen(argv[1]))
>> -             filtered_scan_transport = NULL;
>> -     else
>> -             filtered_scan_transport = g_strdup(argv[1]);
>> +     g_free(filtered_scan_transport);
>> +     filtered_scan_transport = g_strdup(argv[1]);
>
> After applying this patch set, I think that clear command may be needed to
> enhance for clearing a individual filter value. Since all values is needed to
> clear when transport is not want to set after setting uuids/rssi/pathloss/data
> and it.

Yep, that is the drawback of reusing the command to get the current
value, but perhaps we can make clear take an optional parameter to
clear individual options.

>
> Regards,
> Eramoto
>



-- 
Luiz Augusto von Dentz
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux