Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5255315rwb; Mon, 21 Nov 2022 19:35:34 -0800 (PST) X-Google-Smtp-Source: AA0mqf6TWFRSzvluuColsR+4LhVjix/Hzi08vV6DofXVYpQGG0x5bbmchDD4bT2P91g/ubKrNL8l X-Received: by 2002:a05:6402:370e:b0:464:fa1:9dc3 with SMTP id ek14-20020a056402370e00b004640fa19dc3mr4116813edb.343.1669088133985; Mon, 21 Nov 2022 19:35:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669088133; cv=none; d=google.com; s=arc-20160816; b=xfx4GJ/Vz2A+MAAFAyoRSDPXWxpKsNimK6auuYunTH27/6NZG+bADE5Bt25NPyNWIP f7E38Gvghnq2YCZDlnwKgqg6JEBqe94AnqCV8A2fFzdlJfCZwLXgmrj4Na/mTTdpw1yW x//LkXDutD4fREUcp9FjI2Ie2KDKzM3MOMReHgfWHeNYbcn1afZBgmbAn1X0tKRA6zfF qPvP83wbRJcBiv8JXY+7tj1pfmDtiN0x6tqfyOIXwWy4R1zKo71Lw51VzTBT1qUT/Lyp Mc4dtbhJLlYv4ae9/WsjdZ27fgKye2/RtIKHsKw0hgWnu24yF5Yiub8lMK137dAibF+k YdcA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QhRSsTOnIdR7xmx+EcZYMhiQ71rMdfXxsrFUNwNBPYs=; b=jaigAxKWF/SrcFjeBe57yIk27j2dyg1FpT3i6NTXJvFRfBq3dLiqebo92lzuz6yB+B IQRdvDzhiWR46JX9KmAmZndS1+M1DL3/QxBrmYk2xVcQtLFuyOQ4xpqAwKkD04Qyd/WU 6pjlBBAdNrAHZXiK7SpambCy0Sa5uKdcgKCxhE3qJZY8gsBLTp7HpokxAd9iQvmY7+FB uL5QVwVa203ej0qZONYXfPOZzMzR1ah8feNfraI6N36S90t4AQuEQWa6sDyeK8FGBYGQ UQ5NqvR5tlASA4eUC0EK2aySz5S0BDDb3BTAetEMbbLDwjKP3iQtRKgARjbbFHvZGA/W ZxNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=lmxFa2up; 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=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id go7-20020a1709070d8700b007adb3888ad9si12390131ejc.351.2022.11.21.19.35.08; Mon, 21 Nov 2022 19:35:33 -0800 (PST) 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=@intel.com header.s=Intel header.b=lmxFa2up; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230123AbiKVDX6 (ORCPT + 99 others); Mon, 21 Nov 2022 22:23:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232040AbiKVDXz (ORCPT ); Mon, 21 Nov 2022 22:23:55 -0500 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADA54248CE for ; Mon, 21 Nov 2022 19:23:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669087433; x=1700623433; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5HjTXE6yASm4fnculIMu637JkLzu9jsyaoxsbFGWhJY=; b=lmxFa2upHW4LZJ7v7CfDw8xIrvpTNT1PC0hlUMjbA6l8+oJhVxd0+fM4 afJgIat6JQ7YwqQgBRmHzOyXyJN4RfJRaolLLYreL1OzLQnig14zdcjlo DSe/g8B1SKc6G6+ppfbtE3JQQ97DiQ6AvqWniUm5aIO9Q4Q6RpDh2f73e 9EdHvENZOx+DjqLdUc12IoDjm8ooBAdWx1ItxvUJALfp8Vi+rzhGLEI0V l2GrepTx4cKSBp3qaG4GRUZhFeUSXD98Y4WHifzAGU8f3zqe5QJ1SAvID 3w5O9XiQ4jx5rIAEBlVeEa6VYljptLQTiBLtU6Yzj/7qL6rosEHHURn3D A==; X-IronPort-AV: E=McAfee;i="6500,9779,10538"; a="340583286" X-IronPort-AV: E=Sophos;i="5.96,182,1665471600"; d="scan'208";a="340583286" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Nov 2022 19:23:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10538"; a="672331739" X-IronPort-AV: E=Sophos;i="5.96,182,1665471600"; d="scan'208";a="672331739" Received: from intel-latitude-e5450.iind.intel.com ([10.224.186.32]) by orsmga008.jf.intel.com with ESMTP; 21 Nov 2022 19:23:52 -0800 From: Sathish Narasimman To: linux-bluetooth@vger.kernel.org Cc: Sathish Narasimman Subject: [PATCH BlueZ V2 5/6] monitor/att: Add decoding support for CSIP Date: Tue, 22 Nov 2022 08:55:29 +0530 Message-Id: <20221122032530.3842-6-sathish.narasimman@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221122032530.3842-1-sathish.narasimman@intel.com> References: <20221122032530.3842-1-sathish.narasimman@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE 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 This adds decoding support for CSIS attributes --- monitor/att.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/monitor/att.c b/monitor/att.c index d14cbd165697..6fd740aa4cd4 100644 --- a/monitor/att.c +++ b/monitor/att.c @@ -1733,6 +1733,73 @@ static void pac_context_notify(const struct l2cap_frame *frame) print_pac_context(frame); } +static void csip_rank_read(const struct l2cap_frame *frame) +{ + uint8_t rank; + + if (!l2cap_frame_get_u8((void *)frame, &rank)) { + print_text(COLOR_ERROR, "CSIP Rank: invalid size"); + goto done; + } + print_field(" CSIP Rank: %u", rank); + +done: + if (frame->size) + print_hex_field(" Data", frame->data, frame->size); +} + +static void csip_lock_read(const struct l2cap_frame *frame) +{ + uint8_t lock; + + if (!l2cap_frame_get_u8((void *)frame, &lock)) { + print_text(COLOR_ERROR, "CSIP LOCK: invalid size"); + goto done; + } + print_field(" CSIP LOCK: %u", lock); + +done: + if (frame->size) + print_hex_field(" Data", frame->data, frame->size); +} + +static void print_csip_size(const struct l2cap_frame *frame) +{ + uint8_t size; + + if (!l2cap_frame_get_u8((void *)frame, &size)) { + print_text(COLOR_ERROR, "CSIP SIZE: invalid size"); + goto done; + } + print_field(" CSIP SIZE: %u", size); + +done: + if (frame->size) + print_hex_field(" Data", frame->data, frame->size); +} + +static void csip_size_read(const struct l2cap_frame *frame) +{ + print_csip_size(frame); +} + +static void csip_size_notify(const struct l2cap_frame *frame) +{ + print_csip_size(frame); +} + +static void csip_sirk_read(const struct l2cap_frame *frame) +{ + if (frame->size) + print_hex_field(" SIRK", frame->data, frame->size); +} + +static void csip_sirk_notify(const struct l2cap_frame *frame) +{ + if (frame->size) + print_hex_field(" SIRK", frame->data, frame->size); +} + static void print_vcs_state(const struct l2cap_frame *frame) { uint8_t vol_set, mute, chng_ctr; @@ -2413,6 +2480,12 @@ struct gatt_handler { GATT_HANDLER(0x2b7d, vol_state_read, NULL, vol_state_notify), GATT_HANDLER(0x2b7e, NULL, vol_cp_write, NULL), GATT_HANDLER(0x2b7f, vol_flag_read, NULL, vol_flag_notify), + + GATT_HANDLER(0x2b84, csip_sirk_read, NULL, csip_sirk_notify), + GATT_HANDLER(0x2b85, csip_size_read, NULL, csip_size_notify), + GATT_HANDLER(0x2b86, csip_lock_read, NULL, NULL), + GATT_HANDLER(0x2b87, csip_rank_read, NULL, NULL), + GATT_HANDLER(0x2b93, mp_name_read, NULL, mp_name_notify), GATT_HANDLER(0x2b96, NULL, NULL, track_changed_notify), GATT_HANDLER(0x2b97, track_title_read, NULL, track_title_notify), -- 2.25.1