Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4126184ioa; Tue, 26 Apr 2022 18:04:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRN76r8D64MI6oFLAI9DQOpE6sGmy/gX6kDNx/uX3/hF0segUt+Xh8Dpq2re8MaY59BGtr X-Received: by 2002:a17:907:96a8:b0:6f3:9e66:80c5 with SMTP id hd40-20020a17090796a800b006f39e6680c5mr10295551ejc.662.1651021497246; Tue, 26 Apr 2022 18:04:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651021497; cv=none; d=google.com; s=arc-20160816; b=onqRLViy6aFwSP7qx9cTxaAnvmxQ1+UQccWtWewH/XPH7dsdYgGbhJwBIeXYupo5AJ x+ukMLjFtRJKD+lDIL6tEx9DLvW8/5MwJAvd+n6+d7vxCVNFs5rrILMp4OiWI9tl0Qb4 5WQ7pfkoPmIvL/dL+AtyS1Xg/X9thajsaq82SRWQR7aRWuLnz/anyav7iylNJP/2ha/K 3XbRn4ahA0WPj6U60euNpbz1grNU3LOxHowbP2+kN474OFHk9mhW4jXwVBwbZQ1CO+mJ 7I2jVqcR9xkzZG0Y+AJ6GzGtPHXKBETCg/NIuPyV4ojQDyk++OscccDGPT2FylVUsrZD zaug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=A7LzyN3BLdbjimxUb8J0gDuiLBJbokhGYzF2kcOy5uA=; b=T25Mjf7qNEzeJMByNTEvFa0aWAXzxzPuOiDVsRhxwMxr4jwZkWvzRsGB+Ia0WDL3yB Z3lUBzBzorlM4hiVODYSjH2TCiCVvkWefAzLM96q3AcFAeZBAGnWZHGllpfve6ga8Caa 8tqViZFO7qxgZmXGTjoSUiscvw/ehN29EIhkx2hA4905/d+QDwd/6e5o9w3aYUN+QKo8 ZtOjTnqwn/DoUyo+muxhlVPf+b6nA1vC4QGt2egOyRulb/eqYn12zMOg0wrcIVbQlhQz prE4V8bbtuluup/tTK1CVPUC8vhFknmCtXrUYCyQgaCrDWd9mKCcjvd0YOB4nG1IvEiJ qxDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kmNDYJrQ; 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 ss22-20020a170907c01600b006f3a02a71a2si4665721ejc.433.2022.04.26.18.04.31; Tue, 26 Apr 2022 18:04:57 -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=kmNDYJrQ; 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 S1355981AbiDZXG7 (ORCPT + 99 others); Tue, 26 Apr 2022 19:06:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234676AbiDZXG6 (ORCPT ); Tue, 26 Apr 2022 19:06:58 -0400 Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CF3B8BF23 for ; Tue, 26 Apr 2022 16:03:49 -0700 (PDT) Received: by mail-io1-xd2f.google.com with SMTP id p62so659391iod.0 for ; Tue, 26 Apr 2022 16:03:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=A7LzyN3BLdbjimxUb8J0gDuiLBJbokhGYzF2kcOy5uA=; b=kmNDYJrQGSXzfwutaKhdRntfJx8SlDjf5gjZKlGrgaOIZ11Ki5dvJqqPkV8Mdtuc3E CseR8uy4YNiSJ4oWxk8+ZGf18ZNC5r0UEJvOjXHV7Y8JBRfYor49nUGNYgZ5EkONaqLD 3dpbXcCVOBKQ8IRepavOGpS4r/vSiEhbfX57R7697n0QnIyii8Dskaw+mPtBTMmS6EPA 0iEVftNdBSC0mHGpdjDn/MOKdSkHc8WqSr9qj/qqOKWEEFTYrjAGynH8+RUbTWpJvw+A NqrneV959JE8AJwms1Qx3BWQ69HA5svKGS7gUcKr2vaDOSS/vuBFyRoO7Z5IKWn/7ZWj 7CiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=A7LzyN3BLdbjimxUb8J0gDuiLBJbokhGYzF2kcOy5uA=; b=Jze7cOmLtQ0MOwFNIFfhpqdo/r/sdibFNvf66w6g/Kn3EnoTTwfai2cQXCgba91wnx u0CPRtZcmbu/9YK1OFiXjOAMLb935S8tnxEAC60vabl0voV26OSy5BMhE6zep+oOpcT8 K0a4YvQ9TbrlEa2FGFeXldzqiLKV/5LD2G62/rswOciCwgVuCbaeoSXvaEFXh94VC36J FHPhDh/T1xPhR1SFO8eFf0RiFr/PRJb70KuSa1Qrb8pCWAFrJ55JGl/8zcI0PatXsz8t 5oJgJVO2FnLw4gov6EBqlcS7N/0sBuJKy6AEZZM6snY3Ddn15OtFOWEqtGC9AvERR97m /+XQ== X-Gm-Message-State: AOAM5322fnozKw6dGh0Zj3mWkfdIsiGggkhaluzwvxNCN0Nokw2TQpjh G6qeZa8UzbiWB3RDSzW2BDIU7gKm4nQ= X-Received: by 2002:a05:6638:1487:b0:323:7543:6cb9 with SMTP id j7-20020a056638148700b0032375436cb9mr11076614jak.98.1651014228730; Tue, 26 Apr 2022 16:03:48 -0700 (PDT) Received: from lvondent-mobl4.. (c-71-56-157-77.hsd1.or.comcast.net. [71.56.157.77]) by smtp.gmail.com with ESMTPSA id m16-20020a056e020df000b002ccc1d58ca5sm8437194ilj.54.2022.04.26.16.03.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Apr 2022 16:03:48 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ 1/4] btmon: Add proper decoding to Service Data UUID Date: Tue, 26 Apr 2022 16:03:44 -0700 Message-Id: <20220426230347.857783-1-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 From: Luiz Augusto von Dentz This adds proper decoding for Service Data UUID: Service Data: Apple, Inc. (0xfd6f) Data: e6b07e19815e902100b8b2f4a55255fd18f0c6be --- monitor/packet.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/monitor/packet.c b/monitor/packet.c index 6ef2fba3b..471b0dd4d 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -3301,6 +3301,14 @@ static void print_uuid128_list(const char *label, const void *data, } } +static void print_service_data(const uint8_t *data, uint8_t data_len) +{ + uint16_t uuid = get_le16(&data[0]); + + print_field("Service Data: %s (0x%4.4x)", bt_uuid16_to_str(uuid), uuid); + print_hex_field(" Data", &data[2], data_len - 2); +} + static const struct bitfield_data eir_flags_table[] = { { 0, "LE Limited Discoverable Mode" }, { 1, "LE General Discoverable Mode" }, @@ -3703,9 +3711,7 @@ static void print_eir(const uint8_t *eir, uint8_t eir_len, bool le) case BT_EIR_SERVICE_DATA: if (data_len < 2) break; - sprintf(label, "Service Data (UUID 0x%4.4x)", - get_le16(&data[0])); - print_hex_field(label, &data[2], data_len - 2); + print_service_data(data, data_len); break; case BT_EIR_RANDOM_ADDRESS: -- 2.35.1