All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: Simon Mikuda <simon.mikuda@streamunlimited.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH BlueZ 1/2] l2test: Enable hex input for PSM
Date: Thu, 23 Mar 2023 10:20:25 -0700	[thread overview]
Message-ID: <CABBYNZLyQkvU1uzV8WF9n54FC43OvFzNne6XJcAUj2yCB8dVbw@mail.gmail.com> (raw)
In-Reply-To: <20230323102732.566440-2-simon.mikuda@streamunlimited.com>

Hi Simon,

On Thu, Mar 23, 2023 at 3:39 AM Simon Mikuda
<simon.mikuda@streamunlimited.com> wrote:
>
> ---
>  tools/l2test.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/tools/l2test.c b/tools/l2test.c
> index 5aae4b687..595f1dab2 100644
> --- a/tools/l2test.c
> +++ b/tools/l2test.c
> @@ -1416,7 +1416,10 @@ int main(int argc, char *argv[])
>                         break;
>
>                 case 'P':
> -                       psm = atoi(optarg);
> +                       if (!strncasecmp(optarg, "0x", 2))
> +                               psm = strtoul(&optarg[2], NULL, 16);

strtoul should be able to autodetect the base and parse 0x if you give
0 as base:

https://linux.die.net/man/3/strtoul

> +                       else
> +                               psm = atoi(optarg);
>                         break;
>
>                 case 'I':
> --
> 2.34.1
>


-- 
Luiz Augusto von Dentz

  parent reply	other threads:[~2023-03-23 17:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-23 10:27 [PATCH BlueZ 0/2] l2test fix+feature Simon Mikuda
2023-03-23 10:27 ` [PATCH BlueZ 1/2] l2test: Enable hex input for PSM Simon Mikuda
2023-03-23 11:42   ` l2test fix+feature bluez.test.bot
2023-03-23 17:20   ` Luiz Augusto von Dentz [this message]
2023-03-28  5:26     ` [PATCH BlueZ v2 0/2] l2test: Enable hex input for PSM Simon Mikuda
2023-03-28  5:26       ` [PATCH BlueZ v2 1/2] " Simon Mikuda
2023-03-28  6:57         ` bluez.test.bot
2023-03-28  5:26       ` [PATCH BlueZ v2 2/2] l2test: Fix setting mode for BR/EDR l2cap socket Simon Mikuda
2023-03-28 20:50       ` [PATCH BlueZ v2 0/2] l2test: Enable hex input for PSM patchwork-bot+bluetooth
2023-03-23 10:27 ` [PATCH BlueZ 2/2] l2test: Fix setting mode for BR/EDR l2cap socket Simon Mikuda

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=CABBYNZLyQkvU1uzV8WF9n54FC43OvFzNne6XJcAUj2yCB8dVbw@mail.gmail.com \
    --to=luiz.dentz@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=simon.mikuda@streamunlimited.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.