Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp7933923rwl; Thu, 23 Mar 2023 10:23:05 -0700 (PDT) X-Google-Smtp-Source: AK7set9H04WecFW/rpMZs8tlYhVxmm9cjznC9kFVBmvsrnSPPcqtRolO+yf7tj/yYw5eTpP7QqNN X-Received: by 2002:a17:906:5410:b0:931:86cf:9556 with SMTP id q16-20020a170906541000b0093186cf9556mr13333419ejo.23.1679592185637; Thu, 23 Mar 2023 10:23:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679592185; cv=none; d=google.com; s=arc-20160816; b=CiN1+3PCC+vTZiJd47kczEhUiTm/4Sec6FVk9TgxzgcTNiRNKHOEGsxKIunGRVGdin dx4ZXoOC4yU082rjvtxz/c/WZXJ9YrbIz2OKGswb4XAaOSrbC2jdTM6aUsh9jSyfGwl6 Fxj8ZJeFxBTNGU28krR0TOh2cYjdQAEfuAJ0yQGBqXjEfJC1W3xYwqfN02UPEKoAvIWP UDIZR0QdF67q4KTLvHbYwCWT53YKRU4URx3CJ4Vc+K+wcA6yS/1HlApHX1aMLExyZhBr 1wng7pMa9Z4DGPX25JgGIELr9YqxtcpQquWOrX3SCAjCJOFnal7Ahts5uDKOvEfrLEyc mbQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=noADxvVZGzG524wNY29+MYK3uk/CTEYh2NGgaqzuY0c=; b=eXHoG7ECPGzy4ozpIMRqI3rBSqXX0o2YPkj4AoS0eqJ+jWv3E5xiRx/ydHNduWU/4U 82LcytHYhtNdMkRbos6WwnSOskl15J90xYE/swzZlRi8mWdutXIyLXHxl0SQUEq8Lp03 o58Wz1tF5QXBUl0utCj7WFS7VexArk05XLu2aFnvnICTjPuh2+KfYkcMY7jrAkBTEKhQ sqEOOLLR2cub5BmREmcYejTVv0d5rNYpV14e754Oo1tPlSVGnopegChyTEvHjejUQ+6i w6tJKxowdcXVLUFDvpJVL2fsLcoScB2bJV6XdF0p5tMj7NLuqyddHZJpDwZ2L4TPOZUC xH5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ZH6QgJrs; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gt39-20020a1709072da700b0093337d30dadsi20715166ejc.522.2023.03.23.10.21.38; Thu, 23 Mar 2023 10:23:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ZH6QgJrs; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230021AbjCWRUk (ORCPT + 99 others); Thu, 23 Mar 2023 13:20:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229508AbjCWRUj (ORCPT ); Thu, 23 Mar 2023 13:20:39 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C22A52686C for ; Thu, 23 Mar 2023 10:20:38 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id g17so28804239lfv.4 for ; Thu, 23 Mar 2023 10:20:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679592037; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=noADxvVZGzG524wNY29+MYK3uk/CTEYh2NGgaqzuY0c=; b=ZH6QgJrsK2p4uhc1RT2lrj52S5l5JnKSM59OtxJh7H6gsvLzKi9VTLiHM8t/1pFsj8 tL5FgJhzjHdUfU6xBl3QAJi6kNXenqhTYLsbKhmOR/OWbnFt6twYWNsCObbOjvpwzHs8 2+I+pwTbj64P0l5Sw8YukHSrXie8pofZo54ADSRKz/GSu3SPt3ADcBsm/Goo5xmI5EhO TIX+vDfb5ynq5ZVmvr43VI/cZxkWnnIz3RKuXr6REicrvL9hbjvyKGQDLoFl3AxEPyW8 IsuDLBjgQLBC7+/dz3194nb7kZoWgmQfAyZdKfvWV1ydlPZJ2WCPlgUoteM5PR2O+up6 FRIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679592037; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=noADxvVZGzG524wNY29+MYK3uk/CTEYh2NGgaqzuY0c=; b=Z4QjQ32AUFK3Y2BWr/0gVS6Z9Pp+xdvpR+EFNsCeuSVjLemsPC66h56TRnPMnC/JbQ NmB/rTz3EnJHJUuDoT0wwdMMYAruQobIBB+Bk6WFt2f9FdVO/q8bcXjH7msXRH8JOw4f CnkUh4GJ92iQaKFMRE/t0NQ4qUUurp69N7jGHKJIEEOHgpsMP/C2slIY1rpnQ5MTKQSz ZJ1C39ThmICjysyE891zsp7hnMUp4ffJ7ESRHbfYA0KlcwDfPB4+lVKOUgmSAkB4aEmn XXWMmi21uADD8oJJ7y50nO7M8IasFb7JKVJhgW1cUUqgkb93XyoBhgDuTWJBZ12A8yTA QPCg== X-Gm-Message-State: AO0yUKXglzpQtsal4sntDubH5T3LmFKctL/QEUiDo//Ig4xnM14LWgM9 xGna9L1xV1Js3grq8HzHUiIanwis72hX4knlQXuolQs2KMA= X-Received: by 2002:ac2:44c1:0:b0:4db:b4:c8d7 with SMTP id d1-20020ac244c1000000b004db00b4c8d7mr2045336lfm.2.1679592036868; Thu, 23 Mar 2023 10:20:36 -0700 (PDT) MIME-Version: 1.0 References: <20230323102732.566440-1-simon.mikuda@streamunlimited.com> <20230323102732.566440-2-simon.mikuda@streamunlimited.com> In-Reply-To: <20230323102732.566440-2-simon.mikuda@streamunlimited.com> From: Luiz Augusto von Dentz Date: Thu, 23 Mar 2023 10:20:25 -0700 Message-ID: Subject: Re: [PATCH BlueZ 1/2] l2test: Enable hex input for PSM To: Simon Mikuda Cc: linux-bluetooth@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Simon, On Thu, Mar 23, 2023 at 3:39=E2=80=AFAM Simon Mikuda 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 =3D atoi(optarg); > + if (!strncasecmp(optarg, "0x", 2)) > + psm =3D 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 =3D atoi(optarg); > break; > > case 'I': > -- > 2.34.1 > --=20 Luiz Augusto von Dentz